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
var recursivePromise = Promise.promisify(
function recursiveDataGrabber(query, max, data, callback_0){ console.log('Controller: Data with Max: '+data.length +' MAX: '+ max); search.getAllUserInstancesAgain(query,max).then(function (results){ results = JSON.parse(results); data = data.concat(results); if (data.length >= limit || results.length < 200) { console.log('Controller: Recursion DONE LENGTH:'+data.length); callback_0(data); return; } else { recursiveDataGrabber(query, results[199].id_str, data, callback_0); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promisify(inner) {\n return new Promise((resolve, reject) =>\n inner((err, res) => {\n if (err) return reject(err);\n else return resolve(res);\n })\n );\n}", "function promisify(fn) {\n return function(...args) {\n return new Promise( function(resolve, reject) {\n function cb(result) {\n resolve(result)\n }\n\n fn.apply(this, args.concat(cb))\n })\n }\n }", "function promisify(original) {\n if ('promisify' in util) {\n return util.promisify(original); // let nodejs do it's thing thing, if it is supported\n }\n else {\n return innerPromisify(original); // Do it ourselves\n }\n}", "function promisify () {\n\t var callback;\n\t var promise = new Promise(function (resolve, reject) {\n\t callback = function callback (err, value) {\n\t if (err) reject(err);\n\t else resolve(value);\n\t };\n\t });\n\t callback.promise = promise;\n\t return callback\n\t}", "function forkingPromises(promise, resolutionHandler, rejectionHandler) {}", "function workMyCollection(arr) {\n var resultArr = [];\n function _recursive(idx) {\n console.log(idx);\n if (idx >= resultArr.length) return resultArr;\n\n return doSomethingAsync(arr[idx]).then(function(res) {\n resultArr.push(res);\n return _recursive(idx + 1);\n });\n }\n return _recursive(0);\n}", "function deepPromisify(obj) {\n return _.transform(obj, function(promisifiedObj, value, key) {\n if (blacklist.has(key)) {\n promisifiedObj[key] = value;\n return;\n }\n\n if (typeof value === 'function') {\n promisifiedObj[key] = bluebird.promisify(value, obj);\n } else if (typeof value === 'object') {\n promisifiedObj[key] = deepPromisify(value);\n } else {\n promisifiedObj[key] = value;\n }\n });\n}", "function r(e,t,a,i){return new(a||(a=Promise))(function(n,r){function s(e){try{l(i.next(e))}catch(t){r(t)}}function o(e){try{l(i[\"throw\"](e))}catch(t){r(t)}}function l(e){e.done?n(e.value):new a(function(t){t(e.value)}).then(s,o)}l((i=i.apply(e,t||[])).next())})}", "function promisify(original) {\n return function promise_wrap() {\n const args = Array.prototype.slice.call(arguments);\n return new Promise((resolve, reject) => {\n original.apply(this, args.concat((err, value) => {\n if (err) return reject(err);\n resolve(value);\n }));\n });\n };\n}", "function j(e,t,n,r,o,i){var a=m.get(t);return a||(a=Object.create(null),m.set(t,a)),n in a&&O(t,n,i&&i.reset),new Promise((function(t,f){a[n]=Array.isArray(e[n])?function(e,t){var n=e.vm,r=e.key,o=e.collection,i=e.resolve,a=e.reject,f=e.ops;void 0===t&&(t=u);var s=Object.assign({},u,t),l=s.wait?[]:f.set(n,r,[]),v=o.on(\"child_added\",(function(e,t){var n=t?c(l,t)+1:0;f.add(l,n,s.serialize(e))}),a),d=o.on(\"child_removed\",(function(e){f.remove(l,c(l,e.key))}),a),p=o.on(\"child_changed\",(function(e){f.set(l,c(l,e.key),s.serialize(e))}),a),h=o.on(\"child_moved\",(function(e,t){var n=c(l,e.key),r=f.remove(l,n)[0],o=t?c(l,t)+1:0;f.add(l,o,r)}),a);return o.once(\"value\",(function(e){s.wait&&f.set(n,r,l),i(e)})),function(e){if(o.off(\"child_added\",v),o.off(\"child_changed\",p),o.off(\"child_removed\",d),o.off(\"child_moved\",h),!1!==e){var t=\"function\"==typeof e?e():[];f.set(n,r,t)}}}({vm:e,key:n,collection:r,ops:o,resolve:t,reject:f},i):function(e,t){var n=e.vm,r=e.key,o=e.document,i=e.resolve,a=e.reject,c=e.ops;void 0===t&&(t=u);var f=Object.assign({},u,t),s=o.on(\"value\",(function(e){c.set(n,r,f.serialize(e))}),a);return o.once(\"value\",i),function(e){if(o.off(\"value\",s),!1!==e){var t=\"function\"==typeof e?e():null;c.set(n,r,t)}}}({vm:e,key:n,document:r,ops:o,resolve:t,reject:f},i)}))}", "function recursivelyNext(data) {\n let yielded = iterator.next.apply(iterator, arguments); // { value: Any, done: Boolean }\n\n if (isPromise(yielded.value)) {\n yielded.value.then((data) => {\n recursivelyNext(data);\n });\n }\n\n function isPromise(val) {\n return val && typeof val.then === 'function';\n }\n}", "function promisify(func) {\n var deferred = $q.defer();\n\n func(function(){\n deferred.resolve();\n });\n\n return deferred.promise;\n }", "_chain (promise, pack, promiser) {\n let self = this\n return promise.then(() => {\n return new Promise((resolve, reject) => {\n let cd = new ListCountdown(resolve)\n for (let item of pack) {\n try {\n cd.push(promiser(item))\n } catch (err) {\n reject(err)\n }\n }\n })\n .then((cd) => {\n // Concatenate errors and results\n Array.prototype.push.apply(self.errors, cd.errors)\n Array.prototype.push.apply(self.values, cd.values)\n })\n })\n }", "function promisify(request) {\r\n return new Promise(function (resolve, reject) {\r\n request.onsuccess = function () {\r\n resolve(request.result);\r\n };\r\n request.onerror = function () {\r\n reject(request.error);\r\n };\r\n });\r\n}", "function promisify(request) {\r\n return new Promise(function (resolve, reject) {\r\n request.onsuccess = function () {\r\n resolve(request.result);\r\n };\r\n request.onerror = function () {\r\n reject(request.error);\r\n };\r\n });\r\n}", "function promisify(request) {\r\n return new Promise(function (resolve, reject) {\r\n request.onsuccess = function () {\r\n resolve(request.result);\r\n };\r\n request.onerror = function () {\r\n reject(request.error);\r\n };\r\n });\r\n}", "function getFollowersPromise(user, level=1) {\n return new Promise(function(resolve, reject) {\n // instantiate tree\n const followerTree = {};\n // instantiate queue array\n const queue = [];\n // query followers from api\n axios.get(`https://api.github.com/users/${ user }/followers`, {\n auth: config.auth,\n })\n // then\n .then(function (response) {\n // for each of the first 5 followers\n response.data.slice(0, config.maxFollowers).forEach((follower) => {\n // if level is less than or equal to the maxLevels setting\n if (level <= config.maxLevels) {\n // queue a promise that gets the follower's subtree, then mounts the follower and their subtree\n queue.push(getFollowersPromise(follower.login, level + 1).then((subtree) => { followerTree[follower.login] = subtree; }));\n }\n // else mount an empty follower\n else followerTree[follower.login] = null;\n });\n })\n // or catch error\n .catch((error) => {\n // and throw it\n reject(error);\n })\n // then finally\n .then(() => {\n // run the queue\n Promise.all(queue).then(() => {\n // then return the tree\n resolve(followerTree);\n });\n });\n });\n}", "function g(t,e,o,r){return new(o||(o=Promise))((function(n,a){function i(t){try{s(r.next(t))}catch(t){a(t)}}function l(t){try{s(r.throw(t))}catch(t){a(t)}}function s(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,l)}s((r=r.apply(t,e||[])).next())}))}", "function Sc(e,t,n,r){function o(i){return i instanceof n?i:new n(function(u){u(i)})}return new(n||(n=Promise))(function(i,u){function l(d){try{s(r.next(d))}catch(y){u(y)}}function c(d){try{s(r.throw(d))}catch(y){u(y)}}function s(d){d.done?i(d.value):o(d.value).then(l,c)}s((r=r.apply(e,t||[])).next())})}", "function promisify(request) {\n return new Promise(function (resolve, reject) {\n request.onsuccess = function () {\n resolve(request.result);\n };\n request.onerror = function () {\n reject(request.error);\n };\n });\n}", "function promisify(request) {\n return new Promise(function (resolve, reject) {\n request.onsuccess = function () {\n resolve(request.result);\n };\n request.onerror = function () {\n reject(request.error);\n };\n });\n}", "function Sc(e,t,n,r){function o(i){return i instanceof n?i:new n(function(u){u(i)})}return new(n||(n=Promise))(function(i,u){function l(h){try{s(r.next(h))}catch(_){u(_)}}function c(h){try{s(r.throw(h))}catch(_){u(_)}}function s(h){h.done?i(h.value):o(h.value).then(l,c)}s((r=r.apply(e,t||[])).next())})}", "function u(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r[\"throw\"](t))}catch(e){o(e)}}function u(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(a,s)}u((r=r.apply(t,e||[])).next())})}", "function walk(pathname, recursive, cbpojo) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n let stack = [pathname];\r\n // faire l'algo avec une pile impossible avec expected + resolved !!!!\r\n // -------------------------------------------------------------------------\r\n const dirwalk = (dirname, files, resolve, reject) => {\r\n if (files.length) {\r\n const pathname = path.join(dirname, files.pop());\r\n let stats;\r\n try {\r\n stats = fs.statSync(pathname);\r\n }\r\n catch (err) {\r\n return reject(err);\r\n }\r\n let pojo = {};\r\n pojo = Object.keys(stats).reduce((pojo, prop) => {\r\n if (typeof stats[prop] !== 'function')\r\n pojo[prop] = stats[prop];\r\n return pojo;\r\n }, pojo);\r\n pojo.pathname = pathname;\r\n pojo.isdir = stats.isDirectory();\r\n pojo.isfile = stats.isFile();\r\n pojo.isdir && stack.push(pojo.pathname);\r\n if (pojo.isdir || pojo.isfile) {\r\n return cbpojo(pojo).then(() => dirwalk(dirname, files, resolve, reject)).catch(e => reject(e));\r\n }\r\n else {\r\n return dirwalk(dirname, files, resolve, reject);\r\n }\r\n }\r\n resolve();\r\n };\r\n const treewalk = (resolve, reject) => {\r\n if (stack.length === 0)\r\n return resolve();\r\n const dirname = stack.pop();\r\n fs.readdir(dirname, (err, files) => {\r\n if (err)\r\n return reject(err);\r\n new Promise((resolve, reject) => {\r\n dirwalk(dirname, files, resolve, reject);\r\n }).then(_ => {\r\n treewalk(resolve, reject);\r\n }).catch(e => {\r\n reject(e);\r\n });\r\n });\r\n };\r\n return new Promise(treewalk);\r\n });\r\n}", "function c(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function l(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,l)}a((r=r.apply(e,t||[])).next())})}", "function r(e,t,n,i){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function o(e){try{s(i.next(e))}catch(t){r(t)}}function c(e){try{s(i[\"throw\"](e))}catch(t){r(t)}}function s(e){e.done?n(e.value):a(e.value).then(o,c)}s((i=i.apply(e,t||[])).next())}))}", "function iterate(iteration){ //recursive function to iterate through promises\n const yieldedObject = iteration.value;\n if(iteration.done) //stop iterating when done and return the final value wrapped in a promise\n return Promise.resolve(iteration.value);\n return Promise.resolve(iteration.value) //returns a promise with its then() and catch() methods filled\n .then(x => iterate(genObject.next(x))) //calls recursive function on the next value to be iterated\n .catch(x => iterate(genObject.throw(x))); //throws an error if a rejection is encountered\n }", "function promisify(fn) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n var boundFn = fn.bind(context);\n\n return function (data) {\n return new Promise(function (resolve, reject) {\n boundFn(data, function (err, resp) {\n if (err) {\n reject(err);\n } else {\n resolve(resp);\n }\n });\n });\n };\n}", "function e(t,e,i,n){return new(i||(i=Promise))((function(o,a){function l(t){try{r(n.next(t))}catch(t){a(t)}}function s(t){try{r(n.throw(t))}catch(t){a(t)}}function r(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(l,s)}r((n=n.apply(t,e||[])).next())}))}", "function promisify(request) {\n return new Promise(function (resolve, reject) {\n request.onsuccess = function () {\n resolve(request.result);\n };\n\n request.onerror = function () {\n reject(request.error);\n };\n });\n}", "function promisify(fn) {\n //it must return a function\n //to let defer the execution\n return function() {\n //we need the arguments to feed fn when the time comes\n let args = Array.from(arguments);\n\n //we must return a Promise\n //because this is a promisification\n return new Promise(function(resolve, reject) {\n //call the callback-based function and let be notified\n //when it's finished\n //'this' belongs to the function call,\n //therefore it must be set explicitly.\n fn.call(null, ...args, (err, value) => {\n if (err) {\n reject(err);\n } else {\n resolve(value);\n }\n });\n });\n };\n}", "async function asyncPromiseAll() {\n //PLACE YOUR CODE HERE:\n}", "function promisify(func) {\n return function promisified() {\n var args = Array.prototype.slice.call(arguments);\n var context = this;\n\n return new Promise(function(resolve, reject) {\n try {\n func.apply(context, args.concat(function(err, data) {\n if (err) {\n return reject(err);\n }\n\n resolve(data);\n }));\n } catch(err) {\n reject(err);\n }\n });\n };\n}", "function n(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))}", "function u(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}", "function r(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function c(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))}", "function r(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))}", "function bn(e,t,i,r){return new(i||(i=Promise))((function(n,a){function o(e){try{s(r.next(e))}catch(zs){a(zs)}}function c(e){try{s(r[\"throw\"](e))}catch(zs){a(zs)}}function s(e){e.done?n(e.value):new i((function(t){t(e.value)})).then(o,c)}s((r=r.apply(e,t||[])).next())}))}", "resolve(inner, outer, rootId, promiseLinkType, traceId, asyncPromisifyPromiseId) {\n // const rootId = this.getCurrentVirtualRootContextId();\n const from = getPromiseId(inner);\n const to = getPromiseId(outer);\n // if (!from || !to) {\n // this.logger.error(`resolve link failed: promise did not have an id, from=${from}, to=${to}, trace=${traceCollection.makeTraceInfo(traceId)}`);\n // }\n // else {\n return nestedPromiseCollection.addLink(promiseLinkType, from, to, traceId, rootId, asyncPromisifyPromiseId);\n }", "function s(e,t,n,r){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r[\"throw\"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,o)}l((r=r.apply(e,t||[])).next())}))}", "function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r[\"throw\"](e))}catch(t){a(t)}}function u(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,s)}u((r=r.apply(e,t||[])).next())}))}", "function iterate(iteration) { //recursive function to iterate through promises\n if (iteration.done) //stop iterating when done and return the final value wrapped in a promise\n return Promise.resolve(iteration.value);\n return Promise.resolve(iteration.value) //returns a promise with its then() and catch() methods filled\n .then(x => iterate(genObject.next(x))) //calls recursive function on the next value to be iterated\n .catch(x => iterate(genObject.throw(x))); //throws an error if a rejection is encountered\n }", "function p(e,n,t,r){return new(t||(t=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}u((r=r.apply(e,n||[])).next())}))}", "function r(e,t,o,n){return new(o||(o=Promise))((function(i,r){function a(e){try{c(n.next(e))}catch(e){r(e)}}function s(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}", "function Qau(i,u,e,r){function n(o){return o instanceof e?o:new e(function(l){l(o)})}return new(e||(e=Promise))(function(o,l){function x(d){try{c(r.next(d))}catch(D){l(D)}}function E(d){try{c(r.throw(d))}catch(D){l(D)}}function c(d){d.done?o(d.value):n(d.value).then(x,E)}c((r=r.apply(i,u||[])).next())})}", "function e(e,t,a,r){return new(a||(a=Promise))((function(n,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(i,o)}d((r=r.apply(e,t||[])).next())}))}", "function a(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function s(e){try{l(r.next(e))}catch(t){a(t)}}function o(e){try{l(r[\"throw\"](e))}catch(t){a(t)}}function l(e){e.done?n(e.value):i(e.value).then(s,o)}l((r=r.apply(e,t||[])).next())}))}", "function s(e,t,n,a){return new(n||(n=Promise))((function(r,i){function o(e){try{l(a.next(e))}catch(e){i(e)}}function s(e){try{l(a.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((a=a.apply(e,t||[])).next())}))}", "function r(t,e,n,r){return new(n||(n=Promise))((function(i,o){function c(t){try{a(r.next(t))}catch(e){o(e)}}function s(t){try{a(r[\"throw\"](t))}catch(e){o(e)}}function a(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(c,s)}a((r=r.apply(t,e||[])).next())}))}", "function s(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(e){i(e)}}function c(t){try{u(r[\"throw\"](t))}catch(e){i(e)}}function u(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(a,c)}u((r=r.apply(t,e||[])).next())}))}", "function r(e,t,n,o){return new(n||(n=Promise))((function(r,i){function c(e){try{l(o.next(e))}catch(e){i(e)}}function u(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,u)}l((o=o.apply(e,t||[])).next())}))}", "function a(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))}", "function A(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,a){function o(t){try{B(i.next(t))}catch(e){a(e)}}function A(t){try{B(i[\"throw\"](t))}catch(e){a(e)}}function B(t){t.done?n(t.value):r(t.value).then(o,A)}B((i=i.apply(t,e||[])).next())}))}", "function b(f,e,r,t){function a(n){return n instanceof r?n:new r(function(o){o(n)})}return new(r||(r=Promise))(function(n,o){function v(F){try{l(t.next(F))}catch(O){o(O)}}function y(F){try{l(t.throw(F))}catch(O){o(O)}}function l(F){F.done?n(F.value):a(F.value).then(v,y)}l((t=t.apply(f,e||[])).next())})}", "function a(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(e){a(e)}}function o(t){try{l(n[\"throw\"](t))}catch(e){a(e)}}function l(t){t.done?r(t.value):new i((function(e){e(t.value)})).then(s,o)}l((n=n.apply(t,e||[])).next())}))}", "function e(t,e,n,r){return new(n||(n=Promise))((function(a,o){function u(t){try{s(r.next(t))}catch(t){o(t)}}function i(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,i)}s((r=r.apply(t,e||[])).next())}))}", "function Pt(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,s)}c((i=i.apply(e,t||[])).next())})}", "function Promise() {\n}", "function a(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function o(e){try{c(n.next(e))}catch(t){a(t)}}function s(e){try{c(n[\"throw\"](e))}catch(t){a(t)}}function c(e){e.done?r(e.value):i(e.value).then(o,s)}c((n=n.apply(e,t||[])).next())}))}", "function u(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function a(t){try{c(r.next(t))}catch(e){o(e)}}function s(t){try{c(r[\"throw\"](t))}catch(e){o(e)}}function c(t){t.done?n(t.value):i(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))}", "function promisify(f, thisContext) {\n return function () {\n let args = Array.prototype.slice.call(arguments);\n return new Promise((resolve, reject) => {\n args.push((err, result) => err ? reject(err) : resolve(result));\n f.apply(thisContext, args);\n });\n };\n}", "function promisify(func, manyArgs = false) {\n return function(...args) {\n return new Promise((resolve, reject) => {\n function callback(error, ...results) {\n // our custom callback for func\n if (error) {\n return reject(error);\n } else {\n // resolve with all callback results if manyArgs is specified\n resolve(manyArgs ? results : results[0]);\n }\n }\n\n args.push(callback);\n\n func.call(this, ...args);\n });\n };\n}", "function A(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function s(t){try{l(r.next(t))}catch(e){o(e)}}function a(t){try{l(r[\"throw\"](t))}catch(e){o(e)}}function l(t){t.done?n(t.value):i(t.value).then(s,a)}l((r=r.apply(t,e||[])).next())}))}", "function r(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function p(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,p)}a((o=o.apply(t,e||[])).next())}))}", "function All(promiseArray) {\n return new Promise(function(resolve,reject) {\n var args = Array.prototype.slice.call(promiseArray);\n var results = []\n if(args.length === 0)\n return resolve(results);\n\n var remaining = args.length;\n\n function res(i,val) {\n if(val && (typeof val === 'object' || typeof val === 'function') ) {\n var then = getThen(val);\n if(typeof then === 'function') {\n// console.log(\"then is a function\", val.state)\n// while(val.state === PENDING) {\n//// console.log(\"waiting\")\n// //wait\n// }\n //hey already fulfilled, yowzers. no need to call then\n if(val.state === FULFILLED) {\n// console.log(\"case 1\")\n args[i] = val.value;\n if (--remaining === 0) {\n resolve(args);\n }\n return;\n }\n if(val.state === REJECTED) {\n// console.log(\"case 2\")\n reject(val.value);\n }\n\n //if promise succeeded, add its value to args , otherwise call the main reject\n val.then(function(val) {\n// console.log(\"calling then success\", val)\n args[i] = val;\n\n //succeed makes remaining go down by 1. if we hit 0, we have resolved the main promise!!\n if (--remaining === 0) {\n resolve(args);\n }\n// res(i,val.value);\n } , reject)\n }\n else {\n args[i] = val.value;\n if (--remaining === 0) {\n resolve(args);\n }\n return;\n }\n }\n\n }\n\n for(var i = 0; i < args.length; ++i){\n res(i, args[i])\n }\n })\n\n}", "function CompositePromise()\t\t// pass list of promises here\n{\n\tPromise.apply(this);\n\tthis.members = [];\n\tif(arguments.length)\n\t{\n\t\tthis.addPromise(arguments);\n\t}\n}", "function e(e,t,a,n){return new(a||(a=Promise))((function(i,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,s)}l((n=n.apply(e,t||[])).next())}))}", "function r(){var e=this;this.promise=new a.default(function(t,n){e.resolve=t,e.reject=n})}", "async(iterable) {\n\n try {\n\n var iter = _es6now.iter(iterable),\n resolver,\n promise;\n\n promise = new Promise((resolve, reject) => resolver = { resolve, reject });\n resume(\"next\", void 0);\n return promise;\n\n } catch (x) { return Promise.reject(x) }\n\n function resume(type, value) {\n\n if (!(type in iter)) {\n\n resolver.reject(value);\n return;\n }\n\n try {\n\n var result = iter[type](value);\n\n value = Promise.resolve(result.value);\n\n if (result.done) value.then(resolver.resolve, resolver.reject);\n else value.then(x => resume(\"next\", x), x => resume(\"throw\", x));\n\n } catch (x) { resolver.reject(x) }\n }\n }", "function walkEntriesAsync(node) {\n // https://wicg.github.io/entries-api/#api-entry\n let newNode = node\n let onlyFiles = []\n return new Promise( (r,j) => {\n const recursive = (node) => {\n return new Promise((resolve, reject) => {\n // console.log(node, '|||||||||||')\n if (node.isDirectory) {\n // process directories async\n readEntriesAsync(node).then((entries) => { \n let dirPromises = entries.map((dir) => recursive(dir));\n \n return Promise.all(dirPromises).then((fileSets) => { \n onlyFiles.push(node) \n // node.file(file => {\n // onlyFiles.push({ file: file, path: node.fullPath }) \n // }) \n resolve(fileSets);\n });\n });\n \n } else { \n // console.log(node) \n node.file( file => {\n onlyFiles.push({ file: file, path: node.fullPath }) \n resolve(node);\n })\n }\n });\n \n }\n \n \n recursive(newNode).then(res => {\n r(onlyFiles) \n })\n\n })\n }", "function d(e,t,n,o){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function l(e){try{s(o.next(e))}catch(t){a(t)}}function i(e){try{s(o[\"throw\"](e))}catch(t){a(t)}}function s(e){e.done?n(e.value):r(e.value).then(l,i)}s((o=o.apply(e,t||[])).next())}))}", "function sf(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(t){i(t)}}function u(e){try{l(r.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}l((r=r.apply(e,t||[])).next())}))}", "function u(e,t,n,o){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function l(e){try{s(o.next(e))}catch(t){a(t)}}function i(e){try{s(o[\"throw\"](e))}catch(t){a(t)}}function s(e){e.done?n(e.value):r(e.value).then(l,i)}s((o=o.apply(e,t||[])).next())}))}", "getDataRoutes() {\n return this.promisify(cb => super.getDataRoutes(cb))\n }", "function a(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function s(e){try{l(n.next(e))}catch(t){a(t)}}function o(e){try{l(n[\"throw\"](e))}catch(t){a(t)}}function l(e){e.done?r(e.value):i(e.value).then(s,o)}l((n=n.apply(e,t||[])).next())}))}", "function u(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{l(r.next(e))}catch(t){i(t)}}function s(e){try{l(r[\"throw\"](e))}catch(t){i(t)}}function l(e){e.done?n(e.value):o(e.value).then(a,s)}l((r=r.apply(e,t||[])).next())}))}", "function a(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function s(e){try{l(i.next(e))}catch(t){a(t)}}function o(e){try{l(i[\"throw\"](e))}catch(t){a(t)}}function l(e){e.done?n(e.value):r(e.value).then(s,o)}l((i=i.apply(e,t||[])).next())}))}", "function t(e,t,i,n){return new(i||(i=Promise))((function(A,r){function s(e){try{a(n.next(e))}catch(e){r(e)}}function o(e){try{a(n.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?A(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,o)}a((n=n.apply(e,t||[])).next())}))}", "function r(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function c(t){try{s(r.next(t))}catch(e){i(e)}}function a(t){try{s(r[\"throw\"](t))}catch(e){i(e)}}function s(t){t.done?n(t.value):o(t.value).then(c,a)}s((r=r.apply(t,e||[])).next())}))}", "function v(n,e,t,r){return new(t||(t=Promise))((function(o,a){function i(n){try{c(r.next(n))}catch(n){a(n)}}function s(n){try{c(r.throw(n))}catch(n){a(n)}}function c(n){var e;n.done?o(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(i,s)}c((r=r.apply(n,e||[])).next())}))}", "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 flatPromise() {\n let resolveFn\n let rejectFn\n const p = new Promise((resolve, reject) => {\n resolveFn = resolve\n rejectFn = reject\n })\n\n return [p, resolveFn, rejectFn]\n}", "function s(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r[\"throw\"](t))}catch(e){o(e)}}function l(t){t.done?n(t.value):i(t.value).then(a,s)}l((r=r.apply(t,e||[])).next())}))}", "function t(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))}", "function promisify(fn) {\n return () => {\n const { client } = this;\n const args = Array.prototype.slice.call(arguments);\n\n return new Promise((resolve, reject) => {\n args.push((err, result) => {\n if (err) reject(err);\n else resolve(result);\n });\n\n client[fn](...args);\n });\n };\n}", "pack (items, count, promiser) {\n let self = this\n let prom = Promise.resolve()\n let pack = []\n for (let item of items) {\n // Group items in packs\n pack.push(item)\n // When packs have reached the max length,\n // chain them to the promise\n if (pack.length >= count) {\n prom = self._chain(prom, pack, promiser)\n pack = []\n }\n }\n // If remaining items in the pack, wrap them\n if (pack) {\n prom = self._chain(prom, pack, promiser)\n }\n // If there is an error in the chaining, notify using the regular\n // method (the .errors list)\n prom.catch((err) => {\n self.errors.push(err)\n })\n // Last, when everything is finished, fire the resolver\n .then(() => {\n self.resolve(self)\n })\n }", "function vS(t,e,r,n){return new(r||(r=Promise))((function(i,a){function o(t){try{c(n.next(t))}catch(t){a(t)}}function s(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,s)}c((n=n.apply(t,e||[])).next())}))}", "function i(n,e,t,r){return new(t||(t=Promise))(function(o,i){function a(n){try{c(r.next(n))}catch(n){i(n)}}function f(n){try{c(r.throw(n))}catch(n){i(n)}}function c(n){n.done?o(n.value):new t(function(e){e(n.value)}).then(a,f)}c((r=r.apply(n,e||[])).next())})}", "function e(e,t,s,n){return new(s||(s=Promise))((function(i,r){function a(e){try{h(n.next(e))}catch(e){r(e)}}function o(e){try{h(n.throw(e))}catch(e){r(e)}}function h(e){e.done?i(e.value):new s((function(t){t(e.value)})).then(a,o)}h((n=n.apply(e,t||[])).next())}))}", "function promisify(func, argumentsObject) {\n var args = Array.prototype.slice.call(argumentsObject);\n var self = this;\n\n return new Promise(function(resolve, reject) {\n var result;\n args.push(function(err) {\n if (err) reject(err);\n else resolve(result);\n });\n\n result = func.apply(self, args);\n });\n}", "function u(t,e,n,o){return new(n||(n=Promise))((function(r,i){function u(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,s)}c((o=o.apply(t,e||[])).next())}))}", "function $qBluebird(resolve, reject) {\n\t return new Promise(resolve, reject);\n\t}", "function t(e,n,t,r){return new(t||(t=Promise))((function(l,o){function i(e){try{a(r.next(e))}catch(e){o(e)}}function u(e){try{a(r.throw(e))}catch(e){o(e)}}function a(e){var n;e.done?l(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(i,u)}a((r=r.apply(e,n||[])).next())}))}", "function e(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))}", "function addEverySong(Songs, queue, member) {\n //returns a promise\n return new Promise(function(resolve, reject) {\n //some variables we need\n let SongsAdded = 0;\n let SongsToLong = 0;\n let SongsClaimed = 0;\n //call an async forEach so we get when its done\n async.each(Songs, function(Song, callback) {\n //construct out URL\n const URL = \"https://www.youtube.com/watch?v=\" + Song.resourceId.videoId\n //get info about that Song\n yt.getInfo(URL, (err, info) => {\n //if error return and increase SongsClaimed\n if(err) {\n SongsClaimed++;\n //return with the call its done\n return callback();\n }\n //if toLong return and increase SongsToLong\n if(Number(info.length_seconds) > 1800) {\n SongsToLong++\n //return with the call its done\n return callback();\n }\n //attach the member who requested the Song on the info object\n info.requestedBy = member.user;\n //add it to the queue\n queue.push(info);\n //increase SongsAdded\n SongsAdded++;\n //call its done\n callback();\n })\n }, function(err) {\n if (err) reject(new Error(\"I had an fatal error please contact my DEV\"))\n resolve([SongsAdded, SongsToLong, SongsClaimed])\n });\n })\n}", "function new_promise() {\n var resolve, promise = new Promise((res, rej)=>{resolve = res;});\n return [promise, resolve];\n }", "function t(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}", "function c(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(e){i(e)}}function s(t){try{u(r[\"throw\"](t))}catch(e){i(e)}}function u(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))}", "function e(e,t,n,a){return new(n||(n=Promise))((function(o,l){function r(e){try{c(a.next(e))}catch(e){l(e)}}function i(e){try{c(a.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,i)}c((a=a.apply(e,t||[])).next())}))}", "function v(e,t,n,o){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function l(e){try{s(o.next(e))}catch(t){a(t)}}function i(e){try{s(o[\"throw\"](e))}catch(t){a(t)}}function s(e){e.done?n(e.value):r(e.value).then(l,i)}s((o=o.apply(e,t||[])).next())}))}", "function t(e,t,l,i){return new(l||(l=Promise))((function(n,o){function c(e){try{a(i.next(e))}catch(e){o(e)}}function s(e){try{a(i.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof l?t:new l((function(e){e(t)}))).then(c,s)}a((i=i.apply(e,t||[])).next())}))}" ]
[ "0.6813291", "0.6415146", "0.640557", "0.6283072", "0.62223774", "0.6081148", "0.60807854", "0.6064911", "0.60550886", "0.60303", "0.5965134", "0.5840433", "0.5803601", "0.5795231", "0.5795231", "0.5795231", "0.5770007", "0.57583547", "0.57022774", "0.5701393", "0.5701393", "0.56978375", "0.56728023", "0.56646186", "0.5660275", "0.56454515", "0.56431496", "0.5641497", "0.56278414", "0.56269866", "0.5626939", "0.56096035", "0.56024283", "0.55847573", "0.55782944", "0.5565345", "0.5562898", "0.55575466", "0.555698", "0.55532926", "0.5546681", "0.5541429", "0.5536615", "0.553591", "0.5529936", "0.5529161", "0.55278987", "0.5509457", "0.5504095", "0.54900056", "0.5481531", "0.5480086", "0.54751337", "0.54681057", "0.5464922", "0.5462878", "0.5461217", "0.5457288", "0.54555225", "0.5455198", "0.54546124", "0.5452836", "0.5452402", "0.5440508", "0.54347426", "0.5431457", "0.54278994", "0.5426835", "0.54251266", "0.5421517", "0.5416731", "0.54139245", "0.5412865", "0.5410901", "0.54108644", "0.5405393", "0.53984195", "0.53980637", "0.53890157", "0.5376464", "0.5374786", "0.5373883", "0.53733367", "0.53699446", "0.53693795", "0.5368642", "0.5363827", "0.53618866", "0.53611887", "0.5358598", "0.53553694", "0.535269", "0.5351506", "0.5344973", "0.53410035", "0.5337866", "0.5328587", "0.5328112", "0.5328037", "0.5325245", "0.5323843" ]
0.0
-1
CODILITY PROBLEMS ============================================================================================== Lesson 4 Counting Elements ============================================================================================== L4 Perm Checker / A nonempty zeroindexed array A consisting of N integers is given. A permutation is a sequence containing each element from 1 to N once, and only once. For example, array A such that: A[0] = 4 A[1] = 1 A[2] = 3 A[3] = 2 is a permutation, but array A such that: A[0] = 4 A[1] = 1 A[2] = 3 is not a permutation, because value 2 is missing. The goal is to check whether array A is a permutation. Write a function: function solution(A); that, given a zeroindexed array A, returns 1 if array A is a permutation and 0 if it is not. For example, given array A such that: A[0] = 4 A[1] = 1 A[2] = 3 A[3] = 2 the function should return 1. Given array A such that: A[0] = 4 A[1] = 1 A[2] = 3 the function should return 0. Assume that: N is an integer within the range [1..100,000]; each element of array A is an integer within the range [1..1,000,000,000]. Complexity: expected worstcase time complexity is O(N); expected worstcase space complexity is O(N), beyond input storage (not counting the storage required for input arguments). Elements of input arrays can be modified. Perm Check permutation checker, given a zeroindexed array A, returns 1 if array A is a permutation and 0 if it is not
function permCheck(A) { var distinctNumberObject = {}, len = A.length, largest = Math.max.apply(Math,A), distinctNumbersCounted = 0; // largest number must equal size of array for it to be a permutation. if (largest === len) { for (i = 0; i < len; i++) { var distinctNumberIndex = A[i] - 1; if (!distinctNumberObject[distinctNumberIndex]) { distinctNumberObject[distinctNumberIndex] = true; distinctNumbersCounted++; if (distinctNumbersCounted === largest) { return 1; } } } } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n const N = A.length;\n let count = new Array(N+1).fill(0);\n \n for(let i in A){\n if(A[i] > N){\n return 0;\n }\n if(count[A[i]] > 0){\n return 0;\n }\n count[A[i]]++;\n }\n \n for(let i=1; i>N+1; i++){\n if(count[i] != 1){\n return 0;\n }\n }\n \n return 1;\n}", "function solution(A) {\r\n // write your code in JavaScript (Node.js 8.9.4)\r\n\tlet elementMap = {};\r\n\tA.forEach(item => {\r\n\t\tif (!elementMap[item]) {\r\n\t\t\telementMap[item] = true;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn Object.keys(elementMap).length;\r\n}", "function solution(A) {\n const setA = new Set(A)\n if(setA.size!==A.length) return 0\n for(let i =1; i<=A.length; i++){\n if(setA.has(i)===false) return 0\n }\n return 1;\n // write your code in JavaScript (Node.js 8.9.4)\n}", "function solution(A) { \n var len = A.length,\n arr = [],\n value, i;\n \n for(i = 0; i < len; i++){\n value = A[i];\n if(value > 0){\n arr[value] = true;\n }\n }\n for(i = 1; i < arr.length; i++){\n if(typeof arr[i] === \"undefined\"){\n return i;\n }\n }\n return i;\n}", "function solution(A) {\n let map = []\n let index = 1;\n for(let i = 0; i < A.length + 1; i++) {\n map[A[i]] = true;\n }\n\n while( index < A.length + 1) {\n if(!map[index]) break;\n index++;\n }\n\n return index;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n let tmp=Array.from({length:A.length+1}, (v, k) => k);\n let ans = 1;\n A.forEach(n=>{\n if(tmp[n] === n){ \n tmp[n] = 'check'\n }else {\n ans = 0;\n }\n });\n return ans;\n}", "function solution(A){\n let hash = {};\n\n for (let i = 0; i < A.length; i++) {\n if (hash[A[i]] === undefined){\n hash[A[i]] = 1;\n } else if (hash[A[i]] != undefined){\n hash[A[i]]++;\n }\n }\n \n const pairs = Object.entries(hash);\n\n for (const [value,count] of pairs) {\n if (count % 2 != 0){\n return Number(value);\n }\n }\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n // [1,0] . [0,1]\n let f = A[0];\n let count = 0;\n let getOCount = getCount(A, 1);\n let getZCount = getCount(A, 0);\n console.log(getOCount + \" \" + getZCount);\n if (getOCount >= getZCount) {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i] === 1) {\n A[i + 1] = 0;\n } else {\n A[i + 1] = 1;\n }\n count++;\n }\n }\n } else {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i + 1] === 1) {\n A[i] = 0;\n } else {\n A[i] = 1;\n }\n count++;\n }\n }\n }\n return count;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0)\n \n N = 100001\n var bitmap = Array(N).fill(false);\n for (var i = 0; i < A.length; i ++) {\n if (A[i] > 0 && A[i] <= N) {\n bitmap[A[i]] = true;\n }\n }\n \n for(var j = 1; j <= N; j++) {\n if (!bitmap[j]) {\n return j;\n }\n }\n \n return N + 1;\n}", "function numOfPermutations(lettersArr) { let num = 1; for (let i = 1; i <= lettersArr.length; i++) { num *= i } return num }", "function permMissingElem (A) {\n\n\t// corner cases\n\tif (A.length === 0) {\n\t\treturn 1;\n\t} else if (A.length === 1 && A[0] == 1) {\n\t\treturn 2;\n\t} else if (A.length === 1 && A[0] == 2) {\n\t\treturn 1;\n\t}\n\n\t// numerical sort\n\tA.sort(function(a,b) { return a-b; });\n\n\t// if first element missing\n\tif (A[0] == 2) {\n\t\treturn 1;\n\t}\n\t\n\tfor (var i=0; i < A.length; i++) {\n\t\tif (A[i+1]-A[i] != 1) {\n\t\t\treturn A[i]+1;\n\t\t}\n\t\t\n\t}\n\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 4.0.0)\n var B=new Array(A.length+1), j;\n A.forEach((ele, i, arr) => B[ele-1] = i);\n for(j=0; j<B.length; j++) {\n if(B[j] === undefined) {\n return j+1;\n }\n }\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n let count = 1;\n A.sort((a,b)=> a-b).forEach(n=>{\n if(count === n)count ++;\n });\n return count;\n \n}", "function solution(A) {\n // A = [2, 1, 1, 2, 3, 1]\n let unique = new Set();\n // \"let of\" iterates directly over the values of the array.\n for (let x of A) {\n unique.add(x);\n }\n return unique.size;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n if (A.length === 1) {\n return A[0] === 1 ? 2 : 1;\n }\n A = A.sort((a, b) => a - b);\n let i = 0;\n while (i < A.length) {\n if (A[i] !== i + 1) {\n return i + 1;\n }\n i++;\n }\n return A.length + 1;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n var ret = 1;\n A = A.sort((a,b) => a - b);\n var ALength = A.length;\n for(var i = 0; i < ALength; i++){\n if(A[i]!=i+1){\n ret = 0;\n break;\n } \n }\n return ret;\n}", "function solution(A) {\n let len = A.length;\n let storage = {};\n let maxEl = 0, maxCount = 0;\n\n if (len === 0) {\n return -1;\n }\n\n if (len === 1) {\n return 0;\n }\n\n // Solution\n // we used an object(storage) to save every total count of each different number\n // maxEl is used to save element which has highest number so far\n // e.g array A [3, 4, 3, -1, 3] \n // loop 1: storage { '3' : [0] }, maxEl = 3\n // loop 2: storage { '3' : [0], '4' : [1] }, maxEl = 3\n // loop 3: storage { '3' : [0, 2], '4' : [1] }, maxEl = 3\n // loop 4: storage { '3' : [0, 2], '4' : [1], '-1' : [3] }, maxEl = 3\n // loop 5: storage { '3' : [0, 2, 4], '4' : [1], '-1' : [3] }, maxEl = 3\n // check if max element's count over half of array then return max element array index\n // if not then return -1\n // in this case we should return [0, 2, 4]\n\n for (let i = 0; i < len; i++) {\n let el = A[i];\n\n if (storage[el] === undefined) {\n storage[el] = [];\n storage[el].push(i);\n } else {\n storage[el].push(i);\n }\n\n if (storage[el].length > maxCount) {\n maxEl = el;\n maxCount = storage[el].length;\n }\n }\n\n // If every element has equal count , e.g [1, 2, 3] or [-1, -2, 1]\n if (maxCount === 1) {\n return -1;\n }\n\n // Check if max element's count over half array or not\n if (storage[maxEl].length / len <= 0.5) {\n return -1;\n }\n\n return storage[maxEl][0];\n}", "function solution(A) {\n //key insight: answer will always be from 1 to A.length + 1, inclusive\n\n //keep track of the presence of values in stack. time O(n)\n let isInA = []\n for (let i = 0; i < A.length; i++) {\n if (A[i] > 0 && A[i] <= A.length) {\n isInA[A[i]] = true\n }\n }\n\n // iterate through arr and check if exists in A. If not, return it. time O(n)\n for (let i = 0; i <= isInA.length; i++) {\n if (!isInA[i + 1]) {\n return i + 1\n }\n }\n}", "function solution(A) {\r\n // write your code in JavaScript (Node.js 8.9.4)\r\n\r\n /**\r\n * Formula:\r\n * (Sum of each index + 1) - (Sum of each value in array) = missing element\r\n */\r\n if (!A.length) {\r\n return 1;\r\n }\r\n\r\n var fullSum = 0;\r\n var sum = 0;\r\n\r\n for (let i = 0; i <= A.length; i++) {\r\n fullSum += i + 1;\r\n }\r\n\r\n for (let i = 0; i < A.length; i++) {\r\n sum += A[i];\r\n }\r\n\r\n return fullSum - sum;\r\n}", "function solve(arr) {\n // returning the count of unique array combinations\n return (\n // mapping over each array and returning a Set of the size of the array (without duplicates)\n arr\n .map((v) => new Set(v).size)\n // reduce the new Set (lengths of each arr in essence) and multiplies them together starting with 1 to return the count of unique array combos\n .reduce((v, w) => v * w, 1)\n );\n}", "function solution2(A) {\n let filtered = A.filter((v, i, arr) => {\n return arr.indexOf(v) === i;\n });\n return filtered.length;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n const len = A.length;\n let multiplier = 0;\n let total = 0;\n for (let i=0 ; i<len ; i++) {\n \n if(A[i]===0){\n multiplier++;\n }else{\n total += multiplier*1\n }\n\n \n\n }\n if(total > 1000000000){\n return -1\n }\n return total;\n\n}", "function solution3(A) {\n count = 0;\n for (i = 0; i < A.length; i++) {\n if (i + 1 > A.length || i + 2 > A.length) {\n } else if (A[i] - A[i + 1] == A[i + 1] - A[i + 2]) {\n count += 1;\n\n let newA = A.slice(i + 2)\n let dist = A[i] - A[i + 1]\n\n for (j = 0; j < newA.length; j++) {\n if (j + 1 >= A.length) {\n console.log(\"No more new array!\")\n } else if (newA[j] - newA[j + 1] == dist) {\n count += 1;\n }\n }\n }\n }\n // console.log(count)\n}", "function getCount(possibility_matrix, count_arr, len) {\n let turn_1_index = 0;\n let turn_1_count = count_arr[0];\n let turn_2_count = 0;\n for (let i = 0; i < count_arr.length; i++) {\n if (count_arr[i] > turn_1_count) {\n turn_1_count = count_arr[i];\n turn_1_index = i;\n }\n }\n if (count_arr.length > 1) {\n let catched_salmon_arr = [];\n for (let i = 0; i < possibility_matrix[turn_1_index].length; i++) {\n if (possibility_matrix[turn_1_index][i]) {\n catched_salmon_arr[i] = true;\n }\n }\n // console.log(catched_salmon_arr, turn_1_index, turn_1_count);\n let turn_2_index;\n for (let i = 0; i < catched_salmon_arr.length; i++) {\n if (catched_salmon_arr[i]) {\n continue;\n } else {\n turn_2_index = i;\n turn_2_count = count_arr[i];\n break;\n }\n }\n\n for (let i = 0; i < count_arr.length; i++) {\n if (!catched_salmon_arr[i] && count_arr[i] > turn_2_count && (count_arr[i] + turn_1_count) <= len && checkNoneOfCurrentGroupCatched(possibility_matrix[i])) {\n turn_2_index = i;\n turn_2_count = count_arr[i];\n }\n }\n // console.log(catched_salmon_arr, turn_2_index, turn_2_count);\n } else {\n turn_2_count = 0; // turn 2 not possible\n }\n console.log(turn_1_count + turn_2_count);\n}", "function solution(A) {\n let arrayAmmount = 0;\n for (let index = 0; index < A.length; index++) {\n arrayAmmount += A[index];\n }\n return ((A.length + 1) * ((A.length + 1) + 1) / 2) - arrayAmmount;\n }", "function permAlone(str) {\n //, create and array of letters, and store the number of elements in teh array\n let letters = [...str],\n n = letters.length,\n // and a var to increment when strings without repeat letters are found\n count = 0;\n\n permutate(n, letters);\n\n return count;\n\n function permutate (n, array) {\n // if we've swapped the appropriate number of letters then we take teh permutation created\n if (n === 0) {\n console.log(array);\n // and if we can confirm the current permutation doesnt have and letters reapted in sequence\n if (! /(.)\\1/g.test(array.join('')) ) {\n // increase teh count of appropriate permutations\n count++;\n }\n\n return;\n }\n \n // \n for (let i = 0; i < n; i++) {\n // call permutate with n-1 so we can generate permutations of permutations\n permutate(n-1, array);\n // if n is odd we swap the first and last element && if n is even we swap the ith element\n n % 2 === 0 ? swap(i, n-1) : swap(0, n-1);\n }\n\n // simple swap function w/o using temp var\n function swap (a, b) {\n [array[a], array[b]] = [array[b], array[a]];\n }\n }\n\n}", "function permMissingElem2(A) {\n\tvar comparisonArray = [];\n\t\n\tfor (var i=0; i < A.length +1; i++) {\n\t\tcomparisonArray[i] = i+1;\n\t}\n\n\tfor (i=0; i < comparisonArray.length; i++) {\n\t\tif (A.indexOf(comparisonArray[i]) === -1) {\n\t\t\treturn comparisonArray[i];\n\t\t} \n\t\n\t}\n\n}", "function countPairsBruteForce(arr){\n arr = arr.sort(function(a, b){return a - b});\n count =0;\n for(var i =0;i<arr.length-1;i++){\n if(arr[i]===arr[i+1]){\n count++;\n i++;\n }\n }\n return count\n}", "function solve() {\n let probability = {};\n let permutations = findPermutations([1, 2, 3, 4, 5, 6, 7]);\n for (const permutation of permutations) {\n let count = findIncreasingSequences(permutation);\n if (!probability.hasOwnProperty(count)) {\n probability[count] = 0;\n }\n probability[count] += 1;\n }\n console.log(probability);\n}", "function solution (A) {\n const N = A.length\n\n if (N === 0) {\n // Empty A\n return A\n }\n\n if (N % 2 === 0 || N > 1000000) {\n // A does not contain an odd number of elements\n return A\n }\n\n if (A.find(x => (x < 1 || x > 1000000))) {\n // An A element is too small or too large\n return A\n }\n\n // Find unique elements\n const one = []\n\n for (let i = 0; i < A.length; i += 1) {\n const num = A[i]\n const index = one.indexOf(num)\n\n if (index === -1) {\n one.push(num)\n } else {\n one.splice(index, 1)\n }\n }\n // Find the unpaired number\n return one[0]\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n var n = A.length;\n \n A.sort(function(a, b){\n return a - b; \n });\n \n \n if (A[0] != 1) {\n return 0;\n }\n \n for (var i = 1; i < n; i++) {\n if (A[i] - A[i-1] != 1) {\n return 0;\n }\n }\n return 1;\n}", "function solution(a) {\r\n // write your code in JavaScript (Node.js 0.12)\r\n var i, l=a.length-1;\r\n var arr=[];\r\n do{ \r\n arr[a[l]-1] = a[l];\r\n \r\n l--; \r\n if(l===0)\r\n for(j=0;j<arr.length;j++)\r\n if(!arr[j])\r\n return j+1;\r\n \r\n }while(l>=0)\r\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0)\n let valuesByIndex = {};\n let result = 1;\n \n for (let i = 0, aLength = A.length; i < aLength; i++) {\n let currentValue = A[i];\n \n if (!valuesByIndex[currentValue - 1]) {\n valuesByIndex[currentValue - 1] = currentValue; \n } else {\n result = 0;\n break;\n }\n \n }\n \n let valuesByIndexKeys = Object.keys(valuesByIndex);\n \n if (result === 1) {\n for (let i = 0, len = valuesByIndexKeys.length; i < len; i++) {\n let keyValue = parseInt(valuesByIndexKeys[i]);\n \n if (keyValue !== 0 && !valuesByIndex[keyValue - 1]) {\n result = 0;\n break;\n } \n }\n }\n \n return result;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n if (A.length === 1) {\n return 1;\n }\n\n let left = 0;\n let right = 0;\n for (let i = 0; i < A.length; i++) {\n if (A[i] >= 0) {\n left = i;\n right = i;\n break;\n } else {\n A[i] *= -1;\n }\n }\n\n let lastVal = A[left];\n let nextVal = lastVal;\n let count = 1;\n while (left >= 0 && right < A.length) {\n if (A[left] !== A[right] && lastVal !== nextVal) {\n count++;\n }\n\n if (left > 0 && A[left] < A[right]) {\n lastVal = A[left];\n left--;\n nextVal = A[left];\n } else if (right < A.length - 1 && A[right] < A[left]) {\n lastVal = A[right];\n right++;\n nextVal = A[right];\n } else if (left > 0) {\n lastVal = A[left];\n left--;\n nextVal = A[left];\n } else if (right < A.length - 1) {\n lastVal = A[right];\n right++;\n nextVal = A[right];\n } else {\n break;\n }\n }\n\n return count;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n const numbers = [...Array(A.length).keys()].map(x => x + 1)\n A.sort((a, b) => a - b);\n if (A.join('') == numbers.join('')) return 1\n return 0;\n\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n \n \n let sorted = Array.from(new Set(A.filter(v => v>0))).sort(function(a,b) {\n return a-b;\n });\n let missing = 1;\n let found = false;\n \n if(sorted.length==0) {\n found = true;\n }\n \n for(let i=0;i<sorted.length && !found;i++) {\n if(sorted[i]>missing) {\n found = true;\n }\n else {\n missing++;\n }\n }\n return missing;\n}", "function solution1(A) {\n let newSet = new Set(A);\n return newSet.size;\n}", "function PrimeChecker(num) {\n function Prime(num) {\n if (num === 2) {\n return true;\n }\n if (num === 1 || num % 2 === 0) {\n return false;\n }\n for (let i = 3; i <= Math.sqrt(num); i = i + 2) {\n if (num % i === 0) {\n return false;\n }\n }\n return true;\n }\n\n function permut(string) {\n if (string.length < 2) return [string];\n var permutations = [];\n for (var i = 0; i < string.length; i++) {\n var char = string[i];\n\n if (string.indexOf(char) != i) continue;\n\n var remainingString =\n string.slice(0, i) + string.slice(i + 1, string.length);\n\n var subLoop = permut(remainingString);\n\n for (var subPermutation of subLoop)\n permutations.push(char + subPermutation);\n }\n return permutations;\n }\n let res = 0;\n let digits = num.toString();\n let powerSet = permut(digits);\n console.log('PrimeChecker -> powerSet', powerSet);\n powerSet.forEach((combo) => {\n debugger;\n if (Prime(parseInt(combo))) {\n res = 1;\n }\n });\n\n return res;\n}", "function solution(A) {\n var set = new Set(),\n arrayLength = A.length;\n for (var i =0; i < arrayLength; i++) {\n if (set.has(A[i])) {\n set.delete(A[i]);\n continue;\n }\n set.add(A[i]);\n }\n return (set.values()).next().value;\n}", "function solution(A) {\n const arr = A;\n let expectSum = 0;\n let realSum = 0;\n\n for (let i = 0; i <= arr.length; i++) {\n expectSum += i + 1;\n if (arr[i] !== undefined) {\n realSum += arr[i];\n }\n }\n\n return expectSum - realSum;\n}", "function solution(A) {\n // Sort the array, so that test element can be found with linear search\n A.sort(function(a, b) { return a - b; });\n\n // Increment the test element. Return it when not in the array.\n let next = 1; // minimum positive integer\n let i = 0;\n while (next === A[i]) {\n next++;\n i++;\n }\n\n return next;\n}", "function permAlone(str) {\n let count = 0;\n // let perm = [];\n let arr = str.split('');\n\n\n // swaping two variables\n const swap = (a, b) => {\n let temp = arr[a];\n arr[a] = arr[b];\n arr[b] = temp;\n }\n\n const generate = (n) => {\n let regex = /([a-z])\\1+/;\n // n === 1 here is the base case to prevent infinite loops\n // regex.text(arr.join('')) will return true if there is a repeated adjacent char\n if (n === 1 && !regex.test(arr.join(''))) {\n count++\n console.log(arr.join('')) // this will print out every single permutation\n } else {\n n.forEach((element) => {\n generate(n - 1);\n swap(n % 2 ? 0 : element, n - 1);\n })\n }\n \n generate(arr.length);\n }\n\n return count;\n}", "function check(arr) { // check if the input array has any one of the combinations\r\n let flag = false; // in the win_combination array\r\n win_combination.forEach(x => {\r\n let count2 = 0;\r\n x.forEach(y => {\r\n if (arr.includes(y)) {count2 += 1};\r\n })\r\n if (count2 === 3) {flag = true;};\r\n })\r\n return flag;\r\n}", "function solution(K, A) {\n // write your code in JavaScript (Node.js 8.9.4)\n let count = 0;\n let sum = 0;\n \n for(let i=0; i<A.length; i++) {\n sum += A[i];\n if (sum >= K) {\n count ++;\n sum = 0;\n } \n }\n \n return count;\n}", "function findPairs(K, A) {\n let counter = 0\n //create an object of key-value pairs\n //to check if the element in the array is duplicate\n let duplicate = {}\n A.forEach(el => {\n //if the element doesn't exist, create an entry in the object\n if(!duplicate[el]) {\n return duplicate[el] = 1\n //if the element exists, add 1 to the value\n } else {\n duplicate[el] ++ \n }\n })\n // console.log(duplicate)\n Object.keys(duplicate).forEach(key => {\n let difference = K-key\n //if difference is a key in duplicate (this evaluate to true)\n if (difference in duplicate) {\n //console.log(duplicate[key])\n //console.log(duplicate[difference])\n counter += duplicate[key] * duplicate[difference]\n }\n })\n return counter\n }", "function main(input) {\n input = input.trim().split(\"\\n\");\n const N = parseInt(input.shift());\n const permutation = input[0].split(\" \").map(Number);\n\n let result = 0;\n let min = permutation[0];\n\n for (let i = 0; i < N; i++) {\n if (min >= permutation[i]) {\n result++;\n min = permutation[i];\n }\n }\n console.log(result);\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n B = A.slice();\n A.sort();\n var candidate = A[Math.floor(A.length / 2)];\n var count = 0;\n var index = -1;\n for (var i = 0; i < B.length; i++) {\n if (B[i] == candidate) {\n count++;\n index = i;\n }\n }\n if (count > B.length / 2) return index;\n else return -1;\n}", "function countUniqueValues(A){\n let a = 0,\n b = 1;\n for(let i = 0; i < A.length; i++){\n \n if(A[a] == A[b]){\n b++\n }else if(A[a] != A[b]){\n A[a+1] = A[b];\n a++\n b++\n }\n }\n return A.slice(0,a).length\n \n}", "function solution(N, A) {\n // N: number of counters, A: operations\n // 1. Create N length counter and set all values to 0\n // 2. Loop through an array A and check condition\n // 2-1. If A[K] = X(1 <= X <= N), increase X by 1\n // 2-2. If If A[K] = N + 1, set all counters to max\n // 3. Return counter array\n\n // let counter = Array(N).fill(0);\n let counter = Array.from(Array(N), (_) => 0);\n let maxValue = 0;\n\n for(let i = 0; i < A.length; i++) {\n if(A[i] <= N) {\n counter[A[i]-1]++;\n // maxValue = Math.max(...counter);\n maxValue = Math.max(maxValue, counter[A[i]-1]); // 💣\n } else if(A[i] === N + 1) {\n counter = Array(N).fill(maxValue);\n }\n // console.log(counter)\n }\n return counter;\n}", "function slow_solution(arr){\n let resultsArr = []\n for(let i=0; i<arr.length;i++){\n resultsArr[i] = 0;\n for(let j=0; j<arr.length; j++){\n if(arr[i] % arr[j] !== 0){\n resultsArr[i] +=1;\n // console.log('|i:', i, '| j:', j,'| arr:', arr[i], '| res:',resultsArr[i])\n }\n }\n }\n return resultsArr\n}", "function divisibleSumPairs(n, k, ar) {\n let count = 0;\n //console.log(count);\n for(let i = 0; i < n; i++) {\n //console.log(i);\n for(let j = i + 1 ; j < n; j++) {\n //console.log(j);\n if(((ar[i] + ar[j]) % k) === 0) {\n count++;\n //console.log(count.length);\n }\n }\n }\n return count;\n}", "function permAlone (stringToPermutate) {\n let count = 0;\n let acu = [];\n let charsToPermutate = stringToPermutate.split('');\n let passed = [];\n var regex = /([\\w\\d])\\1{1,}/g;\n\n function _permutator () {\n if (acu.length === charsToPermutate.length) {\n if (!acu.join('').match(regex)) {\n count++;\n }\n // exit function\n } else {\n for (let i = 0; i < charsToPermutate.length; i++) {\n if (!passed[i]) {\n passed[i] = true;\n acu.push(charsToPermutate[i]);\n _permutator();\n acu.pop();\n passed[i] = false;\n }\n }\n }\n }\n\n _permutator();\n return count;\n}", "function solution(A) {\n // write your code in JavaScript\n if (A.length == 0) {\n return 0;\n }\n var max = 0;\n var map = {};\n for (var i = 0; i < A.length; i++) {\n var val = A[i];\n if (val > max) {\n max = val;\n }\n if (map[val]) {\n map[val] += 1; \n }\n else {\n map[val] = 1; \n }\n }\n return map[val];\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n A = A.sort((a,b) => a - b);\n var arrayLength = A.length;\n var cur = A[0];\n var curlength = 1;\n for(var i = 1; i < arrayLength; i ++ ){\n if(cur == A[i]){\n curlength += 1;\n }else{\n if(curlength % 2 == 1){\n break;\n }else{\n cur = A[i];\n curlength = 1;\n }\n }\n }\n return cur;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n const sorted = [...A].sort();\n let diff = 0;\n let chunkSize = 0;\n let numChunks = 0;\n for (let i = 0; i < A.length; i++) {\n diff += A[i];\n diff -= sorted[i];\n chunkSize++;\n if (diff === 0 && chunkSize > 1) {\n numChunks++;\n }\n }\n return numChunks;\n}", "function countTrue(array) {\n let count = 0;\n for (let element of array) {\n if (element) {\n count++;\n }\n }\n return count;\n}", "function solution2(N,A){\n let maxNum = 0;\n let counterArr = new Array(N).fill(0);\n\n for (let i = 0; i < A.length; i++) {\n if (1<= A[i] && A[i]<= N){\n counterArr[A[i]-1]+=1;\n if (counterArr[A[i]-1] > maxNum){\n maxNum = counterArr[A[i]-1];\n }\n } else if (A[i] === N + 1){\n counterArr.fill(maxNum);\n }\n }\n return counterArr;\n}", "function solution(A, X) {\n // write your code in JavaScript (Node.js 8.9.4)\n let counts = {};\n let lengths = [];\n let output = 0;\n A.forEach(num => {\n counts[num] = counts[num] ? ++counts[num] : 1;\n });\n\n Object.keys(counts).forEach(num => {\n if (counts[num] <= 1) delete counts[num];\n else lengths.push(num);\n });\n\n lengths.sort((a, b) => b - a);\n\n lengths.forEach((len, idx) => {\n if (len < X ** 0.5) return;\n if (counts[len] >= 4) output++;\n let lastWidthIdx = findLastWidth(lengths, idx, X / lengths[idx]);\n for (let i = idx + 1; i < lengths.length; i++) {\n if (len * lengths[i] >= X) output++;\n else break;\n }\n });\n\n return output;\n}", "function solution(A) {\r\n // write your code in JavaScript (Node.js 8.9.4)\r\n \r\n let sorted = A.sort();\r\n let storage = {};\r\n \r\n // Store sorted Array in a json using the value as the key\r\n for (let i = 0; i < sorted.length; i++) {\r\n storage[sorted[i]] = sorted[i];\r\n }\r\n \r\n // If the storage does not contain the key from the loop below, return the key\r\n for (let i = 1; i < 1000001; i++) {\r\n if (!storage[i]) return i; \r\n }\r\n \r\n return 1;\r\n}", "function solution2(A) {\n let x1 = A[0]; // xor all elements in array\n let x2 = 1; // xor all elements from 1 to n+1 (n+1 since 1 number is missing)\n for (let i = 1; i < A.length; i++) {\n x1 ^= A[i];\n }\n for (let i = 2; i <= A.length + 1; i++) {\n x2 ^= i;\n }\n\n return x2 ^ x1;\n}", "function solution1(givenArray){\n let setFromArray = new Set(givenArray);\n return givenArray.length === setFromArray.size ? true : false;\n}", "function all_permuted(array_length, solutions = {1: 0, 2: 1}) {\n function od_permuted(od_array_length, od_solutions = {1: 1, 2: 1}) {\n if (!od_solutions.hasOwnProperty(od_array_length)) {\n od_solutions[od_array_length] = all_permuted(od_array_length - 1, solutions)\n + (od_array_length - 1) * od_permuted(od_array_length - 1, od_solutions)\n }\n\n return od_solutions[od_array_length]\n }\n\n if (!solutions.hasOwnProperty(array_length)) {\n solutions[array_length] = (array_length - 1) * od_permuted(array_length - 1)\n }\n\n return solutions[array_length]\n}", "function ArrayInversionCount(A) {\n var count = 0;\n \n // Merge sort algorithm from:\n // http://www.stoimen.com/blog/2010/07/02/friday-algorithms-javascript-merge-sort/\n \n function mergeSort(arr) {\n if (arr.length < 2)\n return arr;\n \n var middle = parseInt(arr.length / 2);\n var left = arr.slice(0, middle);\n var right = arr.slice(middle, arr.length);\n \n return merge(mergeSort(left), mergeSort(right));\n }\n \n function merge(left, right) {\n var result = [];\n \n while (left.length && right.length) {\n if (left[0] > right[0]) {\n count += right.length;\n result.push(left.shift());\n } else {\n result.push(right.shift());\n }\n }\n \n while (left.length)\n result.push(left.shift());\n \n while (right.length)\n result.push(right.shift());\n \n return result;\n }\n \n mergeSort(A);\n\n return count < 10e8 ? count : -1; \n}", "function SearchingChallenge2(strArr) {\n let pos = [];\n\n for (let i = 0; i < strArr.length; i++) {\n for (let j = 0; j < strArr[i].length; j++) {\n if ([...strArr[i]][j] === \"0\") pos.push([j, i]);\n }\n }\n\n let count = 0;\n const x = 0;\n const y = 1;\n\n for (let i = 0; i < pos.length; i++) {\n for (let j = 0; j < pos.length; j++) {\n if (\n (pos[i][y] === pos[j][y] && pos[i][x] === pos[j][x] + 1) ||\n (pos[i][x] === pos[j][x] && pos[i][y] === pos[j][y] + 1)\n ) {\n count++;\n }\n }\n }\n\n return count;\n}", "function countPositives(arr) {}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n A.sort((a,b)=>(a-b));\n let count = 0;\n for(let i = 0; i< A.length-2; i++){\n let leftIndex = i+1;\n let rightIndex = i+2;\n while(leftIndex<A.length-1){\n if(A[i]+A[leftIndex]>A[rightIndex] && rightIndex<A.length){\n rightIndex++;\n }else{\n count = count + (rightIndex-leftIndex-1);\n leftIndex++;\n }\n }\n }\n return count;\n}", "function solution(A) {\n let result = false\n // write your code in JavaScript (Node.js 8.9.4)\n let i = 0;\n let j = (A.length - 1);\n let couter = 0;\n for (i = (j - 1); i > 0; i-- , j--) {\n if (A[i] < A[j]) {\n couter++;\n }\n }\n\n result = (couter >= 2) ? false : true\n return result;\n}", "function permutationPalindrome2(str) {\n let strArr = str.split(''),\n head = 0,\n tail = strArr.length - 1,\n tracker = {};\n\n while (head < tail) {\n let headVal = strArr[head],\n tailVal = strArr[tail];\n\n if (!tracker[headVal]) {\n tracker[headVal] = 1;\n } else {\n tracker[headVal]++;\n }\n\n if (!tracker[tailVal]) {\n tracker[tailVal] = 1;\n } else {\n tracker[tailVal]++;\n }\n\n head++;\n tail--;\n }\n\n if (head === tail) {\n let headVal = strArr[head];\n\n if (!tracker[headVal]) {\n tracker[headVal] = 1;\n } else {\n tracker[headVal]++;\n }\n }\n\n let oddTracker = 0;\n\n for (var char in tracker) {\n if (tracker[char] % 2 !== 0) {\n oddTracker++;\n }\n }\n\n switch (strArr.length % 2 === 0) {\n case true:\n return !oddTracker ? true : false;\n case false:\n return oddTracker === 1 ? true : false;\n }\n}", "function solution(arr) {\n let max = 0,\n map = arr.reduce((accum, num)=> {\n if(num > 0) accum[num] = true;\n if(num > max) max = num;\n return accum;\n }, {});\n\n for(let i=1; i<=max+1; i++) {\n if(!map[i]) return i;\n }\n}", "function solve(nums) {\n\tlet counter = 0;\n\tfor (let i = 0; i < nums.length; i++) {\n\t\tlet val = nums[i].toString();\n\t\tif (parseInt(val.length) % 2 !== 0) {\n\t\t\tcounter++;\n\t\t}\n\t}\n\treturn counter;\n}", "function solution(A) {\n\n}", "function solution(arr){\n\n}", "function CountUniqueValue4(arr){\n\tlet i = 0;\n let j = 1;\n\twhile(j<arr.length){\n\tif(arr[i] !== arr[j]){\n\t\ti++\n\t\tarr[i] = arr[j]\n\t}\n\telse{\n\t\tj++\n }\n \n\t}\n\tconsole.log(i+1);\n\t\n}", "function countP(arr) {\n var sum = 0;\n\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > 0) {\n sum++;\n }\n }\n\n arr[arr.length - 1] = sum;\n\n return arr;\n}", "function solution(N, A) {\r\n // write your code in JavaScript (Node.js 8.9.4)\r\n\tlet counters = new Array(N).fill(0);\r\n\tlet maxNum = 0;\r\n\tlet lastMaxNum = 0;\r\n\t\r\n\tA.forEach(item => {\r\n\t\tif (item <= N) {\r\n\t\t\tif (counters[item - 1] < lastMaxNum) {\r\n\t\t\t\tcounters[item - 1] = lastMaxNum;\r\n\t\t\t}\r\n\t\t\tcounters[item - 1]++;\r\n\t\t\t\r\n\t\t\tif (counters[item - 1] > maxNum) {\r\n\t\t\t\tmaxNum = counters[item - 1];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlastMaxNum = maxNum;\r\n\t\t}\r\n\t});\r\n\t\r\n\tfor (const i in counters) {\r\n\t\tif (counters[i] < lastMaxNum) {\r\n\t\t\tcounters[i] = lastMaxNum;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn counters;\r\n}", "function solution(A, S) {\n // write your code in JavaScript (Node.js 8.9.4\n let result = 0;\n if(A.length<1){\n return result; //base case\n }\n //dymamic\n let runningSum = 0;\n for(let i=0; i<A.length; i++){\n let el = A[i];\n \n runningSum+=el;\n \n // if(el>S){\n // continue;\n // }\n // else if(el===S){\n // result++;\n // }\n // else {\n // remaining=S-el;\n //get left and right of S\n result+= solution(A.slice(0,i), S);\n result+= solution(A.slice(i+1), S);\n //}\n }\n if(Math.floor(runningSum/A.length)===S){\n result++;\n }\n \n \n return result;\n //solutionHelper(A,S,0, A.length-1);\n}", "function findTriplets(arr) {\n // add whatever parameters you deem necessary - good luck!\n let count = 0;\n for (let i = 0; i < arr.length; i++) {\n let store = new Set();\n for (let j = i + 1; j < arr.length; j++) {\n let missing = -(arr[i] + arr[j]);\n if (store.has(missing)) {\n count++;\n } else {\n store.add(arr[j]);\n }\n }\n }\n return count;\n}", "function countUniqueValues(array) {\n let p1 = 0\n let p2 = 1\n \n for (p2; p2< array.length; p2++){\n if(array[p1] !== array[p2]){\n p1 ++\n array[p1] = array[p2]\n }\n else {\n console.log(\"undefined\")\n }\n \n }\n return p1 + 1\n }", "solutionCheck() {\n for (let row = 0; row < HEIGHT; row++) {\n for (let col = 0; col < WIDTH; col++) {\n let num = this._puzzle[row][col];\n this._puzzle[row][col] = 0;\n if (num === 0 || !this.isSafe(this._puzzle, row, col, num)) {\n this._puzzle[row][col] = num;\n return false;\n }\n this._puzzle[row][col] = num;\n }\n }\n return true;\n }", "function missing1(A) {\n const N = A.length + 1;\n\n for (let i = 1; i < N; i++) {\n let found = false;\n for (let j = 0; j < A.length && !found; j++) {\n if (i === A[j]) {\n found = true;\n }\n }\n if (!found) {\n return i;\n }\n }\n}", "function solution(A) {\n let outputMap = {};\n A.forEach((element) => {\n if (outputMap[element] === undefined) {\n outputMap[element] = 1;\n }\n else {\n if (outputMap[element] === 1) {\n outputMap[element] = 2;\n }\n else if (outputMap[element] === 2) {\n outputMap[element] = 1;\n }\n }\n });\n let objList = Object.keys(outputMap);\n let arrLength = objList.length;\n let lonelyNo = 0;\n for (let index = 0; index < arrLength; index++) {\n if (outputMap[objList[index]] === 1) {\n lonelyNo = objList[index];\n }\n }\n return parseInt(lonelyNo);\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n //Create a counter for the number of ways to cut the tree\n let counter = 0;\n //Check if Array is sorted in either order. If yes, return counter as -1;\n if(isArraySorted(A)){\n counter = -1;\n return counter;\n }\n // Else,Loop through the array to identify if the trees can be cut\n else{\n for(let i=0;i<A.length; i++){\n //For ith element, check if the i+1 is greater than i or lesser than i\n //If i+1 is greater than i, then check if i+2 is lesser than i+1\n //Take 3 elements and see if they are in the required order of i>i+1 & i+1<i+2 or i<i+1 & i+1>i+2\n if(!checkIfInOrder(A[i],A[i+1],A[i+2])){\n counter++;\n }\n }\n }\n \n //Return the counter\n return counter;\n}", "function solution(N) {\n\n let uniqueMap = {};\n for (let i = 2;i <= N; i++) {\n uniqueMap[i] = uniqueMap[i] || _isPrimeNum(i);\n let rotations = _getRotations(i);\n rotations.map(rotation => {\n uniqueMap[i] &= _isPrimeNum(rotation);\n });\n }\n let primes = Object.keys(uniqueMap).filter(rotation => {return uniqueMap[rotation]});\n return primes.length;\n}", "function arrayCeption(array) {\n var count;\n array.forEach(element => {\n if(element.length === 0){\n count = 0\n }\n else if (Array.isArray(element)) {\n count = arrayCeption(element)\n if (count>0) {\n count++\n }\n } \n else {\n count = 1\n }\n }); \n return count\n}", "function solution(A, X) {\n // write your code in JavaScript (Node.js 8.9.4)\n let counts = {};\n let spans = [];\n let output = 0;\n A.forEach(num => {\n counts[num] = counts[num] ? ++counts[num] : 1;\n });\n\n Object.keys(counts).forEach(num => {\n if (counts[num] <= 1) delete counts[num];\n else spans.push(parseInt(num));\n if (counts[num] >= 4 && num ** 2 >= X) output++;\n });\n\n spans.sort((a, b) => a - b);\n\n spans.forEach((len, i) => {\n let begin = i + 1;\n let end = spans.length - 1;\n let mid = Math.floor((begin + end) / 2);\n while (begin <= end) {\n mid = Math.floor((begin + end) / 2);\n if (spans[mid] * len >= X) end = mid - 1;\n else begin = mid + 1;\n }\n output += spans.length - 1 - end;\n });\n\n return output;\n}", "function solution(arr) {\n let obj = {};\n //st1 :\n for (let e of arr) {\n if (obj[e]) {\n obj[e] += 1;\n } else {\n obj[e] = 1;\n }\n }\n // St2 : \n for (let k in obj) {\n if (obj[k]%2 == 1) {\n return Number(k);\n }\n \n }\n return -1;\n}", "function countUniqueValues(arr) {\n if (arr.length === 0) {\n return 0;\n }\n\n let i = 0;\n for (let j = 1; j < arr.length; j++) {\n // Everytime pointers do NOT match, i increments and is set to match j\n // i's index tracks qty of unique nums through inequality.\n if (arr[i] !== arr[j]) {\n i++;\n arr[i] = arr[j];\n }\n }\n return i + 1;\n}", "function solution(A) {\n let jumps = []\n let i = 0\n while (i<=A.length){\n i= i+A[i]\n jumps.push(A[i])\n if (jumps.length >= A.length) {\n return -1}\n } \n return jumps.length \n }", "countPairs(X, Y, M, N)\n {\n let min_length = Math.min(M,N);\n let min_array_length = min_length == M ? M : N;\n let max_array_length = min_length == M ? N : M;\n let min_array = min_length == M ? X : Y;\n let max_array = min_length == M ? Y : X;\n let result_count = 0;\n // console.log(min_array_length,max_array_length,min_array,max_array)\n for(let i = 0;i<min_array_length; i++){\n let j = 0;\n while(j<max_array_length){\n let first_power = Math.pow(max_array[j],min_array[i]);\n let second_power = Math.pow(min_array[i],max_array[j]);\n // console.log(\"first power\", first_power, \"second_power\", second_power);\n if(first_power > second_power) result_count++;\n //console.log(result_count);\n j++\n }\n }\n return result_count;\n }", "function permPalindrome(str) {\n // make lowercase and remove whitespace\n str = str.trim().toLowerCase().split(\" \").join(\"\");\n let letterCount = {};\n let oddLetter = 0;\n // count number of occurences of each letter\n for (let i = 0; i < str.length; i++) {\n let letter = str[i];\n if (letterCount[letter] === undefined) {\n letterCount[letter] = 0;\n }\n letterCount[letter]++;\n }\n // check the count of each letter\n for (var letter in letterCount) {\n // check to see if the letter occurs an odd number of times\n if (letterCount[letter] % 2 !== 1) {\n // add one to the odd letter counter if it does\n oddLetter++;\n }\n // if there are more than two letters occuring an odd number of\n // times, the input cannot be a palindrome permutation\n if (oddLetter > 1) {\n return false;\n }\n }\n // return true after checking all the letter counts\n return true;\n}", "function solution(N, A) {\n // write your code in JavaScript (Node.js 8.9.4)\n const counters = Array(N + 1).fill(0);\n let max = 0;\n let prevmax = 0;\n for (let i = 0; i < A.length; i++) {\n const op = A[i];\n if (op >= 1 && op <= N) {\n counters[op]++;\n max = Math.max(counters[op], max);\n // max;\n } else if (op === N + 1) {\n if (max !== prevmax) {\n prevmax = max;\n counters.fill(max);\n }\n // counters\n }\n }\n return counters.splice(1);\n}", "function solutionChecker(solution) {\n\t// check rows\n\tfor(let i = 0; i <= 8; i++) {\n\t\tif(!checkRow(solution[i])) return false;\n\t}\n\t// check collums\n\tlet auxRow;\n\tfor(let i = 0; i <= 8; i++) {\n\t\tauxRow = [];\n\t\tfor(let j = 0; j <= 8; j++) {\n\t\t\tauxRow.push(solution[j][i]);\t\t// \t the numbers of the collumn are put in an array,\n\t\t}\t\t\t\t\t\t\t\t\t\t// so its easier to analyse\n\t\tif(!checkRow(auxRow)) return false;\t\t\n\t}\n\t// check big squares\n\tfor(let i = 0; i <= 2; i++) {\n\t\tfor(let j = 0; j <= 2; j++) {\n\t\t\tauxRow = solution[i*3].slice(j*3, j*3+3) // the same is done to the numbers of a big square\n\t\t\t\t.concat(\n\t\t\t\t\tsolution[i*3+1].slice(j*3, j*3+3)\n\t\t\t\t).concat(\n\t\t\t\t\tsolution[i*3+2].slice(j*3, j*3+3)\t\t\t\n\t\t\t\t);\n\t\t\tif(!checkRow(auxRow)) return false;\t\t\n\t\t}\n\t}\n\treturn true;\n\tfunction checkRow(row) {\n\t\treturn numbers.every(number => {\n\t\t\treturn row.some(num => num == number);\n\t\t});\n\t}\n}", "triplet(res) {\n count = 0;\n for (let index = 0; index < res.length; index++) {\n for (let index1 = index + 1; index1 < res.length; index1++) {\n for (let index2 = index1 + 1; index2 < res.length; index2++) {\n // check sum of three elements are equals to zero\n if (Number(res[index]) + Number(res[index1]) + Number(res[index2]) == 0) {\n count++;\n console.log(\"[\" + res[index] + \",\" + res[index1] + \",\" + res[index2] + \"]\");\n }\n\n }\n }\n\n }\n console.log(\"Number of triplets found is \", count);\n}", "function sol26(arr = [2, 3, 1, 1, 2, 4, 2, 0, 1, 1]) {\n // number at idx is the max number of jumps can take\n const dp = arr.slice().fill(Infinity);\n dp[0] = 0;\n\n for (let i = 1; i < arr.length; i++) {\n for (let j = 0; j < i; j++) {\n if (arr[j] + j >= i) {\n if (dp[j] + 1 < dp[i]) {\n dp[i] = dp[j] + 1;\n }\n }\n }\n }\n\n return dp[dp.length - 1];\n}", "function findSolution(arr) {\n const x = [];\n let longestSubArrayLength = 0;\n let subArrayLength = 0;\n for (i = 0; i < arr.length; i++) {\n if (x.includes(arr[i])) {\n if (subArrayLength > longestSubArrayLength) {\n longestSubArrayLength = subArrayLength;\n }\n subArrayLength = 1;\n x.length = 0;\n } else {\n x.push(arr[i]);\n subArrayLength += 1;\n }\n }\n return subArrayLength > longestSubArrayLength\n ? subArrayLength\n : longestSubArrayLength;\n}", "function isPermutationOfPalindrome(str) {\n\tvar arrMap = new Array(128).fill(0);\n\n\tfor (var i = 0; i < str.length; i++) {\n\t\tif (str[i] === \" \") {\n\t\t\tcontinue;\n\t\t}\n\t\tarrMap[str.charCodeAt(i)]++;\n\t}\n\n\tvar oddCount = 0;\n\n\tfor (var i = 0; i < arrMap.length; i++) {\n\t\toddCount += arrMap[i] % 2;\n\t}\n\n\treturn oddCount === 1;\n}", "function solution(values) {\n\n let result = [];\n\n for (let i = 0; i < values.length; i++) {\n if (0 <= values[i]) {\n result[values[i]] = true;\n }\n }\n\n for (let i = 1; i <= result.length; i++) {\n if (undefined === result[i]) {\n return i;\n }\n }\n\n return 1\n\n}", "function solution(A, X) {\n // write your code in JavaScript (Node.js 8.9.4)\n if (A.length < 4) {\n return 0;\n }\n\n const LIMIT = 1000000000;\n let count = [];\n let posts = [];\n let answer = 0;\n for (let i = 0; i < A.length; i++) {\n count[A[i]] = Number.isInteger(count[A[i]]) === false ? 1 : count[A[i]] + 1;\n if (count[A[i]] === 2) {\n posts.push(A[i]);\n }\n if (count[A[i]] === 4 && (A[i] >= X || A[i] * A[i] >= X)) {\n answer++;\n }\n }\n\n posts.sort((a, b) => a - b);\n\n let i = 0;\n let j = posts.length - 1;\n for (let i = 0; i < posts.length; i++) {\n let begin = i + 1;\n let end = posts.length - 1;\n while (begin <= end) {\n let mid = parseInt((begin + end) / 2);\n if (posts[mid] * posts[i] >= X) {\n end = mid - 1;\n } else {\n begin = mid + 1;\n }\n }\n answer += posts.length - (end + 1);\n if (answer > LIMIT) {\n return -1;\n }\n }\n return answer;\n}", "function solve(input) {\n let unique = {\n 2: '1',\n 4: '4',\n 3: '7',\n 7: '8'\n }\n let arr = input.split('\\n').map(r => r.split(' | ')[1]).map (r => r.split(' '));\n let count = 0;\n for (let row of arr) {\n for (let letters of row) {\n if (letters.length in unique) {\n count++;\n }\n }\n }\n return count;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0)\n // sumup.\n var sumA=0;\n var sumI=0;\n for(var i=0;i<A.length;i++)\n {\n sumA+=A[i];\n sumI+=i+1;\n }\n\n sumI+=i+1; // the last item.\n return sumI-sumA;\n}" ]
[ "0.68444836", "0.66633946", "0.6649471", "0.6557802", "0.64224577", "0.63520896", "0.62780696", "0.62755716", "0.62748027", "0.62715364", "0.6223827", "0.61813194", "0.61736655", "0.6140965", "0.61363196", "0.610516", "0.6084023", "0.6071268", "0.6035077", "0.59985274", "0.5993556", "0.5989574", "0.5946375", "0.59343857", "0.5912648", "0.5907283", "0.58959454", "0.58915114", "0.58602816", "0.58499736", "0.5846821", "0.5826967", "0.5819813", "0.5773185", "0.57613814", "0.5757367", "0.5735745", "0.5733055", "0.5731681", "0.57061887", "0.5703973", "0.5697089", "0.56698453", "0.5654057", "0.5613146", "0.56034267", "0.55968124", "0.5596008", "0.5594364", "0.55721325", "0.5568654", "0.55669767", "0.5558826", "0.55430853", "0.5537239", "0.55328804", "0.5529268", "0.55248594", "0.551914", "0.5508305", "0.5507831", "0.5506671", "0.5487648", "0.5478615", "0.5477161", "0.5475234", "0.5472618", "0.5464415", "0.5459893", "0.5459812", "0.5455924", "0.54432124", "0.5441924", "0.5441353", "0.5438062", "0.5437144", "0.54320663", "0.54255", "0.54189366", "0.53965414", "0.5389943", "0.53886104", "0.53851736", "0.5376829", "0.53717124", "0.53712636", "0.5367973", "0.5361092", "0.5357923", "0.534891", "0.53437895", "0.53425884", "0.5338195", "0.5333346", "0.53297454", "0.5321468", "0.5318406", "0.53175455", "0.53155303", "0.53138894" ]
0.77779937
0
Create the function to run for both events
function runEnter() { // Prevent the page from refreshing d3.event.preventDefault(); // Select the input element and get the raw HTML node var inputElementDate = d3.select("#datetime"); // var inputElementCity = d3.select("#city"); // var inputElementState = d3.select("#state"); // var inputElementCountry = d3.select("#country"); // var inputElementShape = d3.select("#shape"); // Get the value property of the input element var inputValue = inputElementDate.property("value").trim(); console.log(inputValue); var filteredData = dataList.filter(dataList => dataList.datetime === inputValue); console.log(filteredData); tbody.html(""); let response = { filteredData }; if(response.filteredData.length !== 0) { getData(filteredData); } else { tbody.append("tr").append("td").text("There are no sightings for the current search criteria. Please try again!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Events(){}//", "function Events(){}//", "onEvent() {\n \n }", "function EventHelper (possibleEvents) {\n }", "function constroiEventos(){}", "handleEvents() {\n }", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "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() {}" ]
[ "0.6424834", "0.6424834", "0.6390404", "0.6353437", "0.63517565", "0.62114793", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931", "0.6122931" ]
0.0
-1
random float for specifying ball direction
function randomFloat(min,max){ return min+(Math.random()*(max-min)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BallStartPosition()\n {\n var randomNum = Math.floor(Math.random()*2)\n if(randomNum == 0)\n {\n ball.speedX = -ball.speedX;\n ball.speedY = -ball.speedY;\n }\n if(randomNum == 1)\n {\n ball.speedX = Math.abs(ball.speedX);\n ball.speedY = Math.abs(ball.speedY);\n }\n console.log(randomNum);\n }", "function startBall () {\n\tlet direction = 1; \n\ttopPositionOfBall = startTopPositionOfBall;\n\tleftPositionOfBall = startLeftPositionOfBall;\n\n\t//50% change of starting in either direction (right of left)\n\tif (Math.random() < 0.5){\n\t\tdirection = 1;\n\t} else {\n\t\tdirection = -1;\n\t}//else\n\n\n\ttopSpeedOfBall = Math.random() * 2 + 3; //3-4\n\tleftSpeedOfBall = direction * (Math.random() * 2 + 3); \n\n\toriginalTopSpeedOfBall = topSpeedOfBall;\n\toriginalLeftSpeedOfBall = leftSpeedOfBall;\n\n}//startBall", "start() {\n\t\tif (this.ball.vel.x === 0 && this.ball.vel.y === 0) {\n\t\t\t// randomize the direction of the ball\n\t\t\tthis.ball.vel.x = 300 * (Math.random() > .5 ? 1 : -1); // if what is returned by math.random is more than .5 then mult by 1 otherwise if less than. mult by -1\n\t\t\tthis.ball.vel.y = 300 * (Math.random() * 2 - 1); // tweaks the y value so it changes the speed up or down just a little bit\n\t\t\tthis.ball.vel.len = 200;\n\t\t}\n\t}", "function randomDirection() {\n var y = Math.random() * 1.6 - 0.8;\n var x = Math.sqrt(1 - y ** 2);\n if (objectMove.direction[0] > 0) {\n x = -x;\n }\n objectMove.direction[0] = x;\n objectMove.direction[1] = y;\n}", "getRandomDirection(){\n this.setDirection(Math.floor(Math.random() * 4));\n }", "function getRandomBall() {\n var pos = randomArrayItem(['top', 'right', 'bottom', 'left']);\n switch (pos) {\n case 'top':\n return {\n x: randomSidePos(can_w),\n y: -R,\n vx: getRandomSpeed('top')[0],\n vy: getRandomSpeed('top')[1],\n r: R,\n alpha: 1,\n phase: randomNumFrom(0, 10)\n }\n break;\n case 'right':\n return {\n x: can_w + R,\n y: randomSidePos(can_h),\n vx: getRandomSpeed('right')[0],\n vy: getRandomSpeed('right')[1],\n r: R,\n alpha: 1,\n phase: randomNumFrom(0, 10)\n }\n break;\n case 'bottom':\n return {\n x: randomSidePos(can_w),\n y: can_h + R,\n vx: getRandomSpeed('bottom')[0],\n vy: getRandomSpeed('bottom')[1],\n r: R,\n alpha: 1,\n phase: randomNumFrom(0, 10)\n }\n break;\n case 'left':\n return {\n x: -R,\n y: randomSidePos(can_h),\n vx: getRandomSpeed('left')[0],\n vy: getRandomSpeed('left')[1],\n r: R,\n alpha: 1,\n phase: randomNumFrom(0, 10)\n }\n break;\n }\n }", "function randVelocity() {\n return Math.random() * (3.5 - 2.25) + 2.25;\n}", "function randomSideFloat(){\n\t\treturn Math.random() * 2 - 1\n\t}", "function getDirection(){\n\t return Math.floor((Math.random() * 4) + 1);\t\n}", "randomSpeed() {\n this.sp = movementMultip * Math.floor(Math.random() * 10+1);\n }", "function spawn() {\n // reset ball position\n x = width*0.5;\n y = height*0.5;\n rot = 0;\n\n // choose random angle & speed\n let angle = Math.random() * 2 * Math.PI;\n let speed = 200 + Math.random() * 1000;\n\n // set initial speed\n dx = speed * Math.sin(angle);\n dy = speed * Math.cos(angle);\n\n // apply some rotation\n dr = (-0.5 + Math.random()) * 60;\n}", "function randYVelocity() {\n var rand = Math.random() * 1 + -0.5;\n return rand;\n}", "move() {\n var dirx = Math.random() > 0.5 ? 1 : -1;\n var diry = Math.random() > 0.5 ? 1 : -1;\n var L = int((Math.random() * 20));\n var L2 = int((Math.random() * 20));\n this.endx = this.posx + (L * dirx);\n this.endy = this.posy + (L2 * diry);\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 }", "rollSpeed() {\n this.xSpeed = Math.random() * (this.maxSpeed * 2) - this.maxSpeed;\n this.ySpeed = Math.random() * (this.maxSpeed * 2) - this.maxSpeed;\n }", "function ballStart() \n {\n ball.xPos = 400;\n ball.yPos = 230;\n ball.speedY = 5 + 5 * Math.random();\n ball.speedX = 5 + 5 * Math.random();\n\n changedirection = true * Math.random;\n }", "function getRandomSpeed(axis = 'x', blnDir = true) {\n\tconst speedOptions = {\n\t\txUpperSpeedBound: 4,\n\t\txLowerSpeedBound: 3,\n\t\tyUpperSpeedBound: 3,\n\t\tyLowerSpeedBound: 2\n\t};\n\tlet min;\n\tlet max;\n\tif (axis === 'x') {\n\t\tmin = speedOptions.xLowerSpeedBound;\n\t\tmax = speedOptions.xUpperSpeedBound;\n\t} else {\n\t\tmin = speedOptions.yLowerSpeedBound;\n\t\tmax = speedOptions.yUpperSpeedBound;\n\t}\n\n\tlet velocity = Math.random() * (max - min) + min;\n\tvelocity = velocity.toFixed(2);\n\tconst negDirection = blnDir ? Math.random() > 0.5 : false;\n\treturn negDirection ? velocity * -1 : velocity;\n}", "function generateRandomDirection() {\n const number = Math.random();\n let key = 'left';\n if (number <= 0.25) {\n key = 'up';\n }\n if (number > 0.25 && number <= 0.5) {\n key = 'left';\n }\n if (number > 0.5 && number <= 0.75) {\n key = 'down';\n }\n if (number > 0.75) {\n key = 'right';\n }\n return key;\n}", "drip() {\n this.y += this.fallSpeed;\n if (this.y > height) {\n this.y = 0;\n this.x = random(width);\n }\n }", "function getRandomBall(min = 0, max = 100) {\n return Math.round( min + Math.random() * (max - min) );\n}", "function random() {\n\t\tr = (r + 0.1) % 1\n\t\treturn r\n\t}", "randomizeDirection() {\n //Create variables to pick randomly from array\n let directions = [this.size, 0, -this.size];\n //Pick from the array index and set the next direction on a horizontal axis\n let randomDirection = floor(random(0, 1) * directions.length);\n this.nextDirectionX = directions[randomDirection];\n //Pick from the array index and set the next direction on a vertical axis\n randomDirection = floor(random(0, 1) * directions.length);\n this.nextDirectionY = directions[randomDirection];\n\n\n\n }", "randomDirection() {\n return this.randomFrom(['up', 'down', 'left', 'right']);\n // return ['up', 'down', 'left', 'right'][Math.floor(Math.random() * 4)];\n }", "function setSpeed() {\n return (Math.random()*(400 - 60)) + 60;\n}", "start () {\n if (this.ball.velocity.x === 0 && this.ball.velocity.x === 0) {\n this.ball.velocity.x = 3 * (Math.random() > .5 ? 1 : -1);\n this.ball.velocity.y = 3 * (Math.random() * 2 - 1);\n this.ball.velocity.len = 3;\n }\n }", "function BounceBall() {\n this.radius = Math.random() * 10 + 10;\n this.x = Math.random() * (canWidth - this.radius * 2) + this.radius;\n this.y = Math.random() * (canHeight - this.radius * 2) + this.radius;\n this.color = randomColor();\n this.dy = Math.random() * 2;\n this.dx = Math.round((Math.random() - 0.5) * 10);\n}", "function setYVelociity() {\n if (ballY < 50) {\n yVelocity = randPosYVelocity();\n } else if (ballY > 450) {\n yVelocity = randNegYVelocity();\n } else {\n yVelocity = randYVelocity();\n }\n}", "function move() {\n orb.roll(60, Math.floor(Math.random() * 360));\n }", "invertDirectionRandom() {\n let hasInverted = false;\n if (Math.random() < 0.5) {\n let temp = this.deltaY;\n this.deltaY = this.deltaX;\n this.deltaX = temp;\n hasInverted = true;\n }\n if (Math.random() < 0.5) {\n this.deltaX = -this.deltaX;\n hasInverted = true;\n }\n if (Math.random() < 0.5) {\n this.deltaY = -this.deltaY;\n hasInverted = true;\n }\n if (!hasInverted) {\n this.invertDirection();\n }\n this.updateHitboxes();\n }", "function randomAngle() {\n rAngle = int(random(0,360));\n}", "function startBall(){\r\n\tlet direction = 1;\r\n\ttopPositionOfBall = startTopPositionOfBall;\r\n\tleftPositionOfBall = startLeftPositionOfBall;\r\n\t\r\n\t//50% chance of starting in either direction (right or left)\r\n\tif(Math.random() < 0.5){\r\n\t\tdirection = 1;\r\n\t} else {\r\n\t\tdirection = -1;\r\n\t}//else\r\n\t\t\r\n\ttopSpeedOfBall = Math.random() * speedRange + speedMin; \r\n\t\r\n\tif(checkScore()){\r\n\tspeedMin += 2;\r\n\tlevels++;\r\n\t}//if\r\n\t\r\n\tleftSpeedOfBall = direction * (Math.random() * speedRange + speedMin);\r\n\t\r\n\t\r\n\t\r\n}//startBall", "function initBall() {\r\n var velocityRange = 0.1;\r\n // init position array.\r\n positionArray.push(Math.random()*2.0-1.0);\r\n positionArray.push(Math.random()*0.5+0.5);\r\n positionArray.push(Math.random()*2.0-1.0);\r\n\r\n //init velocity array.\r\n var initSpeedX = (Math.random()-0.5)*velocityRange;\r\n var initSpeedY = (Math.random()-0.5)*velocityRange;\r\n var initSpeedZ = (Math.random()-0.5)*velocityRange;\r\n velocityArray.push(initSpeedX);\r\n velocityArray.push(initSpeedY);\r\n velocityArray.push(initSpeedZ);\r\n\r\n // init radius array.\r\n var randomRadius = Math.random()/3.0+0.2;\r\n radiusArray.push(randomRadius);\r\n radiusArray.push(randomRadius);\r\n radiusArray.push(randomRadius);\r\n\r\n // init color array.\r\n colorArray.push(Math.random());\r\n colorArray.push(Math.random());\r\n colorArray.push(Math.random());\r\n}", "function random () {\n return MIN_FLOAT * baseRandInt();\n }", "constructor(){\n this.x = random(0,width);\n this.y = random(0,height);\n this.r = random(1,8);\n this.xSpeed = random(-2,2);\n this.ySpeed = random(-1,1.5);\n }", "function randomDirectionClick() {\n\tif (checkDirectionEquality()) {\n\t\tdirection.value = Math.floor(Math.random() * (+ 360 - (+0))) + (+0); \n\t\ttempDirection = direction.value;\n\t\tsetGradient();\n\t} else {\n\t\tuserDirectionClick();\n\t}\n}", "initializeY()\n {\n let sign = Math.random() < 0.5 ? -1.0: 1.0;\n return this.h + sign * random(0, this.displacement / 2.0);\n }", "function RandFloat() {\n\treturn Math.random();\n}", "constructor(){\n this.x = random(0,width);\n this.y = random(0,height);\n this.r = random(1,8);\n this.xSpeed = random(-0.5,0.5);\n this.ySpeed = random(-0.1,0.1);\n }", "function getRandPipeYSpeed() {\n return 1 + Math.random() * 3;\n}", "function randPosYVelocity() {\n var rand = Math.random(0.5);\n return rand;\n}", "function mvDown(){\n newPos += Math.floor(Math.random() * 1 + 10);\n document.getElementById('y').innerHTML = \"y:\" + newPos;\n if ( newPos >= 460 ){\n newPos = 450\n }\n document.getElementById('ball').style.top = newPos + 'px';\n\n}", "function mvUp(){\n newPos += Math.floor(Math.random() * 1 - 10);\n document.getElementById('y').innerHTML = \"y:\" + newPos;\n if ( newPos <= 0 ) {\n newPos = 10\n }\n document.getElementById('ball').style.top = newPos + 'px';\n}", "initializeDirection() {\n // 1, 2, 3, 4.\n this.direction = Math.floor(Math.random() * 4) + 1;\n }", "function bounce() {\n ball.body.velocity.x = 400;\n if (ball.body.velocity.y > 0) {\n ball.body.velocity.y = Math.random() * 750\n }\n else {\n ball.body.velocity.y = -Math.random() * 750\n }\n ball.body.velocity.x = ball.body.velocity.x + 10\n this.counter++;\n }", "static randFloat () {\n return Math.random();\n }", "constructor() {\n this.x = random(0, width);\n this.y = random(0, height);\n this.r = 10;\n this.xSpeed = random(-2, 2);\n this.ySpeed = random(-2, 2);\n }", "setRandVel(factor, minDirection = 0, maxDirection = Math.PI * 2){\n\t\tvar ang = Math.random() * (maxDirection - minDirection) + minDirection;\n\t\tthis.vel = vec2.fromAng(ang, factor);\n\t}", "function randomDir(){\r\n\treturn Math.floor(Math.random()*3)-1;\r\n}", "function randNegYVelocity() {\n var rand = Math.random() * -0.5 - 0.5;\n return rand;\n}", "function randomAngleRadians() {\n return Math.random()*Math.PI*2;\n}", "function resetBall() {\n ball.x = cvs.width / 2;\n ball.y = paddle.y - BALL_RADIUS;\n ball.dx = 3 * (Math.random() * 2 - 1);\n ball.dy = -3;\n}", "randomize() {\n for (let i = 0; i < this.directions.length; i++) {\n let randomAngle = MyMath.random(2 * Math.PI)\n this.directions[i] = randomAngle\n }\n }", "function gen_random(){\r\n\treturn 0.3\r\n}", "function speed(){\n return Math.floor((Math.random() * 3) + 1)\n}", "move() {\n this.y = this.y +this.fallSpeed;\n if(this.y>height+100){\n \n this.y = -100;\n\n this.x = random(width);\n }\n \n }", "constructor() {\n this.amplitude = Math.random() * (10 - 2) + 2;\n this.checkSin = this.randomBool();\n this.choice = Math.round(Math.random() * (2 - 1)) + 1;\n this.direction1 = this.randomDirection();\n this.direction2 = this.randomDirection();\n // this.length = Math.ceil(Math.random() * 500);\n this.drawnLength = 0;\n this.length = Math.random() * 40;\n }", "update() {\n this.z -= 300/tempo;\n if (this.z < 1) {\n this.x = random(-width/1.5, width/1.5);\n this.y = random(-height/1.5, height/1.5);\n this.z = random(width);\n this.pz = this.z;\n }\n }", "setSpeed() {\n return Math.floor(Math.random() * 250) + 120;\n }", "constructor() {\n this.x = random(0, windowWidth);\n this.y = random(0, windowHeight);\n this.r = random(0, 2.5);\n this.xSpeed = random(-0.1, 0.5);\n this.ySpeed = random(-0.1, 0.5);\n }", "move() {\n this.x = this.x + random(-2, 2);\n this.y = this.y + random(-2, 2);\n }", "function mvRight() {\n Pos += Math.floor(Math.random() * 1 + 10);\n document.getElementById('x').innerHTML = \"x:\" + Pos;\n document.getElementById('ball').style.left = Pos + 'px';\n if ( Pos >= 930 ) {\n Pos = 930\n }\n}", "function generateRandomBall() {\n let res = \"\";\n if (Math.random() < 0.5) {\n res = STRIKE_CHAR;\n } else {\n res = generateRandomBetween(0, 9);\n }\n return res;\n}", "generateSpeed(){\n return Math.floor(Math.random()*(250-225)+225);\n }", "function rand(){\n return Math.random()-0.5;\n }", "reset() {\n //spawns it at the middle of the sketch\n this.x = width / 2;\n this.y = height / 2;\n //allows the ball to pop up at a random speed and angle when it has been generated\n let angle = random(-PI / 4, PI / 4);\n this.ballvx = 5 * Math.cos(angle);\n this.ballvy = 5 * Math.sin(angle);\n\n if (random(1) < 0.5) {\n this.ballvx *= -1;\n }\n }", "function getRandomValue() {\n return (Math.random() * (0.9 - 0.2) + 0.2)\n}", "move(){\n this.x=this.x+random(-3,3)\n this.y=this.y+random(-3,3)\n }", "function resetDirection() {\n posX = random(trueFalse);\n posY = random(trueFalse);\n w = 0;\n z = 0;\n}", "move() {\n this.x += random(-5, 5);\n this.y += random(-5, 5);\n }", "function randomRobot(state) {\n return {direction: randomPick(roadGraph[state.place])};\n}", "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "function randomY() {\n var randomNumber = Math.random();\n var y;\n\n switch (true) {\n case (randomNumber < 0.333):\n y = 145;\n break;\n case (0.333 <= randomNumber && randomNumber < 0.666):\n y = 145 + TILE_HEIGHT;\n break;\n default:\n y = 145 + TILE_HEIGHT * 2;\n }\n\n return y;\n}", "function positionFood() {\n food.x = random(0,width);\n food.y = random(0,height);\n ////NEW CODE: Set a random velocity for food based on iits max speed////\n food.vx = random(-food.maxSpeed, food.maxSpeed);\n food.vy = random(-food.maxSpeed, food.maxSpeed);\n ////END NEW CODE////\n}", "move() {\n let xDiff = this.xTarget - this.x + 5; // Blumenmitte\n let yDiff = this.yTarget - this.y;\n if (Math.abs(xDiff) < 1 && Math.abs(yDiff) < 1)\n this.setRandomFlowerPosition();\n else {\n this.x += xDiff * this.speed;\n this.y += yDiff * this.speed;\n }\n }", "function randomShift(mode){\r\n\tvar randNum = 0;\r\n\t\r\n\trandNum = Math.random();\r\n\t\r\n\t//binary mode: output = 0 or 1\r\n\tif (mode == \"binary\"){\r\n\t\tif (randNum < 0.50){\r\n\t\t\trandNum = 0;\r\n\t\t} else randNum = 1;\r\n\t}\r\n\t\r\n\t//ternary mode: output = -1 or 0 or 1\r\n\tif (mode == \"ternary\"){\r\n\t\tif (randNum < 0.33) {\r\n\t\t\trandNum = -1;\r\n\t\t} else if (randNum < 0.66) {\r\n\t\t\trandNum = 0;\r\n\t\t} else randNum = 1;\r\n\t}\r\n\treturn randNum;\r\n\t\r\n}", "static randomClamped () {\n return this.randFloat() - this.randFloat();\n }", "move() {\n this.x = this.x + random(-10,10);\n this.y = this.y + random(-10,10);\n }", "function generateSpeedFactor() {\n var n = 90 + Math.floor(Math.random() * 110);\n var r = n / 100.0;\n return r;\n}", "getWindDir() {\n var rndWind = vec3.create();\n var change = Math.random() * 0.1\n if(Math.random() > 0.6)\n rndWind[0] += change;\n else\n rndWind[2] += change;\n\n vec3.add(rndWind, rndWind, this.wind);\n return rndWind;\n }", "move() {\n\n\t\tthis.x += random(-5, 5);\n\t\tthis.y += random(-5, 5);\n\n\t}", "mutate() {\n //chance that any vector in directions gets changed\n let mutationRate = CONFIG.PERCENTAGE_MUTATION\n\n for (let i = 0; i < this.directions.length; i++) {\n let rand = MyMath.random(1)\n if (rand < mutationRate) {\n \n //set this direction as a random direction \n let randomAngle = MyMath.random(2 * Math.PI)\n this.directions[i] = randomAngle\n }\n }\n }", "stepAgent() {\n let r = Math.random() * 2 * Math.PI;\n this.direction = [\n this.stepSize * Math.cos(r),\n this.stepSize * Math.sin(r)\n ]\n this.position = this.addVectors(this.position, this.direction);\n }", "stepAgent() {\n let r = Math.random() * 2 * Math.PI;\n this.direction = [\n this.stepSize * Math.cos(r),\n this.stepSize * Math.sin(r)\n ]\n this.position = this.addVectors(this.position, this.direction);\n }", "function crndf() {\n return (Math.random()-0.5)*2;\n}", "function randomOffset() {\r\n\r\n\t\treturn ( Math.random() - 0.5 ) * 2 * 1e-6;\r\n\r\n\t}", "function mvLeft() {\n Pos += Math.floor(Math.random() * 1 - 10);\n document.getElementById('x').innerHTML = \"x:\" + Pos;\n document.getElementById('ball').style.left = Pos + 'px';\n if ( Pos <= 10 ) {\n Pos = 10\n }\n}", "function randomNormal() {\r\n var u = 1 - Math.random(); // Subtraction to flip [0, 1) to (0, 1].\r\n var v = 1 - Math.random();\r\n return Math.sqrt( -2.0 * Math.log( u ) ) * Math.cos( 2.0 * Math.PI * v );\r\n}", "function ball() {\n ctx.beginPath();\n ctx.arc(x, y, radius, 0, Math.PI*4);\n ctx.fillStyle = Math.floor(Math.random()*16777215).toString(16);;\n ctx.fill();\n ctx.closePath();\n}", "sample(point) {\n var isovalue = 1.1;\n var normal = new THREE.Vector3(0,0,0);\n this.balls.forEach(function(ball) {\n var d = point.distanceTo(ball.pos);\n var i = (ball.radius * ball.radius) / (d * d);\n isovalue += i;\n\n // formula for normals: http://blackpawn.com/texts/metanormals/ (gradient)\n var n = new THREE.Vector3((point.x - ball.pos.x), (point.y - ball.pos.y), (point.z - ball.pos.z));\n normal.add(n.multiplyScalar(2 * i * i));\n });\n return {\n isovalue: isovalue,\n normal: normal\n };\n }", "function getAutoMove(b) {\n return Math.floor(Math.random() * 4);\n}", "function randomOffset() {\n return ( Math.random() - 0.5 ) * 2 * 1e-6;\n }", "function setGoal() {\n goal = Math.floor(Math.random() * 102) + 19;\n}", "function randomfloatAtoB ( A, B )\n{\n return ( A + ( Math.random() * (B-A) ) );\n}", "function addBall() {\r\n var ball_x = randomInt(50, canvas.width - 50);\r\n var ball_y = randomInt(50, canvas.height - 50);\r\n var ball_dx = randomInt(-10, 10);\r\n var ball_color = colors[randomInt(0, colors.length)];\r\n var ball_radius = randomInt(30, 50);\r\n ballArray.push(new Ball(ball_x, ball_y, ball_dx, 0, ball_radius, ball_color));\r\n}", "function randomOffset() {\n\t\t\treturn ( Math.random() - 0.5 ) * 2 * 1e-6;\n\t\t}", "function random() {\n var x = Math.sin(seed++) * 10000;\n return x - Math.floor(x);\n}", "function totalFriction() {\n var start = randGPM / 100;\n var first = Math.pow(start, 2);\n \tvar second = randCoef * first;\n \tvar third = randLength / 100;\n \tvar result = third * second + randNozzle + randElevation;\n return Math.round(result);\n }", "function update() {\n// update velocity\n vy += gravity; // gravity\n \n // update position\n x += vx;\n y += vy; \n \n // handle bouncing\n if (y > canvas.height - radius){\n \n y = canvas.height - radius;\n vy *= -velRedFac;\n color = getRandomColor()\n };\n // wrap around\n if (x > canvas.width + radius){\n \n x = canvas.offsetLeft;\n };\n if (x < canvas.offsetLeft){\n\n x = canvas.width;\n };\n // update the ball\n drawBall();\n}", "function positionFood() {\n food.x = random(0,width);\n food.y = random(0,height);\n food.vx = random(-food.maxSpeed,food.maxSpeed);\n food.vy = random(-food.maxSpeed,food.maxSpeed);\n}", "constructor() {\n this.x = random(100, width - 100);\n this.y = -25;\n //devides the height of the screen into steps, where the bolt changes angles\n this.steps = ceil(random(15, 25));\n this.stepSize = ceil(height/this.steps);\n this.color = color(random(220, 255), random(220, 255), random(150, 220));\n //random yellow to white colour\n this.size = floor(random(3, 7));\n //thickness\n }" ]
[ "0.7768337", "0.77296907", "0.74361587", "0.73115885", "0.7135385", "0.71310353", "0.7108028", "0.7074491", "0.7020762", "0.7005384", "0.7002904", "0.6989081", "0.6962469", "0.6896277", "0.6894648", "0.6847753", "0.6826241", "0.67911685", "0.6751009", "0.67328095", "0.67312574", "0.6719786", "0.6716159", "0.67142075", "0.6710046", "0.67035156", "0.6696615", "0.66927904", "0.66802275", "0.6666202", "0.6664857", "0.6654275", "0.6646397", "0.6608867", "0.6602494", "0.6590986", "0.6588507", "0.6578708", "0.65613645", "0.6559465", "0.6549437", "0.6547099", "0.6531217", "0.65236145", "0.6511204", "0.6502712", "0.64599276", "0.64527553", "0.6447652", "0.64462686", "0.64448804", "0.64436877", "0.64325154", "0.6408458", "0.6366674", "0.63595355", "0.6359382", "0.6356088", "0.63493836", "0.63490474", "0.63330746", "0.63302183", "0.63198453", "0.6286896", "0.62835824", "0.62807566", "0.62652135", "0.6262622", "0.62623626", "0.62621677", "0.6262021", "0.6262021", "0.62528384", "0.6249338", "0.6245815", "0.6224571", "0.62223893", "0.6220177", "0.6211418", "0.6203918", "0.6200965", "0.6183056", "0.6177909", "0.6177909", "0.6171689", "0.6162807", "0.6161507", "0.6157051", "0.6152398", "0.6148255", "0.6148076", "0.61459565", "0.61442727", "0.6143155", "0.6136288", "0.6123338", "0.6114486", "0.610889", "0.6106964", "0.610449", "0.60980964" ]
0.0
-1
random color for balls
function randomColor(){ return `rgb(${randomInt(0,256)},${randomInt(0,256)},${randomInt(0,256)})`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomColor() {\n r = random(255);\n g = random(255);\n b = random(255);\n}", "function ballsBgColor() {\n const randomNumber = Math.floor(Math.random() * balls.length);// Random number between 0 and 5\n for (let i = 0; i < balls.length; i += 1) {\n if (i === randomNumber) { // To put the answer in a random ball\n let correctAnswer = rgbColor.innerText;\n correctAnswer = 'rgb' + correctAnswer;\n balls[i].style.backgroundColor = correctAnswer;\n } else {\n const rgb = 'rgb(' + random() + ', ' + random() + ', ' + random() + ')';\n balls[i].style.backgroundColor = rgb;\n }\n }\n}", "function randomColor () {\nreturn Math.floor (Math.random() * 256) ;\n}", "function randomColor() {\n\t//pick r, g, b from 0 - 255\n\tvar r = Math.floor(Math.random() * 256);\n\tvar g = Math.floor(Math.random() * 256);\n\tvar b = Math.floor(Math.random() * 256);\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomColor() {\n return Math.floor(Math.random() * 255);\n}", "function determineColor(){\n var red = randomInt(255);\n var green = randomInt(255);\n var blue = randomInt(255);\n}", "function colorBricks() {\n let colorIndex = Math.floor(Math.random() * BRICK_COLOR.length - 1)\n return BRICK_COLOR[colorIndex];\n}", "function randomColor(){\r\n var r= Math.floor(Math.random() * 256);\r\n var g= Math.floor(Math.random() * 256);\r\n var b= Math.floor(Math.random() * 256);\r\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\r\n}", "function randomColor() {\n\t//array with red, green, and blue\n\tvar colors = [color(255,0,0),color(0,255,0),color(0,0,255)];\n\treturn random(colors);\t\t//returns a random color from the array\n}", "function randomColor() {\n var r = random(0, 255);\n var b = random(0, 255);\n var g = random(0, 255);\n\n\n return color(r, b, g);\n}", "function randomColor() {\n\tconst r = Math.round(255 * Math.random());\n\tconst g = Math.round(255 * Math.random());\n\tconst b = Math.round(255 * Math.random());\n\treturn {r, g, b};\n}", "function randomColor(){\r\n return(\"rgba(\" + Math.round(Math.random()*250)+\",\"\r\n + Math.round(Math.random()*250) + \",\"\r\n + Math.round(Math.random()*250) + \",\"\r\n + Math.ceil(Math.random() *10)/10 + \")\" // Math.ceil: round number UP to the nearset Intenger\r\n );\r\n}", "function randomColor()\n{\n\treturn \"rgb(\" + Math.floor(Math.random()*255)+\",\"+\n\t\t\t\t Math.floor(Math.random()*255)+\",\"+\n\t\t\t\t Math.floor(Math.random()*255)+\")\";\n}", "function randColor()\n {\n return '#'+ Math.floor(Math.random()*16777215).toString(16);\n }", "function randColor() {\n return Math.floor(Math.random() * 256);\n}", "function randomColor() {\n return \"rgb(\" + random(0, 235) +\n \", \" + random(0, 235) +\n \", \" + random(0, 235) + \")\";\n}", "function RandomColor()\n{\nif( shapeColor.length > 0)\n {\nvar newColor = Random.Range(0,shapeColor.length);\nGetComponent.<Renderer>().material.color = shapeColor[newColor];\n }\n}", "function randomColor(){\n\tvar r=Math.floor(Math.random()*256);\n\tvar g=Math.floor(Math.random()*256);\n\tvar b=Math.floor(Math.random()*256);\n\treturn \"rgb(\"+r+\", \"+g+\", \"+b+\")\";\n\n}", "function randomColor() {\n return (\n \"rgb(\" +\n Math.round(Math.random() * 250) + \",\" +\n Math.round(Math.random() * 250) + \",\" +\n Math.round(Math.random() * 250)\n + \")\"\n );\n}", "function randomColor() {\n colors = [\"red\", \"yellow\", \"blue\", \"green\"];\n return colors[Math.floor(Math.random() * 7)];\n }", "function RandomColor() {\n\n\tlet rFactor = Math.random()\n\tlet gFactor = Math.random()\n\tlet bFactor = Math.random()\n\n\tlet color = new THREE.Color(rFactor, gFactor, bFactor);\n\n\treturn color ;\n}", "randomColor()\n {\n function r()\n {\n return Math.floor(Math.random() * 255)\n }\n return 'rgba(' + r() + ',' + r() + ',' + r() + ', 0.2)'\n }", "function generateRandomColorValues () {\n r = Math.round(Math.random() * (256));\n g = Math.round(Math.random() * (256));\n b = Math.round(Math.random() * (256));\n}", "function getRandomColor() // function to choose random color of shape\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar letters= '1234567890ABCDEF'.split(''); //spiliting the digits and alphabets randomly to make different color combinations\n\t\t\t\t\t\t\t\t\t\tvar color= '#';\n\t\t\t\t\t\t\t\t\t\t\tfor(i=0; i<6 ; i++)\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\t\tcolor += letters[Math.floor(Math.random() * 16 )]; //setting to a round off digit rather than a decimal one\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\treturn color;\n\t\t\t\t\t\t\t\t\t}", "function randomColor() {\n var r = Math.floor(Math.random() * 256);\n var g = Math.floor(Math.random() * 256);\n var b = Math.floor(Math.random() * 256);\n\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomColor(){\n var r = Math.floor(Math.random() * 256);\n var g = Math.floor(Math.random() * 256);\n var b = Math.floor(Math.random() * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function color_rand() {\n return color(random(127,255),random(127,255),random(127,255));\n}", "function randomColor() {\n var r = random(256) | 0,\n g = random(256) | 0,\n b = random(256) | 0;\n return 'rgb(' + r + ',' + g + ',' + b + ')';\n }", "function randomColor(){\r\n\tvar r = Math.floor( (Math.random()*256));\t\t\t\t\t\t\t//pick a level of red from 0-255\t\t\t\r\n\tvar g = Math.floor( (Math.random()*256));\t\t\t\t\t\t\t//pick a level of green from 0-255\r\n\tvar b = Math.floor( (Math.random()*256));\t\t\t\t\t\t\t//pick a level of blue from 0-255\r\n\r\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\r\n}", "function generateRandomColor() {\n // return '#'+Math.floor(Math.random()*16777215).toString(16);\n return myColors[Math.floor(Math.random()*myColors.length)];\n}", "function randomColor(){\n return color3(Math.floor(Math.random()*256),\n Math.floor(Math.random()*256),\n Math.floor(Math.random()*256));\n}", "function randomColor() {\n //pick red/blue/green from 0 to 255\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 return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "setRandomColor() {\n const r = Math.floor(Math.random() * 255);\n const g = Math.floor(Math.random() * 255);\n const b = Math.floor(Math.random() * 255);\n \n this.setColorState([r, g, b]);\n }", "function randomColor(){\r\n this.colorArray = [\"#CC0000\", \"#FF8800\", \"#007E33\", \"#00695c\", \"#0d47a1\", \"#9933CC\"];\r\n var ranColor = Math.floor(Math.random()*6);\r\n var color = colorArray[ranColor];\r\n return color;\r\n}", "function randomColor() {\n var x = Math.floor(Math.random() * 256);\n var y = Math.floor(Math.random() * 256);\n var z = Math.floor(Math.random() * 256);\n return Color = \"rgb(\" + x + \",\" + y + \",\" + z + \")\";\n}", "function randomColor() {\n const len = colors.length;\n return colors[Math.floor(Math.random() * len)];\n}", "function randomColor(){\n return colors[Math.floor(Math.random() * colors.length)]\n}", "function randomColor() {\n //pick a \"red\" from 0 -255\n const r = Math.floor(Math.random() * 256);\n //pick a \"green\" from 0 -255\n const g = Math.floor(Math.random() * 256);\n //pick a \"blue\" from 0 -255\n const b = Math.floor(Math.random() * 256);\n\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomColor() {\n //pick a red from 0 - 255\n var R = random(0, 255);\n //pick a green from 0 - 255\n var G = random(0, 255);\n //pick a blue from 0 - 255\n var B = random(0, 255);\n return `rgb(${R}, ${G}, ${B})`;\n}", "function gencolor() {\n len = _COLOR.length;\n rand = Math.floor(Math.random()*len); \n return _COLOR[rand];\n }", "function makeRandoColor(){\r\n var rc = 'rgb(' + (Math.floor((256-229)*Math.random()) + 230) + ',' + \r\n (Math.floor((256-190)*Math.random()) + 220) + ',' + \r\n (Math.floor((256-190)*Math.random()) + 200) + ')';\r\n return rc;\r\n}", "function getRandomColor() {\n let r = 0;\n let b = 255;\n let g = 0; //Math.round(Math.random()*255);\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n}", "function randomColor() {\n\t//pick a \"red\" from 0 - 255\n\tvar red = Math.floor(Math.random() * 256);\n\tvar green = Math.floor(Math.random() * 256);\n\tvar blue = Math.floor(Math.random() * 256);\n\treturn \"rgb(\" + red + \", \" + green + \", \" + blue + \")\";\n}", "function GetRandomColor() {\r\n var r = 0,\r\n g = 0,\r\n b = 0;\r\n while (r < 100 && g < 100 && b < 100) {\r\n r = Math.floor(Math.random() * 256);\r\n g = Math.floor(Math.random() * 256);\r\n b = Math.floor(Math.random() * 256);\r\n }\r\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\r\n}", "function randomizeColor() {\n let r = Math.floor(Math.random() * 255);\n let g = Math.floor(Math.random() * 255);\n let b = Math.floor(Math.random() * 255);\n return `rgb(${r}, ${g}, ${b})`;\n}", "function randomColor(){\n\t// pick a red from 0 to 255\n\tvar r = Math.floor(Math.random() * 255 + 1);\n\n\t// pick a green from 0 to 255\n\tvar g = Math.floor(Math.random() * 255 + 1);\n\n\t// pick a blue from 0 to 255\n\tvar b = Math.floor(Math.random() * 255 + 1);\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomColor() {\n // Generate random integer between 0 and 255\n function generateNumber() {\n return Math.floor(Math.random() * 256);\n }\n return \"rgb(\" + generateNumber() + \", \" + generateNumber() + \", \" + generateNumber() + \")\";\n}", "function randColor() {\r\n var r = Math.floor(Math.random() * (256)),\r\n g = Math.floor(Math.random() * (256)),\r\n b = Math.floor(Math.random() * (256));\r\n return '#' + r.toString(16) + g.toString(16) + b.toString(16);\r\n}", "randomColor(){\n return colors[Math.floor(Math.random() * colors.length)];\n }", "function color() {\n\t return {\n\t r: Math.floor(Math.random() * colorArray[0][0]),\n\t g: Math.floor(Math.random() * colorArray[0][1]),\n\t b: Math.floor(Math.random() * colorArray[0][2]),\n\t }\n\t}", "function randomColor() {\n //pick a red from 0 to 255\n var R = Math.floor(Math.random() * 256);\n //pick a green from 0 to 255\n var G = Math.floor(Math.random() * 256);\n //pick a blue from 0 to 255\n var B = Math.floor(Math.random() * 256);\n (\"rgb(R, G, B)\");\n return \"rgb(\" + R + \", \" + G + \", \" + B + \")\";\n}", "function pickcolor() {\n\tvar random=Math.floor(Math.random()*color.length);\n\t return color[random];\n\t// body...\n}", "function randomColour() {\n\n\tfunction value() {\n\t\treturn Math.floor(Math.random() * Math.floor(255)) \n\t}\n\treturn 'rgb(' + value() + ',' + value() + ',' + value() + ')';\n}", "function randomColor() {\n return \"#\" + Math.floor(Math.random() * 0xffffff).toString(16);\n}", "function randomColor(){\t\n\tvar r = Math.floor(Math.random() * 256);\t// pick a \"red\" from 0 - 255\t\n\tvar g = Math.floor(Math.random() * 256);\t// pick a \"green\" from 0 - 255\n\tvar b = Math.floor(Math.random() * 256);\t// pick a \"blue\" from 0 - 255\n\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "randomColor() {\n /*\n Uncomment for random shades of blue\n\n h = 215;\n s = Math.floor(Math.random() * 100);\n l = 60 // Math.floor(Math.random() * 100);\n return 'hsl(' + h + ', ' + s + '%, ' + l + '%)';\n */\n return ('#' + (Math.random() * 0xFFFFFF << 0).toString(16) + '000000').slice(0, 7);\n }", "function randomColor(){\n\tvar red = getRandomNumber(255);\n\tvar green = getRandomNumber(255);\n\tvar blue = getRandomNumber(255);\n\treturn \"rgb(\" + red +\", \" + green + \", \"+ blue + \")\";\n}", "function randomColor(){\n\tlet r = Math.floor(Math.random() * 256);\n\tlet g = Math.floor(Math.random() * 256);\n\tlet b = Math.floor(Math.random() * 256);\n\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n\n}", "function getRandomColor() {\n return colors[Math.floor(Math.random() * colors.length)];\n}", "function randomColor(){\n\t//pick a \"red\" from 0 to 100\n\tvar r = Math.floor(Math.random() * 100);\n\t//pick a \"green\" from 0 to 100\n\tvar g = Math.floor(Math.random() * 100);\n\t//pick a \"blue\" from 0 to 100\n\tvar b = Math.floor(Math.random() * 100);\n\t// Using weights to guarantee the gray(ish)scale\n\t\"rgb(r, g, b)\"\n\treturn \"rgb(\" + (r)*0.3 + \", \" + (g)*0.59 + \", \" + (b)*0.11 + \")\";\n}", "function randomColor() {\r\n let r = Math.floor(Math.random() * 255 + 1);\r\n let g = Math.floor(Math.random() * 255 + 1);\r\n let b = Math.floor(Math.random() * 255 + 1);\r\n return `rgb(${r},${g},${b})`;\r\n}", "static random() {\n return new Color(random(255), random(255), random(255))\n }", "function generateRandomColor() {\n let r = Math.floor(Math.random() * 255);\n let g = Math.floor(Math.random() * 255);\n let b = Math.floor(Math.random() * 255);\n let color = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + 1 + \")\";\n return color;\n }", "function randomColor() {\n var x = Math.floor(Math.random() * 256);\n var y = Math.floor(Math.random() * 256);\n var z = Math.floor(Math.random() * 256);\n var color = \"rgb(\" + x + \",\" + y + \",\" + z + \")\";\n return color;\n}", "getRandomColor () {\n return this.c.particlesColors[Math.floor(Math.random() * this.c.particlesColors.length)]\n }", "function ranColor(){\n\tvar red = Math.floor(Math.random() * 256);\n\tvar green = Math.floor(Math.random() * 256);\n\tvar blue = Math.floor(Math.random() * 256);\n\t\n\treturn \"rgb(\" + red + \",\" + green + \",\" + blue + \")\";\n\n}", "function getRandomColor() {\n return 'rgb(' + Math.floor(Math.random() * 256) + ',' + Math.floor(Math.random() * 256) + ',' + Math.floor(Math.random() * 256) + ')';\n}", "function randomColor() {\n // defines red value as random\n let r = random(255);\n // defines green value as random\n let g = random(255);\n // defines blue value as random\n let b = random(255);\n // sends back the function in red / green / blue form\n return color(r, g, b);\n }", "function randomColor(){\r\n\t//pick a \"red\" from 0 - 255\r\n\tconst r = Math.floor(Math.random() * 256);\r\n\t//pick a \"green\" from 0 -255\r\n\tconst g = Math.floor(Math.random() * 256);\r\n\t//pick a \"blue\" from 0 -255\r\n\tconst b = Math.floor(Math.random() * 256);\r\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\r\n}", "function randomColor(){\n\tvar r,g,b;\n\tvar color = [];\n\tr = random(255); \n\tg = random(255);\n\tb = random(255);\n\tcolor.push(r,g,b);\n\treturn color;\n}", "static random_color () {\n let r = rand_in_range(0, 256)\n let g = rand_in_range(0, 256)\n let b = rand_in_range(0, 256)\n let a = rand_in_range(0, 128)\n\n return [r, g, b, a]\n }", "function randomColor() {\n\n let r = Math.floor(Math.random(256) * 256);\n let g = Math.floor(Math.random(256) * 256);\n let b = Math.floor(Math.random(256) * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function generateColor() {\n var r = Math.floor(Math.random() * 256);\n var g = Math.floor(Math.random() * 256);\n var b = Math.floor(Math.random() * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randColor() {\n // Return a random rgb color for coloring the file blocks\n let r = Math.random() * 180 + 60\n let g = Math.random() * 180 + 60\n let b = Math.random() * 180 + 60\n return `rgba(${r},${g},${b},0.7)`\n }", "function randomColor(){\r\n var hue = Math.floor(Math.random() * 360);\r\n var l = Math.random() * 15 + 70;\r\n var pastel = 'hsl(' + hue + ', 100%, ' + l + '%)';\r\n return pastel;\r\n}", "function rndWaterColor() {\n return 'rgb(' + colorsWater[Math.floor(Math.random() * 5999) + 1] + ')';\n }", "function randomColor() {\n // Pick red, green, and blue from 0 - 255\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\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomColor() {\n\t\treturn \"#\"+(0x1000000+(Math.random())*0xffffff).toString(16).substr(1,6);\n\t}", "function getRandomColor() {\n let r = 0;\n let g = 0;\n let b = 0;\n while (r < 100 && g < 100 && b < 100) {\n r = Math.floor(Math.random() * 256);\n g = Math.floor(Math.random() * 256);\n b = Math.floor(Math.random() * 256);\n }\n return `rgba(${r},${g},${b},0.6)`;\n}", "function randomColor(){\n\tval = Math.floor(Math.random()*255);\n\treturn val;\n}", "function randomColorGenerator() {\n\t\t\t\t\t\t\treturn '#'\n\t\t\t\t\t\t\t\t\t+ (Math.random().toString(16) + '0000000')\n\t\t\t\t\t\t\t\t\t\t\t.slice(2, 8);\n\t\t\t\t\t\t}", "function randomColor() {\n var rColor;\n var red = Math.floor(Math.random() * 256 );\n \tvar green = Math.floor(Math.random() * 256 );\n \tvar blue = Math.floor(Math.random() * 256 );\n\n rColor = 'rgb(' + red + ',' + green + ',' + blue + ')';\n\n return rColor;\n }", "function randomColor(){\n\treturn \"rgba(\"+randomInt(0,255)+\",\"+randomInt(0,255)+\",\"+randomInt(0,255)+\",1)\";\n}", "function randomColorGenerator() {\n\tvar randomColor;\n\tred = Math.floor(Math.random() * 256 );\n\tgreen = Math.floor(Math.random() * 256 );\n\tblue = Math.floor(Math.random() * 256 );\n\trandomColor = 'rgb(' + red + ',' + green + ',' + blue + ')';\n\treturn randomColor;\n}", "function randomColor(color){\n return color[Math.floor((Math.random() * 3))];\n }", "function getRandomColor() {\n var red = Math.floor(Math.random() * 255);\n var green = Math.floor(Math.random() * 255);\n var blue = Math.floor(Math.random() * 255);\n return 'rgb(' + red + ',' + green + ',' + blue + ')';\n\n}", "function randomColor() {\n return (\n \"rgba(\" +\n Math.round(Math.random() * 250) +\n \",\" +\n Math.round(Math.random() * 250) +\n \",\" +\n Math.round(Math.random() * 250) +\n \",\" +\n Math.ceil(Math.random() * 10) /10 +\n \")\"\n )\n}", "function randcolor(a) {\n\t\tvar r = Math.floor(Math.random()*192) + 64;\n\t\tvar g = Math.floor(Math.random()*192) + 64;\n\t\tvar b = Math.floor(Math.random()*192) + 64;\n\t\tfor (var i=0; i<a.length; i++)\n\t\t\trgb(a[i], r, g, b);\n\t}", "function colorRandom(){\n\n\tvar r= Math.floor(Math.random()*256);\n\tvar g= Math.floor(Math.random()*256);\n\tvar b= Math.floor(Math.random()*256);\n\tvar color = \"rgb(\"+ r + \", \" + g + \", \" + b + \")\"; //cuatro horas para descubrir que me faltaba un espacio al lado de las comas cuando asigno el color\n\n\t//Validar para que no me de el mismo color que el background de body\n\t\n\treturn color;\n}", "function randomColor() {\n let r = Math.floor(Math.random() * 256);\n let b = Math.floor(Math.random() * 256);\n let g = Math.floor(Math.random() * 256);\n return bgColor = \"rgb(\" + r + \",\" + b + \",\" + g + \")\";\n}", "function randomizeColors() {\n background(random(0, 255), random(0, 255), random(0, 255));\n fill(random(0, 255), random(0, 255), random(0, 255));\n}", "function randomColor(){\n var rgbValues= [0,0,0];\n\n //Returns the sum of the colors to ensure the color is visually bright enough\n while (rgbValues.reduce(function sum(prev,curr){return prev + curr;},0)<200) {\n //Assign random numbers [0,255] to RGB\n for(var n=0;n<3;n++){\n rgbValues[n]=randomizeBetween(0,255);\n }\n }\n\n //Create string for the color of the circle and the text\n return 'rgba(' + rgbValues[0] + ', ' + rgbValues[1] + ', ' + rgbValues[2] + ', 1)';\n\n}", "getRandomColor() {\n const getByte = _ => 55 + Math.round(Math.random() * 200);\n return `rgba(${getByte()},${getByte()},${getByte()},.9)`;\n }", "function randomColor() {\r\n let red = randomNumber(0, 255)\r\n let green = randomNumber(0, 255)\r\n let blue = randomNumber(0, 255)\r\n return `rgb(${red},${green},${blue})`\r\n}", "function randomColor() {\n function color() {\n return Math.floor(Math.random()*256).toString(16)\n }\n return \"#\"+color()+color()+color();\n}", "function randomColorGenerator(posX, posY){\n\t \t\tvar variant = Math.floor(Math.random() * 256);\n\t\t\tvar r = (posX + variant) % 256; \n\t\t\tvar g = (posY + variant) % 256;\n\t\t\tvar b = (posX + posY + variant) % 256;\n\t\t\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n\n\t \t}", "function getRandomColor() {\n return arrayOfColors[Math.floor(Math.random()*arrayOfColors.length)];\n}", "function getRandomColor() {\n var colors= [\"#444444\",\"#777777\",\"#aaaaaa\",\"#bbbbbb\",\"#cccccc\"]\n return colors[Math.floor(Math.random() * 5)]\n}", "function randomColor() {\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 return (`rgb(${r},${g},${b})`);\n}", "function randomColor() {\n // Defines the red value to be a random number between 1 and 255\n let r = Math.random() * 255;\n // Defines the green value to be a random number between 1 and 255\n let g = Math.random() * 255;\n // Defines the blue value to be a random number between 1 and 255\n let b = Math.random() * 255;\n // Returns as a color value\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomColor(){\n\treturn '#'+Math.random().toString(16).substr(-6);\n}" ]
[ "0.81134444", "0.7710204", "0.77017725", "0.77001345", "0.76753265", "0.767251", "0.76707643", "0.7653003", "0.76454043", "0.7631624", "0.76299345", "0.7571218", "0.7569614", "0.75645864", "0.75579494", "0.7557005", "0.75545645", "0.7542439", "0.75405586", "0.7533367", "0.75292194", "0.7522759", "0.75176173", "0.7511909", "0.75100535", "0.749899", "0.7494888", "0.7494371", "0.7492401", "0.7483042", "0.74782854", "0.7476675", "0.7468115", "0.74613255", "0.7459119", "0.7458466", "0.7456623", "0.7456133", "0.7455772", "0.7453865", "0.7449547", "0.7448774", "0.74457246", "0.74438745", "0.74369884", "0.7436155", "0.7435672", "0.74318385", "0.7424558", "0.74238634", "0.7423025", "0.7419735", "0.7414801", "0.74145883", "0.7413129", "0.74126494", "0.74076223", "0.7406189", "0.74060065", "0.7400038", "0.7398683", "0.7395894", "0.73913515", "0.7387302", "0.7385113", "0.73815155", "0.7379361", "0.73760796", "0.73751456", "0.7374687", "0.73726285", "0.7369977", "0.73679197", "0.7362421", "0.7360259", "0.7358526", "0.7358484", "0.7354349", "0.7354335", "0.7352366", "0.73498386", "0.73492306", "0.734824", "0.73458886", "0.7344228", "0.7343204", "0.73413986", "0.7329984", "0.7326519", "0.732041", "0.7320053", "0.732", "0.73197675", "0.7318842", "0.7311073", "0.7308264", "0.73062867", "0.7284293", "0.72827303", "0.72806644", "0.7273695" ]
0.0
-1
generates balls on screen
function generate(){ for (let i=0;i<randomInt(40,300);i++){ var x = randomInt(50,1150); var y = randomInt(50,650); var r = randomInt(10,30); cond = false; if(i!==0){ do{ x = randomInt(50,1150); y = randomInt(50,650); r = randomInt(10,30); for(j = 0; j < ballarray.length; j++){ if (dist(x,y,ballarray[j].x,ballarray[j].y) -(r + ballarray[j].size)< 10){ cond = true; break; } else{ cond =false; } } }while(cond); } ballarray.push(new ball(x,y,r)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 makeBalls() {\n var count = 50; //was 1000\n var minDiameter = 6; //was 3\n var maxDiameter = 15-minDiameter; //was 15\n var maxXSpeed = 7;//10 a bit too fast\n var maxYSpeed = 7;\n\n //make the balls\n for(var i = 0; i < count; i += 1){\n var tempX = Math.floor((Math.random()*window.innerWidth)+1);\n var tempY = Math.floor((Math.random()*window.innerHeight)+1);\n var tempDiameter = Math.floor((Math.random()*maxDiameter)+minDiameter);\n var tempXSpeed = Math.floor((Math.random()*maxXSpeed*2))-maxXSpeed;\n tempXSpeed = tempXSpeed == 0 ? 1 : tempXSpeed;\n var tempYSpeed = Math.floor((Math.random()*maxYSpeed*2))-maxYSpeed;\n tempYSpeed = tempYSpeed == 0 ? 1 : tempYSpeed;\n balls[i] = [tempX, tempY, tempDiameter, tempXSpeed, tempYSpeed];\n }\n redraw();\n}", "function createInitialBalls() {\r\n 'use strict';\r\n var colors = [0xff0000, 0x00fff0, 0x0000ff, 0xe05a00, 0x800080, 0xffff00];\r\n for (let i = 0; i < 15; i++) {\r\n\r\n var x = ((i % 3) - 1) * 30;\r\n var z = (Math.floor(i / 3) - 2) * 30;\r\n\r\n //Random angle\r\n var angle = Math.floor(Math.random()*(Math.PI*2));\r\n\r\n // Random velocity\r\n var vel = Math.floor(Math.random()*(150 - 100) + 100);\r\n ball = createBall(x, 2, z, colors[i % colors.length]);\r\n giveMovement(ball, angle, vel);\r\n balls.push(ball);\r\n }\r\n}", "static draw() {\n tick++;\n\n background(51);\n\n for( let b of Ball.zeBalls ) {\n b.show();\n b.step(tick);\n }\n\n // if( tick < 1000 )\n // Ball.saveScreenshot( \"balls-\" + Ball.leadingZeroes(tick, 3) );\n }", "function draw() {\n background(20);\n\n // for-loop that goes through the balls array, calling Ball.js's methods for each one\n for (let i = 0; i < balls.length; i++) {\n let ball = balls[i];\n ball.move();\n ball.bounce();\n ball.display();\n }\n}", "function addingBalls() {\n\tvar randI = Math.floor(Math.random()* (ROWS-1));\n\tvar randJ = Math.floor(Math.random()* (COLS-1));\n\n\tif ((gBoard[randI][randJ].type === FLOOR) && (gBoard[randI][randJ].gameElement === null)) {\n\t\tgBoard[randI][randJ].gameElement = BALL;\n\t\tvar currPos = {i: randI, j: randJ};\n\t\trenderCell(currPos, BALL_IMG);\n\t\tgBallCounter++;\n\t}\t\n}", "function draw() {\n background(0);\n\n for (let i = 0; i < balls.length; i++) {\n let ball = balls[i];\n ball.move();\n ball.bounce();\n ball.display();\n }\n}", "function createBall() {\n ball = Matter.Bodies.circle(WINDOWWIDTH / 2, WINDOWHEIGHT / 2, BALLRADIUS, {\n label: 'ball',\n density: BALLDENSITY,\n friction: BALLFRICTION,\n frictionAir: BALLAIRFRICTION,\n restitution: BALLBOUNCE,\n render: {\n fillStyle: BALLCOLOR,\n },\n bounds: {\n min: { x: WALLTHICKNESS, y: WALLTHICKNESS },\n max: { x: WINDOWWIDTH - WALLTHICKNESS, y: WINDOWHEIGHT - WALLTHICKNESS }\n }\n });\n Matter.World.add(world, ball);\n }", "initBallList()\r\n\t{\r\n\t\tlet iterations = 0;\r\n\t\twhile (iterations < this.MAX_BALLS) {\r\n\t\t \tlet digit = Math.floor(Math.random() * this.MAX_BALLS) + 1;\r\n\r\n\t\t\tif (this.drawnBalls.indexOf(digit) < 0) {\r\n\t\t\t\tthis.drawnBalls.push(\r\n\t\t\t\t\tnew Ball(\r\n\t\t\t\t\t\twindow.innerWidth / 2 - 120, \r\n\t\t\t\t\t\twindow.innerHeight / 4,\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\t120,\r\n\t\t\t\t\t\tdigit,\r\n\t\t\t\t\t\t255\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t\titerations++;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function _renderBalls() {\n\t\t// clear last frame of balls\n\t\t$('.ball').remove();\n\t\t// for each ball render that ball on the table\n\t\tballs.forEach(function(ball){\n\t\t\tball.render();\n\t\t});\n\t}", "function addBall() {\n\tvar rows = gBoard.length;\n\tvar colls = gBoard[0].length;\n\tvar i = getRandomIntInclusive(0, rows - 1);\n\tvar j = getRandomIntInclusive(0, colls - 1);\n\n\tvar randomCell = gBoard[i][j];\n\tif (randomCell.type === WALL) return;\n\telse if (randomCell.gameElement !== null) return;\n\telse if (gIsGameOn) {\n\t\tgBoard[i][j].gameElement = BALL\n\t\tgBallsToCollect++;\n\t}\n\n\trenderCell({ i, j }, BALL_IMG);\n}", "function initializeBallsAndDraw() {\r\n\t// store all balls graphics to allGraphic, velocity to allGraphicVelocity\r\n\tallGraphic = [];\r\n\tallGraphicVelocity = [];\r\n\r\n\t// create balls\r\n\tfor (let i = 0; i < ballNumber; i++) {\r\n\t\tlet newBall = new PIXI.Graphics();\r\n\t\tallGraphic.push(newBall);\r\n\t\tapp.stage.addChild(newBall);\r\n\t\txv = Math.floor(Math.random() * 20) - 10;\r\n\t\tyv = Math.floor(Math.random() * 20) - 10;\r\n\t\tallGraphicVelocity.push([xv, yv]);\r\n\t};\r\n\r\n\t// draw all ball graphics on the screen\r\n\tfor (let j = 0; j < allGraphic.length; j++) {\r\n\t\tlet ball = allGraphic[j];\r\n\t\tball.beginFill(0xff0000); // white\r\n\t\tball.drawCircle(0, 0, ballRadius); // drawCircle(x, y, radius)\r\n\t\tball.x = xStart;\r\n\t\tball.y = yStart;\r\n\t\tallGraphic[j].endFill();\r\n\t};\r\n}", "function generateBalls() {\n // atHome constant is used to make a certain amount of balls stay at home\n const atHome = (ISOLATION != 0) ? (ISOLATION * BALL_COUNT * 0.1): 1;\n\n balls = [];\n for (var i = 0; i < BALL_COUNT; i++) {\n var direction = directions[Math.floor(Math.random() * directions.length)];\n\n var init_vx, init_vy;\n\n // If ball is allowed to roam, generate its velocity\n if (i % atHome == 0) {\n var init_v = SPEED; // Hypotenuse SPEED\n\n init_vx = Math.floor((Math.random() * SPEED) + 1)*direction;\n\n direction = directions[Math.floor(Math.random() * directions.length)];\n\n init_vy = Math.sqrt(init_v**2 - init_vx**2)*direction;\n } else {\n init_vy = init_vx = 0; // If ball stays at home then velocity is 0\n }\n\n balls[i] = {\n x:getRandomInt(0,CANVAS_WIDTH),\n y:getRandomInt(0,CANVAS_HEIGHT),\n future: {vx: init_vx/10, vy: init_vy/10}, // Use future so that when we generate\n // nodes, vx and vy will be the speed & direction the ball travels in.\n\n // Set all balls to be healthy at first\n infected: false,\n recovered: false,\n tick_infected: null // tick_infected stores the tick when balls[i] got infected\n }\n }\n\n // Set first ball to be infected\n balls[0].infected = true;\n balls[0].tick_infected = 0;\n}", "function ballGenerator () {\n ballPosition = position()\n ballX = ballPosition.getPosX()\n ballY = ballPosition.getPosY()\n // draw pitch\n ctx.drawImage(background, 0, 0, 700, 500)\n var ball = new Image()\n ball.src = 'assets/soccerball.png'\n // draw ball image on canvas\n ball.onload = function () {\n ctx.drawImage(ball, ballX * 650, ballY * 450, 50, 50)\n }\n }", "function addBall(){\n\tvar color = 'rgb(' + parseInt(Math.random() * 255) + ', ' +\n\t\tparseInt(Math.random() * 255) + ', ' +\n\t\tparseInt(Math.random() * 255) + ')';\n\tvar radius = 5 + Math.floor(Math.random() * 30);\n\t// when random = 1, x = canvas width - radius\n\t// when random = 0, x = radius. so all balls are within canvas\n\tvar x = radius + Math.random() * (canvas.width - 2 * radius);\n\tvar y = Math.random() * canvas.height / 4;\n \tvar ball = new Ball(x, y, radius, color);\n \tballArray.push(ball);\n}", "function Ball(){\n fill(color(255, 255, 0));\n circle(xBall, yBall, diameter);\n}", "function rndBall() {\r\n\tvar locationRow = Math.floor((Math.random() * (gBoard.length - 1 - 1)) + 1);\r\n\tvar locationCol = Math.floor((Math.random() * (gBoard[0].length - 1 - 1)) + 1);\r\n\twhile (gBoard[locationRow][locationCol].gameElement) {\r\n\t\tlocationRow = Math.floor((Math.random() * (gBoard.length - 1 - 1)) + 1);\r\n\t\tlocationCol = Math.floor((Math.random() * (gBoard[0].length - 1 - 1)) + 1);\r\n\t}\r\n\tgBoard[locationRow][locationCol].gameElement = BALL;\r\n\tvar location = { i: locationRow, j: locationCol };\r\n\trenderCell(location, BALL_IMG);\r\n}", "function drawBottles() {\n for (let i = 0; i < placedBottles.length; i++) {\n let bottle_x = placedBottles[i];\n addObject(objectImages.bottles[1], bottle_x, 350, 0.25);\n }\n}", "function drawBalls() {\r\n for (let i = 0; i < ballArray.length; i++) {\r\n ballArray[i].draw();\r\n }\r\n}", "function addBall() {\r\n var ball_x = randomInt(50, canvas.width - 50);\r\n var ball_y = randomInt(50, canvas.height - 50);\r\n var ball_dx = randomInt(-10, 10);\r\n var ball_color = colors[randomInt(0, colors.length)];\r\n var ball_radius = randomInt(30, 50);\r\n ballArray.push(new Ball(ball_x, ball_y, ball_dx, 0, ball_radius, ball_color));\r\n}", "function Ball(x, y, dx, dy, radius, color) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n this.color = color;\n\n // draw items\n this.draw = () => {\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n ctx.stroke();\n ctx.fillStyle = this.color;\n ctx.fill();\n ctx.closePath();\n };\n\n // move items\n this.update = () => {\n if (this.y + this.radius + this.dy > canvas.height) {\n this.dy = -this.dy * rebound;\n floorCount++;\n } else {\n this.dy += gravity;\n }\n\n if (this.x + this.radius > canvas.width || this.x - radius < 0) {\n this.dx = -this.dx;\n }\n\n this.x += this.dx;\n this.y += this.dy;\n\n // increase radius\n if (this.radius < maxRadius && floorCount > numberOfBalls - 2) {\n this.radius = this.radius * 1.005;\n }\n\n // change colors\n if (floorCount === numberOfBalls - 1) {\n this.color = colorArray[Math.floor(Math.random() * colorArray.length)];\n canvas.style.background = 'black';\n }\n\n // last gothic effect\n if (floorCount > 2 * numberOfBalls - 3) {\n this.color = 'black';\n canvas.style.background = 'white';\n maxRadius = 30;\n\n if (this.y - this.radius + this.dy < 0) {\n this.dy = -this.dy;\n rebound = 1;\n gravity = 0;\n }\n\n if (this.y - this.radius + this.dy < -1) {\n this.y = this.radius + 1;\n }\n }\n\n this.draw();\n };\n}", "function walls() {\n var ball;\n for (var i = 0; i < balls.length; i++) {\n ball = balls[i]\n \n if (ball.x - BALL_RADIUS < 0) {\n ball.x = BALL_RADIUS;\n ball.vx = -ball.vx;\n }\n if (ball.y - BALL_RADIUS < 0) {\n ball.y = BALL_RADIUS;\n ball.vy = -ball.vy;\n }\n if (ball.x + BALL_RADIUS > CANVAS_WIDTH) {\n ball.x = CANVAS_WIDTH - BALL_RADIUS;\n ball.vx = -ball.vx;\n }\n if (ball.y + BALL_RADIUS > CANVAS_HEIGHT) {\n ball.y = CANVAS_HEIGHT - BALL_RADIUS;\n ball.vy = -ball.vy;\n }\n }\n}", "function exampleScenario() {\n\tnewtonsBalls();\n\tcreateMassSpring(550, 180, 1.5, 20,1, balls, springs);\n\trandomBalls(offset, canvas.width-offset, canvas.height-offset-50, canvas.height-offset, 0, -0.7,5, 1,8, {\"radius\":8},balls);\n\tballs.push(new Ball(canvas.width/2, canvas.height-offset-50, 6, 0, -2.5, {\"radius\":24, \"colour\":\"#AA00FF\"}));\n}", "function addBall(){\r\n if(count<100){\r\n var rndColor=Math.floor((Math.random() * 16) + 1); //velger tilfeldig farge\r\n var rndX=Math.floor((Math.random() * 5) + 1); //Bestemmer fart x-retning\r\n var rndY=Math.floor((Math.random() * 5) + 1); //Bestemmer fart y-retning\r\n ball[count]= new Ball(Math.floor((Math.random() * 490) + 1),\r\n Math.floor((Math.random() * 490)+1),Math.floor((Math.random() * 10) + 5),color[rndColor],rndX,rndY);\r\n count++;\r\n\r\n //utdata til meteor-teller\r\n document.getElementById(\"ballCount\").innerHTML = \"Meteors: \" + count;\r\n }\r\n}", "function draw() {\n // put drawing code here\n background(20,20,20, 20);// back ground color\n paddle.run();\n mainBall.run();\n for(var i =0; i < balls.length; i++){\n balls[i].run();\n }\n}", "function BounceBall() {\n this.radius = Math.random() * 10 + 10;\n this.x = Math.random() * (canWidth - this.radius * 2) + this.radius;\n this.y = Math.random() * (canHeight - this.radius * 2) + this.radius;\n this.color = randomColor();\n this.dy = Math.random() * 2;\n this.dx = Math.round((Math.random() - 0.5) * 10);\n}", "function drawObjects() {\n\n // Cleaning screen.\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n for (var i = 0; i < numBalls; i++) {\n var radius = balls[i].radius;\n\n balls[i].x = balls[i].nextX;\n balls[i].y = balls[i].nextY;\n\n ctx.drawImage(\n spriteSheet, \n\n // Slicing the image from the sprite sheet.\n 0 + balls[i].image, // X coordinate.\n 0, // Y coordinate.\n spriteSheet.width / spriteSheet.length, // Width.\n spriteSheet.height, // Height.\n\n // Drawing it on the canvas.\n balls[i].x - radius, // X coordinate.\n balls[i].y - radius, // Y coordinate.\n balls[i].diameter, // Width.\n balls[i].diameter // Height.\n );\n }\n }", "function displayBombs() {\n fill(ballColour);\n \n for (let b = 0; b < numberofbombs; b++) {\n circle(bombposX[b], bombposY[b], bombSize)\n \n hit = collidePointCircle(mouseX, mouseY - duck.height * duckScalar / 2, bombposX[b], bombposY[b], bombSize);\n \n if (hit) {\n endGame();\n }\n }\n}", "function Ball() {\n\tctx.fillStyle = white;\n\tctx.beginPath();\n\tctx.arc(BallX, BallY, BallRadius, 0, Math.PI * 2, true);\n\tctx.fill();\n\tctx.closePath();\n\tBallX += BallDisplacementX;\n\tBallY += BallDisplacementY;\n}", "function Ball(x, y, velX, velY, exists) {\n Shape.call(this, x, y, velX, velY, exists);\n\n this.color = 'rgb(' + random(0,255) + ',' + random(0,255) + ',' + random(0,255) +')';\n this.size = random(10,20);\n}", "function displayBall() {\n rect(ball.x,ball.y,ball.size,ball.size);\n}", "function please()\r\n { l++;\r\n t++;\r\n rb++;\r\n score+=10;\r\n const size = random(15,30);\r\n const size1 = random(30,40);\r\n let ball = new Ball(\r\n random(size,width - size),\r\n random(size,height - size),\r\n random(-speed,speed),\r\n random(-speed,speed),\r\n 'rgb(' + random(0,255) + ',' + random(0,255) + ',' + random(0,255) +')',\r\n size,0\r\n );\r\n for(var i=0;i<balls.length;i++)\r\n { \r\n checknewBall(balls[i],ball);\r\n }\r\n if(spawn==true) \r\n { balls.push(ball);\r\n }\r\n else { spawn=true; }\r\n \r\n if(rb%6==0)\r\n {\r\n speed++;\r\n }\r\n if(rb%10==0)\r\n {\r\n let ball = new Ball(\r\n random(size1,width - size1),\r\n random(size1,height - size1),\r\n random(-speed,speed),\r\n random(-speed,speed),\r\n 'rgb(' + random(0,255) + ',' + random(0,255) + ',' + random(0,255) +')',\r\n size1,5\r\n );\r\n for(var i=0;i<balls.length;i++)\r\n { \r\n checknewBall(balls[i],ball);\r\n }\r\n if(spawn==true) \r\n { balls.push(ball);\r\n }\r\n else{spawn=true; \r\n }\r\n }\r\n if(balls.length>20)\r\n { timer=true;\r\n time=time-1;\r\n }\r\n else if(balls.length<=20)\r\n { timer=false;\r\n time=10;\r\n }\r\n \r\n \r\n}", "function Ball(speed, size){\n\tthis.dx = getRandomIntInclusive(speed, speed + 10)*11/64;\n\tthis.dy = getRandomIntInclusive(speed, speed + 10)*11/64;\n\n\tif (Math.floor(Math.random() * 2) == 0)\n\t\tthis.dx *= -1;\n\tif (Math.floor(Math.random() * 2) == 0)\n\t\tthis.dy *= -1;\n\n\tthis.radius = size;\n\tthis.mass = Math.pow(this.radius, 2);\n\n\tthis.x = canvas.width/2;\n\tthis.nextX = this.x;\n\tthis.y = canvas.height/2;\n\tthis.nextY = this.y;\n\n\tthis.speed = Math.sqrt(Math.pow(this.dx, 2) + Math.pow(this.dy,2));\n\tthis.direction = Math.atan2(this.dy, this.dx);\n\n\tthis.spawn = false;\n}", "function Ball () {\n this.x = canvas.width/2; \t//byrjunar x\n this.y = canvas.height-30;\t//byrjunar y\n this.ballRadius = 10;\t\t//stærð boltans\n this.status = 1; \t\t//status 1 visible, status 0 invisible and not in the game\n this.dx = 2; //hvað boltinn hreyfist í hverjum ramma\n this.dy = -2; //hvað boltinn hreyfist í hverjum ramma\n this.color = \"#000000\";\n this.restart = function() { //setja boltann inn aftur\n if (this.status==1){\n \tthis.x = canvas.width/2; \t//byrjunar x\n \tthis.y = canvas.height-30;\t//byrjunar y\n \tthis.ballRadius = 10;\t\t//stærð boltans\n }\n };\n this.draw = function() { //teikna boltann\n if (this.status==1){\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.ballRadius, 0, Math.PI*2);\n ctx.fillStyle = \"#000000\";\n ctx.fill();\n ctx.closePath();\n }\n };\n}", "function drawBottles() {\n\n for (let index = 0; index < placedBottles.length; index++) {\n let bottle_x = placedBottles[index]['position_x'];\n let image = placedBottles[index]['image'];\n addBackgroundobject(image, bottle_x, bg_ground, 318, 0.2, 1);\n }\n}", "function pushNewBalls(){\n\tvar randomPoint = randomFromArray(randPoints),\n\t\t randomColor = randomFromArray(colors)\n\tballs.push(\n\t\tnew Ball(\n\t\t\tcanvas, ctx,\n\t\t\trandomPoint.x, randomPoint.y,\n\t\t\tglobalRadius, randomColor, particles, 0, velocityOfBall, false\n\t\t)\n\t)\n}", "function balls() {\n return Math.floor(innerHeight / 100 + innerWidth / 200);\n}", "function Ball() {\n this.x = 0;\n this.y = 0;\n this.width = 10;\n this.height = 10;\n}", "function addBall(board) {\n\tvar i = getRandomInt(0, board.length - 1);\n\tvar j = getRandomInt(0, board[0].length - 1);\n\twhile ((board[i][j].gameElement === null) &&\n\t\t(board[i][j].type === FLOOR)) {\n\n\t\tboard[i][j].gameElement = BALL;\n\t\trenderCell({ i, j }, BALL_IMG);\n\t\tgBallsAdded++;\n\t\tbreak;\n\t}\n}", "function loop() {\n ctx.fillStyle = 'rgba(0, 0, 0, 0.25)';\n ctx.fillRect(0, 0, width, height);\n\n for (let i = 0; i < balls.length; i++) {\n balls[i].draw();\n balls[i].update();\n balls[i].collisionDetect();\n }\n\n requestAnimationFrame(loop);\n}", "function Ball(tempX, tempY, tempW) {\n this.x = tempX;\n this.y = tempY;\n this.w = tempW;\n this.speed = 0;\n this.gravity = 0.1;\n this.life = 255;\n\n this.move = function () {\n // Add gravity to speed\n this.speed = this.speed + this.gravity;\n // Add speed to y location\n this.y = this.y + this.speed;\n // If square reaches the bottom\n // Reverse speed\n if (this.y > s.height) {\n // Dampening\n this.speed = this.speed * -0.8;\n this.y = s.height;\n }\n };\n\n this.finished = function () {\n // Balls fade out\n this.life--;\n if (this.life < 0) {\n return true;\n } else {\n return false;\n }\n };\n\n this.display = function () {\n // Display the circle\n s.fill(0, this.life);\n //stroke(0,life);\n s.ellipse(this.x, this.y, this.w, this.w);\n };\n }", "function draw() {\n const sAngle = 0;\n const eAngle = 2 * Math.PI;\n\n // draw each ball from the ball array\n balls.forEach((element) => {\n ctx.fillStyle = element.colour;\n ctx.beginPath();\n ctx.arc(\n element.xPos,\n element.yPos,\n element.radius,\n sAngle,\n eAngle\n );\n ctx.closePath();\n ctx.fill();\n });\n}", "function displayBall(){\n fill(ball.c);\n circle(ball.x, ball.y, ball.d);\n}", "function drawBall() {\n\t\tctx.beginPath();\n\t\tctx.arc(ball.x, ball.y, ball.size, 0, Math.PI * 2);\n\t\tctx.fillStyle = '#555';\n\t\tctx.fill();\n\t\tctx.closePath();\n\t}", "function createBalls() {\r\n // this can create as many balls as needed in this case five\r\n for (i = 0; i < maxBalls; i++) {\r\n // calls the function\r\n createCollide(\"red\", i);\r\n }\r\n //does the same for stick side\r\n for (j = maxBalls + 1; j < maxBallstwo; j++) {\r\n createStick(\"blue\", j);\r\n }\r\n\r\n // this just shows whats happening with the arrays when createBalls() is called\r\n //all the balls with id 0-4 and 5-9 and attributes are pushed into arrays\r\n console.log(ballsCollide);\r\n\r\n console.log(ballsStick);\r\n\r\n console.log(xC);\r\n\r\n console.log(yC);\r\n\r\n console.log(xS);\r\n\r\n console.log(yS);\r\n console.log(velocity_xC);\r\n console.log(velocity_yC);\r\n}", "drawBall(){\n \tstroke(0);\n strokeWeight(1);\n fill(\"brown\");\n\t\t rect(this.x,this.y,100,35,10);\n\t}", "function makeBall(xcoord, ycoord, color, velx = 0, vely = 0, fixed = 0) {\n let statObj = {x: xcoord, y: ycoord, velx: velx, vely: vely};\n ball = document.createElement(\"div\");\n ball.style.backgroundColor = color;\n ball.className = \"ball\";\n ball.style.height = ball.style.width = size;\n ball.style.top = ycoord;\n ball.style.left = xcoord;\n document.body.appendChild(ball);\n if (!fixed) {\n // only free balls will be updated\n balls.push([ball,statObj]);\n }\n}", "constructor() {\n this.x = random(100, width - 100);\n this.y = -25;\n //devides the height of the screen into steps, where the bolt changes angles\n this.steps = ceil(random(15, 25));\n this.stepSize = ceil(height/this.steps);\n this.color = color(random(220, 255), random(220, 255), random(150, 220));\n //random yellow to white colour\n this.size = floor(random(3, 7));\n //thickness\n }", "function spawnBricks() {\n //inticates columns in the bricks\n for(var c=0; c<columns; c++) {\n //shows the amount of rows\n for(var r=0; r<rows; r++) {\n if(bricks[c][r].status == 1) {\n var brickX = (r*(bwidth+brickPadding))+brickleft;\n var brickY = (c*(bheight+brickPadding))+brickright;\n bricks[c][r].x = brickX;\n bricks[c][r].y = brickY;\n //color and shape of brick\n ctx.beginPath();\n ctx.rect(brickX, brickY, bwidth, bheight);\n ctx.fillStyle = \"#FFFF00\";\n ctx.fill();\n ctx.closePath();\n }\n }\n }\n}", "function randomBalls_update() {\n \n for(var g_i = 1; g_i < g_balls; g_i++){\n g_arr[g_i].update();\n }\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 setupBalls() {\n status_left = \"init\";\n status_right = \"init\";\n v_left = 0.0;\n v_right = 0.0;\n s_left = 0.0;\n s_right = 0.0;\n s0 = r_ball * sin(rightPhi0 / 2);\n redBall_x = redBall_x0;\n redBall_y = redBall_y0;\n x0R = x0_right;\n y0R = y0_right;\n x0L = x0_left;\n y0L = y0_left;\n}", "function loop() {\n ctx.fillStyle = \"rgba(0,0,0,0.25)\"; // canvas fill color\n ctx.fillRect(0, 0, width, height);\n\n for (let i = 0; i < balls.length; i++) {\n if (balls[i].exists === true) {\n // draw each ball on the screen.\n balls[i].draw();\n // then do the necessary updates to position and velocity in time for the next frame.\n balls[i].update();\n // perform collision detection\n balls[i].collisionDetect();\n }\n }\n\n evilCircle.draw();\n evilCircle.checkBounds();\n evilCircle.eatenDetect();\n\n // This method is constantly run and passed the same function name,\n // it will run that function a set number of times per second to create a smooth animation.\n // This is done recursively\n requestAnimationFrame(loop);\n}", "function drawBall() {\n ctx.beginPath();\n ctx.arc(ballObject.x, ballObject.y, ballObject.radius, 0, Math.PI * 2);\n ctx.fillStyle = \"black\";\n ctx.fill();\n ctx.closePath;\n }", "function drawAliasBalls() {\n for (let ball of ballArray) {\n // calculate position\n let alias = aliasBalls[ball.id]\n alias.x = (ball.x - miniViewWidth * 4) * 4\n alias.y = ball.y * 4\n // update group, colour\n alias.group = ball.group\n alias.colour = ball.colour\n // draw\n alias.draw()\n }\n }", "function Ball(ballX, ballY, speedX, speedY, hueBall)\n{\n this.x = ballX;\n this.y = ballY;\n \n \n this.spX = speedX;\n this.spY = speedY;\n \n this.hBall = hueBall;\n \n \n \n//these are like putting functions in your functions\n this.drawBall1 = function() {\n Stroke();\n \n fill(this.hBall, 0, 89);\n \n ellipse(this.y,this.x,shade, 300,293); \n stroke(230,7);\n \n //head\n ellipse(this.y,67,this.y,32, 20); \n stroke(60,7);\n \n \n \n \n \nellipse(startY*25,startX/2,40,200);\n fill(256,9,9,9);\n \nellipse(startY*25,startX/3,20,700,9);\n fill(25,9);\n \n //horizontal circles\n stroke(230,79);\n \n fill(0,255,70);\nellipse(750,700,startX,startY,7,5);\n\n \n }\n \n \n//these are like putting functions in your functions\n this.drawBall = function() {\n noStroke();\n fill(this.hBall, 90, 89);\n \n line(this.y,this.x, 30,23); \n stroke(230,7);\n \n //head\n ellipse(this.y,this.x, 32, 20); \n stroke(20,7,98);\n \n rect(this.y,this.x, 7,this.x, 29); \n stroke(20,7,);\n fill(random,2,90);\n \n ellipse(this.y,this.x, 450, 100); \n stroke(2,7);\n \n fill(100,7,8);\n rect(this.y+5,this.x, 5, 100); \n stroke(23,9);\n \n ellipse(this.y+8,this.x,this.x, 45, 10); \n stroke(235,9);\n \n fill(random,0,98,9);\n ellipse(this.y+6,this.x,this.x, 45, 100); \n stroke(235);\n \n \n\n \n }\n //these are like putting functions in your functions\n this.drawBall1 = function() {\n \n noStroke();\n fill(this.hBall, 90, 8);\n \n rect(this.y, 30,60); \n stroke(random,890,0);\n \n //head\n ellipse(this.y,this.y,this.x, 39, 20); \n stroke(299,7);\n fill(20,9);\n \n ellipse(this.y,this.x, 7,this.x,this.drawball,29); \n stroke(10,7,);\n fill(random,20,18);\n \n ellipse(this.y,this.x, 45, 100); \n fill(245);\n //moon\n ellipse(this.y, 45, 88); \n fill(34,208,0);\n ellipse(this.y*2, 4, 10); \n ellipse(this.y/2, 5, 10);\n \n ellipse(this.y/3, 65, 20);\n rect(this.y+4,4,10);\n stroke(2,9,3);\n \n fill(100,7,8);\n rect(this.y+5,this.x, 5, 10); \n stroke(23,9);\n \n fill(100,7,80);\n ellipse(this.y,this.x, 100, 10); \n stroke(23,9);\n \n fill(this.hBall, 9, 89);\n rotate(map(mouseX, 70, width, 0, PI));\n ellipse(this.y+8,this.x,this.x, 4, 10); \n stroke(255,9);\n \n \n \n ellipse(this.y+6,this.x,this.x, 45, 100); \n stroke(25);\n \n \n \n \n \n \n \n\n \n }\n \n this.moveBall = function() {\n this.x += this.spX;(78);\n this.y += this.spY;\n this.z += this.spZ; \n }\n \n this.bounceBall = function() {\n if (this.x < 70 || this.x > width - 50)\n this.spX = -this.spX;\n if (this.y < 50 || this.y > height - 50)\n this.spY = -this.spY;\n \n \n }\n \n \n \n \n \n this.isCollided = function(otherX, otherY){\n if(dist(this.x, this.y, otherX, otherY) <= 200)\n \n \n return true; \n \n \n }\n \n this.reset = function(){\n background(90);\n this.x = random(50, width-3);\n this.y = random(50, height-20);\n \n \n this.spX = random(1,1);\n this.spY = random(2,6);\n \n this.hBall = random(360);\n \n }\n \n}", "function randomBalls(x1, x2, y1, y2, speedx, speedy, density, uniformMass, uniformRadius, properties, previousBalls) {\n\tdensity = density / 10000;\n\tvar randomBalls = previousBalls;\n\tvar numNewBalls = 0\n\tvar area = Math.abs( (x2-x1) * (y2-y1) );\n\twhile (numNewBalls/area <= density) {\n\t\tvar succesful = false;\n\t\tif (!uniformRadius) {\n\t\t\tradius = (Math.random() * 20 + 2 );\n\t\t}\n\t\telse {\n\t\t\tradius = uniformRadius;\n\t\t}\n\t\tif (uniformMass) {\n\t\t\tmass = 1;\n\t\t}\n\t\telse {\n\t\t\tmass = Math.pow(radius, 2);\n\t\t}\n\t\twhile (!succesful) {\n\t\t\tsuccesful = true;\n\t\t\tx = Math.random() * (x2 - x1 - 2*radius) + x1 + radius;\n\t\t\ty = Math.random() * (y2 - y1 - 2*radius) + y1 + radius;\n\t\t\tfor (var i=0; i<randomBalls.length; i++) {\n\t\t\t\tif ( distanceTo([x, y], [randomBalls[i].x, randomBalls[i].y]) <= (radius + randomBalls[i].radius) ) {\n\t\t\t\t\tsuccesful = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\trandomBalls.push(new Ball(x, y, mass, speedx, speedy, properties));\n\t\trandomBalls[randomBalls.length-1].setProperties({\"radius\":radius});\n\t\tnumNewBalls += 1;\n\t}\n\treturn randomBalls;\n}", "function generateWorld() {\n\t\t//generate the grass along the x-axis\n\t\tfor(var i = 0; i < 25; i++) {\n\t\t\t//generate the grass along the y-axis\n\t\t\tfor(var j = 0; j < 20; j++) {\n\t\t\t\tgrassType = Crafty.math.randomInt(1, 4);\n\t\t\t\tCrafty.e(\"2D, Canvas, grass\"+grassType)\n\t\t\t\t\t.attr({x: i * 16, y: j * 16});\n\t\t\t\t\n\t\t\t\t//1/50 chance of drawing a flower and only within the bushes\n\t\t\t\tif(i > 0 && i < 24 && j > 0 && j < 19 && Crafty.math.randomInt(0, 50) > 49) {\n\t\t\t\t\tCrafty.e(\"2D, DOM, flower, solid, SpriteAnimation\")\n\t\t\t\t\t\t.attr({x: i * 16, y: j * 16})\n\t\t\t\t\t\t.reel(\"wind\", 1600, 0, 1, 3)\n\t\t\t\t\t\t.animate(\"wind\", -1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//create the bushes along the x-axis which will form the boundaries\n\t\tfor(var i = 0; i < 25; i++) {\n\t\t\tCrafty.e(\"2D, Canvas, wall_top, solid, bush\"+Crafty.math.randomInt(1,2))\n\t\t\t\t.attr({x: i * 16, y: 0, z: 2});\n\t\t\tCrafty.e(\"2D, DOM, wall_bottom, solid, bush\"+Crafty.math.randomInt(1,2))\n\t\t\t\t.attr({x: i * 16, y: 304, z: 2});\n\t\t}\n\t\t\n\t\t//create the bushes along the y-axis\n\t\t//we need to start one more and one less to not overlap the previous bushes\n\t\tfor(var i = 1; i < 19; i++) {\n\t\t\tCrafty.e(\"2D, DOM, wall_left, solid, bush\"+Crafty.math.randomInt(1,2))\n\t\t\t\t.attr({x: 0, y: i * 16, z: 2});\n\t\t\tCrafty.e(\"2D, Canvas, wall_right, solid, bush\"+Crafty.math.randomInt(1,2))\n\t\t\t\t.attr({x: 384, y: i * 16, z: 2});\n\t\t}\n\t}", "function Ball(x, y, downSpeed, color, strokeColor) {\n this.x = x;\n this.y = y;\n this.x_speed = 0;\n this.y_speed = downSpeed;\n this.radius = 5;\n this.color = color;\n this.baseSpeed = this.y_speed;\n this.strokeColor = strokeColor;\n}", "function loop() {\n ctx.fillStyle = Screen;\n ctx.fillRect(0,0,width,height);\n\n CountNormal=0;\n CountSick=0;\n CountCured=0;\n CountDead=0;\n\n for(let i = 0; i < balls.length; i++) {\n balls[i].draw();\n // pour afficher les num de balle\n ctx.beginPath();\n // ctx.fillText(\"\", balls[i].x+10, balls[i].y);\n ctx.fill();\n\n balls[i].updatecolor();\n balls[i].update();\n balls[i].collisionDetect(i);\n\n if(balls[i].color==Normal) {\n CountNormal=CountNormal+1;\n }\n else if (balls[i].color==Sick){\n CountSick=CountSick+1;\n }\n else if (balls[i].color==Cured){\n CountCured=CountCured+1;\n }\n else if (balls[i].color==Dead){\n CountDead=CountDead+1;\n }\n\n }\n //Rnow = new date();\n Rnow = new Date();\n RnowT = Rnow.getTime();\n\n\n ctx.fillStyle = Dead;\n ctx.fillText(''.concat(\"Temps : \",Math.trunc((RnowT - BegTime)/1000)) , 10, 10);\n\n ctx.fillStyle=Normal;\n ctx.fillText(\"Sains : \" , 10, 30);\n ctx.fillText(CountNormal , 50, 30);\n ctx.fillStyle=Sick;\n ctx.fillText(\"Malades : \" , 10, 40);\n ctx.fillText(CountSick , 50, 40);\n ctx.fillStyle=Cured;\n ctx.fillText(\"Guéris : \" , 10, 50);\n ctx.fillText(CountCured , 50, 50);\n ctx.fillStyle=Dead;\n ctx.fillText(\"Décès : \" , 10, 60);\n ctx.fillText(CountDead , 50, 60);\n\n Scenario = document.getElementById('Scénario').value;\n if(Scenario!=OldScenario)\n {\n for(let i = 0; i < NumberBall; i++) {\n balls[i].reinit();\n }\n now = new Date();\n BegTime = now.getTime();\n\n }\n\n OldScenario = Scenario\n //ctx.fillText(Math.trunc(width * height/320000), 30, 20);\n\n //ctx.arc(this.x, this.y, this.size, 0, 2 * Math.PI);\n ctx.fill();\n\n requestAnimationFrame(loop);\n}", "function locateball()\r\n{\r\n\t// the objective of this function is to mark the cells displaying the ball\r\n\t// the cells are color coded as white\r\n\t// this is a single important program\r\n\t// the shape of the ball can be altered\r\n\t// for ease, in this instance, it is considered a square\r\n\t// even if it was a circle, the squares should define the limits\r\n\t// the program, therefore, remains the same\r\n\t/* GEOMETRY OF BALL\r\n\r\n the central column\r\n |\r\n ball_radius | ball_radius\r\n x unit | x unit\r\n <---> v <--->\r\n\t ^ o o o o o o o ^ A SQUARE\r\n\t | o o o o o o o | ball_radius x unit\r\n\t x | o o o o o o o v x = y :: must always be an odd number\r\n\t | o o o o o o o |<------------- the central row\r\n\t | o o o o o o o ^\r\n\t | o o o o o o o | ball_radius x unit\r\n\t v o o o o o o o v\r\n\t < - - - - - >\r\n\t y\r\n\t*/\r\n\tball_geometry_left = ball_location_x- (ball_radius*unit);\r\n\tball_geometry_right = ball_location_x + (ball_radius*unit);\r\n\tball_geometry_top = ball_location_y - (ball_radius*unit);\r\n\tball_geometry_bottom = ball_location_y + (ball_radius*unit);\r\n}", "function Ball (_x, _y, _diameter) {\n this.x = _x;\n this.y = _y;\n this.diameter = _diameter;\n this.color = 'gray';\n this.stroke = noStroke();\n\n this.display = function() {\n fill(this.color);\n ellipse(this.x,this.y,this.diameter);\n }\n\n this.rollover1 = function(_px, _py) {\n var d = dist(_px,_py, this.x, this.y);\n if(d < this.diameter){\n this.color = '#FCB97D';\n }else{\n\n this.color = 'gray';\n }\n }\n\n\n this.rollover2 = function(_px, _py) {\n var d = dist(_px,_py, this.x, this.y+50);\n if(d < this.diameter){\n this.color = '#A9CBB7';\n }else{\n this.color = 'gray';\n }\n }\n\n\n this.rollover3 = function(_px, _py) {\n var d = dist(_px,_py, this.x, this.y-50);\n if(d < this.diameter){\n this.color = '#F78571';\n }else{\n this.color = 'gray';\n }\n }\n\n var yDir = 1; //y direction\n var xDir = 1;\n\n this.move = function() {\n this.x += this.speed * xDir;\n this.y += this.speed * yDir;\n\n if (this.y > height || this.y < 0) {\n yDir = yDir * -1;\n }\n\n if (this.x > width || this.x < 0) {\n xDir = xDir * -1;\n }\n }\n}", "drawWall() {\n this.cxt.fillStyle = '#2E1E1E'\n for (let i = 0, l = this.wallCount; i < l; i++) {\n const position = this.getRandomPosition(0, 0)\n this.cxt.fillRect(position[0] * this.count, position[1] * this.count, this.count, this.count)\n this.wallMap[position] = 1\n }\n }", "function draw() {\n background(0);\n\n // Draw circles\n for (let i = 0; i < balls.length; i++) {\n let ball = balls[i];\n ball.move();\n ball.bounce();\n ball.display();\n }\n\n// Draws squares\nfor (let i = 0; i < squares.length; i++) {\n let square = squares[i];\n square.move();\n square.bounce();\n square.display();\n }\n displayText();\n}", "function initBall() {\r\n var velocityRange = 0.1;\r\n // init position array.\r\n positionArray.push(Math.random()*2.0-1.0);\r\n positionArray.push(Math.random()*0.5+0.5);\r\n positionArray.push(Math.random()*2.0-1.0);\r\n\r\n //init velocity array.\r\n var initSpeedX = (Math.random()-0.5)*velocityRange;\r\n var initSpeedY = (Math.random()-0.5)*velocityRange;\r\n var initSpeedZ = (Math.random()-0.5)*velocityRange;\r\n velocityArray.push(initSpeedX);\r\n velocityArray.push(initSpeedY);\r\n velocityArray.push(initSpeedZ);\r\n\r\n // init radius array.\r\n var randomRadius = Math.random()/3.0+0.2;\r\n radiusArray.push(randomRadius);\r\n radiusArray.push(randomRadius);\r\n radiusArray.push(randomRadius);\r\n\r\n // init color array.\r\n colorArray.push(Math.random());\r\n colorArray.push(Math.random());\r\n colorArray.push(Math.random());\r\n}", "function Ball(x, y, radius, color) {\r\n this.x = x;\r\n this.y = y;\r\n this.radius = radius;\r\n this.color = color;\r\n this.dx = ballSpeed;\r\n this.dy = -ballSpeed;\r\n}", "paintWalls(walls){\n walls.forEach(function(wall){\n \n let color = Phaser.Math.RND.pick(gameOptions.barColors);\n \n // tinting the wall\n wall.setTint(color);\n \n // also assigning the wall body a custom \"color\" property\n wall.body.color = color;\n });\n \n let randomWall = Phaser.Math.RND.pick(walls);\n this.ball.setTint(randomWall.body.color);\n this.ball.body.color = randomWall.body.color;\n }", "function draw() {\n // Get the canvas context first\n var context = getContext();\n\n /* Draw the bricks\n * Brick x is 80\n * Brick y is 20\n */\n for (var y = 0; y < 160; y += 20) {\n for (var x = 0; x < 800; x += 80) {\n context.fillStyle = getRandomColor();\n context.fillRect(x + 1, y + 1, 78, 18);\n // console.log(x + ', ' + y);\n }\n }\n\n // Draw the ball\n context.fillStyle = '#56b0ff';\n context.beginPath();\n context.arc(ball.x, ball.y, ball.radius, ball.startAngle, ball.endAngle, ball.anticlockwise);\n context.fill();\n context.closePath();\n\n // Draw the paddle\n context.fillStyle = '#3235ff';\n context.fillRect(350, 460, 100, 20);\n\n console.log('Game initialised.');\n}", "function Ball(x, y, vx, vy, size, speed) {\n this.x = x;\n this.y = y;\n this.vx = vx;\n this.vy = vy;\n this.size = size;\n this.speed = speed;\n this.fill = 100;\n}", "function createBall() {\n canvasContext.beginPath();\n canvasContext.arc(initialValueX, initialValueY, radiusOfBall, 0, Math.PI * 2);\n canvasContext.fillStyle = \"#DE4B39\";\n canvasContext.fill();\n canvasContext.closePath();\n }", "function makeBall(level_screen_div_ball,level_screen_index,l)\n {\n //Set the background colour for the ball i.e. give the desired colour to the ball\n level_screen_div_ball.style.background=level_screen_ball_colors[level_screen_index];\n }", "function loop() {\n //fillStyle fills the color to semi-transparent black\n ctx.fillStyle = 'rgb(0, 0, 0, 0.25)';\n //fillRect takes 4 parameters, start, width & height\n ctx.fillRect(0, 0, width, height);\n//loops throught the balls array\n for(let i = 0; i < balls.length; i++) {\n balls[i].draw();\n balls[i].update();\n }\n //runs the function a set number of times ensuring that the animation is smooth\n\n requestAnimationFrame(loop);\n\n}", "function loadboid(numboid){\r\n\r\n for(i=50; i < numboid; i++){\r\n var loc = createVector(random(width), random(height));\r\n var vel = createVector(random(-3,3), random(-3,3));\r\n var radius=random(10,10);\r\n var col= color(random(1, 255), random(1, 255), random(1, 255));\r\n boids.push(new boid(loc, vel, radius, col));\r\n }\r\n console.log(boids);\r\n}", "function generateWorld() {\n\t\t//generate the grass along the x-axis\n\t\tfor(var i = 0; i < 25; i++) {\n\t\t\t//generate the grass along the y-axis\n\t\t\tfor(var j = 0; j < 20; j++) {\n\t\t\t\tgrassType = Crafty.randRange(1, 4);\n\t\t\t\tCrafty.e(\"2D, Canvas, grass\"+grassType)\n\t\t\t\t\t.attr({x: i * 16, y: j * 16});\n\t\t\t\t\n\t\t\t\t//1/50 chance of drawing a flower and only within the bushes\n\t\t\t\tif(i > 0 && i < 24 && j > 0 && j < 19 && Crafty.randRange(0, 50) > 49) {\n\t\t\t\t\tCrafty.e(\"2D, DOM, flower, Animate\")\n\t\t\t\t\t\t.attr({x: i * 16, y: j * 16})\n\t\t\t\t\t\t.animate(\"wind\", 0, 1, 3)\n\t\t\t\t\t\t.bind(\"enterframe\", function() {\n\t\t\t\t\t\t\tif(!this.isPlaying())\n\t\t\t\t\t\t\t\tthis.animate(\"wind\", 80);\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//create the bushes along the x-axis which will form the boundaries\n\t\tfor(var i = 0; i < 25; i++) {\n\t\t\tCrafty.e(\"2D, Canvas, wall_top, bush\"+Crafty.randRange(1,2))\n\t\t\t\t.attr({x: i * 16, y: 0, z: 2});\n\t\t\tCrafty.e(\"2D, DOM, wall_bottom, bush\"+Crafty.randRange(1,2))\n\t\t\t\t.attr({x: i * 16, y: 304, z: 2});\n\t\t}\n\t\t\n\t\t//create the bushes along the y-axis\n\t\t//we need to start one more and one less to not overlap the previous bushes\n\t\tfor(var i = 1; i < 19; i++) {\n\t\t\tCrafty.e(\"2D, DOM, wall_left, bush\"+Crafty.randRange(1,2))\n\t\t\t\t.attr({x: 0, y: i * 16, z: 2});\n\t\t\tCrafty.e(\"2D, Canvas, wall_right, bush\"+Crafty.randRange(1,2))\n\t\t\t\t.attr({x: 384, y: i * 16, z: 2});\n\t\t}\n\t}", "function draw() {\n background(51);\n // Run all the boids\n for (let i = 0; i < boids.length; i++) {\n boids[i].run(boids);\n }\n}", "function start() {\n \n // Populate the bldgs array\n for (let i = 0; i < rand(MIN_BLDGS, MAX_BLDGS); i++) {\n bldgs.push(makeBuilding());\n }\n \n // Begin animation\n requestAnimationFrame(update); \n} // end start", "function drawBall(ball) {\n ctx.beginPath();\n ctx.arc(ball.x, ball.y, ball.radius, 0, Math.PI * 2);\n ctx.fillStyle = ball.color;\n ctx.fill();\n ctx.closePath();\n}", "showBall(){\n noStroke()\n fill('#575dfa')\n circle(this._posX, this._posY, this._radius);\n }", "setupBall() {\n // Add ball mesh to scene\n const edgeOffset = 30.0;\n const startingPositionX = this.terrain.terrainWidth / 2.0 - edgeOffset;\n const startingPositionZ = this.terrain.terrainHeight / 2.0 - edgeOffset;\n this.ball = new Ball(this, startingPositionX, startingPositionZ);\n this.add(this.ball);\n\n // Hacky way to push the ball up\n this.ball.position.set(0, this.ball.radius, 0);\n }", "function Ball(x, y, velX, velY, exists, color, size) {\n Shape.call(this, x, y, velX, velY, exists);\n this.color = color;\n this.size = size;\n}", "function Ball(x, y, velX, velY, color, size) {\n this.x = x;\n this.y = y;\n this.velX = velX;\n this.velY = velY;\n this.color = color;\n this.size = size;\n}", "function setPointBalls() {\n let five_point = Math.floor(ball_amount*0.6);\n let fifteen_point = Math.floor(ball_amount*0.3);\n let twentyFive_point = Math.floor(ball_amount*0.1);\n let free_spot;\n\n while (ball_count < ball_amount){\n if (five_point > 0){\n free_spot = findRandomSpot(board_static);\n board_static[free_spot.i][free_spot.j] = 5;\n five_point--;\n ball_count++;\n }\n if (fifteen_point > 0){\n free_spot = findRandomSpot(board_static);\n board_static[free_spot.i][free_spot.j] = 15;\n fifteen_point--;\n ball_count++;\n }\n if (twentyFive_point > 0){\n free_spot = findRandomSpot(board_static);\n board_static[free_spot.i][free_spot.j] = 25;\n twentyFive_point--;\n ball_count++;\n }\n if (five_point === 0 && ball_count<ball_amount){\n five_point++;\n }\n }\n\n}", "function startBallManagers() {\n\t\n\tmakeFullscreen();\n\n\n\tvar cans = document.getElementsByClassName(\"ballsCanvas\");\n\t\n\tfor (var can of cans) {\n\t\tnew BallsManager(can);\n\t}\n\n}", "function initUseless(){\n\tfor(let i = 0; i < 20; i++){\n\t\tlet randVelXY = {\n\t\t\tx: randomFloatFromRange(-5, 5),\n\t\t\ty: randomFloatFromRange(-5, 5)\n\t\t}\n\t\tlet r = randomFloatFromRange(5, 10)\n\t\tuselessBalls.push(\n\t\t\tnew Ball(\n\t\t\t\tcanvas, ctx, canvasWidth / 2, canvasHeight / 2,\n\t\t\t\tr, colors[Math.floor(Math.random() * colors.length)],\n\t\t\t\tparticles, randVelXY.x, randVelXY.y, true\n\t\t\t)\n\t\t)\n\t}\n\tballs.push([...uselessBalls])\n}", "function drawBall() {\n\t\t//Start a path, or reset the current path\n\t\tctx.beginPath();\n\t\t//create a circle ,context.arc(x,y,r,sAngle,eAngle,counterclockwise);\n\t\tctx.arc(x, y, radius, 0, Math.PI * 2);\n\t\tctx.fillStyle = color;\n\t\tctx.fill();\n\t\tctx.closePath();\n\t}", "function createBricks() {\n for (var i = 0; i < 9; i++) {\n for (var j = 0; j < 3; j++) {\n if (ceilBricks[i][j].z == 0) {\n\n\n var brickX = (i * (75 + 10)) + 20;\n var brickY = (j * (20 + 10)) + 10;\n ceilBricks[i][j].x = brickX;\n ceilBricks[i][j].y = brickY;\n canvasContext.beginPath();\n canvasContext.rect(brickX, brickY, 75, 20);\n canvasContext.fillStyle = '#E6D4A4';\n canvasContext.fill();\n canvasContext.closePath();\n }\n }\n }\n }", "collisionDetect(balls) {\n for (let j = 0; j < balls.length; j++) {\n if (!(this === balls[j])) {\n const dx = this.x - balls[j].x;\n const dy = this.y - balls[j].y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n\n if (distance < this.size + balls[j].size) {\n balls[j].color = this.color = `rgb(${random(0, 255)}, ${random(0, 255)}, ${random(0, 255)})`;\n }\n }\n }\n }", "function drawBall() \n{\n\tctx.beginPath();\n\tctx.arc(x, y, ballRadius, 0, Math.PI*2);\n\tctx.fillStyle = ballColor;\n\tctx.fill();\n\tctx.closePath();\n}", "function drawItemBottles() {\n for (i = 0; i < placedBottles.length; i++) {\n let bottle_x = placedBottles[i];\n addBackgroundObject('./img/items/Bottle_Tabasco/2_bottle_buried1.png', bg_elem_1_x + bottle_x, 310, 0.25);\n }\n}", "function renderBombs()\n{\n //for each bomb\n balloonAmmo.forEach(oneBomb =>\n {\n //if bomb has exploded\n if (oneBomb.exploded)\n {\n ctx.drawImage(explodedBombImage, oneBomb.x, oneBomb.y, bombSize, bombSize); \n }\n //if bomb has been fired\n else if (oneBomb.fired)\n {\n //draw the bomb\n ctx.drawImage(bombImage, oneBomb.x, oneBomb.y, bombSize, bombSize);\n \n //help determine hitbox for bombs\n //insert painted hitboxes here if needed\n }\n });\n}", "function generate_bomb() \n{\n for (var i = 0; i < rows; i++) \n {\n for (var j = 0; j < cols; j++) \n {\n var ratio = bombCount / (rows * cols);\n if (rdm(0, 1) < ratio) \n {\n $cell[(i * cols) + j].classList.add('cell-bomb');\n $cell[(i * cols) + j].classList.add('x' + j);\n $cell[(i * cols) + j].classList.add('y' + i);\n bombs.posX[(i * cols) + j] = j;\n bombs.posY[(i * cols) + j] = i;\n }\n }\n }\n}", "function makeBox() {\n bokser.innerHTML = '';\n for (var i = 0; i < antallFarger; i++) {\n var rndFarge1 = Math.floor(Math.random() * 255);\n var rndFarge2 = Math.floor(Math.random() * 255);\n var rndFarge3 = Math.floor(Math.random() * 255);\n colorArr.push(`rgb(${rndFarge1},${rndFarge2},${rndFarge3})`);\n bokser.innerHTML += `<div id=\"boks-${i}\" style=\"\n width:100px; \n height:100px;\n float: left;\n background-color: rgb(${rndFarge1},${rndFarge2},${rndFarge3});\n \"></div>`;\n }\n}", "function Ball(x, y, velX, velY, color, size, nextphase,retention) {\n this.x = x;\n this.y = y;\n this.velX = velX;\n this.velY = velY;\n this.color = color;\n this.size = size;\n this.nextphase=nextphase;\n this.retention=retention;\n\n\n}", "function createBricks(){\n let brickX = 2,brickY=10,j=0,a=0;\n for(var i=0;i<60;i++){\n let brick={\n x: brickX,\n y: brickY,\n w: brickWidth,\n h: 10,\n color: colors[j]\n }\n bricks.push(brick);\n brickX+=brickWidth+2;\n if(brickX+brickWidth+2>Width){\n brickY+=12;\n brickX=2;\n j++;\n }\n }\n }", "function Ball(x, y, velX, velY, exists, color, size) {\r\n Shape.call(this, x, y, velX, velY, exists);\r\n\r\n this.color = color;\r\n this.size = size;\r\n}", "function getRandomBall() {\n var pos = randomArrayItem(['top', 'right', 'bottom', 'left']);\n switch (pos) {\n case 'top':\n return {\n x: randomSidePos(can_w),\n y: -R,\n vx: getRandomSpeed('top')[0],\n vy: getRandomSpeed('top')[1],\n r: R,\n alpha: 1,\n phase: randomNumFrom(0, 10)\n }\n break;\n case 'right':\n return {\n x: can_w + R,\n y: randomSidePos(can_h),\n vx: getRandomSpeed('right')[0],\n vy: getRandomSpeed('right')[1],\n r: R,\n alpha: 1,\n phase: randomNumFrom(0, 10)\n }\n break;\n case 'bottom':\n return {\n x: randomSidePos(can_w),\n y: can_h + R,\n vx: getRandomSpeed('bottom')[0],\n vy: getRandomSpeed('bottom')[1],\n r: R,\n alpha: 1,\n phase: randomNumFrom(0, 10)\n }\n break;\n case 'left':\n return {\n x: -R,\n y: randomSidePos(can_h),\n vx: getRandomSpeed('left')[0],\n vy: getRandomSpeed('left')[1],\n r: R,\n alpha: 1,\n phase: randomNumFrom(0, 10)\n }\n break;\n }\n }", "function Ball(x, y, width, height, xdir, ydir) {\n\tthis.x = x;\n\tthis.y = y;\n\tthis.width = width;\n\tthis.height = height;\n\tthis.xdir = xdir; // horizontal\n\tthis.ydir = ydir; // vertical\n}", "display(){\n push();\n noStroke();\n fill(this.fill.r,this.fill.g,this.fill.b);\n //2 balls\n ellipse(this.x, this.y, this.size);\n ellipse(this.x2, this.y2, this.size);\n // timer ball\n ellipse(this.x3,this.y3, this.size3);\n pop();\n }", "function insertBall() {\n const ball = new Ball(\n 640 / 2, // x\n 480 / 2, // y\n 16, // width\n 16, // height\n ctx, // papper\n \"white\"// farg\n );\n gameObjects.push(ball); // tryck in i listan\n}", "function ball() {\n ctx.beginPath();\n ctx.arc(x, y, radius, 0, Math.PI*4);\n ctx.fillStyle = Math.floor(Math.random()*16777215).toString(16);;\n ctx.fill();\n ctx.closePath();\n}" ]
[ "0.79297787", "0.77312446", "0.76148176", "0.7614811", "0.7538535", "0.7502164", "0.74750805", "0.7460339", "0.74571425", "0.73702365", "0.7358047", "0.73537654", "0.73315406", "0.73086935", "0.7247816", "0.7241751", "0.7214185", "0.7196349", "0.7102294", "0.708334", "0.7082336", "0.70498806", "0.7018689", "0.6994998", "0.69808966", "0.6961215", "0.6958886", "0.6930891", "0.6926004", "0.6923884", "0.69231427", "0.69172585", "0.69025403", "0.68909156", "0.6869073", "0.6866946", "0.6866475", "0.6862933", "0.6844627", "0.68406457", "0.68075943", "0.6805453", "0.6790625", "0.6784879", "0.6756806", "0.6752532", "0.67486393", "0.67420024", "0.6730847", "0.6723492", "0.671809", "0.6717579", "0.67116433", "0.6700117", "0.6699022", "0.66848284", "0.6683851", "0.66715044", "0.667031", "0.66678965", "0.6665854", "0.66644543", "0.6658258", "0.6643951", "0.66421187", "0.6633784", "0.66261053", "0.66254073", "0.6624681", "0.6618954", "0.6613143", "0.66096175", "0.66091114", "0.6599273", "0.6594578", "0.6589628", "0.6588302", "0.6585582", "0.65845567", "0.6580834", "0.6578021", "0.6573651", "0.6567031", "0.6565454", "0.65626657", "0.6556601", "0.65409523", "0.6539082", "0.653662", "0.653469", "0.6534622", "0.6533874", "0.65337497", "0.6531772", "0.6529797", "0.65278035", "0.6526618", "0.65103203", "0.6499724", "0.6498834" ]
0.6984431
24
Retrieve the search results.
componentWillMount(): void { this._updateSearch(this.props.filter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchAndResults() {\n return messenger.searchIsReady().then(function (data) {\n var bag = data;\n quickSearch.getFormConfig($stateParams.entityId, $stateParams.userId, $stateParams.formId).then(function (data) {\n vm.data = data;\n vm.formFields = data.fields;\n rebuildModel(bag);\n quickSearch.getResults(vm.formModel).then(function (data) {\n vm.searchResults = data;\n });\n });\n });\n }", "getResults() {\n\t\t\t// Save this instance of this\n\t\t\tvar self = this;\n\t\t\t// The URL to call the Nutritionix API\n\t\t\tlet URL = \"https://api.nutritionix.com/v1_1/search/\" + $('#food-search').val() + \"?results=0%3A20&cal_min=0&cal_max=50000&fields=item_name%2Cnf_calories&appId=f9261c61&appKey=fcf83f625641eb2e88ab325848e09e01\";\n\n\t\t\t// Store healthData.results in variable for easy access\n\t\t\tvar results = this.get('healthData').results;\n\n\t\t\t$.get(URL)\n\t\t\t.then(function(data) {\n\t\t\t\tif (!data.total_hits || !$('#food-search').val()) {\n\t\t\t\t\talert('Please enter a actual FOOD!!!');\n\t\t\t\t} else {\n\n\t\t\t\t\t// Move to the search-results route\n\t\t\t\t\tself.transitionTo('search-results');\n\n\t\t\t\t\t// Change searched and onAppRoute properties\n\t\t\t\t\t// so that correct button is displayed\n\t\t\t\t\tself.set('healthData.searched', true);\n\t\t\t\t\tself.set('healthData.onAppRoute', false);\n\n\t\t\t\t\t// Make sure the healthData.results is emptied so the user\n\t\t\t\t\t// only sees results from their most recent search\n\t\t\t\t\tresults.length = 0;\n\t\t\t\t\t// Push each separate item into the healthData.results variable\n\t\t\t\t\tvar itemID = -1;\n\t\t\t\t\tdata.hits.forEach(function(item){\n\t\t\t\t\t\t// itemID = itemID + 1;\n\t\t\t\t\t\t// item.itemID = itemID\n\t\t\t\t\t\tresults.pushObject(item);\n\t\t\t\t\t});\n\n\t\t\t\t\tconsole.log(data);\n\t\t\t\t}\n\t\t\t}).fail(function() {\n\t\t\t\talert('CRAP');\n\t\t\t});\n\t\t}", "function getSearchResults() {\n var searchString = getSearchBoxValue();\n var url = getPageBaseURL() + '/results/' + searchString;\n window.location = url;\n}", "getResult(){\r\n // Call database\r\n this.getMovie();\r\n this.getSeries();\r\n this.getGenreMovie();\r\n this.getGenreSerie();\r\n \r\n // Clear Searchbar\r\n this.searchInput= ''; \r\n }", "function fetchResults(searchQuery) {\n // Add to base url the query\n const url = `${baseUrl}/search?q=${searchQuery}`;\n // Fetch it and data in response\n fetch(url, { method: 'GET', headers })\n .then(response => response.json())\n .then(data => {\n const results = data.data;\n displayResults(results);\n })\n // Errors\n .catch((e) => console.log(\"An error occurred\", e));\n}", "function getResults() {\n var searchText = document.getElementById('search').value;\n \n odkData.query('pediatria', 'regdate = ?', [searchText], null, null, \n \t\tnull, null, null, null, true, cbSRSuccess, cbSRFailure);\n}", "async results() {\n\t\tlet response = await this.kojac.performRequest(this);\n\t\treturn response.error ? null : response.results;\n\t}", "async getResults() {\n\n try {\n /** axios:\n * fetching and converting with .json happens in one step rather than 2 separate like fetch\n * API call syntax: is on food2fork.com => browse => api, \n * site name followed http request with documented search data syntax: /api/search?field= ...\n * axios will return a promise, so we need to await and save into a constant. */\n const result = await axios(`https://www.food2fork.com/api/search?key=${key}&q=${this.query}`);\n //a limit of only 50 API calls a day, ran out so result isn't received properly\n console.log(result);\n //we want to save the recipes array inside the Search object, encapsulationnn\n this.result = result.data.recipes;\n } catch (error) {\n alert(error);\n }\n }", "function getSearchResults(searchTerm) {\n fetch('https://thinksaydo.com/tiyproxy.php?https://openapi.etsy.com/v2/listings/active?api_key=h9oq2yf3twf4ziejn10b717i&keywords=' + encodeURIComponent(searchTerm) + '&includes=Images,Shop')\n .then(response => response.json())\n .then(data => {\n searchResults = data;\n \n console.log(searchResults);\n\n renderResultCards();\n });\n}", "function getSearchResults() {\n return browser.loadOptions().then(function(options) {\n return gerrit.fetchAllowedInstances(options).then(function(instances) {\n var hosts = instances.map(function(instance) { return instance.host; });\n return comm.sendMessage('getSearchResults', hosts).then(\n function(wrapper) {\n var results = undefined;\n if (wrapper.results.length !== 0) {\n results = new gerrit.SearchResults(wrapper.results.map(\n function(result) {\n return gerrit.SearchResult.wrap(\n result.host, result.user, result.data, options);\n }));\n }\n\n var errors = undefined;\n if (wrapper.errors.length !== 0) {\n errors = wrapper.errors.map(function(element) {\n return {\n host: element.host,\n error: browser.FetchError.wrap(element.error),\n };\n });\n }\n\n return Promise.resolve({\n results: results,\n errors: errors,\n });\n });\n });\n });\n}", "async getResults() {\n\t\ttry {\n\t\t\tconst res = await axios(`${proxy}https://www.food2fork.com/api/search?key=${key}&q=${this.query}`)\n\t\t\tthis.result = res.data.recipes;\n\n\t\t\t// for local storage when running out of api\n\t\t\t// localStorage.setItem('result',JSON.stringify(res.data.recipes));\n\t\t\t// const storage = JSON.parse(localStorage.getItem('result'));\n\n\t\t\t// this.result = storage;\n\n\t\t} catch(error) {\n\t\t\tconsole.log(error);\n\t\t}\n}", "function search(){\r\n if (!searchField.value)\r\n return;\r\n\r\n let results = searchEngine.search(searchField.value,{\r\n fields: {\r\n tags: { boost: 3 },\r\n title: { boost: 2 },\r\n body: { boost: 1 }\r\n }\r\n }); \r\n\r\n searchResults.classList.add('header-searchResults--show')\r\n\r\n let resultsHtml = '';\r\n if (results.length){\r\n \r\n resultsHtml = `Found ${results.length} post(s).`;\r\n for(let result of results){\r\n let doc = searchEngine.documentStore.getDoc(result.ref);\r\n resultsHtml += `\r\n <div class=\"header-searchResult\">\r\n <a href=\"${doc.id}\">${doc.title}</a>\r\n </div>`;\r\n\r\n }\r\n } else{\r\n resultsHtml = `<div class=\"header-searchResult\">\r\n No results found for ${searchField.value}\r\n </div>`;\r\n }\r\n\r\n searchResults.innerHTML = resultsHtml;\r\n}", "get searchResults() {\n return this.searchResultsInternal;\n }", "function getNewsResults() {\n // grab search term from UI\n if (isRefreshing) {\n searchTerm = lastSearched;\n }\n else {\n searchTerm = $(\"#searchTerm\").val();\n } // personal newsapi key\n var apiKey = '9dd7602e5a99dcd0eacce85dbe256de8';\n \n // base api url\n var baseUrl = 'https://gnews.io/api/v4/';\n // compile full request\n var requestUrl = `${baseUrl}search?q=${searchTerm}&lang=en&token=${apiKey}`;\n console.log(`requestUrl -> ${requestUrl}`);\n // make a request for the data at the \n\n fetch(requestUrl)\n .then(response => response.json())\n .then(data => processResults(data));\n}", "async getResults(page = 1) {\n try {\n this.page = page;\n const result = await searchRecipes(this.query, this.page);\n\n this.currResults = result.results;\n this.allResults.push(...result.results);\n this.numRetrieved += result.results.length;\n if (page === 1) this.numTotal = result.totalResults;\n if (this.numRetrieved === this.numTotal) this.allRetrieved = true;\n } catch (error) {\n console.log('Error retrieving results', error);\n throw error;\n }\n }", "function runSearch() {\n ps.search()\n .then(function(rsp) {\n if(rsp.stat === \"fail\") {\n ps.showError(rsp);\n }\n else if (rsp.stat === \"ok\") {\n ps.paging = rsp.photos;\n ps.parseSearchResults();\n }\n });\n }", "function allAccessSearch() {\n var deferred = Q.defer();\n\n that.pm.search(query, 25, function(err, data) {\n if (err) { deferred.reject(err); return; }\n\n var songs = (data.entries || []).map(function(res) {\n var ret = {};\n\n ret.score = res.score;\n\n if (res.type == \"1\") {\n ret.type = \"track\";\n ret.track = that._parseTrackObject(res.track);\n }\n else if (res.type == \"2\") {\n ret.type = \"artist\";\n ret.artist = res.artist;\n }\n else if (res.type == \"3\") {\n ret.type = \"album\";\n ret.album = res.album;\n }\n\n return ret;\n });\n\n deferred.resolve(songs);\n });\n\n return deferred.promise;\n }", "executeSearch(term) {\n var results;\n try {\n results = this.search.fuse.search(term); // the actual query being run using fuse.js\n } catch (err) {\n if (err instanceof TypeError) {\n console.log(\"hugo-fuse-search: search failed because Fuse.js was not instantiated properly.\")\n } else {\n console.log(\"hugo-fuse-search: search failed: \" + err)\n }\n return;\n }\n let searchitems = '';\n\n if (results.length === 0) { // no results based on what was typed into the input box\n this.resultsAvailable = false;\n searchitems = '';\n } else { // we got results, show 5\n for (let item in results.slice(0,5)) {\n let result = results[item];\n if ('item' in result) {\n let item = result.item;\n searchitems += this.itemHtml(item);\n }\n }\n this.resultsAvailable = true;\n }\n\n this.element_results.innerHTML = searchitems;\n if (results.length > 0) {\n this.top_result = this.element_results.firstChild;\n this.bottom_result = this.element_results.lastChild;\n }\n }", "function getResults( searchTerm ) {\n var url = 'https://www.googleapis.com/youtube/v3/search'; // endpoint url\n var params = {\n part: 'snippet, id', // required for YouTube v3 API request\n key: 'AIzaSyBIVxF2SP7ozlaVsOfTB8nj-1TJhkP3NsI', // developer key\n type: 'video',\n videoEmbeddable: 'true', // only return videos that can be embedded\n maxResults: 5, // limit the search results to max of 5\n q: searchTerm // query parameter\n };\n\n makeAjaxCall(url, params); \n }", "async search(searchObj) {\n const { results, searchURL } = await runSearch(searchObj)\n\n this.lastSearchURL = searchURL\n this.lastSearch = searchObj\n this.results = results\n\n return results\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 Search() {\n if ($('#doc-count').html() != \"\") {\n $('#loading-indicator').show();\n }\n else $('#progress-indicator').show();\n\n q = $(\"#q\").val();\n\n // Get center of map to use to score the search results\n $.get('/api/GetDocuments',\n {\n q: q != undefined ? q : \"*\",\n searchFacets: selectedFacets,\n currentPage: currentPage\n },\n function (data) {\n $('#loading-indicator').css(\"display\", \"none\");\n $('#progress-indicator').css(\"display\", \"none\");\n UpdateResults(data);\n });\n}", "function fetchResults (searchText) {\n var items = $scope.$parent.$eval(itemExpr),\n term = searchText.toLowerCase();\n if (angular.isArray(items)) {\n handleResults(items);\n } else if (items) {\n setLoading(true);\n $mdUtil.nextTick(function () {\n if (items.success) items.success(handleResults);\n if (items.then) items.then(handleResults);\n if (items.finally) items.finally(function () {\n setLoading(false);\n });\n },true, $scope);\n }\n function handleResults (matches) {\n cache[ term ] = matches;\n if ((searchText || '') !== ($scope.searchText || '')) return; //-- just cache the results if old request\n ctrl.matches = matches;\n ctrl.hidden = shouldHide();\n if ($scope.selectOnMatch) selectItemOnMatch();\n updateMessages();\n positionDropdown();\n }\n }", "search() {\n this.send('searchWithParams', this.buildSearchQuery());\n }", "function getResults(p_oEvent){\n\t\tvar sUrl, sMovie;\n\t\tvar oData;\n\t p_oEvent.preventDefault();\n\t\tsMovie = $Form.find('#title').val();\n\t\tsUrl = 'https://api.themoviedb.org/3/search/movie?api_key=97058a18f3b899a2e57452cec18ee321&query=' + sMovie;\n\t $.ajax(sUrl, { \t\n\t complete: function(p_oXHR, p_sStatus){\n\t oData = $.parseJSON(p_oXHR.responseText);\n\t\t\t\tif (oData.Response === \"False\") {\n\t\t\t\t\t$Container.hide();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tqResults = oData;\n\t\t\t\t\tif(qResults.results.length>0){\n\t\t\t\t\t\t$(\"#noResults\").hide();\n\t\t\t\t\t\tfillOutResults(0);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(\"#noResults\").show();\n\t\t\t\t\t\t$Container.hide();\n\t\t\t\t\t}\n\t\t\t\t} \n\t }\n\t });\n\t}", "function renderResults(){\n console.log(results)\n}", "function getResults() {\n var searchText = document.getElementById('search').value;\n var searchData = control.query(\n 'femaleClients',\n 'client_id = ?',\n [searchText]);\n if(searchData.getCount() > 0) {\n // open filtered list view if client found\n control.openTableToListView(\n 'femaleClients',\n 'client_id = ?',\n [searchText],\n '/tables/FemaleClients/html/femaleClients_list.html');\n } else {\n // open 'client not found' page\n control.openTableToListView(\n 'femaleClients',\n null,\n null,\n 'assets/clients_not_found_list.html');\n }\n}", "function getResults(){\n\tvar api_endpt = \"http://en.wikipedia.org/w/api.php\";\n\t$.ajax({\n\t\turl: api_endpt,\n\t\tdata: { action: 'opensearch', search: $(\"input[name=search]\").val(), format: 'json' }, \n\t\tdataType: \"jsonp\",\n\t\ttype: \"GET\",\n\t\terror: function(){\n\t\t\tconsole.log(\"could not receive data\");\n\t\t},\n\t\tsuccess: printInfo\n\t});\n}", "function fetchResults(e) {\n e.preventDefault(); // stops the default submit event that a form has, this allows us to create our own event for this form, also known as an override\n url = `${baseURL}?api-key=${key}&page=${pageNumber}&q=${searchTerm.value}`;\n // check to see if a startDate.value has been provided\n if (startDate.value !== \"\") {\n url += `&begin_date=${startDate.value}`; // add the query parameter to the url string\n }\n // check to see if an endDate.value has been provided\n if (endDate.value !== \"\") {\n url += `&end_date=${endDate.value}`; // add the query parameter to the url string\n }\n fetch(url) // submits a GET request\n .then((results) => {\n // once a reply has been made\n return results.json(); // return a converted JSON to JS object\n })\n .then((json) => {\n displayResults(json); // passes the parsed json data to displayResults()\n });\n}", "function getSearchResults(term) {\n return new Promise( function(resolve) {\n // Create object and set up request\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n resolve(this.responseText);\n }\n };\n\n // Pass query information into server script for GET request\n let queryString = \"?term=\" + term;\n xhttp.open(\"GET\", \"../backend/search.php\" + queryString, true);\n xhttp.send();\n });\n }", "fetchSearchResults(query) {\n const fetchURL = WM_API_SEARCH_FULL_PATH.replace('{{q}}', query);\n\n return fetch(fetchURL)\n .then((response) => {\n if (!response.ok) Promise.reject(response.text());\n return response.json();\n })\n .then(result => result.items)\n .then((searchResults) => {\n this.searchResults = searchResults;\n })\n .catch((err) => { this.error = err; });\n }", "function getSearchResults(query, number) {\r\n const userSearch = '?q=' + query.split(' ').join(\"+\") + '&';\r\n const params = {\r\n type: 'podcast',\r\n limit: number,\r\n info: 1,\r\n k: apiKey\r\n };\r\n const PROXY = 'https://cors-anywhere.herokuapp.com/';\r\n fetch(PROXY + searchEndpoint + userSearch + formatQueryParameters(params))\r\n .then(rawResponse => {\r\n if (rawResponse.ok) {\r\n return rawResponse.json();\r\n } else {\r\n throw new Error(message.statusText);\r\n }\r\n })\r\n .then(response => {\r\n if (response.Similar.Results.length === 0) {\r\n $('.results-list').empty();\r\n $('.error-field').text(`Looks like we couldn't find your podcast. Check your spelling and try again!`).removeClass('hide');\r\n } else {\r\n $('.error-field').text('').addClass('hide');\r\n $('.landing-message').addClass('hide');\r\n $('#instructions-btn').show();\r\n renderResultsToDom(response);\r\n }\r\n })\r\n .catch(error => {\r\n alert(`Looks like something went wrong: ${error.message}`);\r\n })\r\n}", "function sendSearchResult(search) {\n selectAndExecute(\"sr/\" + forHash(search), function() {\n var response = {type: \"searchresult\", link: \"search\", search: search, lists: [], controlLink: location.hash};\n response.header = $.trim($(\"#breadcrumbs\").find(\".tab-text\").text());\n var searchView = $(\"#main .search-view\");\n response.moreText = $.trim(searchView.find(\"div .header .more:visible\").first().text());\n response.lists.push(parseSublist(searchView, \"srar\", 6));\n response.lists.push(parseSublist(searchView, \"sral\", 5));\n response.lists.push(parseSublist(searchView, \"srs\", 10));\n response.empty = response.lists[0] === null && response.lists[1] === null && response.lists[2] === null;\n post(\"player-navigationList\", response);\n });\n }", "function getResults (props) {\n let email = UserStore.getUserDetails().email;\n let secretToken = UserStore.getUserDetails().secretToken;\n\n if (props.query.category) {\n // fetch either running or completed results\n AdhocQueryActions\n .getQueries(secretToken, email, { state: props.query.category });\n } else {\n // fetch all\n AdhocQueryActions.getQueries(secretToken, email);\n }\n}", "function basicsearch() {\n searchString = document.basicForm.basicText.value;\n searchTerms = searchString.split(/\\s/);\n\n putHeader();\n\n findResults();\n putResults();\n\n putFooter();\n\n writeResultsPage();\n}", "function getSearchResults(request) {\n return \"Search Results.\";\n}", "function getSearchResults(urls, query) {\n // callback function to be called by the fetching code.\n /**\n * @param obj\n * the result data object, should be XML.\n * @param engineTitle\n * title of the engine being searched.\n */\n function urlResponse(obj, engineTitle) {\n // create placeholder for results\n var su = document.getElementById('results');\n var resultDiv = document.createElement('div');\n su.appendChild(resultDiv);\n // if there are no errors, parse the results\n if (obj.status == 200) {\n resultDiv.className = 'searchEngine';\n var stringDom = obj.content;\n var domdata=opensocial.xmlutil.parseXML(stringDom);\n if (domdata != null) {\n var entries = domdata.getElementsByTagName('entry');\n resultDiv.innerHTML = resultDiv.innerHTML + engineTitle + ':<br/>';\n if (entries.legnth == 0) {\n resultDiv.innerHTML = resultDiv.innerHTML + ('No results found');\n } else {\n var resultCount = entries.length;\n if (resultCount > 15) {\n resultCount = 15;\n }\n for (i = 0; i < resultCount; i++) {\n if (entries[i].getElementsByTagName('title').length > 0) {\n titles = entries[i].getElementsByTagName('title');\n title = titles[0].childNodes[0].nodeValue;\n } else {\n title = 'Untitled';\n }\n var link = null;\n //for standard atom results, we can extract the link\n if (entries[i].getElementsByTagName('link').length > 0) {\n links = entries[i].getElementsByTagName('link');\n link = links[0].attributes.href.nodeValue;\n }\n var summaryNode = entries[i].getElementsByTagName('summary')[0];\n if (summaryNode == null) {\n summaryNode = entries[i].getElementsByTagName('description')[0];\n }\n if (link == null) {\n resultDiv.innerHTML = resultDiv.innerHTML\n + '<p style=\\\"color:blue\\\"/>'\n + gadgets.util.escapeString(title);\n } else {\n resultDiv.innerHTML = resultDiv.innerHTML\n + '<p style=\\\"color:blue\\\"/>'\n + '<a href=\\\"'+ link + '\\\" target=\\\"_blank\\\">'\n + gadgets.util.escapeString(title)\n + '</a>';\n }\n if (summaryNode != null) {\n var summary = summaryNode.textContent;\n if (summary != null) {\n resultDiv.innerHTML = resultDiv.innerHTML\n + gadgets.util.escapeString(summary);\n }\n }\n }\n }\n }\n } else { // errors occured, notify the user.\n resultDiv.innerHTML = resultDiv.innerHTML + engineTitle\n + '<br/> An error has occured:' + obj.status;\n }\n }\n var params = {};\n for (url in currentEngines) {\n // check if the current engine is selected.\n if (document.getElementById(url).checked) {\n title = currentEngines[url];\n // replace placeholder with actual search term.\n url = url.replace('{searchTerms}', query);\n // for now, start on page 1\n url = url.replace('{startPage?}', 1);\n // makes sure that the title corresponds to the engine being search.\n // Resolves a prior timing issue.\n var callback = function() {\n var myTitle = '' + title;\n return function(response) {\n urlResponse(response, myTitle);\n };\n }();\n // go fetch the results.\n osapi.http.get({\n 'href' : url,\n 'format' : 'text'\n }).execute(callback)\n }\n }\n\n}", "function getResults(query, page) {\n\turlRoot = \"https://archive-it.org/seam/resource/opensearch?q=\" + query\n\t\n\tvar collections = \"\";\n\tvar numberOfChBox = $('.styled').length;\n\tfor(i = 1; i <= numberOfChBox; i++) {\n\n if($('#checkbox' + i).is(':checked')) {\n\t\t\tcollections += \"&i=\" + $('#checkbox' + i).val();\n } \n }\n\t\n\tif (collections.length == 0){\n\t\tshowFeedback(\"error\", \"#search-error\", \"You must select at least one collection to search.\");\n\t} else {\n\t\tsearchURL = urlRoot + collections\n\t\t\n\t\tif (page == 0){\n\t\t\turlPath = searchURL\n\t\t} else {\n\t\t\turlPath = searchURL + '&p=' + page\n\t\t}\n\t\t\t\n\t $(\"#search-error\").empty().removeClass(function(index, css) {\n\t\t return (css.match(/(^|\\s)alert?\\S+/g) || []).join(' ');\n\t\t});\n\t\t\t\n\t $(\"#results\").empty();\n\t $(\"#loadingArea\").append('<img src=\"img/loading.gif\" />');\n\t $(\"#results\").fadeIn(100);\n\t \n\t objects = $.ajax({\n\t\ttype: \"GET\",\n\t\tdataType: \"xml\",\n\t\turl: urlPath,\n\t\tasync: true,\n\t\tsuccess: function(results) {\n\t\t\t$(\"#loadingArea\").empty();\n\t\t\tresultCount = results.getElementsByTagName(\"totalResults\")[0].childNodes[0].nodeValue;\n\t\t\t\n\n\t\t\t if (resultCount < 1) {\n\t\t\t\tshowFeedback(\"error\", \"#search-error\", \"Sorry, I couldn't find anything for \" + query);\n\t\t\t } else {\n\t\t\t\t \n\t\t\t\tpageValue = Number(results.getElementsByTagName(\"startIndex\")[0].childNodes[0].nodeValue)\n\t\t\t\tstartValue = pageValue + 1\n\t\t\t\tpageMax = pageValue + Number(results.getElementsByTagName(\"itemsPerPage\")[0].childNodes[0].nodeValue)\n\t\t\t\tif (resultCount > pageMax) {\n\t\t\t\t\tendValue = pageMax\n\t\t\t\t} else {\n\t\t\t\t\tendValue = resultCount\n\t\t\t\t}\n\t\t\t\tpreviousPage = pageValue - Number(results.getElementsByTagName(\"itemsPerPage\")[0].childNodes[0].nodeValue)\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$(\"#results\").append('<div class=\"row\"><div id=\"pagination\" class=\"col-xs-12\"></div></div>')\n\t\t\t\tif (pageValue != 0) {\n\t\t\t\t\t$(\"#pagination\").append('<a class=\"pageLink\" onclick=\"getResults(\\'' + query + '\\', previousPage);\" href=\"javascript:void(0);\"><span class=\"glyphicon glyphicon-chevron-left\"></span></a>')\n\t\t\t\t} else {\n\t\t\t\t\t$(\"#pagination\").append('<span class=\"glyphicon glyphicon-chevron-left pageLink\"></span>')\n\t\t\t\t}\n\t\t\t\t$(\"#pagination\").append('<h4>Viewing ' + startValue + ' - ' + endValue + ' of ' + resultCount + ' results for \"' + results.getElementsByTagName(\"query\")[0].childNodes[0].nodeValue + '\"</h4>');\n\t\t\t\t$(\"#pagination\").append('<a class=\"pageLink\" onclick=\"getResults(\\'' + query + '\\', endValue);\" href=\"javascript:void(0);\"><span class=\"glyphicon glyphicon-chevron-right\"></span></a>')\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(i=0; i<results.getElementsByTagName(\"item\").length; i++) {\n\t\t\t\t var resultItem = results.getElementsByTagName(\"item\")[i];\n\t\t\t\t var timestamp = resultItem.getElementsByTagName(\"date\")[0].childNodes[0].nodeValue;\n\t\t\t\t var fromCollection = resultItem.getElementsByTagName(\"index\")[0].childNodes[0].nodeValue;\n\t\t\t\t var collectionName = $(':checkbox[value=' + fromCollection + ']').next(\"label\").text();\n\t\t\t\t var isoTime = timestamp.slice(0,4) + '-' + timestamp.slice(4,6) + '-' + timestamp.slice(6,8) + 'T' + timestamp.slice(8,10) + ':' + timestamp.slice(10,12) + ':' + timestamp.slice(12,14) + 'Z'\n\t\t\t\t\tdate = new Date(isoTime),\n\t\t\t\t $(\"#results\").append('<div id=\"'+i+'\" class=\"panel panel-default\">'+\n\t\t\t\t\t'<div class=\"panel-body\">'+\n\t\t\t\t\t\t'<h4 class=\"title\" style=\"margin-top:10px\">' + \n\t\t\t\t\t\t\t'<a href=\"http://wayback.archive-it.org/' + resultItem.getElementsByTagName(\"index\")[0].childNodes[0].nodeValue + '/' + resultItem.getElementsByTagName(\"date\")[0].childNodes[0].nodeValue + '/' + resultItem.getElementsByTagName(\"link\")[0].childNodes[0].nodeValue + '\">' +\n\t\t\t\t\t\t\t\tresultItem.getElementsByTagName(\"title\")[0].childNodes[0].nodeValue + \n\t\t\t\t\t\t\t'</a>' +\n\t\t\t\t\t\t\t' <span class=\"liveLink\">(<a href=\"' + resultItem.getElementsByTagName(\"link\")[0].childNodes[0].nodeValue + '\">Live Web</a>)</span>' +\n\t\t\t\t\t\t'</h4>'+\n\t\t\t\t\t\t//'<h5 class=\"collectionLink\"><span class=\"glyphicon glyphicon-arrow-right\"></span> Part of collection: </h5>' +\n\t\t\t\t\t\t'<h5><i class=\"fa fa-clock-o\"></i> Captured on ' +\n\t\t\t\t\t\t\t date.toString().split('GMT')[0] + ' (<a href=\"http://wayback.archive-it.org/' + resultItem.getElementsByTagName(\"index\")[0].childNodes[0].nodeValue + '/*/' + resultItem.getElementsByTagName(\"link\")[0].childNodes[0].nodeValue+ '\">More Captures</a>)' +\n\t\t\t\t\t\t'</h5>' +\n\t\t\t\t\t\t'<h5><span class=\"glyphicon glyphicon-arrow-right\"></span> found in ' + collectionName + '</h5>' +\n\t\t\t\t\t\t'<p>'+\n\t\t\t\t\t\t\tresultItem.getElementsByTagName(\"description\")[0].childNodes[0].nodeValue +\n\t\t\t\t\t\t'</p>'+\n\t\t\t\t\t'</div>'+\n\t\t\t\t '</div>');\n\t\t\t\t}\n\t\t\t\t$(\"#results\").append('<div class=\"row\"><div id=\"pagination2\" class=\"col-xs-12\"></div></div>')\n\t\t\t\tif (pageValue != 0) {\n\t\t\t\t\t$(\"#pagination2\").append('<a class=\"pageLink\" onclick=\"getResults(\\'' + query + '\\', previousPage);\" href=\"javascript:void(0);\"><span class=\"glyphicon glyphicon-chevron-left\"></span></a>')\n\t\t\t\t}\telse {\n\t\t\t\t\t$(\"#pagination2\").append('<span class=\"glyphicon glyphicon-chevron-left pageLink\"></span>')\n\t\t\t\t}\n\t\t\t\t$(\"#pagination2\").append('<h4>Viewing ' + startValue + ' - ' + endValue + ' of ' + resultCount + ' results for \"' + results.getElementsByTagName(\"query\")[0].childNodes[0].nodeValue + '\"</h4>');\n\t\t\t\t$(\"#pagination2\").append('<a class=\"pageLink\" onclick=\"getResults(\\'' + query + '\\', endValue);\" href=\"javascript:void(0);\"><span class=\"glyphicon glyphicon-chevron-right\"></span></a>')\n\t\t\t }\n\t\t \n\t\t},\n\t\t error: function(XMLHttpRequest, textStatus, errorThrown) {\n\t\t\t showFeedback(\"error\", \"#search-error\", \"Sorry, there was an error with this query\");\n\t\t\tconsole.log(\"Status: \" + textStatus); \n\t\t\tconsole.log(\"Error: \" + errorThrown); \n\t\t} \n\t });\n\t}\n\t\n}", "function performSearch() {\n // reset the scroll in case they scrolled down to read prior results\n window.scrollTo(0, 0)\n\n fetchSearch(\n // Ensures event properties include \"type\": \"gene\" in search logging.\n 'gene', {\n page: searchParams.page,\n genes: searchParams.genes,\n preset: searchParams.preset\n }).then(results => {\n setSearchState({\n params: searchParams,\n isError: false,\n isLoading: false,\n isLoaded: true,\n results,\n updateSearch\n })\n }).catch(error => {\n setSearchState({\n params: searchParams,\n isError: true,\n isLoading: false,\n isLoaded: true,\n results: error,\n updateSearch\n })\n })\n }", "function result() {\n\trequestXml = new XMLHttpRequest();\n\trequestXml.open(\"GET\", result_url, true);\n\trequestXml.onreadystatechange = processSearchResponse;\n\trequestXml.send(null);\n}", "function search_results(data, context){\n // cache the jQuery object\n var $search_results = $('#search_results');\n // empty the element\n $('#loading').hide();\n $search_results.hide();\n $search_results.empty();\n // add the results\n $search_results.append('<h2>Results</h2>');\n if (data.ids.length>0) {\n $search_results.append('<ul class=\"paging\"></ul>');\n pager = $('ul.paging');\n for(item in data.ids) {\n object_id = data.ids[item];\n display_item(object_id, pager);\n }\n } else {\n $search_results.append('<div>None found. Please try again...</div>');\n }\n page_size = 10;\n if (data.ids.length>200) {\n page_size = data.ids.length/20;\n }\n pager.quickPager({pageSize: page_size, pagerLocation: \"both\"});\n $search_results.fadeIn();\n }", "function showSearchResults(searchQuery) {\n searchData(searchQuery).then(results => {\n const html = results.map(movie => `\n <li>\n <span class=\"title\">${movie.title}</span>\n <span class=\"rating\">${movie.rating}</span>\n </li>\n `);\n\n resultsElement.innerHTML = html.join('');\n });\n }", "function processSearchResponse() {\n\tif (requestXml.readyState == 4) {\n\t\tvar resultXml = requestXml.responseXML;\n\t\t\n\t\tk = 0;\n\t\tnames = [];\n\t\ttrackers = [];\n\t\thashes = [];\n\t\t$('RESULT', resultXml).each(function(i) {\n\t\t\tnames[k] = $(this).find(\"NAME\").text();\n\t\t\ttrackers[k] = $(this).find(\"TRACKER\").text();\n\t\t\thashes[k] = $(this).find(\"HASH\").text();\n\t\t\tk++;\n\t\t});\n\t\t\n\t\tsearch_results = [];\n\t\tfor (var j = 0; j < names.length; j++)\n\t\t\tsearch_results.push(names[j]);\n\t\t\n\t\t$('#results_list').sfList('clear');\n\t\t$('#results_list').sfList('option', 'data', search_results);\n\t\t\n\t\tis_list_shown = true;\n\t}\n}", "function search(options){\n Search.getResults(options).then(function(response){\n vm.searchResults = response.data[\"applications\"];\n }, Toast.showHttpError)\n }", "function search() {\t\t\t\t\n\t\t\tconsole.log(vm.apiDomain);\n\t\t\n\t\t\tpageScope.loadingStart();\n\t\t\t\n\t\t\tAlleleFearSearchAPI.search(vm.apiDomain, function(data) {\n\t\t\t\tvm.results = data;\n\t\t\t\tvm.selectedIndex = 0;\n\t\t\t\tif (vm.results.length > 0) {\n\t\t\t\t\tloadObject();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tclear();\n\t\t\t\t pageScope.loadingEnd();\n\t\t\t\t}\n\t\t\t\tsetFocus();\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"API ERROR: AlleleFearSearchAPI.search\");\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t});\n\t\t}", "function showResults(results){\n var result = \"\";\n // got through each array and get the value of the Title only\n $.each(results, function(index,value){\n result += '<p>' + value.Title + '</p>';\n });\n // append the information into search-results div.\n $('#search-results').append(result);\n }", "function getResults(query, callback)\n{\n var xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = function()\n {\n if(xhr.readyState === 4)\n {\n var results;\n\n try\n {\n results = JSON.parse(this.responseText)\n callback(results);\n }\n catch(e)\n {\n // If we encounter an error while parsing the JSON,\n // silently handle the error\n callback([]);\n }\n }\n }\n\n xhr.open(\"GET\", \"/search?q=\" + encodeURIComponent(query));\n xhr.send();\n}", "async function searchPosts() {\n let searchTerm = id(\"search-term\").value.trim();\n showHomeView();\n let results = formatResults(await getSearchResults(searchTerm));\n displaySearchResults(results);\n }", "function fetchResults(searchText){var items=$scope.$parent.$eval(itemExpr),term=searchText.toLowerCase(),isList=angular.isArray(items),isPromise=!!items.then;// Every promise should contain a `then` property\n\tif(isList)onResultsRetrieved(items);else if(isPromise)handleAsyncResults(items);function handleAsyncResults(items){if(!items)return;items=$q.when(items);fetchesInProgress++;setLoading(true);$mdUtil.nextTick(function(){items.then(onResultsRetrieved)[\"finally\"](function(){if(--fetchesInProgress===0){setLoading(false);}});},true,$scope);}function onResultsRetrieved(matches){cache[term]=matches;// Just cache the results if the request is now outdated.\n\t// The request becomes outdated, when the new searchText has changed during the result fetching.\n\tif((searchText||'')!==($scope.searchText||'')){return;}handleResults(matches);}}", "function makeSearch() {\n var query = $('#search-line').val();\n if (query.length < 2) {\n return null;\n }\n\n // cleanup & make AJAX query with building response\n $('#ajax-result-items').empty();\n $.getJSON(script_url+'/api/search/index?query='+query+'&lang='+script_lang, function (resp) {\n if (resp.status !== 1 || resp.count < 1)\n return;\n var searchHtml = $('#ajax-carcase-item').clone().removeClass('hidden');\n $.each(resp.data, function(relevance, item) {\n var searchItem = searchHtml.clone();\n searchItem.find('#ajax-search-link').attr('href', site_url + item.uri);\n searchItem.find('#ajax-search-title').text(item.title);\n searchItem.find('#ajax-search-snippet').text(item.snippet);\n $('#ajax-result-items').append(searchItem.html());\n searchItem = null;\n });\n $('#ajax-result-container').removeClass('hidden');\n });\n }", "function postSearchResults(request, response) {\n // get api url\n let url = 'https://www.googleapis.com/books/v1/volumes?q='\n\n\n let query = request.body.search[0];\n let titleOrAuthor = request.body.search[1];\n\n if (titleOrAuthor === 'title') {\n url += `+intitle:${query}`;\n } else if (titleOrAuthor === 'author') {\n url += `+inauthor:${query}`;\n }\n\n // grab data from api\n superagent.get(url)\n .then(results => {\n // loop through results and construct new book object each iteration\n let books = results.body.items.map(val => {\n return new Book(val);\n });\n // console.log(results.body.items[0]);\n response.render('pages/searches/show.ejs', {\n searchResults: books\n });\n }).catch(err => error(err, response));\n}", "get results() {\n return (\n this.data\n // get a copy of the data for this view (.sort() modifies arrays in place)\n .slice()\n\n // sort alphabetically\n .sort((a, b) => (this.sortAsc ? a.title.localeCompare(b.title) : b.title.localeCompare(a.title)))\n\n // filter by query match\n .filter((item) => (this.query ? matches(this.query, item.title) : true))\n\n // filter by filters state\n .filter((item) =>\n Object.entries(this.filtersState).every(([key, filter]) =>\n Object.entries(item).every(([prop, value]) => {\n if (key === prop && filter) {\n return filter === value\n }\n\n return true\n })\n )\n )\n )\n }", "function results(data) {\n $(\"#movie_results\").html(data.results.length+\" Results for search '\"+$(\"#movieQuery\").val()+\"'\");\n data.results.forEach(function(item){$(\"#movie_results\").append(\"<hr><ul>\").append(\"<li>Title: \"+item.title+\"</li>\").append(\"<li><img src=\"+img_base_url+item.poster_path+\"></img></li>\").append(\"<li>Popularity: \"+item.popularity+\"</li>\").append(\"</ul><hr>\")});\n}", "function fetchResults(txt) {\n\tconsole.log(searchStr);\n}", "function getSearchResults(search) {\r\n const found = fetch(link_giphy + search + '&api_key=' + apiKey)\r\n .then((response) => {\r\n return response.json()\r\n }).then(data => {\r\n return data\r\n })\r\n .catch((error) => {\r\n return error\r\n })\r\n return found\r\n}", "function search_results(data, context){\n var obj = JSON.parse(data);\n // cache the jQuery object\n var $search_results = $('#search_results');\n // empty the element\n $search_results.empty();\n // add the results\n $search_results.append('<h2>Results</h2><p>Objects with the following ids match your query:</p><ul>');\n if (obj.ids.length>0) {\n $.each(obj.ids, function(o, object_id) {\n context.partial('templates/result.template', { obj: object_id}, function(rendered) { $search_results.append(rendered)});\n });\n } else {\n $search_results.append('<li>None found. Please try again...</li>');\n }\n $search_results.append('</ul>');\n }", "async function getSearchData() {\n const response = await getSearch({\n keywords: keyword,\n type,\n limit: limit_item,\n offset: (page - 1) * limit_item,\n });\n if (response.data.code === 200) {\n if (\n response.data.result.songCount > 0 ||\n type === \"1000\" ||\n type === \"1004\"\n ) {\n switch (type) {\n case \"1\":\n setSongList(response.data.result.songs);\n setTotal_item(response.data.result.songCount);\n break;\n case \"1000\":\n setPlayList(response.data.result.playlists);\n setTotal_item(response.data.result.playlistCount);\n break;\n case \"1004\":\n setMvList(response.data.result && response.data.result.mvs);\n setTotal_item(response.data.result.mvCount);\n break;\n default:\n break;\n }\n } else {\n alert(`No result match '${keyword}', please try again!`);\n }\n }\n }", "function getSearchMatches(state) {\n return state.entities.search.matches;\n}", "async function fetchResults() {\n try {\n var req = await fetch(apiURL + `/suggest/${searchValue}`);\n var res = await req.json();\n songsData = res;\n } catch (error) {\n console.log(error);\n }\n nextIndexPage = songsData.next;\n previousIndex.style.display = 'none';\n showResults();\n}", "async search(term){\n\n // if no search term was given, abort the search\n if(term === '' || term == null){\n return;\n }\n\n // check if there is no access token => first login \n if(typeof accessToken === 'undefined'){\n checkAccessToken();\n }\n\n // search for tracks, since it contains ablbums and artists\n // limit search results to 5 results\n const response = await fetch(`${apiURL}search?q=${term}&type=track&limit=5`, {\n headers: {Authorization: `Bearer ${accessToken}`}\n });\n\n // check if there was error on an existing access token\n // i.e. access token expired\n if(response.status === 401){\n checkAccessToken();\n }\n\n // get the array with the search results\n const jsonResponse = await response.json();\n if(typeof jsonResponse.tracks.items !== 'undefined'){\n return jsonResponse.tracks.items.map(track => {\n return {\n id: track.id,\n album: track.album.name,\n artist: track.artists[0].name,\n track: track.name,\n image: track.album.images[0].url\n }\n })\n } \n }", "function search(query) {\n var aMatches = aLastResults =_search(query)\n .filter(function(o) {\n return o.sIdMatch !== null || o.sNameMatch !== null;\n });\n console.log(aLastResults.length + ' search results');\n _populateSearchTargetVariables(ui$, aMatches);\n return _toControl(aMatches);\n }", "function getResults (query) {\n fetch(`${api.base}/cuisine?q=${query}&APPID=${api.key}`)\n .then(cuisine => {\n return cuisine.json();\n }).then(displayResults); \n }", "function showResults () {\n const value = this.value\n const results = index.search(value, 8)\n // console.log('results: \\n')\n // console.log(results)\n let suggestion\n let childs = suggestions.childNodes\n let i = 0\n const len = results.length\n\n for (; i < len; i++) {\n suggestion = childs[i]\n\n if (!suggestion) {\n suggestion = document.createElement('div')\n suggestions.appendChild(suggestion)\n }\n suggestion.innerHTML = `<b>${results[i].tablecode}</>: ${results[i].label}`\n // `<a href = '${results[i].tablecode}'> ${results[i]['section-name']} ${results[i].title}</a>`\n\n // console.log(results[i])\n }\n\n while (childs.length > len) {\n suggestions.removeChild(childs[i])\n }\n //\n // // const firstResult = results[0].content\n // // const match = firstResult && firstResult.toLowerCase().indexOf(value.toLowerCase())\n // //\n // // if (firstResult && (match !== -1)) {\n // // autocomplete.value = value + firstResult.substring(match + value.length)\n // // autocomplete.current = firstResult\n // // } else {\n // // autocomplete.value = autocomplete.current = value\n // // }\n }", "function getResults(term, callback) {\n\t\tvar options = [];\n\t\t$.get(\n\t\t\twebroot + 'li3_docs/search/' + term.term,\n\t\t\tfunction(data, status, xhr) {\n\t\t\t\tif(typeof(data.results.error) != 'undefined') {\n\t\t\t\t\talert(data.results.error);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfor(var i in data.results) {\n\t\t\t\t\toptions.push(createValue(\n\t\t\t\t\t\tdata.results[i]['class'],\n\t\t\t\t\t\tdata.results[i].type,\n\t\t\t\t\t\tdata.results[i].name\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t\tcallback(options);\n\t\t\t},\n\t\t\t'json'\n\t\t);\n\t}", "function displaySearchResults(results, store) {\n\t\tvar searchResults = document.getElementById('search-results');\n\t\tif (results.length) { // Are there any results?\n\t\t\tvar appendString = '';\n\n\t\t\tfor (var i = 0; i < results.length; i++) { // Iterate over the results\n\t\t\t\tvar item = store[results[i].ref];\n\t\t\t\tappendString += '<h3><a href=\".' + item.url + '\">' + item.title + ' <div class=\"fa fa-arrow-right\" aria-hidden=\"true\"></div></a></h3>';\n\t\t\t\tappendString += '<p>' + item.content.substring(0, 150) + '...</p></li>';\n\t\t\t}\n\t\t\tsearchResults.innerHTML = appendString;\n\t\t} else {\n\t\t\tdisplayFailureMessage('No results found for \"' + searchTerm);\n\t\t}\n\n\n\t}", "function doSearch() {\n var termsFacet = ejs.TermsFacet('types').field('type');\n var dataHistogramFacet = ejs.DateHistogramFacet('period').field('created').interval(interval);\n\n if (termsFacetFilter && rangeFacetFilter) {\n var andFacet = ejs.AndFilter([termsFacetFilter, rangeFacetFilter]);\n termsFacet.facetFilter(andFacet);\n dataHistogramFacet.facetFilter(andFacet);\n }\n else if (termsFacetFilter) {\n termsFacet.facetFilter(termsFacetFilter);\n dataHistogramFacet.facetFilter(termsFacetFilter);\n }\n else if (rangeFacetFilter) {\n termsFacet.facetFilter(rangeFacetFilter);\n dataHistogramFacet.facetFilter(rangeFacetFilter);\n }\n\n ejs.Request().indices(index).types(type)\n .facet(termsFacet)\n .facet(dataHistogramFacet).doSearch(function (results) {\n $scope.results = results;\n $log.log(results);\n });\n }", "function getResults() {\n return new Promise((resolve, reject) => {\n client.getQueryResults(params, (err, data) => {\n if (err) return reject(err)\n var list = []\n let header = buildHeader(data.ResultSet.ResultSetMetadata.ColumnInfo)\n let top_row = _.map(_.head(data.ResultSet.Rows).Data, (n) => { return n.VarCharValue })\n let resultSet = (_.difference(header, top_row).length > 0) ?\n data.ResultSet.Rows :\n _.drop(data.ResultSet.Rows)\n resultSet.forEach((item) => {\n list.push(_.zipObject(header, _.map(item.Data, (n) => {return n.VarCharValue })))\n })\n return resolve({next: ('NextToken' in data) ? data.NextToken : undefined, list: list})\n })\n })\n }", "function searchRecommendations(searchVal) {\n if (searchVal !== \"\") {\n let resultArray = [];\n if (props.title === \"Song\")\n {\n const testParams = {\n limit: 5\n }\n props.spotify.search(searchVal, [\"track\"], testParams)\n .then((response) => {\n console.log(response)\n response.tracks.items.map((item, index) => {\n resultArray.push(item.name + \" By: \" + item.artists[0].name + \";\" + item.id + \";\" + (item.album.images.length > 0 ? item.album.images[0].url : \"\"))\n })\n props.setRecs(resultArray)\n })\n }\n else if (props.title === \"Artist\")\n {\n const testParams = {\n limit: 5\n }\n props.spotify.search(searchVal, [\"artist\"], testParams)\n .then((response) => {\n console.log(response)\n response.artists.items.map((item, index) => {\n resultArray.push(item.name + ';' + item.id + ';' + (item.images.length > 0 ? item.images[0].url : \"\"))\n })\n props.setRecs(resultArray)\n })\n }\n else if (props.title === \"Genre\")\n {\n props.spotify.getAvailableGenreSeeds()\n .then((response) => {\n let genres = response.genres.filter((genre) => genre.includes(searchVal))\n if (genres.length > 5) {\n props.setRecs(genres.slice(0, 5))\n }\n else props.setRecs(genres)\n })\n }\n }\n }", "function getSearchResult(subject, searchQuery) {\n defer = $q.defer();\n\n $http({\n method: 'GET',\n url: DATASERVICECONSTANTS.BASE_URL + '/' + subject + '?q=' + searchQuery,\n timeout: 5000\n }).then(function successCallback(response) {\n defer.resolve(response);\n }, function errorCallback(response) {\n defer.reject(response);\n });\n\n return defer.promise;\n }", "async function getResults(searchTerm) {\n const offset = currentApiPage * pageSize;\n const response = await fetch(`http://api.giphy.com/v1/gifs/search?q=${searchTerm}&limit=${pageSize}&offset=${offset}&api_key=${apiKey}`);\n const jsonResponse = await response.json();\n return jsonResponse.data;\n}", "function search(searchCriteria) {\n if (searchCriteria.groupUsers) {\n if (searchCriteria.groupUsers.length === 0) {\n delete searchCriteria.groupCriteria;\n delete searchCriteria.groupUsers;\n }\n }\n\n ngProgress.start();\n return Search.search(searchCriteria).success(function(response) {\n if (response[0].total > 1000 && ($location.$$search.pageLength >= 1000 || $location.$$search.pageLength === 'All')) {\n $scope.form.pageLength = '200';\n $location.search('pageLength', 200);\n processResult(response.slice(0, 200));\n Flash.addAlert(null, '<b>Result is too big</b>: Showing first 200 items, use pagination');\n } else {\n processResult(response);\n }\n\n console.log('RESULT', response[0].report);\n // console.log('scope.form.groups', $scope.form.groups);\n //console.log('search', response);\n ngProgress.complete();\n }).error(function(error) {\n Flash.addAlert('danger', error.body.errorResponse.message);\n ngProgress.complete();\n });\n }", "async getResults() {\n const proxy = 'https://cors-anywhere.herokuapp.com/';\n const key = '1f21814749b5c18a412a3db9259754c5';\n try {\n //axios is better than fetch in terms of brining data from ser\n const res = await axios(`${proxy}http://food2fork.com/api/search?key=${key}&q=${this.query}`);\n this.result = res.data.recipes;\n } catch(error) {\n alert(error);\n } // end catch block\n }", "searchEntry(){\n\t\tdriver.sleep(3000);\n\t\tdriver.findElement(By.name('q')).sendKeys('little mamas filipino food austin');\n\t\tdriver.findElement(By.name('btnK')).click();\n\t\treturn require('./searchResult');\n\t}", "function performRemoteSearch(data) {\n return swRemoteSearch.search(data);\n }", "function retrieveData(){\n\t$.ajax({\n\t\turl: searchUrl + searchTerm + limit + key,\n\t\tmethod: \"GET\"\n\t}).done(function(response){\n\t\t//console.log(response);\n\t\treturnedData = response;\n\t\t//console.log(returnedData);\n\t\tcreateGrid();\n\t})\n}", "async function getSearch (){\n\n let adata = await fetch(`/account?username=${name}`)\n .then(res => res.json())\n .then(res => {return res;});\n\n let matchHistory = JSON.parse(\n await fetch(`./matchstats?accountId=${adata.accountId}`)\n .then(res => res.json())\n .then(res => {return res}));\n\n let userInfo = {user: adata, matchHistory: matchHistory};\n\n props.appCallback(userInfo);\n }", "function displaySearchResults(query){\n\t// create the complete url\n\tvar wiki_url = base_url + query;\n\tconsole.log(wiki_url);\n\t$.getJSON(wiki_url, function(json){\n\t\tvar result = json[\"query\"][\"search\"];\n\t\tfor(var i=0; i<result.length; i++){\n\t\t\tconsole.log(result[i]);\n\t\t\turl_link = base_redirect + result[i].title.replace(\" \", \"%20\");\n\t\t\t$(\"#content\").append(\"<a href='\" + url_link + \"' class='list-group-item' target='_blank'><h3>\"\n\t\t\t+ result[i].title + \"</h3><br>\" + result[i].snippet + \"<br></a>\");\n\t\t}\n\t});\n\t\n}", "function displayResults() {\n $.ajax({\n type: 'POST',\n url: 'responder_search.php',\n dataType: 'json',\n success: function (data) {\n _results = data;\n _redrawTable();\n },\n error: function (XMLHttpRequest, textStatus, errorThrown) {\n alert('Error. Check the console for more details.');\n console.log(XMLHttpRequest);\n console.log(textStatus);\n console.log(errorThrown);\n }\n });\n }", "function displaySearchResults(results) {\n // Hide the spinner.\n spinner.style.display = \"none\";\n\n if (results.length) {\n // Group the results by category.\n var categoryMap = {};\n for (var i = 0; i < results.length; i++) {\n var result = results[i];\n var categoryName = getCategoryName(result.url);\n var category = categoryMap[categoryName] = categoryMap[categoryName] || [];\n prepareResult(result, categoryName);\n category.push(result);\n }\n\n // Build up the HTML to display.\n var appendString = \"\";\n for (var i = 0; i < categories.length; i++) {\n var categoryName = categories[i].name;\n var category = categoryMap[categoryName];\n if (category && category.length > 0) {\n appendString += buildCategoryString(categoryName, category);\n }\n }\n searchResultsContainer.innerHTML = appendString;\n } else {\n searchResultsContainer.innerHTML = \"<p>No results found.</p>\";\n }\n }", "function getSearches(cb) {\n const query = \"recipes.searches\"\n db.findOneSorted({\"_id\": \"server\", [query] : { \"$exists\" : true }}, { [query] : 1 }, data => {\n if (!data) {\n const err = {\n \"error\" : 404,\n \"payload\" : \"There is no recipe search info\"\n }\n return cb(err);\n };\n return cb(null, data.recipes.searches);\n });\n}", "function showResults(search) {\n\t//show loading icon in btn\n\tvar btn = $('#search');\n\t\tbtn.addClass('searching');\n\t$.ajax(\n\t{\n\t\turl: 'php_scripts/actions.php',\n\t\ttype: 'POST',\n\t\tdata: 'action=search&search='+search,\n\t\tdataType: 'JSON',\n\t\tsuccess: function(data) {\n\t\t\t// console.log(data.length);\n\t\t\t// console.log(typeof data[0] !== 'object');\n\t\t\t// var result = JSON.parse(data);\n\t\t\tappendResultToDom(data);\n\t\t\t//remove loading from search btn\n\t\t\tbtn.removeClass('searching');\n\t\t},\n\t\terror: function(response) {\n\t\t\t//log js errors\n\t\t\tshortTimeMesg('Alert! Search failed!', 'short-time-msg-failure');\n\t\t\t//remove loading from search btn\n\t\t\tbtn.removeClass('searching');\n\t\t}\n\t}\n\t);\n}", "function getResults(query)\r\n{ \r\n fetch(`${api.base}weather?q=${query}&units=metric&APPID=${api.key}`) //retrieving the weather data\r\n .then(weather => {\r\n return weather.json(); //converting it into a JSON file\r\n\r\n }).then(DisplayResults);\r\n\r\n}", "fetchResults(searchTerm) {\n apiSearch(searchTerm)\n .then(reviews => {\n this.setState({ reviews: reviews.results })\n })\n }", "function fetchResults (searchText) {\n var items = $scope.$parent.$eval(itemExpr),\n term = searchText.toLowerCase(),\n isList = angular.isArray(items),\n isPromise = !!items.then; // Every promise should contain a `then` property\n\n if (isList) onResultsRetrieved(items);\n else if (isPromise) handleAsyncResults(items);\n\n function handleAsyncResults(items) {\n if (!items) return;\n\n items = $q.when(items);\n fetchesInProgress++;\n setLoading(true);\n\n $mdUtil.nextTick(function () {\n items\n .then(onResultsRetrieved)\n .finally(function(){\n if (--fetchesInProgress === 0) {\n setLoading(false);\n }\n });\n },true, $scope);\n }\n\n function onResultsRetrieved(matches) {\n cache[term] = matches;\n\n // Just cache the results if the request is now outdated.\n // The request becomes outdated, when the new searchText has changed during the result fetching.\n if ((searchText || '') !== ($scope.searchText || '')) {\n return;\n }\n\n handleResults(matches);\n }\n }", "function fetchResults (searchText) {\n var items = $scope.$parent.$eval(itemExpr),\n term = searchText.toLowerCase(),\n isList = angular.isArray(items),\n isPromise = !!items.then; // Every promise should contain a `then` property\n\n if (isList) onResultsRetrieved(items);\n else if (isPromise) handleAsyncResults(items);\n\n function handleAsyncResults(items) {\n if ( !items ) return;\n\n items = $q.when(items);\n fetchesInProgress++;\n setLoading(true);\n\n $mdUtil.nextTick(function () {\n items\n .then(onResultsRetrieved)\n .finally(function(){\n if (--fetchesInProgress === 0) {\n setLoading(false);\n }\n });\n },true, $scope);\n }\n\n function onResultsRetrieved(matches) {\n cache[term] = matches;\n\n // Just cache the results if the request is now outdated.\n // The request becomes outdated, when the new searchText has changed during the result fetching.\n if ((searchText || '') !== ($scope.searchText || '')) {\n return;\n }\n\n handleResults(matches);\n }\n }", "function getSearchResults(query) {\n\n \n fetch(`${api.base}weather?q=${query}&units=metric&APPID=${api.key}`)\n\n .then(verifyFetch)\n .then(weather => {\n return weather.json();\n })\n .then(displayResults)\n .then(function () {\n loadContainer.style.display = 'none';\n });\n\n\n // Adding the second API FETCH for the forecast \n fetch(`${api.base}forecast?q=${query}&units=metric&APPID=${api.key}`)\n .then(verifyFetch)\n .then(forecast => {\n return forecast.json();\n })\n .then(displayForecast);\n}", "function renderResults(result) {\n\t\tif(result && result.searchHits && result.searchHits.length) {\t\n\t\t\tlistOfMyListItems = result.searchHits;\n\t\t\tdisplayMyList(result.searchHits);\n\t\t\tpagingControl.updatePaging(result);\n\t\t}\n\t}", "function displayQueryResults() {\n\t\t\t$scope.resultsAvailable = true;\n\t\t\tresultsOffset = 0;\n\t\t\t$scope.getNextResultsPage();\n\n\t\t}", "function getSearches(req, res) {\n\tif (!req.session.user) {\n\t\tres.end();\n\t\treturn;\n\t}\n\tvar result;\n\tvar username = req.session.user;\n\tmongo.connect(\"mongodb://localhost:27017/\", function(err, db) {\n\t\tif(err) {\n\t\t\tconsole.log(\"Database error\");\n\t\t\treturn;\n\t\t}\n\t\tvar collection = db.collection('users');\n\t\tcollection.find({username : username}).toArray(function(err,items) {\n\t\t\t// Setting up user Session (=email)\n\t\t\tif (!err) {\n\t\t\t\tresult = items[0].searches;\n\t\t\t\tres.json(result);\n\t\t\t}\n\t\t});\n\t});\n}", "function getSearch() {\n\t\tvar query = $('#searchBar').val();\n\t\tvar url = \"https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=\" + query + \"&callback=?\";\n\n\t\t$.getJSON(url, function(json) {\n\t\t\t\n\t\t\t// Replace content of div1 with \"\" to clear results div\n\t\t\t$(\"#div1\").html(\"\");\n\n\t\t\tfor (var i = 1; i < json[1].length; i++) {\n\t\t\t\t// Variables for every item to display on search results\n\t\t\t\tvar $div = $(\"<div>\", {id: \"div\"});\n\t\t\t\tvar $span = $(\"<span>\");\n\t\t\t\tvar $title = $(\"<h3>\");\n\t\t\t\tvar $text = $(\"<p>\");\n\t\t\t\tvar $link = $(\"<a>\", {class: \"links\", href: \"\"});\n\n\t\t\t\t// Append query results to every item and append all to link\n\t\t\t\t$title.append(json[1][i].toUpperCase());\n\t\t\t\t$text.append(json[2][i]);\n\t\t\t\t$link.attr('href', json[3][i]);\n\t\t\t\t$span.attr(\"data-hover\", json[1][i]);\n\n\t\t\t\t// Here we build the clickeable block\n\t\t\t\t$div.append($title, $text);\n\t\t\t\t$span.append($div)\n\t\t\t\t$link.append($span);\n\t\t\t\t$(\"#div1\").append($link);\n\t\t\t}\n\t\t});\n\t}", "function getSearches() {\n storedSearches = JSON.parse(localStorage.getItem(\"Search Term\"));\n if (!storedSearches) {\n savedST = [];\n } else {\n savedST = storedSearches;\n STSavedSearches();\n }\n}", "handleSearchResults(results) {\n console.log(results);\n // search actually took place and checked for specific results\n if (results.some(group => group.matches)) {\n console.log(results.map(group => group.matches?.map(match => match.value)));\n // save local filteredTaskLists\n this.filteredTaskLists = results.map(group => this.getTaskList(group));\n }\n // search was initialized or cleared, so return all data\n else {\n this.filteredTaskLists = this.allData.data.currentProject.taskLists;\n }\n\n }", "function searchDocuments(searchTerm, res){\r\n var results;\r\n var searchResults = \"No results found\"\r\n MongoClient.connect(url, function(err, client){\r\n if (err) throw err;\r\n var collection = client.db('info30005').collection('info30005');\r\n \r\n collection.find( { $text: { $search: searchTerm } }).toArray(function(err, results){\r\n //console.log(results);\r\n client.close();\r\n var searchResults = generateSearchTable(results);\r\n res.render('pages/search', { myVar : searchTerm , searchResults : searchResults});\r\n });\r\n\r\n })\r\n}", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "async search(query, options = {}) {\n return await this.fetch(\"/search/byterm\", {\n q: query,\n max: options.max ?? 25,\n clean: Boolean(options.clean),\n fulltext: Boolean(options.fulltext),\n });\n }", "static async search(query) {\n const res = await this.request(`search`, { query });\n return res;\n }", "function fetchResults(){\n \t\n \tvar obj = new Object();\n \tobj.search = searchString;\n \t\n \t$.ajax({\n\t type : 'get',\n\t url : 'http://localhost:8080/MyAwesomeApp/SearchServlet',\n\t dataType: 'JSON',\n\t data : {input : JSON.stringify(obj)} ,\n\t success : function(response) {\n\t \t\n\t //parse json feedback\n\t if(response != \"[]\"){\n\t \tresponse = JSON.parse(response);\n\t \t\t \t\n\t \tfor(i = 0; i < response.length; i++){\n\t \t\t\n \t\t\t//remove name spaces, append as id. add info to box\n \t\t\tstr = response[i][\"bookName\"];\n \t\t\tvar book = $('<option id='+response[i][\"bookId\"]+' style=\"margin-bottom: 2%;\">'+str+'</option>'); \n \t\t\t\n \t\t\t//add to select box\n\t $('#booksBoxInfo').append(book);\t \t\t \t \t\t\n\t \t}\n\t }\n\t \n\t },\n\t error: function() {\n\t $('#ajaxGetUserServletResponse').text('An error occurred');\n\t }\n\t }); \n }", "search() {\n axios\n .get(this.moviesUrl + this.querySearch)\n .then(resp => {\n this.response = resp.data;\n this.moviesRes = this.response.results;\n })\n }", "async getAllResults(req, res, next) {\n try {\n const results = await resultsService.getAllResults()\n res.send(results)\n } catch (error) {\n next(error)\n }\n }", "function getResults() {\n\n $.ajax({\n url: '/nytimes_fetch',\n dataType: 'json',\n success: function(data) {\n data.forEach(function(article){\n renderResult(article)\n })\n }\n });\n }", "function displayResults(data){\r\n // remove all past results\r\n $(\".results\").remove();\r\n // lift WikiSearch title to top of page\r\n $(\".titleClass\").css(\"padding-top\",\"0px\");\r\n // show results\r\n \r\n const result = data[\"query\"][\"search\"][0][\"title\"];\r\n // create div for all search results\r\n $(\".searchMenu\").append(\"<div class = 'searchResults results'></div>\");\r\n // main search result title\r\n $(\".searchResults\").append(\"<div class='searchTitle'></div>\");\r\n $(\".searchTitle\").html(\"Search Results for <a target=\\\"_blank\\\" href = \\'https://en.wikipedia.org/wiki/\"+result+\"\\'>\"+result+\"</a>\"); // push titleClass to top of page\r\n \r\n // results\r\n for (var ii =1; ii < data[\"query\"][\"search\"].length -1; ii++){\r\n // create div for each result\r\n $(\".searchResults\").append(\"<div class='key\" + ii + \" result'></div>\");\r\n // append to div\r\n var searchResult = data[\"query\"][\"search\"][ii][\"title\"];\r\n $(\".key\" + ii).append(\"<p class = 'resultTitle'><a target=\\\"_blank\\\" href = \\'https://en.wikipedia.org/wiki/\"+searchResult+\"\\'>\"+searchResult+\"</a></p>\");\r\n $(\".key\"+ii).append(\"<p class = 'resultText'>\" + data[\"query\"][\"search\"][ii][\"snippet\"]+\"...\" + \"</p>\");\r\n }\r\n}" ]
[ "0.7297593", "0.72167414", "0.7154665", "0.70559335", "0.7008465", "0.7007643", "0.69624525", "0.69535667", "0.6947637", "0.6902696", "0.6847962", "0.6824126", "0.67735595", "0.67410344", "0.67110157", "0.66888815", "0.6644403", "0.6642325", "0.66234", "0.66161823", "0.6603917", "0.6563529", "0.6546526", "0.6541147", "0.653089", "0.65278524", "0.6515894", "0.6508033", "0.6504539", "0.65005744", "0.6457108", "0.6415779", "0.64154786", "0.6413149", "0.64092076", "0.6406715", "0.6403377", "0.6396696", "0.63899547", "0.63831806", "0.6379981", "0.6366498", "0.6363561", "0.6355951", "0.63523734", "0.63258994", "0.63251126", "0.6313059", "0.63061464", "0.62667763", "0.62667537", "0.62658787", "0.6263619", "0.6262098", "0.6257013", "0.6248283", "0.62416583", "0.6236547", "0.6228207", "0.6219789", "0.62112707", "0.6205156", "0.62025356", "0.6201888", "0.61907715", "0.61898893", "0.61741483", "0.6168485", "0.61622405", "0.6155432", "0.6155069", "0.61527693", "0.61520237", "0.6150012", "0.61481667", "0.6146359", "0.6145795", "0.61444676", "0.61430997", "0.6141524", "0.6140927", "0.6136763", "0.6134752", "0.61346954", "0.61339855", "0.61302435", "0.6129839", "0.61269355", "0.6123852", "0.6123574", "0.61234313", "0.61195415", "0.6100652", "0.6098064", "0.60908693", "0.60874665", "0.60838217", "0.6076902", "0.60639805", "0.60631746", "0.6057127" ]
0.0
-1
const socket = io.connect(); Function that will get the Streamer's camera
async function startVideo() { console.log("Requesting Local Media"); try { // TODO: Add checking for camera and audio const userMedia = await navigator.mediaDevices.getUserMedia({ audio: false, video: true, }); console.log("Recieved Local Media"); stream = userMedia; videoElementHTML.srcObject = stream; socket.emit("stream_online"); } catch (err) { console.error(`Error getting local media: ${err}`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onLoad() {\n // opens websocket\n function isOpen(ws) {\n return socket.readyState === ws.OPEN;\n }\n //connecting to camera using websocket\n var socket = new WebSocket(\"ws://\" + window.location.host + \"/ws\");\n var img_socket = new WebSocket(\n \"ws://\" + window.location.host + \"/ws_camera_feed\"\n );\n\n // when websocket connected, prints statement in log\n socket.onopen = function () {\n socket.send(\"connected to the SocketServer...\");\n };\n //error message + log handling\n socket.onerror = function (error) {\n appendToLogs(`Error: ${error}`);\n };\n\n // message displayed on log after sensor detects something\n socket.onmessage = function (msg, cb) {\n appendToLogs(msg.data);\n if (cb) cb();\n };\n\n // camera log statement\n img_socket.onmessage = function (msg) {\n $(\"#cam\").attr(\"src\", \"data:image/jpg;base64,\" + msg.data);\n return false;\n };\n\n // displayed when camera mode switched\n $(\"form#camera_mode\").submit(function (event) {\n if (!isOpen(socket)) {\n appendToLogs(\"Already closed socket!\");\n return false;\n }\n sendRequest(\"camera\", c, $(\"#camera_mode_data\").val());\n return false;\n });\n\n // displayed when client disconnected from websocket\n $(\"form#disconnect\").submit(function (event) {\n if (!isOpen(socket)) {\n appendToLogs(\"Already closed socket!\");\n return false;\n }\n appendToLogs(\"Disconnected from the server...\");\n socket.send(\"disconnect_request\");\n return false;\n });\n}", "function startStream () {\n startButton.setAttribute('disabled', true)\n video.addEventListener('canplay', function() {\n videoWidth = video.videoWidth;\n videoHeight = video.videoHeight;\n var duration = video.duration;\n var i = 0;\n\n var interval = setInterval(function() {\n if ((socket == null) || (\"undefined\" === typeof socket)) {\n console.log(\"ROOM NOT CONNECTED >> no avatar broadcast\");\n return;\n }\n context.drawImage(video, 0, 0, 256, 256);\n var dataURL = canvas.toDataURL('image/jpeg', 0.1);\n // console.log(\"created avatar face with \" + dataURL);\n socket.emit(\"avatar-face\", JSON.stringify( {\"socket_id\": socket.id, 'type':'avatar-face', 'imagebuffer': dataURL} ) );\n }, 300);\n });\n navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;\n if (navigator.getUserMedia) {\n navigator.getUserMedia({audio: true, video: { width: 320, height: 240}}, handleVideo, videoError);\n }\n function handleVideo(stream) {\n var video = document.querySelector(\"video\");\n video.src = window.URL.createObjectURL(stream);\n video.volume = 0;\n }\n function videoError(e) {console.log(e);}\n\n // Usually, this would use PubNub Phone WebRTC to do VOIP,\n // This is also availabel as a support mechanism\n document.getElementById('echobutton').addEventListener('click',function() { window.open('https://discord.gg/3j7XYqY','_blank'); });\n }", "function connect(){\n const socket = io(server);\n socket.on('connect', ()=>{\n console.log('connected')\n })\n\n emissionObject ={\n currentName:user.userName,\n currentImg:user.imgUrl,\n date:new Date().getTime,\n message:\"hello world\"\n }\n socket.on(room, (message)=>{\n console.log(`${user.username}: ${user.imgUrl}: ${message}`)\n let textLine = document.createElement(\"li\")\n let image = createImage(user.imgUrl);\n textLine.innerText = `${user.userName}: ${message}`\n textLine.appendChild(image);\n chatbox.appendChild(textLine);\n\n \n }) ;\n\n return socket;\n}", "function displayStaticVideo(cameraName, port) {\n let socket = io.connect('http://127.0.0.1:' + port);\n socket.on('frame', function (data) {\n const base64String = btoa(new Uint8Array(data.buffer).reduce(function(data, byte) {\n return data + String.fromCharCode(byte);\n }, ''));\n if (!$('#block-button-' + cameraName).is(':disabled')) {\n $('#canvas-image-' + cameraName).attr('src', 'data:image/png;base64,' + base64String);\n }\n });\n}", "function startSocketService() {\n\n sockets = initCameraSocketService(config, socketService);\n\n sockets.forEach(function(socket) {\n if (typeof socket !== 'undefined') {\n socket.on('camera:status', updateCameraStatus);\n }\n });\n\n }", "async function startStream() \n {\n \n if (localMediaStream)\n return;\n\n try {\n localMediaStream = await navigator.mediaDevices.getUserMedia({\n video: true,\n audio: true\n });\n\n }\n catch (e) {\n console.error('start camera error', e);\n }\n\n await soupclient.sendStream(localMediaStream);\n\n\n const ret = await window.drawsocket.on_newLocalStream(localMediaStream);\n if( ret != 1 )\n {\n defaultDisplay();\n }\n\n // default display when \n }", "function startSocketService() {\n\n sockets = initCameraSocketService(config, socketService);\n\n sockets.forEach(function(socket) {\n\n socket.on('camera:status', updateCameraStatus);\n\n socket.on('disconnect', disconnectHandler);\n\n socket.on('camera:freespace', updateSizeChart);\n\n });\n\n }", "setupSocket() {\n this.socket = io('/gameroom');\n this.socket.on('connect', () => {\n this.socket.emit('setup_client')\n });\n this.socket.on('packet', this.handleSocketMessages)\n }", "async function connect_camera() {\n\t\ttry {\n\t\t\tlet stream = await navigator.mediaDevices.getUserMedia({\n\t\t\t\tvideo: { facingMode: \"user\" },\n\t\t\t\taudio: false\n\t\t\t});\n\t\t\tvideo_element.srcObject = stream;\n\t\t\tvideo_element.setAttribute('playsinline', true);\n\t\t\tvideo_element.setAttribute('controls', true);\n\t\t\t// remove controls separately\n\t\t\tsetTimeout(function() { video_element.removeAttribute('controls'); });\n\t\t} catch(error) {\n\t\t\tconsole.error(\"Got an error while looking for video camera: \" + error);\n\t\t\treturn null;\n\t\t}\n\t}", "function startStream() {\n let url = 'http://' + ipAddress + '/webcam/?action=stream'\n var video = document.getElementById('video')\n\n video.setAttribute('src', url)\n\n}", "authenticate() { \n this.socket = io(this.protocol + '://' + this.host + ':' + this.port, {\n\t\t\tquery: querystring.stringify({\n\t\t\t\taccess_token: this.token\n\t\t\t}) \n });\n //use minimal resources to run io socket for live rates\n //this.liveRatesSocket = io('/live')\n //this.tablesSocket = io('/tables')\n\n //console.log(this.liveRatesSocket)\n }", "function socketIOinit(io)\n{\n console.log(\"running on port\");\n //python client connects\n io.on('connection',function(socket){\n // socketListeners\n // call this immediately on PC client\n socket.on('registerListener',function(data){\n console.log(\"uid: \" + data['UID']);\n var uuid = data['UID'];\n if (!socketListeners[uuid]) {\n socketListeners[uuid] = [];\n }\n socketListeners[uuid].push(socket);\n });\n\n socket.on('reqFiles',function(data){\n var client = data[\"client\"];\n var dir = data[\"dir\"];\n var file = data[\"file\"];\n console.log(\"req files\");\n requestFilesFromClient(file, dir, client, socket);\n });\n\n socket.on(\"reqEncrypt\",function(data){\n var client = data[\"client\"];\n console.log(\"req encrypt\");\n encrypt(client);\n });\n\n socket.on(\"reqDecrypt\",function(data){\n var client = data[\"client\"];\n console.log(\"req decrypt\");\n decrypt(client);\n });\n\n socket.on(\"reqKeylog\",function(data){\n var client = data[\"client\"];\n console.log(\"req keylog\");\n keylog(client,socket);\n });\n\n socket.on(\"reqWebcam\",function(data){\n var client = data[\"client\"];\n console.log(\"req webcam\");\n webcam(client,socket);\n });\n\n socket.on(\"reqScreenshot\",function(data){\n var client = data[\"client\"];\n console.log(\"req screenshot\");\n screenshot(client,socket);\n });\n\n socket.on(\"reqTTS\",function(data){\n var client = data[\"client\"];\n var text = data[\"text\"];\n console.log(\"req tts\");\n tts(client,text);\n });\n\n });\n}", "_initVideoStream () {\n const getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia ||\n navigator.mozGetUserMedia || navigator.msGetUserMedia\n if (!getUserMedia) {\n throw new Error('Webcam feature not supported! :(')\n }\n\n getUserMedia.call(navigator, { video: true }, (stream) => {\n this._stream = stream\n this._video.onloadedmetadata = this._onVideoReady.bind(this)\n this._video.src = window.URL.createObjectURL(stream)\n }, (err) => {\n throw err\n })\n }", "async function setupCamera() {\n const video = document.getElementById('video')\n video.width = videoWidth\n video.height = videoHeight\n\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n facingMode: 'user',\n width: videoWidth,\n height: videoHeight\n }\n })\n video.srcObject = stream\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video)\n }\n })\n}", "function socket_connect() {\n socket = io('localhost:3000/');\n socket_emitUsername();\n socket_initSocketEventHandlers();\n}", "function connect () {\n window.io = io\n socket = io.connect('http://' + window.location.hostname + ':5000')\n}", "function startClientListener() {\n socketIO.on(\"connection\",(socket)=>{\n console.log(\"New connection. Waiting for device authentication...\");\n\n socket.on(\"device\",(data)=>{\n let type = data.type;\n console.log(\"Device authenticated as \"+type);\n\n switch(type) {\n case \"python\": pythonModule = socket; initializePythonModule(); break;\n case \"esp\": espModules.push(socket); break;\n default: console.log(\"Unknown device type...\");\n }\n });\n });\n}", "function connect() {\n // console.log(io)\n if (!socket)\n socket = io.connect('http://localhost:5000/');\n if(socket !== undefined){\n console.log('Connected to socket...', socket);\n }\n }", "function getCamera(){\n document.getElementById('ownGifs').style.display=\"none\"\n document.getElementById('createGif').style.display=\"none\";\n document.getElementById('camera').style.display=\"inline-block\";\n var video = document.querySelector('video');\n stream = navigator.mediaDevices.getUserMedia(constraints)\n .then(function(mediaStream) {\n video.srcObject = mediaStream;\n video.onloadedmetadata = function(e) {\n video.play(); // Starting reproduce video cam\n };\n recorder = RecordRTC(mediaStream, { \n // disable logs\n disableLogs: true,\n type: \"gif\",\n frameRate: 1,\n width: 360,\n hidden: 240,\n quality: 10});\n })\n .catch(function(err) { \n\n }); // always check for errors at the end.\n\n \n}", "function getSocketFromApp(){\n return io;\n}", "async function setupCamera() {\r\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\r\n throw new Error(\r\n 'Browser API navigator.mediaDevices.getUserMedia not available');\r\n }\r\n\r\n const camera = document.getElementById('camera');\r\n camera.width = cameraWidth;\r\n camera.height = cameraHeight;\r\n\r\n const mobile = isMobile();\r\n\r\n const stream = await navigator.mediaDevices.getUserMedia({\r\n 'audio': false,\r\n 'video': {\r\n facingMode: 'user',\r\n width: mobile ? undefined : cameraWidth,\r\n height: mobile ? undefined : cameraHeight,\r\n },\r\n });\r\n camera.srcObject = stream;\r\n\r\n return new Promise((resolve) => {\r\n camera.onloadedmetadata = () => {\r\n resolve(camera);\r\n };\r\n });\r\n}", "function wsConnect(){\n\n socket = io(\"http://\" + window.location.hostname + \":2345\"); \n\n socket.on('reconnecting',function(){\n // notify the user that he is currently deconnected\n $(\"#status\").html(langs[lang].reconnecting + \"<span id='ellipsisSpan'></span>\");\n startEllipsis();\n });\n socket.on('reconnect',function(){\n stopEllipsis();\n })\n socket.on('connect', function() {\n $(\"#server\").hide();\n $('#waitForConnection').show();\n $(\"#status\").html(langs[lang].connected);\n socket.emit(\"fetch img\");\n });\n\n socket.on('close', function() {\n console.log('disconnected');\n $(\"#server\").show();\n $('#waitForConnection').hide();\n });\n\n socket.on('update img',function(data) {\n grid = data;\n loadFromGrid();\n });\n\n socket.on('update pixel',function(pixel) {\n grid[pixel[0][0]][pixel[0][1]] = pixel[1];\n drawPixel(pixel[0][0],pixel[0][1],pixel[1]);\n });\n\n socket.on('set rot speed',function(rotSpeed){\n $(\"#rotationSpeed\").val(rotSpeed);\n });\n\n // receive a binary Array and transform it to array to finally save it with the library FileSaver\n socket.on('get raw file',function(rawFile){\n // You can't directly use a binary Array, to use it, you have to create a DataView\n var data = new DataView(rawFile);\n var offset = 0;\n var array = new Array(rawFile.byteLength);\n while(offset < rawFile.byteLength)\n {\n //An array isn't a binary array, so, we have to transform uint8 to char \n array[offset] = String.fromCharCode(data.getUint8(offset));\n offset++;\n } \n\n saveAs(new Blob(array),\"sphere.colors\");\n });\n}", "function newConnection(socket) {\n // Log the socket id\n console.log('New connection: ' + socket.id);\n\n // Emit to all other clients except user.\n socket.on('CONNECT_USER', function (userProfile) {\n // For every user add userProfile to object\n connectedUsers[socket.id] = userProfile;\n socket.broadcast.emit('CONNECT_USER', {\n // Send the user profile and socket id to client\n userProfile: userProfile,\n id: socket.id\n });\n });\n\n // When textArea received from client\n socket.on('textArea', sendTextarea);\n\n // When searchField received from client\n socket.on('searchField', sendSearchfield);\n\n // Send searchfield message to all clients\n function sendSearchfield(field) {\n // Api request to Youtube send it to all clients\n io.emit('NEW_VIDEO',\n // EncodeURI Make sure spaces work\n `${(field)}`);\n }\n\n // Send textarea message to all clients\n function sendTextarea(text) {\n io.sockets.emit('textArea', text);\n }\n\n // Client disconnect\n socket.on('disconnect', function () {\n console.log('User disconnected: ' + socket.id);\n // Broadcast to all other clients. Delete the socket.id from the connecter\n socket.broadcast.emit('DISCONNECT_USER', socket.id);\n // Delete the property\n delete connectedUsers[socket.id];\n });\n\n // When video playing received from client\n socket.on('videoPlay', sendPlaying);\n // Send to all client except self\n function sendPlaying() {\n socket.broadcast.emit('videoPlay', true);\n }\n\n // When video pause received from client\n socket.on('videoPause', sendPause);\n // Send to all client except self\n function sendPause() {\n socket.broadcast.emit('videoPause', true);\n }\n}", "function start(server) {\n wss.on('connection', function (ws) {\n // When we get stream data\n ws.on('message', function (data) {\n ws.send(data, { binary: true });\n //socket.broadcast.emit('response', { image: data });\n });\n });\n}", "connect() {\n const protocol = this.config.ssl ? 'wss' : 'ws';\n const url = `${protocol}://${this.config.ip}:${this.config.port}`;\n\n log.debug('Socket - connect()', url);\n\n this.connection = null;\n\n this.connection = io(url, {\n forceNew: true,\n reconnection: false,\n upgrade: false,\n transports: ['websocket'],\n });\n\n // listens for server side errors\n this.connection.on('error', (error) => {\n log.debug('Socket - connect() - error', error);\n });\n\n // listens for websocket connection errors (ie db errors, server down, timeouts)\n this.connection.on('connect_error', (error) => {\n log.debug('Socket - connect() - server connection error', this.config.ip);\n log.error(error);\n\n this.listening = false;\n\n this.game.app.toggleLogin(false);\n this.game.app.sendError(null, 'Could not connect to the game server.');\n });\n\n // listens for socket connection attempts\n this.connection.on('connect', () => {\n log.debug('Socket - connect() - connecting to server', this.config.ip);\n this.listening = true;\n\n this.game.app.updateLoader('Preparing handshake...');\n this.connection.emit('client', {\n gVer: this.config.version,\n cType: 'HTML5',\n });\n });\n\n // listens for server side messages\n this.connection.on('message', (message) => {\n log.debug('Socket - connect() - message', message);\n this.receive(message);\n });\n\n // listens for a disconnect\n this.connection.on('disconnect', () => {\n log.debug('Socket - connect() - disconnecting');\n this.game.handleDisconnection();\n });\n }", "async function setupCamera() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n throw new Error(\n 'Browser API navigator.mediaDevices.getUserMedia not available');\n }\n\n const video = document.getElementById('webcam-video');\n video.width = videoWidth;\n video.height = videoHeight;\n\n // const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: videoWidth,\n height: videoHeight,\n },\n });\n video.srcObject = stream;\n\n return new Promise((resolve) => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n}", "function start(isCaller) {\n peerConnection = new RTCPeerConnection();\n\n // send any ice candidates to the other peer\n peerConnection.onicecandidate = evt => {\n socket.emit('new peer candidate', evt.candidate);\n };\n\n // once remote stream arrives, show it in the remote video element\n peerConnection.onaddstream = evt => {\n console.log(`evt.stream: ${evt.stream.id}`);\n remoteVideo.srcObject = evt.stream;\n };\n\n // get the local stream, show it in the local video element and send it\n navigator.getUserMedia(\n configuration,\n stream => {\n localVideo.srcObject = stream;\n console.log(`stream id: ${stream.id}`);\n peerConnection.addStream(stream);\n\n if (isCaller) {\n peerConnection.createOffer(gotDescription, err => {\n console.log(err);\n });\n } else {\n peerConnection.createAnswer(gotDescription, err => {\n console.log(err);\n });\n }\n },\n err => {\n console.log(err);\n }\n );\n}", "function importWebcamStream() {\n let constraints = {\n video: {\n mandatory: {\n minWidth: width,\n minHeight: height,\n },\n optional: [{ maxFrameRate: 24 }],\n },\n audio: true,\n };\n createCapture(constraints, function (stream) {\n console.log(stream);\n });\n}", "function cam() {\n snapBtn.addEventListener('click', enroll);\n // detectButton.addEventListener('click', detect);\n navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n width: 500,\n height: 500\n }\n })\n .then(stream => {\n video.srcObject = stream;\n video.onloadedmetadata = video.play()\n })\n .catch(err => console.error(err));\n}", "function getStream() {\n if (mediaStream) {\n mediaStream.getTracks().forEach(track => {\n track.stop();\n });\n }\n var videoSource = videoSelect.value;\n constraints = {\n video: {deviceId: videoSource ? {exact: videoSource} : undefined}\n };\n navigator.mediaDevices.getUserMedia(constraints)\n .then(stream)\n .catch(error => {\n console.log('getUserMedia error: ', error);\n });\n}", "function getStreamAndRecord() {\n navigator.mediaDevices\n .getUserMedia({\n audio: false,\n video: {\n height: { max: 480 },\n },\n })\n .then(function (stream) {\n streamCam = stream;\n unhide(\"contenedor-gif-creado\", \"video\");\n hide(\"msj-2\");\n video.srcObject = stream;\n video.play();\n btnCrear.innerText = \"grabar\";\n btnCrear.setAttribute(\"onclick\", \"grabar()\");\n unhide(btnCrear.id);\n pasoActivo(2);\n recorder = RecordRTC(stream, {\n type: \"gif\",\n width: 360,\n });\n });\n}", "function initSocket() {\n\tg_socket = io.connect(g_server_address, {secure: true});\n}", "function onConnection(socket){\n console.log('connected...');\n}", "async function setupCamera() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n throw new Error(\n 'Browser API navigator.mediaDevices.getUserMedia not available');\n }\n\n const video = document.getElementById('video');\n video.width = videoWidth;\n video.height = videoHeight;\n\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: mobile ? undefined : videoWidth,\n height: mobile ? undefined : videoHeight,\n },\n });\n video.srcObject = stream;\n\n return new Promise((resolve) => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n}", "function getStream() {\n if (mediaStream) {\n mediaStream.getTracks().forEach(track => {\n track.stop();\n });\n }\n var videoSource = videoSelect.value;\n constraints = {\n video: {deviceId: videoSource ? {exact: videoSource} : undefined}\n };\n navigator.mediaDevices.getUserMedia(constraints)\n .then(gotStream)\n .catch(error => {\n console.log('getUserMedia error: ', error);\n });\n}", "function gotSocket()\n{\n const r = window.radioclient;\n\n r.transmitting = true; // Just so that receive will start.\n receive();\n notice(\"Connected.\");\n document.getElementsByClassName('Controls')[0].id = 'ControlsVisible';\n}", "async function init() {\n const constraints = {\n video: {\n width: innerWidth, height: innerHeight\n }\n };\n\n try {\n const stream = await navigator.mediaDevices.getUserMedia(constraints);\n window.stream = stream;\n video.srcObject = stream;\n } catch (e) {\n errorMsgElement.style.display = \"block\";\n if (onMobile()) {\n errorMsgElement.innerHTML = \"Welcome to RiemannWeb! To get started, click the \\\"Upload\\\" button to take a photo.\";\n }\n else {\n errorMsgElement.innerHTML = \"Uh oh, an error has occured starting a live video feed! Please upload an image instead.\";\n }\n snapButton.style.display = \"none\";\n }\n}", "function makeConnection() {\n // peer connection on each browser\n myPeerConnection = new RTCPeerConnection({\n iceServers: [\n {\n urls: [\n \"stun:stun.l.google.com:19302\",\n \"stun:stun1.l.google.com:19302\",\n \"stun:stun2.l.google.com:19302\",\n \"stun:stun3.l.google.com:19302\",\n \"stun:stun4.l.google.com:19302\",\n ],\n },\n ],\n });\n // step 13: addEventListener with icecandidate\n myPeerConnection.addEventListener(\"icecandidate\", handleIce);\n // step 17 : add addstream event \n myPeerConnection.addEventListener(\"addstream\", handleAddStream);\n // console.log(myStream.getTracks())\n // 각 브라우저에서 카메라, 오디오 데이터 스트림을 받아서 myPeerConnnection안에 집어 넣었다.\n myStream.getTracks().forEach(track => myPeerConnection.addTrack(track, myStream))\n}", "initSocket(socket){\n\t\tsocket.on('connect', (value)=>{\n\t\t\tconsole.log(\"Connected\");\n\t\t})\n\t\tsocket.on('disconnect', this.reconnectUserInfo)\n\t}", "async connect() {\n this._mav = await this._getMavlinkInstance();\n this._socket = await this._getSocket();\n this._registerMessageListener();\n this._registerSocketListener();\n }", "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\n // Insert sockets below\n require('../api/thing/thing.socket').register(socket);\n }", "initSocket() {\n const channels = this.get('channels');\n const pusher = this.get('pusher');\n const node = this.get('nodeId');\n const sensors = this.get('sensorMap').keys();\n\n for (const channel of channels) {\n pusher.unsubscribe(channel);\n }\n\n for (const sensor of sensors) {\n const channel = `private-${NETWORK};${node};${sensor}`;\n pusher.subscribe(channel, this.appendObservation.bind(this));\n channels.push(channel);\n }\n }", "function initialize() {\n key = (new URLSearchParams(window.location.search)).get('key') || null;\n // Create own peer object with connection to shared PeerJS server\n peer = new Peer(key, { host: 'obsp2pwebcanstream.herokuapp.com', secure:true, port:443, key: 'peerjs', debug: 3, path: '/peer'});\n //peer = new Peer(key, { });\n console.log(peer);\n\n peer.on('call', call => {\n const startChat = async () => {\n const localStream = await navigator.mediaDevices.getUserMedia(constraints);\n videoLocal.srcObject = localStream;\n call.answer(localStream);\n call.on('stream', remoteStream => {\n videoRemote.srcObject = remoteStream;\n })\n };\n startChat()\n });\n\n peer.on('open', function (id) {\n // Workaround for peer.reconnect deleting previous id\n if (peer.id === null) {\n console.log('Received null id from peer open');\n peer.id = lastPeerId;\n } else {\n lastPeerId = peer.id;\n }\n\n console.log(recvId, 'ID: ' + peer.id);\n recvId.innerHTML = \"ID: \" + peer.id;\n status.innerHTML = \"Awaiting connection...\";\n });\n peer.on('connection', function (c) {\n // Allow only a single connection\n if (conn) {\n c.on('open', function () {\n c.send(\"Already connected to another client\");\n /*setTimeout(function () {\n c.close();\n }, 500);*/\n });\n return;\n }\n\n conn = c;\n console.log(\"Connected to: \" + conn.peer);\n status.innerHTML = \"Connected\"\n ready();\n });\n peer.on('disconnected', function () {\n status.innerHTML = \"Connection lost. Please reconnect\";\n console.log('Connection lost. Please reconnect');\n\n // Workaround for peer.reconnect deleting previous id\n peer.id = lastPeerId;\n peer._lastServerId = lastPeerId;\n peer.reconnect();\n });\n peer.on('close', function () {\n conn = null;\n status.innerHTML = \"Connection destroyed. Please refresh\";\n console.log('Connection destroyed');\n });\n peer.on('error', function (err) {\n console.log(err);\n status.innerHTML = err;\n });\n }", "function connect() {\n\n socket.emit(\"resetMeeteing\");\n $.getJSON(url, function(data) {\n socket.emit(\"takeControl\",userName);\n identity = data.identity;\n \n // Bind button to join Room.\n \n roomName = \"Lobby\"\n\n log(\"Joining room '\" + roomName + \"'...\");\n var connectOptions = {\n name: roomName,\n logLevel: \"error\",\n video:{width:600},\n audio:true\n\n };\n\n if (previewTracks) {\n connectOptions.tracks = previewTracks;\n }\n\n // Join the Room with the token from the server and the\n // LocalParticipant's Tracks.\n Video.connect(data.token, connectOptions).then(roomJoined, function(error) {\n log(\"Could not connect to Twilio: \" + error.message);\n });\n });\n}", "function onConnect(socket, io) {\n var channel = 'none';\n\n clients[socket.id] = true;\n console.log('socket', socket.id);\n setTimeout(function() {\n io.sockets.in(channel).emit('clients', JSON.stringify(clients));\n }, 1000);\n // When the client emits 'info', this listens and executes\n socket.on('info', function (data) {\n console.info('[%s] %s', socket.address, JSON.stringify(data, null, 2));\n });\n\n //\n socket.on('channel', function(_channel) {\n socket.join(_channel);\n channel = _channel;\n console.log('channel', channel);\n });\n socket.on('keydown', function(data){\n socket.broadcast.in(channel).emit('keydown', data);\n });\n socket.on('keyup', function(data){\n socket.broadcast.in(channel).emit('keyup', data);\n });\n socket.on('fadeDuration', function (val) {\n socket.broadcast.in(channel).emit('fadeDuration', val);\n });\n socket.on('transform', function(str){\n var data = JSON.parse(str);\n io.sockets.connected[data.clientID] && io.sockets.connected[data.clientID].in(channel).emit('transform', data);\n });\n\n}", "function socketInit() {\r\n\tsocket = io();\r\n\r\n\tsocket.on('message', parsedMessage => {\r\n\t\tconsole.info('Received message: ' + parsedMessage.id);\r\n\r\n\t\tswitch (parsedMessage.id) {\r\n\t\t\t//event for self user, when he leaves the room\r\n\t\t\tcase 'disconn':\r\n\t\t\t\tparticipants[userId].disposeSelf();\r\n\t\t\t\tsocket.close();\r\n\t\t\t\tbreak;\r\n\t\t\t// event for new user to connect to KMS and register other users in room\r\n\t\t\tcase 'existingParticipants':\r\n\t\t\t\tonExistingParticipants(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event for other users to register new participant\r\n\t\t\tcase 'newParticipantArrived':\r\n\t\t\t\tonNewParticipant(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event for other users to register the leaving of user\r\n\t\t\tcase 'participantLeft':\r\n\t\t\t\tonParticipantLeft(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event to register answers : user-KMS and user-user\r\n\t\t\tcase 'receiveVideoAnswer':\r\n\t\t\t\treceiveVideoResponse(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event for exchanging ICE candidates between WebRTC peers\r\n\t\t\tcase 'iceCandidate':\r\n\t\t\t\tparticipants[parsedMessage.userId].rtcPeer.addIceCandidate(parsedMessage.candidate, function (error) {\r\n\t\t\t\t\tif (error) {\r\n\t\t\t\t\t\tconsole.error(\"Error adding candidate: \" + error);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase'chat message':\r\n\t\t\t\treceiveChatMessage(parsedMessage);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// event for new user to receive a response of moderator\r\n\t\t\tcase 'moderatorResponse':\r\n\t\t\t\tmoderatorResponse(parsedMessage.accepted, socket);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'videoDisabled':\r\n\t\t\t\tputNameOverVideo(document.getElementById(parsedMessage.userId));\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'videoEnabled':\r\n\t\t\t\tputVideoOverName(document.getElementById(parsedMessage.userId));\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\t// event fired when moderator enters the room or if the moderator is not available\r\n\tsocket.on('onEnterNotification', error => {\r\n\t\tif (error === null) {\r\n\t\t\tenter('moderator');\r\n\t\t} else {\r\n\t\t\talert(error);\r\n\t\t}\r\n\t});\r\n\t// event for requesting permission from the moderator to log in a new user\r\n\tsocket.on('requestForModerator', (socketId, fullName) => {\r\n\t\tlet data = {\r\n\t\t\tid: 'moderatorResponse',\r\n\t\t\tuserId: socketId,\r\n\t\t\taccepted: false\r\n\t\t}\r\n\r\n\t\taddModal(fullName, (modalId) => {\r\n\t\t\tdata.accepted = true;\r\n\t\t\tdocument.getElementById(modalId).remove();\r\n\t\t\tsendMessage(data);\r\n\t\t}, (modalId) => {\r\n\t\t\tdocument.getElementById(modalId).remove();\r\n\t\t\tsendMessage(data);\r\n\t\t});\r\n\r\n\t});\r\n\tsocket.on('waitModeratorResponse', () => {\r\n\t\talert('Please wait until moderator accepts your entry');\r\n\t});\r\n}", "async function setupCamera() {\n const video = document.getElementById('video');\n video.width = maxVideoSize;\n video.height = maxVideoSize;\n\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'environment',\n width: mobile ? undefined : maxVideoSize,\n height: mobile ? undefined: maxVideoSize}\n });\n video.srcObject = stream;\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n } else {\n const errorMessage = \"This browser does not support video capture, or this device does not have a camera\";\n alert(errorMessage);\n return Promise.reject(errorMessage);\n }\n}", "async function setupCamera() {\n const video = document.getElementById('video');\n video.width = maxVideoSize;\n video.height = maxVideoSize;\n\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: mobile ? undefined : maxVideoSize,\n height: mobile ? undefined: maxVideoSize}\n });\n video.srcObject = stream;\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n } else {\n const errorMessage = \"This browser does not support video capture, or this device does not have a camera\";\n alert(errorMessage);\n return Promise.reject(errorMessage);\n }\n}", "constructor() {\n this.io = require('socket.io')();\n }", "init(data){\r\n //Receive the socket\r\n this.socket = data.socket;\r\n //Send to SERVER the information that I'm playing \r\n this.socket.emit('playerStartLevel1', data.texture);\r\n this.texture = data.texture;\r\n }", "function gotStream(stream) {\n console.log('getUserMedia() got stream: ', stream);\n mediaStream = stream;\n video.srcObject = stream;\n video.classList.remove('hidden');\n imageCapture = new ImageCapture(stream.getVideoTracks()[0]);\n getCapabilities();\n}", "function gotStream(stream) {\n console.log('getUserMedia() got stream: ', stream);\n mediaStream = stream;\n video.srcObject = stream;\n video.classList.remove('hidden');\n imageCapture = new ImageCapture(stream.getVideoTracks()[0]);\n getCapabilities();\n}", "function change_camera(cam_id){\n current_ip_cam = ip_addr_cam[cam_id];\n if (ROS_connected){\n let change_camera = new ROSLIB.Topic({\n ros : window.ros,\n name : '/rtsp_driver_node/camera_switch',\n messageType : 'std_msgs/String',\n queue_size : 1,\n });\n\n let new_camera = new ROSLIB.Message({\n data : \"rtsp://\"+current_ip_cam+\":554/s0\"\n });\n change_camera.publish(new_camera)\n }\n }", "function connect() {\n $scope.socket = io.connect(constants.backendUrlEcran);\n\n $scope.socket.io.on('connect_error', function (err) {\n console.log('Error connecting to server');\n });\n }", "function _buildSocketDest(){var model=UIModel.getInstance();var socketDest=model.applicationSettings.socketDest;socketDest=model.socketProtocol+model.authenticateRequest.socketUrl;socketDest+=\":\"+model.authenticateRequest.socketPort;socketDest+=\"?access_token=\"+model.authenticateRequest.accessToken;socketDest+=\"&agent_id=\"+model.agentSettings.agentId;model.applicationSettings.socketDest=socketDest;// seems redundant, but needed to update value on model\nreturn socketDest;}// connect socket, setup socket event listeners", "function Call() {\n\n if (!isWebRTCSupported) {\n alert(\"error: This browser seems not supported WebRTC!\");\n return;\n }\n\n console.log(\"Connecting to server\");\n socket = io(server);\n \n // once access given, join the channel\n socket.on(\"connect\", () => {\n console.log(\"Connected to server\");\n if (myMediaStream) joinToChannel(); \n else setupMyMedia(() => { start(); });\n });\n\n\n // server sends out 'add' signals to each pair of users in the channel \n socket.on(\"add\", (config) => {\n\n let peer_id = config.peer_id;\n let peers = config.peers;\n\n if (peer_id in connections) return;\n if (config.iceServers) iceServers = config.iceServers;\n\n connection = new RTCPeerConnection({ iceServers: iceServers });\n connections[peer_id] = connection;\n\n msgerAddPeers(peers);\n participantAddPeers(peers);\n\n connections[peer_id].onicecandidate = (event) => {\n if (event.candidate) {\n socket.emit(\"ICE\", { \n peer_id: peer_id, \n ice_candidate: { \n sdpMLineIndex: event.candidate.sdpMLineIndex, \n candidate: event.candidate.candidate, \n address: event.candidate.address, \n }, \n });\n } \n };\n\n let ontrackCount = 0;\n connections[peer_id].ontrack = (event) => {\n ontrackCount++;\n if (ontrackCount === 2) loadOthersMediaStream(event, peers, peer_id); // audio + video\n };\n myMediaStream.getTracks().forEach((track) => { connections[peer_id].addTrack(track, myMediaStream); });\n\n // RTC Data Channel\n connections[peer_id].ondatachannel = (event) => {\n console.log(\"Datachannel event \" + peer_id, event);\n event.channel.onmessage = (msg) => {\n switch (event.channel.label) {\n case \"chat_channel\":\n let message = {};\n try {\n message = JSON.parse(msg.data);\n ChatChannel(message);\n } \n catch (err) {\n console.log(err);\n }\n break;\n case \"file_channel\":\n FileChannel(msg.data);\n break;\n }\n };\n };\n createChatChannel(peer_id);\n createFileChannel(peer_id);\n\n if (config.should_create_offer) {\n\n console.log(\"creating RTC offer to\", peer_id);\n connections[peer_id].createOffer()\n .then((local_description) => {\n console.log(\"local offer description is\", local_description);\n connections[peer_id].setLocalDescription(local_description)\n .then(() => {\n socket.emit(\"SDP\", { peer_id: peer_id, session_description: local_description, });\n console.log(\"offer setLocalDescription done!\");\n })\n .catch((err) => {\n console.error(\"error: offer setLocalDescription\", err);\n alert(\"error: offer setLocalDescription failed \" + err);\n });\n })\n .catch((err) => {\n console.error(\"error: sending offer\", err);\n });\n }\n\n });\n\n \n socket.on(\"sessionDescription\", (config) => {\n\n let peer_id = config.peer_id;\n let remote_description = config.session_description;\n let description = new RTCSessionDescription(remote_description);\n\n connections[peer_id].setRemoteDescription(description)\n .then(() => {\n console.log(\"setRemoteDescription done!\");\n if (remote_description.type == \"offer\") {\n console.log(\"creating answer\");\n connections[peer_id].createAnswer()\n .then((local_description) => {\n console.log(\"answer description is: \", local_description);\n connections[peer_id].setLocalDescription(local_description)\n .then(() => {\n socket.emit(\"SDP\", { peer_id: peer_id, session_description: local_description, });\n console.log(\"answer setLocalDescription done!\");\n })\n .catch((err) => {\n console.error(\"error: answer setLocalDescription\", err);\n alert(\"error: answer setLocalDescription failed \" + err);\n });\n })\n .catch((err) => {\n console.error(\"error: creating answer\", err);\n });\n } \n })\n .catch((err) => {\n console.error(\"error: setRemoteDescription\", err);\n });\n });\n\n\n socket.on(\"iceCandidate\", (config) => {\n\n let peer_id = config.peer_id;\n let ice_candidate = config.ice_candidate;\n connections[peer_id]\n .addIceCandidate(new RTCIceCandidate(ice_candidate))\n .catch((err) => {\n console.error(\"Error addIceCandidate\", err);\n alert(\"error: addIceCandidate failed \" + err);\n });\n });\n\n \n // remove all connections\n socket.on(\"disconnect\", () => {\n\n console.log(\"Disconnected from server\");\n for (let peer_id in mediaElements) {\n document.body.removeChild(mediaElements[peer_id].parentNode);\n setVideos();\n }\n for (let peer_id in connections) {\n connections[peer_id].close();\n msgerRemovePeer(peer_id);\n participantRemovePeer(peer_id);\n }\n chatChannels = {};\n fileChannels = {};\n connections = {};\n mediaElements = {};\n });\n\n \n // 'remove' signal is passed to all the users and the media channels open for that peer are deleted\n socket.on(\"remove\", (config) => {\n\n console.log(\"Server said to remove peer:\", config);\n let peer_id = config.peer_id;\n if (peer_id in mediaElements) {\n document.body.removeChild(mediaElements[peer_id].parentNode);\n setVideos();\n }\n if (peer_id in connections) connections[peer_id].close();\n\n msgerRemovePeer(peer_id);\n participantRemovePeer(peer_id);\n\n delete chatChannels[peer_id];\n delete fileChannels[peer_id];\n delete connections[peer_id];\n delete mediaElements[peer_id];\n });\n\n\n socket.on(\"status\", setPeerStatus);\n socket.on(\"muteEveryone\", setMyAudioOff);\n socket.on(\"hideEveryone\", setMyVideoOff);\n socket.on(\"kickOut\", kickedOut);\n socket.on(\"fileInfo\", startDownload);\n\n} // end Call", "openConnection() {\n\n this.socket = io()\n\n this.socket.on('Welcome', data => {\n this.username = data.username\n this.avatar = data.avatar\n })\n\n this.socket.on('chatMessageFromServer', (data) => { // arrow function keeps \"this.\" from changing \n\n // alert(data.message) // debug +++\n\n this.displayMessageFromServer(data)\n\n })\n\n }", "function handleCapture(MediaStream) {\n var recordedChunks = [];\n // Create socket connection using socket.io\n var socketio = io(socketConnectionUrl,{\n 'reconnectionDelay': 1000,\n 'reconnectionDelayMax' : 5000,\n 'reconnectionAttempts': 5\n });\n // set to arraybuffer because data need to send would be an arraybuffer\n socketio.binaryType = 'arraybuffer';\n\n // Set the timestamp as a file name and send to server\n var id = new Date().getTime();\n socketio.emit('action', `{\"status\":\"start\",\"fileName\":\"${id}\"}`);\n\n // create HTML5 mediaRecorder object and pass stream to that.\n var mediaRecorder = new MediaRecorder(MediaStream, {mimeType: 'video/webm'});\n // Start collecting the stream\n mediaRecorder.start();\n // ondataavailable event executed when it recive the stream\n mediaRecorder.ondataavailable = function(event) {\n if (event.data.size > 0) {\n // push blob to recordedChunks array\n recordedChunks.push(event.data);\n }\n };\n\n /*\n interval function execute every 5 seconds send the collected blob objects inside recordedChunks\n to the server\n */\n var sendRecordingInterval = setInterval(function(){\n if(recordedChunks.length>0){\n var tempChunks = [...recordedChunks];\n // clear recordedChunks array\n recordedChunks = [];\n //Convert blob object to array buffer.\n blobToArrayBufferConverter(tempChunks,function(arrBuffer){\n // send array buffer to server\n socketio.emit('message', arrBuffer);\n });\n }\n },5000);\n\n\n /*\n -Interval function check every time is status is set to stop . if yes\n -then stop the mediaRecorder and send remaining collected blob inside recordedChunks to server\n -and disconnect the connection\n */\n var checkRecorderStatus = setInterval(function() {\n if (statusObj.getStatus() == \"stop\") {\n clearInterval(checkRecorderStatus);\n MediaStream.getVideoTracks()[0].stop();\n mediaRecorder.stop();\n clearInterval(sendRecordingInterval);\n if(recordedChunks.length>0){\n blobToArrayBufferConverter(recordedChunks,function(arrBuffer){\n socketio.emit('message', arrBuffer);\n });\n recordedChunks = [];\n socketio.disconnect();\n }\n }\n }, 100);\n }", "function init() {\n socket.on('connect', function() {\n console.log(\"Connected\");\n });\n\n socket.on('disconnect', function() {\n console.log(\"Connection closed\");\n });\n \n socket.on('person_name', function(message) {\n if(message !== initialName) {\n speak(generateGreetingMessage(message));\n initialName = message;\n }\n });\n \n socket.on('face_coordinates', function(coordinates) {\n if (coordinates.status == 'SUCCESS') {\n let left = coordinates.left;\n let top = coordinates.top;\n let width = coordinates.right - coordinates.left;\n let height = coordinates.bottom - coordinates.top;\n rectangleCoordinates = { left, top, width, height };\n } else {\n rectangleCoordinates = null;\n }\n });\n}", "init() {\n this.io.on('connection', function (socket) {\n /**\n * Triggered when a socket disconnects\n */\n socket.on('disconnect', function () {\n console.log(`[SOCKET] Client disconnected! ID: ${socket.id}`);\n });\n\n console.log(`[SOCKET] New client connected! ID: ${socket.id}`);\n });\n\n /**\n * Start listening on the right port/host for the Socket.IO server\n */\n console.log('[SYSTEM] Socket.IO started !');\n }", "function receiveStream(stream,elemid){\n\n var video=document.getElementById(elemid);\n\n video.srcObject=stream;\n\n window.peer_stream=stream;\n\n}", "function connectStream() {\n\n navigator.getUserMedia({\n audio: true,\n video: false\n },\n function(stream) {\n let input = audioContext.createMediaStreamSource(stream);\n input.connect(submixGain);\n },\n function(e) {\n console.log('No live audio input: ' + e)\n }\n )\n}", "function createCameraStream(uid) {\n var localStream = AgoraRTC.createStream({\n streamID: uid,\n audio: true,\n video: true,\n screen: false\n });\n localStream.setVideoProfile(cameraVideoProfile);\n localStream.init(function () {\n console.log(\"getUserMedia successfully\");\n // TODO: add check for other streams. play local stream full size if alone in channel\n localStream.play('local-video'); // play the given stream within the local-video div\n\n // publish local stream\n client.publish(localStream, function (err) {\n console.log(\"[ERROR] : publish local stream error: \" + err);\n });\n\n enableUiControls(localStream); // move after testing\n localStreams.camera.stream = localStream; // keep track of the camera stream for later\n }, function (err) {\n console.log(\"[ERROR] : getUserMedia failed\", err);\n });\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\n // Socket register\n require('../streams/tweets/tweets.events').register(socket);\n\n}", "function startVideo(){\n //gets the webcam, takes object as the first param, video is key, empty object as param\n navigator.getUserMedia(\n {video: {}},\n //whats coming from our webcam, setting it as source\n stream =>video.srcObject = stream,\n err => console.log(err))\n}", "function openWebSocket() {\n websocket = new WebSocket(host);\n\n websocket.onopen = function(evt) {\n //writeToScreen(\"Websocket Connected\");\n websocket.send(\"cam-start\");\n //refreshStream();\n\n };\n\n websocket.onmessage = function(evt) {\n\n\n\n\n var message = JSON.parse(evt.data);\n var data = ab2str(message.data);\n\n console.log(data);\n if (data === \"255\") {\n writeToScreen('<span style = \"color: red;\">Error Incoming Collision Detected!</span>', true);\n } else {\n //writeToScreen('<span style = \"color: blue;\">RECEIVE: ' + data + '</span>');\n }\n\n };\n\n websocket.onerror = function(evt) {\n writeToScreen('<span style=\"color: red;\">ERROR:</span> ' + evt.data);\n };\n\n websocket.onclose = function (p1) {\n websocket.send('cam-stop');\n }\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\n var id=socket.decoded_token;\n\n //Join own room\n socket.join(id._id);\n\n // Insert sockets below\n require('../api/room/room.socket').register(socket,id);\n require('../api/thing/thing.socket').register(socket);\n\n}", "async function getStreamAndRecord() {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: false,\n video: true,\n })\n\n // utilizo stream como src y empiezo a reproducir\n video.srcObject = stream;\n await video.play();\n\n return stream;\n\n } catch (error) {\n console.error(error);\n }\n}", "function gotRemoteMediaStream(Event)\n{\n\n const mediaStream = event.stream;\n remoteVideo.srcObject = mediaStream;\n remoteStream = mediaStream;\n trace('Remote peer connection received remote stream.');\n\n Android.showToast();\n\n\n}", "function onConnect(socket) {\n // When the client emits 'info', this listens and executes\n socket.on('info', function (data) {\n console.info('[%s] %s', socket.address, JSON.stringify(data, null, 2));\n });\n\n //When the document is delete(active status is changed) 'Document:Delete' is emitted\n socket.on('Document:Delete', function (data) {\n socket.broadcast.emit('Document:Delete', data);\n});\n\n socket.on('onDisconnect', function (data) {\n socket.disconnect();\n });\n require('../api/photo/photo.socket').register(socket);\n require('../api/stamp/stamp.socket').register(socket);\n require('../api/signature/signature.socket').register(socket);\n require('../api/mobilelink/mobilelink.socket').register(socket);\n require('../api/links/links.socket').register(socket);\n require('../api/department/department.socket').register(socket);\n require('../api/otp/otp.socket').register(socket);\n require('../api/folder/folder.socket').register(socket);\n require('../api/document/document.socket').register(socket);\n require('../api/sharingpeople/sharingpeople.socket').register(socket);\n require('../api/notification/notification.socket').register(socket);\n require('../api/chat/chat.socket').register(socket);\n require('../api/onlineuser/onlineuser.socket').register(socket);\n require('../api/comment/comment.socket').register(socket);\n require('../api/fieldvalue/fieldvalue.socket').register(socket);\n require('../api/fieldoption/fieldoption.socket').register(socket);\n require('../api/documentlogs/documentlogs.socket').register(socket);\n require('../api/user/user.socket').register(socket);\n require('../api/favorite/favorite.socket').register(socket);\n}", "async function setupCam() {\n navigator.mediaDevices.getUserMedia({\n video: true\n }).then(mediaStream => {\n vid.srcObject = mediaStream;\n }).catch((error) => {\n console.warn(error);\n });\n await knn.load();\n setTimeout(loop, 50);\n}", "connect (){\n let self = this;\n let options = {\n port: this.port\n };\n var promise = new Promise((resolve) => {\n \n self.socket = SC.connect(options);\n self.socket.on('init', (data) =>{\n resolve(data);\n });\n });\n\n return promise;\n }", "function gotRemoteStream(event){\n // Associate the remote video element with the retrieved stream\n if (window.URL) {\n // Chrome\n remoteVideo.src = window.URL.createObjectURL(event.stream);\n } else {\n // Firefox\n remoteVideo.src = event.stream;\n }\n log(\"Received remote stream\");\n }", "async function initCanvas(sckt, imageUrl, oldImage) {\n socket = sckt;\n userId = document.getElementById('who_you_are').value; // this isn't working for some reason\n room = document.getElementById('roomNo').value;\n\n selectCamera('Room');\n\n //sets up original values for use for each client\n let flag = false,\n prevX, prevY, currX, currY = 0;\n let canvas = $('#canvas');\n cvx = document.getElementById('canvas');\n let img = document.getElementById('image');\n img.src = imageBase;\n ctx = cvx.getContext('2d');\n ctx.save();\n\n // event on the canvas when the mouse is on it\n canvas.on('mousemove mousedown mouseup mouseout', function (e) {\n let color = document.getElementById('colorOptions').value;\n\n prevX = currX;\n prevY = currY;\n currX = e.clientX - canvas.position().left;\n currY = e.clientY - canvas.position().top;\n if (e.type === 'mousedown') {\n flag = true;\n }\n if (e.type === 'mouseup' || e.type === 'mouseout') {\n flag = false;\n }\n // if the flag is up, the movement of the mouse draws on the canvas\n if (e.type === 'mousemove') {\n if (flag) {\n drawOnCanvas(imageBase, ctx, canvas.width, canvas.height, prevX, prevY, currX, currY, color, thickness);\n // draw on the canvas, lets everyone know via socket.io by sending them drawOnCanvas data\n socket.emit('pic', room, canvas.width, canvas.height, prevX, prevY, currX, currY, color, thickness);\n }\n }\n });\n\n // Captures button click for clearing the canvas for everyone in room\n $('.canvas-clear').on('click', function (e) {\n let c_width = canvas.width\n let c_height = canvas.height\n ctx.clearRect(0, 0, c_width, c_height);\n clearAnnotations(imageBase, room);\n img.height = c_height;\n img.width = c_width;\n drawImageScaled(img, cvx, ctx);\n // communicates that a client has cleared the canvas everyone via socket.io\n socket.emit('clear', room)\n });\n\n // Capture event when someone else clears the canvas\n socket.on('clear-display', function (room) {\n let c_width = canvas.width\n let c_height = canvas.height\n ctx.clearRect(0, 0, c_width, c_height);\n clearAnnotations(imageBase, room);\n img.height = c_height;\n img.width = c_width;\n drawImageScaled(img, cvx, ctx);\n });\n\n // capture the event on the socket when someone else is drawing on their canvas (socket.on...)\n socket.on('pic_display', function (room, width, height, x1, y1, x2, y2, color, thickness) {\n //document.getElementById('who_you_are').innerHTML= \"Third test\";\n drawOnCanvas(imageBase, ctx, width, height, x1, y1, x2, y2, color, thickness)\n });\n\n // this is called when the src of the image is loaded\n // this is an async operation as it may take time\n img.addEventListener('load', () => {\n // it takes time before the image size is computed and made available\n // here we wait until the height is set, then we resize the canvas based on the size of the image\n let poll = setInterval(async function () {\n if (img.naturalHeight) {\n clearInterval(poll);\n // resize the canvas\n let ratioX = 1;\n let ratioY = 1;\n // if the screen is smaller than the img size we have to reduce the image to fit\n if (img.clientWidth > window.innerWidth)\n ratioX = window.innerWidth / img.clientWidth;\n if (img.clientHeight > window.innerHeight)\n ratioY = img.clientHeight / window.innerHeight;\n let ratio = Math.min(ratioX, ratioY);\n // resize the canvas to fit the screen and the image\n cvx.width = canvas.width = img.clientWidth * ratio;\n cvx.height = canvas.height = img.clientHeight * ratio;\n // draw the image onto the canvas\n drawImageScaled(img, cvx, ctx);\n // hide the image element as it is not needed\n img.style.display = 'none';\n //Adding past image data to idb for follow checking paths\n await addData({\n 'image': imageBase,\n 'room': document.getElementById('roomNo').value,\n 'annotations': [],\n 'chat': [],\n 'knowledge': [],\n 'previousImage': oldImage,\n 'nextImage': \"\"\n });\n await checkNextPrevious(imageBase);\n\n }\n }, 10);\n });\n\n}", "function getStream(uid) {\n\tvar localStream = AgoraRTC.createStream({\n\t\tstreamID: uid,\n\t\taudio: true,\n\t\tvideo: true,\n\t\tscreen: false,\n\t});\n\tlocalStream.setVideoProfile(Profile);\n\n\tlocalStream.init(\n\t\tfunction () {\n\t\t\t// Add to Grid\n\t\t\tAddRemoteStreamToGrid(localStream);\n\n\t\t\t// publish local stream\n\t\t\tclientinstance.publish(localStream, function (err) {\n\t\t\t\tconsole.log(\"[ERROR] : publish local stream error: \" + err);\n\t\t\t});\n\t\t\t// enables user interface controls on the user's stream\n\t\t\tenableUiControls(localStream);\n\t\t\tStreamsContainer.camera.stream = localStream; // keeps track of the this(camera) stream for later\n\t\t},\n\t\tfunction (err) {\n\t\t\tdocument.getElementById(\"video-icon\").innerHTML = \"videocam_off\";\n\t\t\tdocument.getElementById(\"video-btn\").classList.toggle(\"btn-danger\");\n\t\t\tdocument.getElementById(\"mic-icon\").innerHTML = \"mic_off\";\n\t\t\tdocument.getElementById(\"mic-btn\").classList.toggle(\"btn-danger\");\n\t\t\tdocument.getElementById(\"screen-share-icon\").innerHTML =\n\t\t\t\t\"cancel_presentation\";\n\t\t\tdocument\n\t\t\t\t.getElementById(\"screen-share-btn\")\n\t\t\t\t.classList.toggle(\"btn-danger\");\n\t\t\tconsole.log(\"[ERROR] : getUserMedia failed\", err);\n\t\t}\n\t);\n}", "connect() {\n let socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_3__(`http://192.168.1.17:8080/socket`);\n let stompClient = stompjs__WEBPACK_IMPORTED_MODULE_2__[\"over\"](socket);\n stompClient.debug = null;\n return stompClient;\n }", "function handleUserMedia(stream) {\n console.log('Adding local stream.');\n localVideo.src = window.URL.createObjectURL(stream);\n localStream = stream;\n //sendMessage('got user media');\n //invoke connection with the initiator \n if(!isInitiator){ \n\tvar wheretowhere = '0 '+whoAmI;\n\t\tsocket.emit('connectingPeers', wheretowhere);\n }\n}", "connect() {\n return super.connect().then(() => {\n this.socket.on('disconnect', () => {\n document.body.classList.add('disconnected');\n document.body.classList.remove('gameActive');\n });\n\n this.socket.on('metaDataUpdate', (e) => {\n this.gameEngine.metaData = e;\n this.renderer.onMetaDataUpdate();\n });\n });\n }", "function init (log) {\n// Establish update loop\n const digest = createDigest(io.sockets)\n Observable.timer(0, 15).subscribe(() => {\n eventBus.put('updateAll', {})\n digest.send()\n })\n\n // Set up handlers to consume events from the bus and update the digest\n eventHandlers.forEach(([name, handler]) => {\n eventBus.get(name).subscribe(handler(digest))\n })\n\n // We will process these events when a client sends them\n const clientEvents = ['updateDirection']\n\n // configure websockets\n io.on('connection', socket => {\n socket.on('disconnect', () => {\n log(`User ${player.id} disconnected.`)\n eventBus.put('remove', {\n id: player.id\n })\n })\n\n // create a new player\n const player = saveBlob(createBlob(100, 100, 100))\n log(`User ${player.id} connected.`)\n\n // initialize the client\n socket.emit('initialize', {\n id: player.id,\n location: player.location,\n size: player.size,\n blobs: blobs\n })\n\n // route known events coming in on this socket to the main event bus\n clientEvents.forEach(type => socket.on(type, data => {\n eventBus.put(type, data)\n }))\n\n // let the world know what just happened!\n eventBus.put('newPlayer', player)\n })\n\n // Some error handling. It's unlikely that these will occur but when they do we want\n // to know about it.\n io.on('connect_error', data => {\n log('connect error!', data)\n })\n\n io.on('connect_timeout', () => {\n log('connect timeout!')\n })\n\n io.on('error', data => {\n log('error!', data)\n })\n\n return server\n}", "function connect(){\n\tconsole.log('Attempting to connect to ' + Config.url());\n\tsocket = new io.connect(Config.url());\n\tsocket.on('start',onStart);\n\tsocket.on('disconnect',onDisconnect);\n\tsocket.on('connect',onConnect);\n}", "socketConnect() {\n\t\tthis.socket = io('localhost:4001');\n\t\tthis.socket.on('disconnect', () => {\n\t\t\tthis.socket.open();\n\t\t});\n\t}", "function SocketReadStream(socket, eventName){\n Readable.call(this);\n this.socket=socket;\n this.eventName=eventName;\n var self=this;\n this.socket.once(eventName,function(token){\n self.token=token;\n self.socket.emit(\"socket-ready-\"+token);\n self.socket.on(\"socket-data-\"+token,function(d){\n\n });\n self.socket.on(\"\")\n });\n}", "function gotStream(stream) {\n console.log(\"Adding local stream.\");\n localStream = stream;\n // window.stream = stream;\n localVideo.srcObject = stream;\n sendMessage(\"got user media\", room);\n if (isInitiator) {\n maybeStart();\n }\n}", "function startConnect() {\n socket = io.connect(\"https://online-go.com\", {\n reconnection: true,\n reconnectionDelay: 500,\n reconnectionDelayMax: 60000,\n transports: [\"websocket\"]\n });\n\n // Send authentication info when we're connected\n socket.on('connect', authenticate);\n\n // Finish our prep when we get a gamedata object\n socket.on('game/'+game_id+'/gamedata', finishConnect);\n\n // Pass moves to stdout when we see them\n socket.on('game/'+game_id+'/move', handleMove);\n}", "function RoomSocket(io, roomId){\n this.roomId = roomId;\n this.io = io;\n}", "function cameraStart() {\n cameraView = document.querySelector(\"#webcam\");\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "async function selectMediaStream() {\n try {\n // Working with Screen Capture API.\n // We get our mediastream data.\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n // We pass the mediaStream the user select as video src.\n video.srcObject = mediaStream;\n // When the video has loaded its metadata it's gonna call a function to play the video.\n video.onloadedmetadata = () => {\n video.play();\n }\n } catch (error) {\n console.error(`Whoops, error here: ${error}`);\n }\n}", "function ClientSocket(io, socket){\n this.io = io;\n this.socketId = socket.id;\n\n var _this = this;\n socket.on('playerMove', function(move){\n console.log('playerMove');\n _this.emit('playerMove', move);\n });\n\n socket.on('disconnect', function () {\n _this.emit('disconnect');\n });\n\n socket.on('registerAs', function (role, secret){\n console.log('registerAs');\n _this.emit('registerAs', role, secret);\n });\n\n socket.on('error', function (error) {\n console.error('error on socket.io server:', error);\n });\n}", "function socketConnect(socketio) {\n socketio.on('connection', function (socket) {\n socket.address = socket.handshake.address !== null ?\n socket.handshake.address.address + ':' + socket.handshake.address.port :\n process.env.DOMAIN;\n\n socket.connectedAt = new Date();\n\n // Call onConnect.\n require('../api/card/card.socket').register(socket);\n });\n}", "function handleAddStream(data) {\n console.log(\"got stream from peer\");\n console.log(\"peer stream\", data.stream)\n console.log(\"my stream\", myStream)\n const peerStream = document.getElementById(\"peerFace\");\n peerStream.srcObject = data.stream;\n}", "async function streamVideoRequest() {\n try {\n captureStream = await navigator.mediaDevices.getDisplayMedia();\n videoContainer.srcObject = captureStream;\n videoContainer.onloadedmetadata = () => {\n videoContainer.play();\n };\n } catch (error) {\n console.error(error);\n }\n}", "constructor(socket) {\n super(socket);\n }", "function InitSocketIOConnections() {\n io.on('connection', (socket) => {\n\n // Notify of user connect\n console.info('User connected');\n\n // Widget socket functions\n\n socket.on('fetch_info_bar_messages', (callback) => {\n //console.info('== Server received request to fetch saved messages for info bar widget, fetching messages...');\n fs.readFile('data/info_bar_messages.txt', 'utf8', (err, data) => {\n if (err) {\n console.error(err);\n return;\n }\n //socket.broadcast.emit('info_bar_update_messages', data);\n callback(data);\n //console.info('== Messages fetched, sending the following:\\n' + data);\n });\n });\n\n socket.on('info_bar_new_messages', (msg) => {\n socket.broadcast.emit('info_bar_new_messages', msg);\n //console.info('== Server received request to change info bar messages, sending now the following:\\n' + msg);\n });\n\n socket.on('info_bar_open', () => {\n socket.broadcast.emit('info_bar_open');\n //console.info('== Server received request to open the information bar, opening now...');\n });\n\n socket.on('send_to_chat', (msg) => {\n SendToChat(msg);\n //console.info('== Server received request to send text to the chat, sending now the following:\\n' + msg);\n });\n\n socket.on('start_stream_signal', () => {\n if (!streaming_mode) {\n StartStreamMode();\n //console.info('== Server is now transitioning to streaming mode...')\n }\n });\n\n // Notify of user disconnect\n socket.on('disconnect', () => {\n console.info('User disconnected');\n });\n });\n}", "function proxySocket() {\n\t\tproxyEvents.forEach(function(event){\n\t\t\tsocket.on(event, function(data) {\n\t\t\t\tamplify.publish('socket:'+event, data || null);\n\t\t\t});\n\t\t});\n\t\tsocket.on('connect', function() {\n\t\t\tsocket.emit('subscribe', user.token);\n\t\t\tamplify.publish('socket:connect');\n\t\t});\n\t\n\t}", "_registerSocketListener() {\n this._socket.on('message', (data) => {\n this._mav.parse(data);\n });\n }", "function newConnection(socket) { // create a new socket everytime there is a connection\n\n console.log ('new connetion: ' + socket.id); // print the id of socket cloent\n // when receive mesege called 'mouse', trigger function called MouseMsg\n // just printing data\n socket.on('mouse', mouseMsg);\n\n\n \n}", "async function cameraStart() {\n\n await faceapi.nets.faceLandmark68TinyNet.loadFromUri(\"models\");\n await faceapi.nets.tinyFaceDetector.loadFromUri('models')\n\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "async function setupWebcam() {\n if (navigator.mediaDevices.getUserMedia) {\n const stream = await navigator.mediaDevices.getUserMedia({\n \"audio\": false,\n \"video\": {\n width: {\n min: 640,\n max: 640\n },\n height: {\n min: 480,\n max: 480\n }\n }\n });\n\n webcam.srcObject = stream;\n\n return new Promise((resolve) => {\n webcam.onloadedmetadata = () => {\n webcam.width = stream.getVideoTracks()[0].getSettings().width;\n webcam.height = stream.getVideoTracks()[0].getSettings().height;\n canvas.width = stream.getVideoTracks()[0].getSettings().width;\n canvas.height = stream.getVideoTracks()[0].getSettings().height;\n\n canvasDims = [canvas.height, canvas.width];\n\n resolve(webcam);\n };\n });\n }\n}", "async function selectStream () {\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n video.srcObject = mediaStream;\n video.onloadedmetadata = () => {\n video.play();\n }\n } catch (error) {\n console.log('whoops, error in selectStream function', error)\n }\n}", "setSocket (state, io) {\n Vue.set(state, 'io', io)\n }" ]
[ "0.7234021", "0.7009632", "0.6764083", "0.6715808", "0.6542103", "0.6523225", "0.6460521", "0.6446046", "0.6441944", "0.643081", "0.6361702", "0.62628293", "0.6206829", "0.61739737", "0.6143523", "0.612827", "0.6116145", "0.6101446", "0.60846347", "0.60835785", "0.6079427", "0.60733026", "0.60086226", "0.5984834", "0.5981142", "0.59776735", "0.59741527", "0.5972742", "0.59614897", "0.5958068", "0.59558713", "0.5943963", "0.59305054", "0.5928321", "0.5920151", "0.5909264", "0.58713835", "0.58653486", "0.5857554", "0.5835106", "0.5822693", "0.5819986", "0.5815763", "0.5811576", "0.57944363", "0.5792081", "0.5788422", "0.5780806", "0.57804984", "0.5767696", "0.57617074", "0.57617074", "0.57590455", "0.5757905", "0.5757903", "0.5757628", "0.57520974", "0.5751868", "0.5742742", "0.5738711", "0.57378966", "0.572617", "0.5715987", "0.5710786", "0.57061446", "0.5700417", "0.569708", "0.56923807", "0.5686023", "0.5680973", "0.56776977", "0.5674077", "0.5672489", "0.5669303", "0.56489015", "0.5639451", "0.5636042", "0.5624203", "0.5618814", "0.56157917", "0.5609293", "0.5604452", "0.5603785", "0.56001675", "0.55939543", "0.5592259", "0.55876476", "0.55867416", "0.5575068", "0.5571449", "0.55694836", "0.556772", "0.5565452", "0.5562985", "0.5551748", "0.55425054", "0.5541572", "0.5541394", "0.55411804", "0.55394834" ]
0.59327835
32
Only show the star counter if the number of star is greater than 2
showStarCounter() { const currentBoard = Boards.findOne(Session.get('currentBoard')); return currentBoard && currentBoard.stars >= 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function starCount() {\n if (moves == 22 || moves == 27 || moves == 32) {\n hideStar();\n }\n}", "function starCount() {\n if (moveCount >= starChart4 && moveCount < starChart3) {\n $('.star4').hide();\n starResult = 3;\n\t}\n else if (moveCount >= starChart3 && moveCount < starChart2) {\n $('.star3').hide();\n starResult = 2;\n }\n else if (moveCount >= starChart2) {\n $('.star2').hide();\n starResult = 1;\n }\n}", "function stars() {\n if (counts > 17 && counts < 21) {\n let star = document.getElementsByClassName('fa fa-star')[2];\n star.classList.add('hide');\n } else if (counts > 20) {\n let star = document.getElementsByClassName('fa fa-star')[1];\n star.classList.add('hide');\n }\n}", "function star_number(recruit_star) {\r\n return recruit_star.stars > 2;\r\n }", "function starCount() {\n let stars = document.querySelectorAll('.stars li i');\n\n switch (true) {\n case ( cardMoves >= 24):\n stars[2].classList.add('hide');\n starCounter = 0;\n break;\n case (cardMoves >= 18):\n stars[1].classList.add('hide');\n starCounter = 1;\n break;\n case (cardMoves >= 9):\n stars[0].classList.add('hide');\n starCounter = 2;\n break;\n default:\n starCounter = 3;\n }\n }", "function starRating() {\n if (moves > 13 && moves < 16) {\n starCounter = 3;\n } else if (moves > 17 && moves < 27) {\n starCounter = 2;\n } else if (moves > 28) {\n starCounter = 1;\n }\n showStars(starCounter);\n }", "function starCount () {\n if (counter.textContent == 17) {\n starDown();\n } else if (counter.textContent == 21) {\n starDown();\n } \n}", "function updateStarsDisplay(counter){\n let stars = document.getElementsByClassName(\"fa-star\");\n\n // for every 16 moves (or number of cards), remove a star\n if (counter > 0 && stars.length > 0){\n let penaltyLimit = cards.length + 1; \n let z = counter % penaltyLimit;\n if (z == 0){\n stars[0].classList.add(\"fa-star-o\");\n stars[0].classList.remove(\"fa-star\");\n }\n }\n return stars.length;\n}", "function gameRating(count){\n if (count === 29){\n starCount --;\n document.querySelector('.rating.second').className = 'rating second hidden';\n }else if (count === 39){\n starCount --;\n document.querySelector('.rating.first').className = 'rating first hidden';\n }\n}", "function starsRating() {\n if (moves === 14 || moves === 17 || moves === 24 || moves === 28\n ) { hideStar();\n }\n}", "function starRating() {\n if((score > 9) && (score <= 16)) {\n star3.style.visibility = 'hidden';\n starTally = 2;\n }\n if((score >16) && (score <=28)) {\n star3.style.visibility = 'hidden';\n star2.style.visibility = 'hidden';\n tarTally = 1;\n }\n if(score >28) {\n star3.style.visibility = 'hidden';\n star2.style.visibility = 'hidden';\n star1.style.visibility = 'hidden';\n starTally = 0;\n }\n}", "function starCount() {\n\n if(numMoves < 16) {\n numStars = 3;\n }else if (numMoves >= 16 && numMoves < 25) {\n numStars = 2;\n }else {\n numStars = 1;\n };\n\n printStars();\n}", "function starCount() {\n if (moveCountNum === 20 || moveCountNum === 35) {\n removeStar();\n }\n}", "function showStars() {\n let count;\n if (moveCount < 16) {\n count = 3;\n score = 60;\n } else if (moveCount < 32) {\n count = 2;\n score = 40;\n } else {\n count = 1;\n score = 10;\n }\n for (let i = 0; i < (stars.length - count); i++) {\n stars[i].setAttribute('style', 'display: none');\n }\n}", "function displayStars(count) {\n let starNodes = [...document.querySelectorAll('.fa-star')];\n if (starNodes.length === 3) {\n if (count === 3) {\n starNodes[0].style.visibility = \"\";\n starNodes[1].style.visibility = \"\";\n starNodes[2].style.visibility = \"\";\n } else if (count === 2) {\n starNodes[0].style.visibility = \"\";\n starNodes[1].style.visibility = \"\";\n starNodes[2].style.visibility = \"hidden\";\n } else if (count === 1) {\n starNodes[0].style.visibility = \"\";\n starNodes[1].style.visibility = \"hidden\";\n starNodes[2].style.visibility = \"hidden\";\n } else if (count === 0) {\n starNodes[0].style.visibility = \"hidden\";\n starNodes[1].style.visibility = \"hidden\";\n starNodes[2].style.visibility = \"hidden\";\n }\n }\n }", "function getStars() {\r\n stars = document.querySelectorAll('.stars li');\r\n starCount = 3;\r\n for (star of stars) {\r\n if (star.style.display == 'none') {\r\n --starCount;\r\n }\r\n }\r\n return starCount;\r\n }", "function stars(num){\n var vote = Math.ceil(num/2);\n var star = '';\n for (var i = 0; i < 5; i++){\n if (i <= vote){\n star += '<i class=\"fas fa-star\"></i>';\n } else {\n star += '<i class=\"far fa-star\"></i>';\n }\n }\n return star;\n}", "function countStars() {\n if (moves <= 30) { //star count will be initial value of 3 stars\n document.getElementById(\"oneStar\").style.visibility = 'visible'; //star is visible//\n document.getElementById(\"twoStar\").style.visibility = 'visible'; //star is visible//\n document.getElementById(\"threeStar\").style.visibility = 'visible'; //star is visible//\n document.getElementById(\"oneStar\").style.color = 'green'; //star colour is green//\n document.getElementById(\"twoStar\").style.color = 'green'; //star colour is green//\n document.getElementById(\"threeStar\").style.color = 'green'; //star colour is green//\n } else if (moves > 30 && moves < 50) {\n document.getElementById(\"threeStar\").style.visibility = 'hidden'; //star is hidden\n document.getElementById(\"oneStar\").style.color = 'yellow'; //star colour is yellow//\n document.getElementById(\"twoStar\").style.color = 'yellow'; //star colour is yellow//\n stars = 2; //star count will be 2 stars//\n } else if (moves > 50) {\n document.getElementById(\"twoStar\").style.visibility = 'hidden'; //star is hidden\n document.getElementById(\"threeStar\").style.visibility = 'hidden'; //star is hidden\n document.getElementById(\"oneStar\").style.color = 'red'; //star colour is red//\n stars = 1; //star count will be 1 star//\n }\n }", "function updateScore() {\n $('.moves').text(movesCounter);\n if (movesCounter > 10 && movesCounter <= 15 ) {\n $('#thirdStar').removeClass('fa fa-star');\n $('#thirdStar').addClass('fa fa-star-o');\n starsCounter = 2;\n }\n else if (movesCounter > 15) {\n $('#secondStar').removeClass('fa fa-star');\n $('#secondStar').addClass('fa fa-star-o');\n starsCounter = 1;\n }\n // you should have at least 1 star\n}", "function checkStarRating() {\n\tif (moves < twoStar) {\n\t\treturn ' <i class=\"fa fa-star\"></i> <i class=\"fa fa-star\"></i> <i class=\"fa fa-star\"></i>';\n\t} else if (moves < oneStar) {\n\t\treturn ' <i class=\"fa fa-star\"></i> <i class=\"fa fa-star\"></i>';\n\t} else {\n\t\treturn ' <i class=\"fa fa-star\"></i>';\n\t}\n}", "function starlevel() {\n\tif (movesCount >= 14 && movesCount <= 20) {\n\t\tstarCount = 2;\n\t\tstarSection[2].style.display = \"none\";\n\t}\n\tif (movesCount > 20) {\n\t\tstarCount = 1;\n\t\tstarSection[1].style.display = \"none\";\n\t}\n}", "function showStars(num) {\n const starHtml = '<li class=\"fa fa-star\"></li>';\n stars.innerHTML = \"\";\n for (let i = 0; i < num; i++) {\n stars.innerHTML += starHtml;\n }\n }", "function stars ( number ) {\n var starList = $(\".fa.fa-star\");\n var firstStar = 18;\n var secondStar = 24;\n if (number === firstStar || number === secondStar){\n starList.last().attr(\"class\",\"fa fa-star-o\")\n }\n}", "function getStars() {\n const allStars = document.querySelectorAll('.stars li');\n starCount = 5;\n for (star of stars) {\n if (star.classList.innerHTML =\"starOut\") {\n starCount--;\n }\n }\n}", "function voto(num) {\r\n var num = Math.round(num / 2);\r\n var stars= \"\";\r\n for (var i=1; i<=5; i++) {\r\n if (i<=num) {\r\n var star = '<i class=\"fas fa-star\"></i>';\r\n } else {\r\n var star = '<i class=\"far fa-star\"></i>';\r\n }\r\n stars += star;\r\n }\r\n return stars;\r\n }", "function updateStar() {\n\tlet starCount = 0;\n\tfor(star of allStars) {\n\t\tif(star.hidden === false) {\n\t\t\tstarCount++;\n\t\t}\n\t}\n\treturn starCount;\n}", "function updateStarCounter() {\n\t// when moves counter reaches 20, one star is removed\n\tif (Number(movesMade.innerText) === 20) {\n\t\tlet star = document.querySelector('#star-one').classList.add('none');\n\t}\n\t// when moves counter reaches 29, two stars are removed\n\tif (Number(movesMade.innerText) === 29) {\n\t\tlet star = document.querySelector('#star-two').classList.add('none');\n\t}\n\t//when moves counter is zero, all stars should be shown\n\tif (Number(movesMade.innerText) === 0) {\n\t\tdocument.querySelector('#star-one').classList.remove('none');\n\t\tdocument.querySelector('#star-two').classList.remove('none');\n\t\tdocument.querySelector('#star-three').classList.remove('none');\n\t}\n}", "function starsAppear(number){\r\n var number = Math.ceil(number / 2);\r\n var string = \"\";\r\n\r\n for (var i = 0; i < 5; i++) {\r\n if (i <= number) {\r\n string += \"<i class='fas fa-star'></i>\"\r\n }\r\n else {\r\n string += \"<i class='far fa-star'></i>\"\r\n }\r\n }\r\n return string;\r\n}", "function printStar (num) {\r\n var star = '';\r\n for (var i = 1; i <= 5; i++) {\r\n if( i <= num ) {\r\n star += '<i class=\"fas fa-star\"></i>'; \r\n } else {\r\n star = star + '<i class=\"far fa-star\"></i>';\r\n }\r\n } \r\n return star; \r\n}", "function starScore () {\n if (moves >= 12) {\n stars[3].setAttribute('style', 'visibility: hidden');\n finalStarScore = 3;\n } \n if (moves >= 18) {\n stars[2].setAttribute('style', 'visibility: hidden');\n finalStarScore = 2;\n }\n if (moves >= 25) {\n stars[1].setAttribute('style', 'visibility: hidden');\n finalStarScore = 1;\n }\n}", "function countStars() {\n\n if (moves <= 20) {\n stars = 3;\n } else if (moves <= 25) {\n stars = 2;\n } else {\n stars = 1;\n }\n\n displayStars();\n}", "function scoreStar() {\n if (moveCounter === 18) {\n stars1 = 2 // 2 estrelas\n $('.fa-star').remove()\n $('.stars').append('<li><i class=\"fa fa-star\"></i></li>')\n $('.stars').append('<li><i class=\"fa fa-star\"></i></li>')\n } else if (moveCounter === 22) {\n stars1 = 1 // 1 estrela\n $('.fa-star').remove()\n $('.stars').append('<li><i class=\"fa fa-star\"></i></li>')\n } else if (moveCounter === 29) {\n stars1 = 0 // 0 estrelas\n $('.fa-star').remove()\n }\n return\n}", "function updateStarCount()\n\t{\n\t\tif ( previousCard == null )\n\t\t{\n\t\t\tif ( movesCounter == 20 || movesCounter == 30 )\n\t\t\t{\n\t\t\t\t$('ul.stars li').first().remove();\n\t\t\t}\n\t\t}\t\t\t\t\n\t}", "function displayStars(numS) {\n const stars = document.querySelectorAll('.score-panel .fa-star');\n //reads input and displays correct number of stars\n switch (true) {\n case numS === 1:\n stars[2].parentElement.style.display = 'none';\n stars[1].parentElement.style.display = 'none';\n break;\n case numS === 2:\n stars[2].parentElement.style.display = 'none';\n break;\n }\n}", "function countStars() {\n const closedStar = `<i class=\"fa fa-star\"></i>`;\n const hollowStar = `<i class=\"fa fa-star-o\"></i>`;\n starCount = [];\n\n /* puts stars in an array and removes their li tag */\n for (let i = 0; i <= 2; i++) {\n starCount.push(hollowStar)\n };\n\n /* checks if a closed star is present */\n if (stars.querySelectorAll('.fa-star').length !== 0) {\n for (let i = 0; i <= stars.querySelectorAll('.fa-star').length - 1; i++) {\n starCount.splice(i, 1, closedStar)\n }\n }\n}", "function displayStarsEnd(numS) {\n const stars = document.querySelectorAll('.modal-content .fa-star');\n //reads input and displays correct number of stars\n switch (true) {\n case numS === 1:\n stars[2].parentElement.style.display = 'none';\n stars[1].parentElement.style.display = 'none';\n break;\n case numS === 2:\n stars[2].parentElement.style.display = 'none';\n break;\n }\n}", "function updateStars(){\n for(let star in stars){\n if(counter > 8 && counter < 15){\n stars[2].classList.add('star-colour');\n totalStars = 2;\n }\n if(counter > 16){\n stars[1].classList.add('star-colour');\n totalStars = 1;\n }\n }\n}", "function displayStarRating() {\n const userRating = document.querySelector(\".total-rating\").textContent;\n if (userRating < 10) {\n addProfileStars(1)\n }\n else if (userRating >= 10 && userRating <= 100) {\n addProfileStars(2);\n }\n else if (userRating > 100 && userRating <= 200) {\n addProfileStars(3);\n }\n else if (userRating > 200 && userRating <= 500) {\n addProfileStars(4);\n }\n else {\n addProfileStars(5);\n }\n}", "function starModalCount() {\n const numStars = document.querySelectorAll('.stars li i');\n let starCounter = 0;\n for (let i = 0; i < numStars.length; i++) {\n if (numStars[i].style.display !== 'none') {\n starCounter++;\n }\n }\n let numStarsModal = document.querySelector('.modalStar');\n numStarsModal.innerHTML = \"Stars: \" + starCounter;\n}", "function ratings() {\n\tif(moveCounter > 12 && moveCounter <= 16) {\n\t\tsStar[0].style.cssText = 'opacity: 0';\n\t\tcStar[0].style.cssText = 'display: none';\n\t}\n\tif(moveCounter > 16) {\n\t\tsStar[1].style.cssText = 'opacity: 0';\n\t\tcStar[1].style.cssText = 'display: none';\t\n\t}\n}", "function countMove() {\n moves++;\n count.innerHTML = moves;\n if (moves < 20 && moves > 12) {\n starCount[1].style.display = 'none';\n } else if (moves > 20) {\n starCount[2].style.display = 'none';\n }\n}", "function starCount() {\r\n if (moveCounter === 15) { // when the move counter reaches 10 remove the star\r\n document.querySelector('.fa-star:last-of-type').classList.remove('fa-star');\r\n console.log('drop one star');\r\n } else if (moveCounter === 30) {\r\n document.querySelector('.fa-star:last-of-type').classList.remove('fa-star');\r\n console.log('drop second star');\r\n }\r\n}", "function rating() {\n if (totalClicks <= 29) {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>`;\n } else if (totalClicks >= 30 && totalClicks <= 39) {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>`;\n } else if (totalClicks >= 40) {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\"></i></li>`;\n } else {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>`;\n }\n }", "function displayStars(numFullStars, numHalfStars) {\n var numTotalStars = 5;\n var elementId;\n // add the fa-star, fa-star-half-o, or fa-star-o class OR neutral-color for no reviews yet\n if ((numFullStars == 0) && (numHalfStars == 0)) {\n console.log(\"displayStars(): no reviews yet\");\n return;\n }\n // Replace empty star with full star and add color\n var i;\n for (i = 1; i <= numFullStars; i++) {\n elementId = \"#star-\" + i; \n $(elementId).removeClass(\"fa-star-o\");\n $(elementId).addClass(\"fa-star\");\n $(elementId).addClass(\"star-color\");\n }\n // Replace empty star with half star and add color\n var j = numFullStars + 1;\n numHalfMax = numFullStars + numHalfStars;\n if (numHalfMax > numTotalStars) {\n return false;\n }\n for (j; j <= numHalfMax; j++) {\n elementId = \"#star-\" + j; \n $(elementId).removeClass(\"fa\");\n $(elementId).removeClass(\"fa-star-o\");\n $(elementId).addClass(\"fas\");\n $(elementId).addClass(\"fa-star-half-alt\");\n $(elementId).attr(\"aria-hidden\",\"true\"),\n $(elementId).addClass(\"star-color\");\n }\n // Add color to remaining stars\n var m = numHalfMax + 1;\n while (m <= numTotalStars) { \n elementId = \"#star-\" + m; \n $(elementId).addClass(\"star-color\");\n m = m + 1;\n }\n console.log(\"displayStars(\" + numFullStars + \", \" + numHalfStars + \")\");\n}", "function setStars(numStars){\n let count = 0;\n let indexRating = global.ratingPara.indexOf(\":\") + 2;\n let ratingNum = parseFloat(global.ratingPara.slice(indexRating));\n\n for (let i=0; i < numStars; i++){\n let star = document.createElement(\"span\");\n\n // sets constants representing the minimum and maximum ratings\n const FIVE_STARS = 5;\n const ZERO_STARS = 0;\n\n if(ratingNum == FIVE_STARS){\n star.textContent = \"\\u2605\";\n }\n else if (ratingNum == ZERO_STARS){\n star.textContent = \"\\u2606\";\n }\n else{\n // ensures that ratings with decimals do not count as an extra star. Ex: Rating 2.9 --> 2 stars.\n let difference = ratingNum - count;\n if (count <= ratingNum && difference >= 1){\n star.textContent = \"\\u2605\";\n count++;\n }\n else{\n star.textContent = \"\\u2606\";\n }\n }\n displayStars(star);\n }\n}", "function updateStars() {\n\t{\n\t\t$(\".fa-star\").last().attr(\"class\", \"fa fa-star-o\");\n\t\tif (numStars > 0)\n\t\t{\n\t\t\tnumStars--;\n\t\t}\n\t\t$(\".numStars\").text(numStars);\n\t}\n}", "function getStars() {\n starNumber = document.querySelectorAll(\".stars li\");\n starCount = 0;\n for(star of starNumber){\n if (star.style.display != \"none\"){\n starCount++;\n }\n }\n return starCount;\n}", "function howManyStars() {\n\tif (Number(movesMade.innerText) < 20) {\n\t\treturn \"3 stars\";\n\t}\n\tif (Number(movesMade.innerText) > 19 && Number(movesMade.innerText) < 29) {\n\t\treturn \"2 stars\";\n\t}\n\tif (Number(movesMade.innerText) > 28) {\n\t\treturn \"1 star\";\n\t}\n}", "function starRating () {\n if ( moveCount === 20 || moveCount === 30 ) {\n decrementStar();\n }\n}", "function starCounter(moves) {\r\n if (moves >= 20 && moves <= 30) {\r\n // stars.innerHTML.remove();\r\n stars.innerHTML = star.repeat(4);\r\n } else if (moves >= 31 && moves <= 40) {\r\n // stars.innerHTML.remove();\r\n stars.innerHTML = star.repeat(3);\r\n } else if (moves >= 41 && moves <= 50) {\r\n // stars.innerHTML.remove();\r\n stars.innerHTML = star.repeat(2);\r\n } else if (moves >= 51) {\r\n // stars.innerHTML.remove();\r\n stars.innerHTML = star.repeat(1);\r\n } else {\r\n // stars.innerHTML.remove();\r\n stars.innerHTML = star.repeat(5);\r\n\r\n }\r\n}", "function displayStars(num) {\n var starLevelTemplate = '<li><i class=\"fa fa-star fa-3x animated bounceIn\"></i></li>';\n var starTemplate = '<li><i class=\"fa fa-star \"></i></li>';\n $(\"#starLevel\").empty();\n $(\".stars\").empty();\n for (var i = 0; i < num; i++) {\n $(\".stars\").append(starTemplate);\n $(\"#starLevel\").append(starLevelTemplate)\n }\n }", "function recalcStars() {\n const stars = document.querySelector(\".stars\");\n if ((countStars===3 && countMoves === 11) || (countStars===2 && countMoves === 17) ) {\n stars.children[countStars-1].firstElementChild.classList.replace('fa-star','fa-star-half-o');\n countStars -= 0.5;\n }\n if ((parseInt(countStars)===2 && countMoves === 14) || (parseInt(countStars)===1 && countMoves === 20)) {\n countStars -= 0.5;\n stars.children[countStars].firstElementChild.classList.replace('fa-star-half-o','fa-star-o');\n }\n}", "function stars() {\n starsNumber = 3;\n if (moves >= 10 && moves < 18) {\n thirdStar.classList.remove('fa-star', 'starColor');\n thirdStar.classList.add('fa-star-o');\n starsNumber = 2;\n } else if (moves >= 18) {\n secondStar.classList.remove('fa-star', 'starColor');\n secondStar.classList.add('fa-star-o');\n starsNumber = 1;\n }\n}", "function moveCounter() {\n moveCount ++;\n moves.textContent = moveCount;\n // star Rating:\n let starRating = document.getElementsByClassName(\"stars\")[0];\n if (moveCount > 20) {\n starRating.innerHTML = \"<li><i class=\\\"fa fa-star\\\"></i></li> <li><i class=\\\"fa fa-star\\\"></i></li>\";\n } else if (moveCount > 30) {\n starRating.innerHTML = \"<li><i class=\\\"fa fa-star\\\"></i></li>\";\n }\n}", "function rating(numOfMistakes) {\n if ((numOfMistakes === 9)||(numOfMistakes === 12)) {\n stars.removeChild(stars.lastChild);\n starCount -= 1;\n }\n }", "function getStars() {\n\tstars = document.querySelectorAll('.stars li');\n\tstarCount = 0;\n\tfor (star of stars) {\n\t\tif (star.style.display !== 'none') {\n\t\t\tstarCount++;\n\t\t}\n\t}\n\treturn starCount;\n}", "function applyRating() {\n for (var i = 0; i < 3; i++) {\n stars[i].style.visibility = (i < rating) ? \"show\" : \"collapse\";\n }\n}", "function updateStarRating() {\n const numCards = deckConfig.numberOfcards;\n\n if (scorePanel.moveCounter === 0) {\n scorePanel.starCounter = 3;\n $(\".star-disabled\").toggleClass(\"star-enabled star-disabled\");\n } else if (scorePanel.moveCounter === Math.trunc(numCards / 2 + numCards / 4)) {\n scorePanel.starCounter = 2;\n $($(\".stars\").children()[0]).toggleClass(\"star-enabled star-disabled\");\n } else if (scorePanel.moveCounter === (numCards)) {\n scorePanel.starCounter = 1;\n $($(\".stars\").children()[1]).toggleClass(\"star-enabled star-disabled\");\n }\n}", "function printStar(x, total) {\n\tvar star = '';\n\tfor (var i = 0; i < total; i++) {\n\t\tif (i < x) {\n\t\t\tstar += '<i class=\"fas fa-star\"></i>';\n\t\t} else {\n\t\t\tstar += '<i class=\"far fa-star\"></i>';\n\t\t}\n\t}\n\treturn star;\n}", "function countMoves() {\n move++;\n moves.innerHTML = move;\n\n //Removes stars after a number of moves\n if (move > 15 && move < 20) {\n for (let i = 0; i < 3; i++) {\n if (i > 1) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n } else if (move > 20) {\n for (let i = 0; i < 3; i++) {\n if (i > 0) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n }\n}", "function resetStars() {\n countStars = 3;\n for (star of stars) {\n star.style.display = 'inline';\n }\n}", "function stars(){\n const two = document.querySelector(\".two\");\n const three = document.querySelector(\".three\");\n if(turnCounter >= 20){\n two.classList.add(\"hidden\");\n three.classList.add(\"hidden\");\n }else if(turnCounter > 13 && turnCounter <20){\n three.classList.add(\"hidden\");\n }\n\n}", "function showStars(number) {\n let star = '';\n for (let i = 1; i <= number; i++) {\n star += '*';\n console.log(star);\n }\n}", "function reduceStars() {\n let starList = document.querySelectorAll('.fa-star');\n\n // determine whether star should be removed\n if(turns % STAR_REDUCTION === 0 && stars!== 1) {\n // change the rightmost star to an empty star\n let starLost = starList[starList.length-1];\n starLost.setAttribute('class', 'fa fa-star-o');\n stars--;\n }\n}", "function handleStarRating(){\n\t// setting the rates based on moves\n if (numberOfMoves > 30){\n stars[1].style.visibility = \"collapse\";\n } else if (numberOfMoves > 25){\n stars[2].style.visibility = \"collapse\";\n } else if (numberOfMoves > 20){\n stars[3].style.visibility = \"collapse\";\n } else if (numberOfMoves > 16){\n stars[4].style.visibility = \"collapse\";\n }\n}", "function addStarBonusToScore(){\n let starBonus = endingStarBonus * 1000;\n $('#star-bonus').html(starBonus);\n score += starBonus;\n}", "function moveCounter() {\n moves += 1;\n moveField = document.getElementsByClassName(\"moves\");\n moveField[0].innerHTML = moves;\n\n if (moves === 16) {\n let starList = document.querySelectorAll('.fa-star');\n let star1 = starList[2];\n star1.style.color = \"black\";\n stars--\n } else if (moves === 24) {\n let starList = document.querySelectorAll('.fa-star');\n let star2 = starList[1];\n star2.style.color = \"black\";\n stars--\n }\n}", "function removeStar() {\n const stars = Array.from(document.querySelectorAll('.fa-star'));\n if (moves === 12 || moves === 15 || moves === 18) {\n for (star of stars){\n if (star.style.display !== 'none'){\n star.style.display = 'none';\n numberOfStarts--;\n break;\n }\n }\n }\n}", "function rating(){\n //// TODO: Bug has been fixed\n if (!cardCouple[0].classList.contains('match') && !cardCouple[1].classList.contains('match')){\n moves.innerText++;\n }\n if (moves.innerText > 14){\n document.querySelector('.stars li:nth-child(1)').classList.add('starDown');\n }\n else if (moves.innerText > 20){\n document.querySelector('.stars li:nth-child(2)').classList.add('starDown');\n }\n}", "function star(numOfMove){\n\t noMoves = numOfMove; \n\t let stars = document.querySelector(\".stars\");\n\t if(numOfMove>50){\n\t \tnoStar=1;\n stars.innerHTML = `<li><i class=\"fa fa-star\"></i></li>`;\n\t }\n\t else if (numOfMove>30){\n\t \tnoStar=2;\n\t \tstars.innerHTML = `<li><i class=\"fa fa-star\"></i></li><li><i class=\"fa fa-star\"></i></li>`;\n\t }\n\t else{\n\t \tnoStar=3;\n\t\tstars.innerHTML = `<li><i class=\"fa fa-star\"></i></li><li><i class=\"fa fa-star\"></i></li><li><i class=\"fa fa-star\"></i></li>`;\n\t }\n}", "function starCount() {\n\twhile(starArea.childNodes.length > 0) {\n\t\tstarScore.appendChild(starArea.childNodes[0]);\n\t}\n}", "function removeStar() {\n if (remainingStars >= 2) {\n remainingStars -=1;\n stars.removeChild(stars.firstElementChild);\n }\n}", "function getStarRating() {\n if ($('#star-3').hasClass('fa-star')) {\n return 3;\n } else if ($('#star-2').hasClass('fa-star')) {\n return 2;\n } else {\n return 1;\n }\n}", "function removeStar() {\n if (moves <= 15) {\n starNum = 3;\n }\n if (moves > 15) {\n document.querySelector('.three').innerHTML = '<i></i>';\n starNum = 2;\n };\n if (moves > 30) {\n document.querySelector('.two').innerHTML = '<i></i>';\n starNum = 1;\n };\n}", "function starRating() {\n if(moveCounter <= 25) {\n starsList[0].style.display = 'inline-block';\n starsList[1].style.display = 'inline-block';\n starsList[2].style.display = 'inline-block';\n moves.style.color = \"green\";\n }\n else if(moveCounter > 25 && moveCounter <=65) {\n starsList[0].style.display = 'inline-block';\n starsList[1].style.display = 'inline-block';\n starsList[2].style.display = 'none';\n moves.style.color = \"orange\";\n }\n else if(moveCounter > 65) {\n starsList[0].style.display = 'inline-block';\n starsList[1].style.display = 'none';\n starsList[2].style.display = 'none';\n moves.style.color = \"red\";\n }\n}", "function incrementMoves() {\n\tmoves++;\n\tdocument.querySelector('.moves').textContent = moves;\n\tif (moves === twoStar) {\n\t\tdocument.querySelector('.star-3').style.display = 'none';\n\t} else if (moves === oneStar) {\n\t\tdocument.querySelector('.star-2').style.display = 'none';\n\t}\n}", "function createStars(number){\n\tif (number === 3){\n\t\t// Create 3 stars\n\t\tstars.innerHTML = \"<li><i class='fa fa-star'></i></li><li><i class='fa fa-star'></i></li><li><i class='fa fa-star'></i></li>\";\n\t} else if (number === 2){\n\t\t// Create 2 stars\n\t\tstars.innerHTML = \"<li><i class='fa fa-star'></i></li><li><i class='fa fa-star'></i></li>\";\n\t} else {\n\t\t// Create 1star\n\t\tstars.innerHTML = \"<li><i class='fa fa-star'></i></li>\";\n\t}\n}", "function starRating() {\n var starsTracker = starsPanel.getElementsByTagName('i');\n\n // If game finished in 11 moves or less, return and star rating remains at 3\n if (moves <= 11) {\n return;\n // If finished between 11 to 16 moves, 3rd colored star is replaced with empty star class\n } else if (moves > 11 && moves <= 16) {\n starsTracker.item(2).className = 'fa fa-star-o';\n // If finished with more than 16 moves, 2nd colored star is replaced with empty star class\n } else {\n starsTracker.item(1).className = 'fa fa-star-o';\n }\n\n // Update stars variable by counting length of remaining colored star elements\n stars = document.querySelectorAll('.fa-star').length;\n}", "updateStarCount(questionElement, nbStart) {\n questionElement.getElementsByClassName('star-count')[0].textContent = nbStart;\n }", "function rating () {\n if (moves < maxStars) {\n ratingStar = \"<i class= 'star fas fa-star'></i><i class= 'star fas fa-star'></i><i class='star fas fa-star'></i>\";\n } else if (moves < minStars) {\n stars[2].style.color = \"#444\";\n ratingStar = \"<i class='star fas fa-star'></i><i class= 'star fas fa-star'></i>\";\n } else {\n stars[1].style.color = \"#444\";\n ratingStar = \"<i class='star fas fa-star'></i>\";\n }\n}", "function rateStars(clicks_score) {\n if (clicks_score <= 25 && clicks_score > 20) {\n $('.rating').text('★★☆');\n return '★★☆';\n }\n else if (clicks_score > 25) {\n $('.rating').text('★☆☆');\n return '★☆☆';\n }\n else {\n return '★★★';\n }\n}", "function incMoves() {\n moveCounter += 1;\n moves.innerText = moveCounter;\n //set star score\n if (moveCounter > 12 && moveCounter <= 18) {\n //if player uses more than 18 moves, but less than 24, deduct one star\n for (i = 0; i < starsList.length; i++) {\n if (i > 1) {\n starsList[i].style.visibility = \"collapse\";\n score = starsList.length - 1;\n }\n }\n } else if (moveCounter > 18 && moveCounter <= 24) {\n //if player uses more than 24 moves, but less than 32, deduct another star\n for (i = 0; i < starsList.length; i++) {\n if (i > 0) {\n starsList[i].style.visibility = \"collapse\";\n score = starsList.length - 2;\n }\n }\n }\n}", "function numberOfStars(rating) {\n\t\n\tvar ratingString = '';\n\t\n\tfor(var i = 0; i < rating; i++) {\n\t\t\n\t\tratingString += '<span class=\"glyphicon glyphicon-star review-star\"></span>'\n\t\t\n\t}\n\t\n\treturn ratingString;\n\t\n}", "function movieScore(rating) {\r\n // Trasformazione punteggio a 5 punti\r\n var ratingTrasformato = rating / 2;\r\n\r\n var vote = Math.round(ratingTrasformato);\r\n\r\n var stars = '';\r\n for (var i = 1; i <= 5; i++) {\r\n if (i <= vote) {\r\n stars += '<i class=\"fas fa-star\"></i>';\r\n } else {\r\n stars += '<i class=\"far fa-star\"></i>';\r\n }\r\n }\r\n return stars;\r\n}", "function create_stars(rating) {\r\n \r\n var stars = '';\r\n for (j=1; j<6; j++) {\r\n\r\n if (j <= Math.floor(rating)) {\r\n stars += `<span class=\"fa fa-star checked\"></span>`;\r\n }\r\n else {\r\n stars += `<span class=\"fa fa-star\"></span>`;\r\n }\r\n\r\n }\r\n\r\n return stars;\r\n}", "function catchStar(){\n for (let k = 1; k <= numberofStar; k++) {\n setInterval(function(){\n if(j == (parseFloat($('#star'+k).css('left'))-785)/30 && i == (parseFloat($('#star'+k).css('top')) - 408)/30){\n score++;\n }\n },500)\n }\n }", "function starVote (voto) {\n var star = \"\";\n var stella = Math.floor(voto/2);\n for (var i = 1; i <= 5; i++) {\n if (stella >= i) {\n star += '<i class=\"fas fa-star\"></i>';\n } else {\n star += '<i class=\"far fa-star\"></i>';\n }\n }\n return star;\n }", "function starsEarned() {\n if (moves > 8 && moves < 12) {\n for (i = 0; i < 3; i++) {\n if (i > 1) {\n stars[i].style.visibility = \"hidden\";\n }\n }\n } else if (moves > 13) {\n for (i = 0; i < 3; i++) {\n if (i > 0) {\n stars[i].style.visibility = \"hidden\";\n }\n }\n }\n}", "function outputStars(newRating) {\n\tlet intRating = parseInt(newRating)\n\t\n\t$('#rating-stars i').each(function(i) {\n\t\tlet $this = $(this)\n\t\t$this.removeClass('user-rating')\n\t\tif (i < intRating) {\n\t\t\t$this.removeClass('far').addClass('fas')\n\t\t} else {\n\t\t\t$this.removeClass('fas').addClass('far')\n\t\t}\n\t})\n}", "function getStars() {\n stars = document.querySelectorAll('.stars li');\n starCount = 0;\n for (star of stars) {\n if (star.style.display !== 'none') {\n starCount++\n }\n }\n console.log(starCount);\n return starCount;\n}", "function moveCounter() {\n moves++;\n counter.innerHTML = moves;\n textMoves();\n\n /*\n * Check to determine the player's rating after\n * certain number of moves have been exceeded\n */\n if (moves > 12 && moves < 19) {\n starsArray.forEach(function(star, i) {\n if (i > 1) {\n star.style.visibility = 'collapse';\n }\n });\n } else if (moves > 20) {\n starsArray.forEach(function(star, i) {\n if (i > 0) {\n star.style.visibility = 'collapse';\n }\n });\n }\n}", "function ShowStars(numOfStars) {\n // First call hide to remove all stars.\n HideStars(3);\n\n for (let i = 0; i < numOfStars; i++) {\n if (stars[i].childNodes[0].classList.contains('hidden'))\n {\n stars[i].childNodes[0].classList.remove('hidden');\n }\n stars[i].childNodes[0].classList.add('show');\n }\n}", "function createStars(starsCS) {\n for (let total = 5, current = starsCS; total > 0; --total) {\n if (current) {\n starsDis.push(\"fas fa-star\");\n --current;\n } else {\n starsDis.push(\"far fa-star\");\n }\n }\n }", "function addOnetoCounter(){\n counterint++;\n counter.innerHTML=counterint;\n let scores= document.querySelector('.stars')\n if (counterint == 18){\n\n let firstStar = scores.firstElementChild;\n scores.removeChild(firstStar);\n }\n if (counterint == 28){\n let firstStar = scores.firstElementChild;\n scores.removeChild(firstStar);\n }\n}", "function starRemove() {\n\tif (numMove > 16) {\n\t\testrelas[2].style.display = 'none';\n\t\tcontStars = 2;\n\t} if (numMove > 20) {\n\t\testrelas[1].style.display = 'none';\n\t}\n}", "function setStarRating(starsNumber) {\n if (starsNumber === 2) {\n stars[2].firstChild.classList.remove('fa-star');\n stars[2].firstChild.classList.add('fa-star-o');\n } else if (starsNumber === 1) {\n stars[1].firstChild.classList.remove('fa-star');\n stars[1].firstChild.classList.add('fa-star-o');\n } else if (starsNumber === 0) {\n stars[0].firstChild.classList.remove('fa-star');\n stars[0].firstChild.classList.add('fa-star-o');\n }\n}", "function decrementStar() {\n const stars = document.querySelectorAll('.stars li');\n for (star of stars) {\n if (star.style.display !== 'none') {\n star.style.display = 'none';\n break\n }\n }\n}", "function addMove() {\n moves ++;\n moveCount.innerHTML = moves;\n if(moves === 10) {\n hideStar();\n } else if(moves === 20) {\n hideStar();\n }\n}", "function scoreKeeper() {\n\tif (pairs === 10) {\n\n\t\tpopup.classList.add('show');\n\t}\n}", "ratingDisplay() {\n let myRating = document.getElementById(\"rating\");\n for(let i = 0; i < this.state.data.rating; i++) {\n let star = document.createElement(\"SPAN\");\n star.setAttribute(\"class\", \"glyphicon glyphicon-star\");\n myRating.appendChild(star);\n }\n\n for(let i = this.state.data.rating; i < 5; i++) {\n //let myRating = document.getElementById(\"rating\");\n let star = document.createElement(\"SPAN\");\n star.setAttribute(\"class\", \"glyphicon glyphicon-star-empty\");\n myRating.appendChild(star);\n }\n }" ]
[ "0.75931925", "0.75653076", "0.75070995", "0.7431751", "0.74291766", "0.7384715", "0.72422016", "0.7238542", "0.71884614", "0.71672255", "0.71468824", "0.71317893", "0.7130833", "0.70577246", "0.70502913", "0.7042862", "0.7031024", "0.7030213", "0.6967661", "0.69583267", "0.6936351", "0.6919962", "0.6913869", "0.6913745", "0.69091684", "0.69035655", "0.68835175", "0.6868565", "0.68630916", "0.68590224", "0.68342537", "0.6819836", "0.67906594", "0.6760555", "0.6753828", "0.6720915", "0.6706728", "0.6705905", "0.6703722", "0.67031306", "0.6701821", "0.6681545", "0.6664145", "0.66578066", "0.66426545", "0.6637882", "0.66262734", "0.66169894", "0.66129273", "0.6592012", "0.65844816", "0.6577282", "0.6570838", "0.65520656", "0.65461546", "0.6542264", "0.65409", "0.6538028", "0.65334964", "0.65261257", "0.65187186", "0.64904743", "0.6489514", "0.6483608", "0.6475944", "0.64692533", "0.64677095", "0.64508265", "0.64464945", "0.64458275", "0.64430594", "0.6422488", "0.6422419", "0.6419111", "0.64188576", "0.6417406", "0.6394891", "0.63762194", "0.6373605", "0.6370336", "0.6365582", "0.6362646", "0.63613313", "0.63554597", "0.63548416", "0.6352824", "0.6343229", "0.6341345", "0.634105", "0.63405687", "0.6329097", "0.6322446", "0.63092345", "0.6300541", "0.62942487", "0.6289451", "0.62817943", "0.627363", "0.627093", "0.6266003" ]
0.75144744
2
Limit amount of threads used for each image sharp.concurrency(1); Create preview for image path Image file path. resizeConfig width height max_width max_height jpeg_quality gif_animation skip_size imageType gif, jpeg, png, etc
async function createPreview(image, resizeConfig, imageType) { // To scale image, we calculate new width and height, // resize image by height, and crop by width let saveAsIs = false; let u = resize_outline(image.width, image.height, resizeConfig); let scaledWidth = u.crop_width; let scaledHeight = u.crop_height; let outType = resizeConfig.type || imageType; if (imageType === outType) { // If image size is smaller than 'skip_size', skip resizing; // this saves image as is, including metadata like EXIF // if (resizeConfig.skip_size && image.length < resizeConfig.skip_size) { saveAsIs = true; } // If image is smaller than needed already, save it as is // if (scaledWidth >= image.width && scaledHeight >= image.height) { if (!resizeConfig.max_size || image.length < resizeConfig.max_size) { saveAsIs = true; } } } // Do not repack small non-jpeg images, // we always process jpegs to fix orientation // if (saveAsIs && imageType !== 'jpeg') { return { image, type: imageType }; } let sharpInstance = sharp(image.buffer); let formatOptions = {}; if (outType === 'jpeg') { // Set quality for jpeg image (default sharp quality is 80) formatOptions.quality = resizeConfig.jpeg_quality; // Rotate image / fix Exif orientation sharpInstance.rotate(); // Jpeg doesn't support alpha channel, so substitute it with white background if (imageType === 'gif' || imageType === 'png') { sharpInstance.flatten({ background: 'white' }); } } if (!saveAsIs) { if (resizeConfig.unsharp) { sharpInstance.sharpen(); } sharpInstance.resize(Math.round(scaledWidth), Math.round(scaledHeight), { fit: 'cover', position: 'attention', withoutEnlargement: true }); } let res = await sharpInstance.toFormat(outType, formatOptions) .withMetadata() .toBuffer({ resolveWithObject: true }); return { image: { buffer: res.data, length: res.info.size, width: res.info.width, height: res.info.height, type: res.info.type }, type: outType }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function previewImages(input, imgId, parentId, cssClass, maxImages) {\n // Ensure at least one image is selected and there's no more than maxImagess\n if (input.files[0] && (input.files.length <= maxImages)) {\n // counter to keep track of the element ID to be modified\n var i = 0; \n // Queue containing all the images\n var images = [];\n // put each image into the queue\n for (var j = 0; j <= input.files.length - 1; j++) {\n images.push(input.files[j]);\n }\n\n var reader = new FileReader();\n\n // Create handle to parent element\n var parent = document.getElementById(parentId);\n\n // Function that will set the image(s) recursively\n function setImage() {\n var imgElementId = imgId + i;\n \n reader.onload = function (e) {\n //console.log(imgElementId); // For debugging\n\n // Create image element and set attributes\n var imgElement = document.createElement('img');\n imgElement.src = e.target.result;\n imgElement.className = cssClass;\n imgElement.id = imgElementId; \n // Append image element to the parent element\n parent.appendChild(imgElement);\n\n // increment counter to get right element ID\n i++;\n\n // check if any images are still in the queue\n if (images.length > 0) {\n // Images still left, set the next one\n setImage();\n } else{\n // no images left, exits function\n }\n };\n // Will get the image data and remove it from the queue\n var imageData = images.shift();\n reader.readAsDataURL(imageData);\n }\n\n // begin setting images\n setImage(); \n\n } else {\n // Error handling. Most likely case is more than maxImages selected\n if (input.files.length > maxImages) {\n alert('You can only upload ' + maxImages + ' photos');\n // remove files from upload input\n input.value = '';\n input.className = 'errorClass';\n\n } else {\n // Unable to preview image(s) for other reason, fail silently\n }\n }\n}", "function imagesPreview(input) {\n var cropper;\n galleryImagesContainer.innerHTML = '';\n var img = [];\n if(cropperImageInitCanvas.cropper){\n cropperImageInitCanvas.cropper.destroy();\n cropImageButton.style.display = 'none';\n cropperImageInitCanvas.width = 0;\n cropperImageInitCanvas.height = 0;\n }\n if (input.files.length) {\n var i = 0;\n var index = 0;\n for (let singleFile of input.files) {\n var reader = new FileReader();\n reader.onload = function(event) {\n var blobUrl = event.target.result;\n img.push(new Image());\n img[i].onload = function(e) {\n // Canvas Container\n var singleCanvasImageContainer = document.createElement('div');\n singleCanvasImageContainer.id = 'singleImageCanvasContainer'+index;\n singleCanvasImageContainer.className = 'singleImageCanvasContainer';\n // Canvas Close Btn\n var singleCanvasImageCloseBtn = document.createElement('button');\n var singleCanvasImageCloseBtnText = document.createTextNode('Close');\n // var singleCanvasImageCloseBtnText = document.createElement('i');\n // singleCanvasImageCloseBtnText.className = 'fa fa-times';\n singleCanvasImageCloseBtn.id = 'singleImageCanvasCloseBtn'+index;\n singleCanvasImageCloseBtn.className = 'singleImageCanvasCloseBtn';\n singleCanvasImageCloseBtn.onclick = function() { removeSingleCanvas(this) };\n singleCanvasImageCloseBtn.appendChild(singleCanvasImageCloseBtnText);\n singleCanvasImageContainer.appendChild(singleCanvasImageCloseBtn);\n // Image Canvas\n var canvas = document.createElement('canvas');\n canvas.id = 'imageCanvas'+index;\n canvas.className = 'imageCanvas singleImageCanvas';\n canvas.width = e.currentTarget.width;\n canvas.height = e.currentTarget.height;\n canvas.onclick = function() { cropInit(canvas.id); };\n singleCanvasImageContainer.appendChild(canvas)\n // Canvas Context\n var ctx = canvas.getContext('2d');\n ctx.drawImage(e.currentTarget,0,0);\n // galleryImagesContainer.append(canvas);\n galleryImagesContainer.appendChild(singleCanvasImageContainer);\n while (document.querySelectorAll('.singleImageCanvas').length == input.files.length) {\n var allCanvasImages = document.querySelectorAll('.singleImageCanvas')[0].getAttribute('id');\n cropInit(allCanvasImages);\n break;\n };\n urlConversion();\n index++;\n };\n img[i].src = blobUrl;\n i++;\n }\n reader.readAsDataURL(singleFile);\n }\n // addCropButton();\n // cropImageButton.style.display = 'block';\n }\n }", "function _sizeImage(count) {\n\t\tdata.windowHeight = data.viewportHeight = (count == 0) ? $(window).height() : data.windowHeight;\n\t\tdata.windowWidth = data.viewportWidth = (count == 0) ? $(window).width() : data.windowWidth;\n\t\t\n\t\tdata.imageHeight = (count == 0) ? data.naturalHeight : data.$image.outerHeight();\n\t\tdata.imageWidth = (count == 0) ? data.naturalWidth : data.$image.outerWidth();\n\t\tdata.metaHeight = (count == 0) ? 0 : data.metaHeight;\n\t\t\n\t\tif (count == 0) {\n\t\t\tdata.ratioHorizontal = data.imageHeight / data.imageWidth;\n\t\t\tdata.ratioVertical = data.imageWidth / data.imageHeight;\n\t\t\t\n\t\t\tdata.isWide = (data.imageWidth > data.imageHeight);\n\t\t}\n\t\t\n\t\t// Double check min and max\n\t\tif (data.imageHeight < data.options.minHeight) {\n\t\t\tdata.options.minHeight = data.imageHeight;\n\t\t}\n\t\tif (data.imageWidth < data.options.minWidth) {\n\t\t\tdata.options.minWidth = data.imageWidth;\n\t\t}\n\t\t\n\t\tif (data.isMobile) {\n\t\t\tdata.viewportHeight -= data.padding;\n\t\t\tdata.viewportWidth -= data.padding;\n\t\t\t\n\t\t\tdata.contentHeight = data.viewportHeight;\n\t\t\tdata.contentWidth = data.viewportWidth;\n\t\t\t\n\t\t\tdata = _fitImage(data); \n\t\t\t\n\t\t\tdata.imageMarginTop = (data.contentHeight - data.targetImageHeight) / 2;\n\t\t\tdata.imageMarginLeft = (data.contentWidth - data.targetImageWidth) / 2;\n\t\t} else {\n\t\t\tdata.viewportHeight -= data.options.margin + data.padding + data.metaHeight;\n\t\t\tdata.viewportWidth -= data.options.margin + data.padding;\n\t\t\t\n\t\t\tdata = _fitImage(data);\n\t\t\t\n\t\t\tdata.contentHeight = data.targetImageHeight;\n\t\t\tdata.contentWidth = data.targetImageWidth;\n\t\t\t\n\t\t\tdata.imageMarginTop = 0;\n\t\t\tdata.imageMarginLeft = 0;\n\t\t}\n\t\t\n\t\t// Modify DOM\n\t\tdata.$content.css({ \n\t\t\theight: (data.isMobile) ? data.contentHeight : \"auto\",\n\t\t\twidth: data.contentWidth \n\t\t});\n\t\tdata.$meta.css({ \n\t\t\twidth: data.contentWidth \n\t\t});\n\t\tdata.$image.css({ \n\t\t\theight: data.targetImageHeight, \n\t\t\twidth: data.targetImageWidth,\n\t\t\tmarginTop: data.imageMarginTop,\n\t\t\tmarginLeft: data.imageMarginLeft\n\t\t});\n\t\t\n\t\tif (!data.isMobile) {\n\t\t\tdata.metaHeight = data.$meta.outerHeight(true);\n\t\t\tdata.contentHeight += data.metaHeight;\n\t\t\t\n\t\t\tif (data.contentHeight > data.viewportHeight && count < 2) {\n\t\t\t\treturn _sizeImage(count+1);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function filePreview(input) {\n if (input.files && input.files[0]) {\n\t\tif(input.files.length > 1) {\n\t\t\tvar imgCount = input.files.length\n\t\t\t$('.imgPreview').remove();\n\t\t\t\n\t\t\tfor(x=0; x < imgCount; x++) {\n\t\t\t\tvar reader = new FileReader();\n\t\t\t\treader.onload = function (e) {\n\t\t\t\t\t$('<img class=\"imgPreview img-thumbnail m-1\" src=\"' + e.target.result + '\" width=\"350\" height=\"200\"/>').appendTo('.uploadsView');\n\t\t\t\t}\n\t\t\t\treader.readAsDataURL(input.files[x]);\n\t\t\t}\t\t\t\n\t\t} else {\n\t\t\tvar reader = new FileReader();\n\t\t\t$('.imgPreview').remove();\n\t\t\t\n\t\t\treader.onload = function (e) {\n\t\t\t\t$('<img class=\"imgPreview img-thumbnail\" src=\"' + e.target.result + '\" width=\"450\" height=\"300\"/>').appendTo('.uploadsView');\n\t\t\t}\n\t\t\treader.readAsDataURL(input.files[0]);\n\t\t}\n }\n}", "function masterImage(mstrObj){\n //Image Tool Kit\n //console.log(\"in the pit\");\n //properties\n //required\n\n if(mstrObj == undefined){alert(\"canvas object parameter is not defined.\"); return;}\n if(mstrObj.home == undefined){alert(\"canvas object needs \\\"home:'container id string'\\\".\"); return;}\n var home = mstrObj.home;\n\n var iUN = mstrObj.iUN || Math.round(Math.random() * 10000);//see iUN get and set\n var canvas_type = mstrObj.type || \"thumbnail\";//NOTE may not need #remove\n var canvas_mode = mstrObj.mode || \"default\";//NOTE may not need #remove\n\n\n //at 100 x100 or 50 x50 the image is adjusted perfectly\n //100 x 80 the image is stretched\n //NOTE image 4:3 aspect ratio multiply by 3/4ths or .75\n var type_str = (canvas_mode != \"default\") ? canvas_type + \"_\" + canvas_mode : canvas_type;\n\n //used to set the various canvas default dimensions (if they arent manually entered)\n switch(type_str)\n {\n case \"thumbnail\":\n var default_width = 50;\n var default_height = 50;\n break;\n\n case \"profile\":\n var default_width = 100;\n var default_height = 100;\n break;\n\n case \"profile_edit\":\n var default_width = 200;\n var default_height = 200;\n break;\n\n case \"image\":\n var default_width = 100;\n var default_height = 75;\n break;\n }//end switch\n\n\n\n\n var canvas_width = mstrObj.width || default_width;\n var canvas_height = mstrObj.height || default_height;\n\n\n //HTML generated variable\n //window['CANVAS_IMG_URL'] = \"<?php echo JUri::root(); ?>components/com_arc/xfiles/images/\";\n var img_default = window['ARC_IMG_URL'] + \"flame.png\";\n\n //properties\n var canvas = \"\";\n var context_obj = \"\";\n var action = mstrObj.action || \"\";\n var prefix = mstrObj.varName || \"masImg\";//get set\n var fill_content = \"\";\n //console.log(display);\n var custom_class = \"\";\n var add_to_class = \"false\";\n var custom_id = \"\";\n var id_type = \"default\";\n var first_run = \"true\";\n var sli_ctrl_inputA = \"\";\n var\tsli_ctrl_inputB = \"\";\n var mousedown = false;\n var touchdown = false;\n var last_panel_clicked_id = \"\";//remove\n var last_x = \"default\";\n var last_y = \"default\";\n var offset_x = 0;\n var offset_y = 0;\n var img_label = \"default\";\n var slide_limit = 500;\n //var display_size = \"default\";\n\n var img_url = (mstrObj != undefined && mstrObj.url != undefined) ? mstrObj.url : img_default;\n\n //obj_globals\n var src_x = 0;\n var src_y = 5;\n var img_w = 500;\n var img_h = 500;\n var can_x = 0;\n var can_y = 0;\n var can_w = canvas_width;\n var can_h = canvas_height;\n\n //NOTE I don't need this. won't be saving this to local storage #remove\n /*try{\n if(localStorage != undefined && localStorage.canvas_tutorial != undefined && localStorage.canvas_tutorial != \"\")\n {\n var local_str = localStorage.canvas_tutorial;\n var local_ary = local_str.split(\",\");\n img_url = local_ary[0];\n src_x = local_ary[1];\n src_y = local_ary[2];\n img_w = local_ary[3];\n img_h = local_ary[4];\n can_x = local_ary[5];\n can_y = local_ary[6];\n can_w = local_ary[7];\n can_h = local_ary[8];\n }//end if\n }catch(e){\n console.log(\"nope. reload failed.\")\n }*/\n\n var obj_els = {};\n var event_ids = [];\n\n\n //methods\n this.setContent = function(sC){fill_content = sC;}//\n this.get_event_ids = function(){return event_ids;}\n this.setCustomClass = function(clsStr,addPar){custom_class = clsStr; add_to_class = addPar || true;/*addPar is nothing yet*/}\n this.setCustomId = function(cId){custom_id = cId; id_type = \"custom\";}\n\n var image_object=new Image();\n\n\n var create_canvas = function(c_cont){\n\n var bigDaddy = (document.getElementById(c_cont)) ? document.getElementById(c_cont) : document.getElementsByClassName(c_cont)[0];\n //clears container\n //if(clearHome == \"true\"){}\n bigDaddy.innerHTML = \"\";//\n\n /******************************** Sample Code *****************************************\n\n ***************************************************************************************/\n\n //alert(\"data object is \" + dataObject);\n //gets container\n\n\n var add_custom_class = (custom_class != \"\") ? custom_class : \"\";\n\n canvas = document.createElement(\"canvas\");\n canvas.id = prefix + \"_ImgCanvas\" + \"_\" + iUN;\n\n event_ids.push(canvas.id);\n\n canvas.className = prefix + \"__ImgCanvas\" + iUN + \" \" + prefix + \"__ImgCanvas \" + prefix + \" ImgCanvas \" + add_custom_class;\n\n if(fill_content != \"\"){canvas.innerHTML = fill_content;}\n\n bigDaddy.appendChild(canvas);\n\n context_obj = canvas.getContext('2d');\n canvas.width = canvas_width;\n canvas.height = canvas_height;\n\n }//end create_preview\n\n var draw_me = function() {\n\n //console.log(\"draw running\");\n\n //clear the canvas\n //canvas.width = canvas.width;\n\n if (canvas.getContext) {\n\n image_object.onload=function(){\n\n //needs this to keep drawing movements smooth\n canvas.width = canvas_width;\n canvas.height = canvas_height;\n\n context_obj.drawImage(image_object, src_x, src_y, img_w, img_h, can_x, can_y, can_w, can_h);\n //console.log(\"image_object\",image_object);//try here\n\n }//end onload//\n\n\n image_object.src=img_url;\n //console.log(\"image_object\",image_object);//nothing to run yet here so its \"\"\n //var dataURL = canvas.toDataURL(\"image/png\");\n //console.log(\"image_object height = \",image_object.height);\n }//end if\n\n\n }//end draw_me\n\n var canvas_editor = function()\n {\n\n\n\n }//end canvas_editor\n\n\n this.display = function(){\n switch(canvas_mode)\n {\n case \"edit\":\n //prep edit elements that add canvas\n control_panel();\n //draw it\n draw_me();\n break;\n\n default:\n create_canvas(home);\n draw_me();\n break;\n\n }//end switch\n }//end display\n\n\n /******************************** SCRAP SECTION BELOW ****************************************/\n\n //NOTE i don't need this panel array - i will need a btn array in its place.\n var ctrl_ary = [\n {\n \"label\":\"POSIION\",\n \"contents\":\"IP\",\n \"title\":\"Image Position\",\n },\n {\n \"label\":\"SCALE\",\n \"contents\":\"IS\",\n \"title\":\"Image Scale\",\n },\n {\n \"label\":\"BORDERS\",\n \"contents\":\"CB\",\n \"title\":\"Canvas Borders\",\n },\n {\n \"label\":\"BORDER SCALE\",\n \"contents\":\"BS\",\n \"title\":\"Canvas Border scale\",\n },\n {\n \"label\":\"BACKGROUND COLOR\",\n \"contents\":\"BC\",\n \"title\":\"Background Color\",\n },\n {\n \"label\":\"RESET\",\n \"contents\":\"RE\",\n \"title\":\"Reset All\",\n }\n\n ];//end ctrl_ary\n\n var size_ary = [\n {\n \"label\":\"XS\",\n \"contents\":\"XS\",\n \"title\":\"for extra small images\",\n \"size\":\"100\",\n \"scale\":\"200%\",\n \"zoom\":\"5X\",\n \"limit\":\"150\"\n },{\n \"label\":\"S\",\n \"contents\":\"S\",\n \"title\":\"for small images\",\n \"size\":\"640\",\n \"scale\":\"100%\",\n \"zoom\":\"4X\",\n \"limit\":\"700\"\n },\n {\n \"label\":\"M\",\n \"contents\":\"M\",\n \"title\":\"for medium images\",\n \"size\":\"1280\",\n \"scale\":\"50%\",\n \"zoom\":\"3X\",\n \"limit\":\"1330\"\n },\n {\n \"label\":\"L\",\n \"contents\":\"L\",\n \"title\":\"for large images\",\n \"size\":\"2560\",\n \"scale\":\"25%\",\n \"zoom\":\"2X\",\n \"limit\":\"2610\"\n },\n {\n \"label\":\"XL\",\n \"contents\":\"XL\",\n \"title\":\"for extra large images\",\n \"size\":\"5120\",\n \"scale\":\"12.5%\",\n \"zoom\":\"1X\",\n \"limit\":\"5170\"\n }\n\n ];//end size_ary\n\n //size_ary.reverse();\n\n var control_panel = function(){\n\n //object properties\n\n\n //local variables\n\n //jqm collapsible\n var bigDaddy = document.getElementsByClassName(home)[0];\n //clear the container\n bigDaddy.innerHTML = \"\";\n\n var edit_box = document.createElement(\"div\");\n edit_box.id = \"edit_box\" + iUN;\n edit_box.className = \"edit_box\" + iUN + \" edit_box \";//test_orange\n //collapsible set\n\n\n //make the other Stuff\n\n //edit_sectionB\n var edit_sectionB = document.createElement(\"div\");\n edit_sectionB.id = \"edit_sectionB\" + iUN;\n edit_sectionB.className = \"edit_sectionB\" + iUN + \" edit_sectionB \";//test_blue\n\n //canvas_cont\n var canvas_cont = document.createElement(\"div\");\n canvas_cont.id = \"canvas_cont\" + iUN;\n canvas_cont.className = \"canvas_cont\" + iUN + \" canvas_cont \";//test_purple\n obj_els[\"edit_home_id\"] = canvas_cont.id;\n\n\n\n //edit_slider_box\n var edit_slider_box = document.createElement(\"div\");\n edit_slider_box.id = \"edit_slider_box\" + iUN;\n edit_slider_box.className = \"edit_slider_box\" + iUN + \" edit_slider_box \";//test_yellow\n\n //edit_lock_box\n var edit_lock_box = document.createElement(\"div\");\n edit_lock_box.id = \"edit_lock_box\" + iUN;\n edit_lock_box.className = \"edit_lock_box\" + iUN + \" edit_lock_box test_pink\";\n\n //edit_lock_box\n var edit_slider_cont = document.createElement(\"div\");\n edit_slider_cont.id = \"edit_slider_cont\" + iUN;\n edit_slider_cont.className = \"edit_slider_cont\" + iUN + \" edit_slider_cont \";//test_green\n\n\n edit_slider_box.appendChild(edit_lock_box);\n edit_slider_box.appendChild(edit_slider_cont);\n\n edit_sectionB.appendChild(canvas_cont);\n\n //edit_resize_box\n var edit_resize_box = document.createElement(\"div\");\n edit_resize_box.id = \"edit_resize_box\" + iUN;\n edit_resize_box.className = \"edit_resize_box\" + iUN + \" edit_resize_box \";\n\n\n //$(\".ctrl_cont\").addClass(\"hibernate\");\n //$(\".col_label\").removeClass(\"hide\");\n edit_box.appendChild(edit_resize_box);\n edit_box.appendChild(edit_sectionB);\n edit_box.appendChild(edit_slider_box);\n\n //edit_cmd_label\n var edit_cmd_label = document.createElement(\"div\");\n edit_cmd_label.id = \"edit_cmd_label\" + iUN;\n edit_cmd_label.className = \"edit_cmd_label\" + iUN + \" edit_cmd_label test_orange\";\n\n\n var ctrl_box = document.createElement(\"div\");\n ctrl_box.id = \"ctrl_box\" + iUN;\n ctrl_box.className = \"ctrl_box\" + iUN + \" ctrl_box edit_sectionA \";\n\n\n\n edit_box.appendChild(ctrl_box);\n edit_box.appendChild(edit_cmd_label);\n\n\n bigDaddy.appendChild(edit_box);\n\n\n\n\n var test_nbr = 3;\n //content for ctrl_box\n for(var x = 0; x < ctrl_ary.length ; x++){\n\n var ec_Nm = \"edit_ctrl_btn\" + x;\n var edit_ctrl_btn = document.createElement(\"button\");\n edit_ctrl_btn.id = \"edit_ctrl_btn\" + iUN + \"_\" + x;\n edit_ctrl_btn.className = \"edit_ctrl_btn\" + iUN + \"_\" + x + \" edit_ctrl_btn\" + x + \" edit_ctrl_btn \";\n edit_ctrl_btn.setAttribute(\"href\",\"#\");\n edit_ctrl_btn.dataset.nbr = x;\n edit_ctrl_btn.dataset.contents = ctrl_ary[x].contents;\n edit_ctrl_btn.title = ctrl_ary[x].title;\n //edit_ctrl_btn.innerHTML = \"<h5>\" + ctrl_ary[x].label + \"</h5>\";\n obj_els[ec_Nm] = edit_ctrl_btn;\n\n //helps set up the correct call inside the event listener\n obj_els[\"contents\" + x] = ctrl_ary[x].contents;\n\n\n obj_els[ec_Nm].addEventListener(\"click\",function(e){\n //i used this.dataset so it doesn't pass the updated x of the for loop\n //and everything ending up being on click of the last index nbr passed\n e.preventDefault();\n var sNbr = this.dataset.nbr;\n var my_contents = this.dataset.contents\n run_contents(my_contents);\n })//end c_Nm\n\n ctrl_box.appendChild(edit_ctrl_btn);\n\n }//end for\n\n\n //content for edit_resize_box\n for(var y = 0; y < size_ary.length ; y++){\n\n var er_Nm = \"edit_resize_btn\" + y;\n var edit_resize_btn = document.createElement(\"button\");\n edit_resize_btn.id = \"edit_resize_btn\" + iUN + \"_\" + y;\n edit_resize_btn.className = \"edit_resize_btn\" + iUN + \"_\" +y + \" edit_resize_btn\" + y + \" edit_resize_btn \";\n edit_resize_btn.setAttribute(\"href\",\"#\");\n edit_resize_btn.dataset.nbr = y;\n edit_resize_btn.dataset.contents = size_ary[y].contents;\n edit_resize_btn.title = size_ary[y].title;\n edit_resize_btn.innerHTML = \"<h6>\" + size_ary[y].zoom + \"</h6>\";\n obj_els[er_Nm] = edit_resize_btn;\n\n //helps set up the correct call inside the event listener\n obj_els[\"contents\" + y] = size_ary[y].contents;\n\n\n obj_els[er_Nm].addEventListener(\"click\",function(e){\n //i used this.dataset so it doesn't pass the updated x of the for loop\n //and everything ending up being on click of the last index nbr passed\n e.preventDefault();\n var sNbr = this.dataset.nbr;\n var my_contents = this.dataset.contents\n run_contents(my_contents);\n })//end c_Nm\n\n edit_resize_box.appendChild(edit_resize_btn);\n\n }//end for\n\n create_canvas(obj_els[\"edit_home_id\"]);\n run_contents(\"IP\");\n\n }//end control_panel\n\n\n\n var run_contents = function(str)\n {\n switch(str)\n {\n case \"IP\":\n //image position\n add_slider_input(0);\n break;\n\n case \"IS\":\n //image scale\n add_slider_input(1);\n break;\n\n case \"CB\":\n //canvas border\n add_slider_input(2);\n break;\n\n case \"BS\":\n //canvas border scale\n add_slider_input(3);\n break;\n\n case \"BC\":\n\n break;\n\n case \"RE\":\n reset_canvas();\n break;\n\n //resize section\n case \"XS\":\n reset_canvas();\n\n img_w = size_ary[0].size;\n img_h = img_w;\n can_w = canvas_width;\n can_h = canvas_width;\n slide_limit = size_ary[0].limit;\n img_label = size_ary[0].label;\n\n control_panel();\n draw_me();\n\n break;\n\n case \"S\":\n reset_canvas();\n\n img_w = size_ary[1].size;\n img_h = img_w;\n can_w = canvas_width;\n can_h = canvas_width;\n slide_limit = size_ary[1].limit;\n img_label = size_ary[1].label;\n\n control_panel();\n draw_me();\n break;\n\n case \"M\":\n reset_canvas();\n\n img_w = size_ary[2].size;\n img_h = img_w;\n can_w = canvas_width;\n can_h = canvas_width;\n slide_limit = size_ary[2].limit;\n img_label = size_ary[2].label;\n\n control_panel();\n draw_me();\n break;\n\n case \"L\":\n reset_canvas();\n\n img_w = size_ary[3].size;\n img_h = img_w;\n can_w = canvas_width;\n can_h = canvas_width;\n slide_limit = size_ary[3].limit;\n img_label = size_ary[3].label;\n //canvas.width = canvas.width;\n\n control_panel();\n draw_me();\n\n break;\n\n case \"XL\":\n reset_canvas();\n\n img_w = size_ary[4].size;\n img_h = img_w;\n can_w = canvas_width;\n can_h = canvas_width;\n slide_limit = size_ary[4].limit;\n img_label = size_ary[4].label;\n //canvas.width = canvas.width;\n control_panel();\n draw_me();\n\n break;\n\n }//end switch\n\n }//end run_contents\n\n var reset_canvas = function()\n {\n src_x = 0;\n src_y = 0;\n img_w = 500;\n img_h = 500;\n can_x = 0;\n can_y = 0;\n can_w = canvas_width;\n can_h = canvas_width;\n //canvas.width = canvas.width;\n create_canvas(obj_els[\"edit_home_id\"]);\n draw_me();\n\n }//end reset_canvas\n\n //html5 slider research\n //https://codepen.io/collection/DgYaMj/2/\n //http://thenewcode.com/757/Playing-With-The-HTML5-range-Slider-Input\n //http://danielstern.ca/range.css/#/\n //http://www.cssportal.com/style-input-range/\n\n\n var add_slider_input = function(nbr)\n {\n var home = document.getElementsByClassName(\"edit_slider_cont\")[0];\n home.innerHTML = \"\";\n\n \t\t\t//reset slide input\n\t\t\tsli_ctrl_inputA = \"\";\n\t\t\tsli_ctrl_inputB = \"\";\n\n var styleA = (nbr == 0 || nbr == 1) ? \"goofy\" : \"default\";//may need to make this different with html range slider\n var styleB = (nbr == 0 || nbr == 1) ? \"default\" : \"goofy\";//reverse for html slider\n var my_limit = (nbr == 0 || nbr == 1) ? slide_limit: canvas_width;//\n\n //SLIDER A\n var sli_ctrl_contA = document.createElement(\"div\");\n sli_ctrl_contA.id = \"sli_ctrl_contA\";\n sli_ctrl_contA.className = \"sli_ctrl_contA\";//\n\n //input\n /*\n var sli_ctrl_inputA = document.createElement(\"input\");\n sli_ctrl_inputA.id = \"sli_ctrl_inputA\";\n sli_ctrl_inputA.className = \"sli_ctrl_inputA\";//\n sli_ctrl_inputA.setAttribute(\"data-slider-id\",\"sli_ctrl_inputA\");//\n sli_ctrl_inputA.setAttribute(\"data-slider-min\",\"-\" + my_limit);//\n sli_ctrl_inputA.setAttribute(\"data-slider-max\",my_limit);//\n sli_ctrl_inputA.setAttribute(\"data-slider-step\",\"1\");//\n var set_valA = slide_data(\"A\",nbr);\n var goof_A = set_valA * -1;//natural opposite effect\n var ctrl_valA = (style == \"goofy\") ? goof_A : set_valA;\n sli_ctrl_inputA.setAttribute(\"data-slider-value\", ctrl_valA);//\n //sli_ctrl_inputA.setAttribute(\"data-slider-handle\",\"custom\");//ninja stars section\n sli_ctrl_inputA.type = \"text\";\n sli_ctrl_inputA.onfocus = function(){this.select();}\n */\n\n sli_ctrl_inputA = document.createElement(\"input\");\n sli_ctrl_inputA.id = \"sli_ctrl_inputA\";\n sli_ctrl_inputA.className = \"sli_ctrl_inputA sli_ctrl_input slider\";\n sli_ctrl_inputA.name = \"sli_ctrl_inputA\";\n //sli_ctrl_inputA.dataset.type = \"range\";\n sli_ctrl_inputA.type = \"range\";\n sli_ctrl_inputA.setAttribute(\"min\",\"-\" + my_limit);\n //max changes depending on user access\n //verified server side\n //entered range number can't be greater than db record of your max access\n sli_ctrl_inputA.setAttribute(\"max\",my_limit);\n var set_valA = slide_data(\"A\",nbr);\n var goof_A = set_valA * -1;//natural opposite effect\n var ctrl_valA = (styleA == \"goofy\") ? goof_A : set_valA;\n sli_ctrl_inputA.setAttribute(\"value\",ctrl_valA);\n\n sli_ctrl_contA.appendChild(sli_ctrl_inputA);//\n\n //A onchange function below\n\n\n var sli_ctrl_boxA = document.createElement(\"input\");\n sli_ctrl_boxA.id = \"sli_ctrl_boxA\";\n sli_ctrl_boxA.className = \" sli_ctrl_boxA\";//\n sli_ctrl_boxA.value = set_valA;//src_x;\n sli_ctrl_boxA.type = \"number\";\n sli_ctrl_boxA.onfocus = function(){this.select(); }\n\n sli_ctrl_boxA.oninput = function(){\n sli_ctrl_inputA.value = sli_ctrl_boxA.value;\n slide_data(\"A\",nbr,{\"value\" :\tsli_ctrl_boxA.value, \"val_oper\": \"add\"});\n //src_x = sli_ctrl_inputA.value;\n sliderA.setValue();\n draw_me();\n }//end on oninput\n\n\n\n //sli_ctrl_contA.appendChild(sli_ctrl_boxA);\n\n //END SLIDER A\n\n //SLIDER B\n var sli_ctrl_contB = document.createElement(\"div\");\n sli_ctrl_contB.id = \"sli_ctrl_contB\";\n sli_ctrl_contB.className = \"sli_ctrl_contB\";\n\n //input\n /*\n var sli_ctrl_inputB = document.createElement(\"input\");\n sli_ctrl_inputB.id = \"sli_ctrl_inputB\";\n sli_ctrl_inputB.className = \"sli_ctrl_inputB\";//\n sli_ctrl_inputB.setAttribute(\"data-slider-id\",\"sli_ctrl_inputB\");//\n sli_ctrl_inputB.setAttribute(\"data-slider-min\",\"-\" + my_limit);\n sli_ctrl_inputB.setAttribute(\"data-slider-max\",my_limit);//\n sli_ctrl_inputB.setAttribute(\"data-slider-step\",\"1\");//\n var set_valB = slide_data(\"B\",nbr);\n var goof_B = set_valB * -1;//natural opposite effect\n var ctrl_valB = (style == \"goofy\") ? goof_B : set_valB;\n sli_ctrl_inputB.setAttribute(\"data-slider-value\",ctrl_valB);\n sli_ctrl_inputB.setAttribute(\"data-slider-orientation\",\"vertical\");\n //sli_ctrl_inputB.setAttribute(\"data-slider-handle\",\"custom\");//ninja stars section\n sli_ctrl_inputB.type = \"text\";\n sli_ctrl_inputB.onfocus = function(){this.select();}\n */\n\n\n sli_ctrl_inputB = document.createElement(\"input\");\n sli_ctrl_inputB.id = \"sli_ctrl_inputB\";\n sli_ctrl_inputB.className = \"sli_ctrl_inputB sli_ctrl_input slider\";\n sli_ctrl_inputB.name = \"sli_ctrl_inputB\";\n //sli_ctrl_inputB.dataset.type = \"range\";\n sli_ctrl_inputB.type = \"range\";\n sli_ctrl_inputB.setAttribute(\"min\",\"-\" + my_limit);\n //max changes depending on user access\n //verified server side\n //entered range number can't be greater than db record of your max access\n sli_ctrl_inputB.setAttribute(\"max\",my_limit);\n var set_valB = slide_data(\"B\",nbr);\n var goof_B = set_valB * -1;//natural opposite effect\n var ctrl_valB = (styleB == \"goofy\") ? goof_B : set_valB;\n sli_ctrl_inputB.setAttribute(\"value\",ctrl_valB);\n\n sli_ctrl_contB.appendChild(sli_ctrl_inputB);\n\n\n //console.info(\"sli_ctrl_inputB\");//\n //console.dir(sli_ctrl_inputB);\n\n var sli_ctrl_boxB = document.createElement(\"input\");\n sli_ctrl_boxB.id = \"sli_ctrl_boxB\";\n sli_ctrl_boxB.className = \"sli_ctrl_boxB\";//\n sli_ctrl_boxB.value = set_valB;//src_y;\n sli_ctrl_boxB.type = \"number\";\n sli_ctrl_boxB.onfocus = function(){this.select(); }\n\n //boxB input event\n sli_ctrl_boxB.oninput = function(){\n sli_ctrl_inputB.value = sli_ctrl_boxB.value;\n slide_data(\"B\",nbr,{\"value\" : \tsli_ctrl_boxB.value, \"val_oper\": \"add\"});\n //src_y = sli_ctrl_inputB.value;\n sliderB.setValue();\n draw_me();\n }//end on oninput\n\n\n\n //sli_ctrl_contB.appendChild(sli_ctrl_boxB);\n\n home.appendChild(sli_ctrl_contA);\n home.appendChild(sli_ctrl_contB);\n\n /*\n var sliderA = new Slider('#sli_ctrl_inputA', {\n formatter: function(value) {\n return 'Current value: ' + value;\n }\n });//end new slider script\n\n console.info(\"sliderA\");\n console.dir(sliderA);\n //http://seiyria.com/bootstrap-slider/\n\n var sliderB = new Slider('#sli_ctrl_inputB', {\n formatter: function(value) {\n return 'Current value: ' + value;\n }\n });//end new slider script\n */\n\n //$('input').slider();//calls both sliders\n //$('#sli_ctrl_inputA').slider();//\n //$(\"#lat_slider\").on('change',function(){slideUpdate({'mode':gEd_mode,'dir':'lattitude'});});\n //$(\"#lon_slider\").on('change',function(){slideUpdate({'mode':gEd_mode,'dir':'longitude'});});\n\n\n //$(\"#sli_ctrl_contB\").on('change',function(){\n sli_ctrl_inputB.oninput = function(e){\n console.log(\"slider B = \",sli_ctrl_inputB.value);\n\t\t\t\t\t\timage_update({\"ltr\":\"B\", \"nbr\":nbr, \"style\":styleB, \"mode\":\"motion\", \"slide_el\":sli_ctrl_inputB, \"box_el\":sli_ctrl_boxB});\n\n };//end on blur\n\n //A onchange function\n //$(\"#sli_ctrl_contA\").on('change',function(){\n sli_ctrl_inputA.oninput = function(){\n console.log(\"slider A = \",sli_ctrl_inputA.value);\n\t\t\t\t\t\timage_update({\"ltr\":\"A\", \"nbr\":nbr, \"style\":styleA, \"mode\":\"motion\", \"slide_el\":sli_ctrl_inputA, \"box_el\":sli_ctrl_boxA});\n\n };//end on blur//\n //http://seiyria.com/bootstrap-slider/\n\n //END SLIDER B\n\n\t\t\t\t\t\tcanvas_mouse_events(\"set\");\n\n\t\t\t\t\t\tcanvas.onmouseover = function(e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tcanvas_mouse_events(\"set\");\n\n\t\t\t\t\t\t\twindow.onmousemove = function(e)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmove_my_image(e);\n\t\t\t\t\t\t\t}//end canvas mousemove\n\n }//on mouse over\n\n //mouse has 4 events (mO,mD, mU, mM) touch only has 3 (tS,tE,tM)\n //so i had to do more with less - it was pretty straight forward after that.\n\n canvas.ontouchstart = function(e)\n {\n touchdown = true;\n e.preventDefault();\n\t\t\t\t\t\t\tget_touch_offset(e)\n\t\t\t\t\t\t\tcanvas_mouse_events(\"set\");\n //alert(\"touch started\");\n\n canvas.ontouchmove = function(e)\n\t\t\t\t\t\t\t{\n //alert(\"move started\");\n\t\t\t\t\t\t\t\tmove_my_image(e);\n\t\t\t\t\t\t\t}//end canvas mousemove\n\n }//end ontouchstart\n\n //i put this in a separate function so i can use it for touch and mouse\n //canvas events\n var move_my_image = function(e)\n {\n //console.log(e);\n\t\t\t\t\t\t\t\tif(mousedown == true || touchdown == true)\n\t\t\t\t\t\t\t\t{\n //alert(\"im goin in\");\n //stops the mouse from hightlighting everyting on the page\n\t\t\t\t\t\t\t\t//e.preventDefault();\n var motion_method = (mousedown == true) ? \"mouse\" : (touchdown == true) ? \"touch\" : \"error\";\n\t\t\t\t\t\t\t\t\t//e.clientX,Y = mouse position in the browser window\n\t\t\t\t\t\t\t\t\tvar y = (mousedown == true) ? e.clientY : e.touches[0].clientY;//this number is a large # like 400 or 600\n\t\t\t\t\t\t\t\t\tvar x = (motion_method == \"mouse\") ? e.clientX : e.touches[0].clientX;\n\t\t\t\t\t\t\t\t\tvar pos = (motion_method == \"mouse\") ? getMousePos(e) : getTouchPos(e);\n\t\t\t\t\t\t\t\t\tvar pos_x = pos.x; //converts to a small number like 37\n\t\t\t\t\t\t\t\t\tvar pos_y = pos.y;\n\n //if(motion_method == \"touch\"){alert(\"pos_x = \" + pos_x + \", pos_y = \" + pos_y\n // + \", x = \" + x + \", y = \" + y)}\n\n\n\t\t\t\t\t\t\t\t\tif(last_x != \"default\" && last_x != x)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//i use \"default\" initially so i can tell if the object\n\t\t\t\t\t\t\t\t\t\t//ever moved at all, if never used i set it in the else\n\n\t\t\t\t\t\t\t\t\t\tif(x < last_x)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//then its going right\n\t\t\t\t\t\t\t\t\t\t\t//this if helps me determine which way the mouse is moving\n\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"x is less\");\n\t\t\t\t\t\t\t\t\t\t\t//calculate how far away the new mouse position is from the\n\t\t\t\t\t\t\t\t\t\t\t//last mouse position\n\t\t\t\t\t\t\t\t\t\t\t//var new_x = last_x - x;\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"new_x = \",new_x);\n\t\t\t\t\t\t\t\t\t\t\t//var cur_val_x = parseInt(sli_ctrl_inputA.value);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputA.value = cur_val_x - new_x //pos_x;//cur_val_x - 50;\n\n\t\t\t\t\t\t\t\t\t\t\t//what i need is to calculate how far img is from the\n\t\t\t\t\t\t\t\t\t\t\t//point of origin basically the img_last_x then i need to\n\t\t\t\t\t\t\t\t\t\t\t//calculate how far the mouse is from that position and\n\t\t\t\t\t\t\t\t\t\t\t//use it as an offset.\n\n\n\t\t\t\t\t\t\t\t\t\t\tvar cur_val_x = parseInt(sli_ctrl_inputA.value);\n\t\t\t\t\t\t\t\t\t\t\tvar new_x = pos_x + offset_x;\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"new_x = \",new_x);\n console.log(\"styleA = \",styleA);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputA.value = new_x;\n\n\n\n\t\t\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//if it uses this section then its going left\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"x is more\");\n\t\t\t\t\t\t\t\t\t\t\t//var new_x = x - last_x;\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"new_x = \",new_x);\n\t\t\t\t\t\t\t\t\t\t\t//var cur_val_x = parseInt(sli_ctrl_inputA.value);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputA.value = cur_val_x + new_x//pos_x//cur_val_x + 50;\n\n\t\t\t\t\t\t\t\t\t\t\tvar cur_val_x = parseInt(sli_ctrl_inputA.value);\n\t\t\t\t\t\t\t\t\t\t\tvar new_x = pos_x + offset_x;\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"new_x = \",new_x);\n console.log(\"styleA = \",styleA);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputA.value = new_x;\n\n\t\t\t\t\t\t\t\t\t\t}//end else x\n\t\t\t\t\t\t\t\t\t\t//console.log(\"new x val= \",sli_ctrl_inputA.value);\n\t\t\t\t\t\t\t\t\t\tif(nbr == 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tsli_ctrl_inputA.value = new_x;\n\t\t\t\t\t\t\t\t\t\t\timage_update({\"ltr\":\"A\", \"nbr\":nbr, \"style\":styleA, \"mode\":\"motion\", \"slide_el\":sli_ctrl_inputA, \"box_el\":sli_ctrl_boxA});//\n\t\t\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tsrc_x = new_x * -1;\n\t\t\t\t\t\t\t\t\t\t\tdraw_me();\n\t\t\t\t\t\t\t\t\t\t}//end else\n\n\n\t\t\t\t\t\t\t\t\t}//end if last_x\n\n\t\t\t\t\t\t\t\t\tif(last_y != \"default\")\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//what is important here is whether im above\n\t\t\t\t\t\t\t\t\t\t//or below the origin\n\n\t\t\t\t\t\t\t\t\t\tif(y < last_y && last_y != y)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//then its going up\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"y is less\");\n\t\t\t\t\t\t\t\t\t\t\t//var new_y = last_y - y;\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"new_y = \",new_y);\n\t\t\t\t\t\t\t\t\t\t\t//var cur_val_y = parseInt(sli_ctrl_inputB.value);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputB.value = cur_val_y - new_y//pos_y//poscur_val_y - 50;\n\n\t\t\t\t\t\t\t\t\t\t\t//then its going up\n\t\t\t\t\t\t\t\t\t\t\tvar new_y = pos_y + offset_y;\n\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm pos_y = \",pos_y);\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm new_y = \",new_y);\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm offset_y = \",offset_y);\n\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputB.value = new_y;\n\n\t\t\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"y is more\");\n\t\t\t\t\t\t\t\t\t\t\t//var new_y = y - last_y;\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"new_y = \",new_y);\n\t\t\t\t\t\t\t\t\t\t\t//var cur_val_y = parseInt(sli_ctrl_inputB.value);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputB.value = cur_val_y + new_y//pos_y//cur_val_y + 50;\n\t\t\t\t\t\t\t\t\t\t\t//then its going up\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"y is less\");\n\n\t\t\t\t\t\t\t\t\t\t\t//var cur_val_y = parseInt(sli_ctrl_inputB.value);\n\t\t\t\t\t\t\t\t\t\t\t//var new_y = pos_y - cur_val_y;\n\t\t\t\t\t\t\t\t\t\t\tvar new_y = pos_y + offset_y;\n\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm pos_y = \",pos_y);\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm new_y = \",new_y);\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm offset_y = \",offset_y);\n\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputB.value = new_y;\n\n\t\t\t\t\t\t\t\t\t\t}//end else x\n\n\n\n\t\t\t\t\t\t\t\t\t\t//console.log(\"new input value = \",sli_ctrl_inputB.value);\n\t\t\t\t\t\t\t\t\t\tif(nbr == 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tsli_ctrl_inputB.value = new_y * -1;\n\t\t\t\t\t\t\t\t\t\t\timage_update({\"ltr\":\"B\", \"nbr\":nbr, \"style\":styleB, \"mode\":\"motion\", \"slide_el\":sli_ctrl_inputB, \"box_el\":sli_ctrl_boxB});\n\t\t\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//using this without modification creates\n\t\t\t\t\t\t\t\t\t\t\t//and opposite effect during moving.\n\t\t\t\t\t\t\t\t\t\t\t//src_y = new_y;\n\n\t\t\t\t\t\t\t\t\t\t\t//modify with new_y * -1\n\t\t\t\t\t\t\t\t\t\t\tsrc_y = new_y * -1;\n\n\t\t\t\t\t\t\t\t\t\t\tdraw_me();\n\t\t\t\t\t\t\t\t\t\t}//end else\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t// i use this the clear the default word and to set the\n\t\t\t\t\t\t\t\t\t//last move for each subsequent mousemove after it runs the\n\t\t\t\t\t\t\t\t\t//above processes\n\t\t\t\t\t\t\t\t\tlast_x = x;\n\t\t\t\t\t\t\t\t\tlast_y = y;\n\t\t\t\t\t\t\t\t\t//console.log(\"mouse-x = \",x);\n\t\t\t\t\t\t\t\t\t//console.log(\"last_x = \",last_x);\n\t\t\t\t\t\t\t\t\t//console.log(\"pos_x = \",pos_x);\n\t\t\t\t\t\t\t\t\t//console.log(\"pos_y = \",pos_y);\n\n\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//clear the tracker\n\t\t\t\t\t\t\t\t\t//last_x = \"\";\n\t\t\t\t\t\t\t\t\t//last_y = \"\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//end if\n\n }//end move my image\n\n\n }//end add_slider_input\n\n\n function getTouchPos(e) {\n var rect = canvas.getBoundingClientRect();\n //alert(\"touch x = \" + e.touches[0].clientX);\n return {\n x: e.touches[0].clientX - rect.left,\n y: e.touches[0].clientY - rect.top\n };\n }\n\n\n var getMousePos = function(e) {\n\n\t\t\t//this section returns the mouse position minus the\n\t\t\t//canvas' top or left window position. \"rect\"\n\n\t\t\tvar canvas_el = document.getElementById(\"tutorial\");\n\t\t\tvar rect = canvas.getBoundingClientRect();\n\n\t\t\t//console.log(\"rect.left\" + rect.left);\n\n\t\t\treturn {\n\t\t\t\tx: (e.clientX - rect.left) ,\n\t\t\t\ty: (e.clientY - rect.top)\n\t\t\t};\n\n\t\t}//- canvas_size/2 - canvas_size/2\n\n\t\tvar canvas_mouse_events = function(aVar,cId)\n\t\t{\n\n\t\t\t//this function adds and removes events that affects the canvas\n\t\t\t//once you are outside of the canvas and you let the mouse up\n\t\t\t//this is designed to clear these mouse events from the memory so\n\t\t\t//no event occurs again until you are \"mouseover\"'d the canvans where\n\t\t\t//which will set up these events again.\n\t\t\tvar action = aVar || \"remove\";\n\t\t\tvar canvas_id = cId;\n\t\t\tvar canvas_el = document.getElementById(cId);\n\n\t\t\tif(action == \"set\"){\n\n\t\t\t\t\t\tcanvas.onmousedown = function(e){\n\t\t\t\t\t\t\tmousedown = true;\n e.preventDefault();\n\t\t\t\t\t\t\tvar d = new Date();\n\t\t\t\t\t\t\t//console.log(\"onmousedown mousedown = \",mousedown);\n\t\t\t\t\t\t\t//console.log(\"time = \",d.toLocaleString());\n\t\t\t\t\t\t\tvar pos = getMousePos(e)\n\t\t\t\t\t\t\tvar pos_x = pos.x;\n\t\t\t\t\t\t\tvar pos_y = pos.y;\n\t\t\t\t\t\t\t//x is dealing with different values so\n\t\t\t\t\t\t\t//the math is addition not subtraction\n\n\t\t\t\t\t\t\t//this offset number has to be\n\t\t\t\t\t\t\t//permanent not recalculating so it\n\t\t\t\t\t\t\t//doesn't migrate to another position\n\n\t\t\t\t\t\t\t//pos_x - src_x; & pos_y - src_y; produced errant results\n\t\t\t\t\t\t\t//pos_x/y is always negative - you cant click on other\n\t\t\t\t\t\t\t//side of origin - so to properly calculate the offset\n\t\t\t\t\t\t\t//change mouse position read out from the positive int\n\t\t\t\t\t\t\t//representing the amount of canvas points from the\n\t\t\t\t\t\t\t//origin to a more accurate negative number representing\n\t\t\t\t\t\t\t//the actual canvas position\n\t\t\t\t\t\t\tvar act_x = (pos_x * -1);\n\t\t\t\t\t\t\tvar act_y = (pos_y * -1);\n\n\t\t\t\t\t\t\toffset_x = act_x - src_x;\n\n\t\t\t\t\t\t\toffset_y = act_y - src_y;\n\n\t\t\t\t\t\t\tcanvas_mouse_events(\"set\");\n\t\t\t\t\t\t}//end onmousedown\n\n\n window.onmouseup = function()\n {\n mousedown = false;\n\n }//end onmousedown\n\n window.ontouchend = function()\n {\n touchdown = false;\n\n }//end ontouchend\n\n\n\t\t\t}else\n {\n\t\t\t\t\t\tmousedown = false;\n\t\t\t\t\t\tcanvas.onmousedown = \"\";\n\t\t\t\t\t\tcanvas.onmousemove = \"\";\n\n touchdown = false;//\n canvas.ontouchstart = \"\";\n canvas.ontouchmove = \"\";\n\n\t\t\t}//end else\n\t\t}//end canvas_mouse_events\n\n var get_touch_offset = function(e)\n {\n var d = new Date();\n\t\t\t\t\t\t\t//console.log(\"onmousedown mousedown = \",mousedown);\n\t\t\t\t\t\t\t//console.log(\"time = \",d.toLocaleString());\n\t\t\t\t\t\t\tvar pos = getTouchPos(e);\n\t\t\t\t\t\t\tvar pos_x = pos.x;\n\t\t\t\t\t\t\tvar pos_y = pos.y;\n\n\t\t\t\t\t\t\tvar act_x = (pos_x * -1);\n\t\t\t\t\t\t\tvar act_y = (pos_y * -1);\n\n\t\t\t\t\t\t\toffset_x = act_x - src_x;\n\n\t\t\t\t\t\t\toffset_y = act_y - src_y;\n //alert(\" offset_x & y = \" + offset_x + \"\\n \" + offset_y);\n\n }//end get touch offset\n\n var image_update = function(mObj){\n\t\t\t//console.info(\"image update running\");\n\n\t\t\tvar style = mObj.style;\n\t\t\tvar ltr = mObj.ltr;\n\n\t\t\tvar nbr = mObj.nbr;\n\t\t\tvar mode = mObj.mode;//\"motion\" or not (\"input\" as other)\n\n\t\t\tvar slide_el = mObj.slide_el;\n\t\t\tvar box_el = mObj.box_el;\n\n\t\t\tvar target_el = (mode == \"motion\") ? slide_el : box_el;\n\n\t\t\tif(mode == \"motion\")\n\t\t\t{\n\t\t\t\t//make regular and goofy foot (opposite) values\n\t\t\t\tvar val_regular_input = target_el.value;\n\t\t\t\tvar val_goof_input = target_el.value * -1;\n\t\t\t\tvar input_val = (style == \"goofy\") ? val_goof_input : val_regular_input;\n\t\t\t\tbox_el.value = input_val;//unique to motion\n\t\t\t}else\n\t\t\t{\n\t\t\t\tif(ltr = \"A\"){\n\t\t\t\t\tsli_ctrl_inputA.value = box_el.value;\n\t\t\t\t}else{\n\t\t\t\t\tsli_ctrl_inputB.value = box_el.value;\n\t\t\t\t}\n\n\t\t\t\tvar input_val = box_el.value;\n\t\t\t\t//slide_data(\"B\",nbr,{\"value\" : \tsli_ctrl_boxB.value, \"val_oper\": \"add\"});\n\t\t\t\t//src_y = sli_ctrl_inputB.value;\n\n\t\t\t}\n\n\t\t\tslide_data(ltr,nbr,{\"value\" :\tinput_val, \"val_oper\": \"add\"});\n\n\n\t\t\tif(mode == \"input\"){\n\t\t\t\tif(ltr == \"A\")\n\t\t\t\t{\n\t\t\t\t\t//make these \"object properties\"\n\t\t\t\t\tsliderA.setValue();//unique to input\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\tsliderB.setValue();//unique to input\n\t\t\t\t}\n\t\t\t}//end if mode == input\n\n\t\t\tdraw_me();\n\n\t\t}//end image_update\n\n var slide_data = function(ltr,nbr,obj)\n {\n //span_set2 view_span span3 view_span3\n var slide_ltr = ltr;\n var nbr = nbr;\n var val = (obj != undefined && obj.value != undefined) ? obj.value : \"\";\n var val_oper = (obj != undefined && obj.val_oper != undefined) ? obj.val_oper : \"get_value\";\n\n var slide_id = ltr+nbr;\n var span_id_str = \"span\" + slide_id;\n var targetSpan = document.getElementById(span_id_str);\n\n if(val != \"\" && val_oper == \"add\" || val_oper == \"both\"){\n //A covers x and width\n //B covers y and height\n switch(slide_id)\n {\n case \"A0\":\n src_x = val;\n //targetSpan.innerText = val;\n break;\n case \"B0\":\n src_y = val;\n //targetSpan.innerText = val;\n break;\n\n case \"A1\":\n img_w = val;\n //targetSpan.innerText = val;\n break;\n case \"B1\":\n img_h = val;\n //targetSpan.innerText = val;\n break;\n\n case \"A2\":\n can_x = val;\n //targetSpan.innerText = val;\n break;\n case \"B2\":\n can_y = val;\n //targetSpan.innerText = val;\n break;\n\n case \"A3\":\n can_w = val;\n //targetSpan.innerText = val;\n break;\n case \"B3\":\n can_h = val;\n //targetSpan.innerText = val;\n break;\n }//end switch\n }//end if\n\n if(val_oper == \"get_value\" || val_oper == \"both\"){\n switch(slide_id)\n {\n case \"A0\":\n return src_x;\n break;\n case \"B0\":\n return src_y;\n break;\n case \"A1\":\n return img_w;\n break;\n case \"B1\":\n return img_h;\n break;\n case \"A2\":\n return can_x;\n break;\n case \"B2\":\n return can_y;\n break;\n\n case \"A3\":\n return can_w;\n break;\n case \"B3\":\n return can_h;\n break;\n }//end switch\n }//end if\n\n }//end slide_dataA\n\n\n /*\n\n //this.draw_me = function(){ draw_me(); };\n */\n\n\n }", "function image_medium1() {\r\n return gulp\r\n .src(medium1.src, { nodir: true })\r\n .pipe(newer(medium1.dist + \"medium\"))\r\n .pipe(imageresize({\r\n width: medium1.params.width,\r\n height: medium1.params.height,\r\n crop: medium1.params.crop,\r\n upscale: false\r\n }))\r\n .pipe(imagemin({\r\n progressive: true,\r\n svgoPlugins: [{ removeViewbox: false}, { removeUselessStrokeAndFill: false }]\r\n }))\r\n .pipe(gulp.dest(medium1.dist + \"medium\"));\r\n\r\n}", "function handleFiles(files, maxImages) {\n\n // set fallback for max images\n if(typeof maxImages == 'undefined') { maxImages = 5; }\n\n var existingImageCount = $(\"#issue_images > *\").length;\n\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n var imageType = /^image\\//;\n \n if (!imageType.test(file.type)) {\n continue;\n }\n\n if((files.length + existingImageCount) > $maxImages) {\n alert('You can only upload a maximum of ' + $maxImages + ' images.');\n break;\n }\n\n var previewDiv = document.createElement(\"div\");\n previewDiv.classList.add(\"badge\", \"badge-image\", \"u-relative\", \"u-mr10\");\n previewDiv.file = file;\n issue_images.appendChild(previewDiv);\n \n var reader = new FileReader();\n reader.onload = (function(aImg) {\n return function(e) {\n\n // convert string to form value\n var base64string = '';\n if (e.target.result.split(',')[0].indexOf('base64') >= 0) {\n base64string = e.target.result.split(',')[1];\n var resultInput = document.createElement(\"input\");\n resultInput.type = 'hidden';\n resultInput.name = 'images[]';\n resultInput.value = base64string;\n aImg.appendChild(resultInput);\n } else {\n alert('There was a problem with your image.');\n return false;\n }\n\n // output preview image\n aImg.style.backgroundImage = 'url(' + e.target.result + ')';\n\n // add remove button\n var closeButtonIcon = document.createElement(\"i\");\n closeButtonIcon.classList.add(\"ion\", \"ion-onbadge\", \"ion-close\");\n var closeButton = document.createElement(\"a\");\n closeButton.href = 'javascript:void(0)';\n closeButton.class = 'remove-image';\n closeButton.appendChild(closeButtonIcon);\n\n aImg.appendChild(closeButton);\n\n closeButton.addEventListener('click', function(e) {\n $(this).closest('.badge').remove();\n checkImageCount();\n });\n }; \n })(previewDiv);\n reader.readAsDataURL(file);\n }\n}", "function make3Images() {\n var firstImageFilePath = allItem[queue[3]].filePath;\n allItem[queue[3]].shown++;\n var secondImageFilePath = allItem[queue[4]].filePath;\n allItem[queue[4]].shown++;\n var thirdImageFilePath = allItem[queue[5]].filePath;\n allItem[queue[5]].shown++;\n image1.src = firstImageFilePath;\n image2.src = secondImageFilePath;\n image3.src = thirdImageFilePath;\n}", "generateImages(){const fullDeferred=new $.Deferred;const thumbDeferred=new $.Deferred;const resolveFullBlob=blob=>fullDeferred.resolve(blob);const resolveThumbBlob=blob=>thumbDeferred.resolve(blob);const displayPicture=url=>{const image=new Image;image.src=url;// Generate thumb.\nconst maxThumbDimension=friendlyPix.Uploader.THUMB_IMAGE_SPECS.maxDimension;const thumbCanvas=friendlyPix.Uploader._getScaledCanvas(image,maxThumbDimension);thumbCanvas.toBlob(resolveThumbBlob,'image/jpeg',friendlyPix.Uploader.THUMB_IMAGE_SPECS.quality);// Generate full sized image.\nconst maxFullDimension=friendlyPix.Uploader.FULL_IMAGE_SPECS.maxDimension;const fullCanvas=friendlyPix.Uploader._getScaledCanvas(image,maxFullDimension);fullCanvas.toBlob(resolveFullBlob,'image/jpeg',friendlyPix.Uploader.FULL_IMAGE_SPECS.quality)};const reader=new FileReader;reader.onload=e=>displayPicture(e.target.result);reader.readAsDataURL(this.currentFile);return Promise.all([fullDeferred.promise(),thumbDeferred.promise()]).then(results=>{return{full:results[0],thumb:results[1]}})}", "function showPicked(input) {\n const width = 400;\n\n const fileName = input.files[0].name;\n el(\"upload-label\").innerHTML = fileName;\n var reader = new FileReader();\n reader.onload = function(readerEvent) {\n el(\"image-picked\").src = readerEvent.target.result;\n el(\"image-picked\").className = \"\";\n\t \n var img = new Image();\n img.onload = function(imageEvent) {\n const elem = document.createElement('canvas');\n const scaleFactor = width / img.width;\n elem.width = width;\n elem.height = img.height * scaleFactor;\n const ctx = elem.getContext('2d');\n // img.width and img.height will contain the original dimensions\n ctx.drawImage(img, 0, 0, width, img.height * scaleFactor);\n const dataUrl = ctx.canvas.toDataURL(img, 'image/jpeg', 1);\n //el(\"resized-image\").className = \"\";\n el(\"resized-image\").src = dataUrl;\n //var resizedImage = dataURLToBlob(dataUrl);\n //el(\"resized-Image\") = resizedImage;\n //ctx.canvas.toBlob((blob) => {\n // const file = new File([blob], fileName, {\n // type: 'image/jpeg',\n // lastModified: Date.now()\n // });\n //}, 'image/jpeg', 1);\n }\n img.src = readerEvent.target.result;\n reader.onerror = error => console.log(error);\n\n };\n reader.readAsDataURL(input.files[0]);\n}", "function loadImage(fileList, fileIndex) {\n\t//if (fileList.indexOf(fileIndex) < 0) {\n cc = document.getElementById('user_image').getContext('2d');\n\n\t\tvar reader = new FileReader();\n\t\treader.onload = (function(theFile) {\n\t\t return function(e) {\n\t\t\t\t// check if positions already exist in storage\n\t\t\t\t// Render thumbnail.\n\t\t\t\tvar canvas = document.getElementById('user_image')\n\t\t\t\tvar cc = canvas.getContext('2d');\n\t\t\t\tvar img = new Image();\n\t\t\t\timg.onload = function() {\n\t\t\t\t\tif (img.height > 500 || img.width > 700) {\n\t\t\t\t\t\tvar rel = img.height/img.width;\n\t\t\t\t\t\tvar neww = 700;\n\t\t\t\t\t\tvar newh = neww*rel;\n\t\t\t\t\t\tif (newh > 500) {\n\t\t\t\t\t\t\tnewh = 500;\n\t\t\t\t\t\t\tneww = newh/rel;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcanvas.setAttribute('width', neww);\n\t\t\t\t\t\tcanvas.setAttribute('height', newh);\n // overlay.setAttribute('width', neww);\n // overlay.setAttribute('height', newh);\n\t\t\t\t\t\tcc.drawImage(img,0,0,neww, newh);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcanvas.setAttribute('width', img.width);\n\t\t\t\t\t\tcanvas.setAttribute('height', img.height);\n // overlay.setAttribute('width', img.width);\n // overlay.setAttribute('height', img.height);\n\t\t\t\t\t\tcc.drawImage(img,0,0,img.width, img.height);\n\t\t\t\t\t}\n startCrop(overlay);\n // jQuery('#overlay').css({left:jQuery('#user_image').offset().left})\n // jQuery('#overlay').css({top:jQuery('#user_image').offset().top})\n\t\t\t\t}\n\t\t\t\timg.src = e.target.result;\n\n\t\t\t};\n\t\t})(fileList[fileIndex]);\n\t\treader.readAsDataURL(fileList[fileIndex]);\n\t\toverlayCC.clearRect(0, 0, 720, 576);\n\t\tdocument.getElementById('convergence').innerHTML = \"\";\n\t\tctrack.reset();\n\n animateClean();\n//\t}\n}", "function imagePreview(input) {\n if (input.files && input.files[0]) {\n const fileReader = new FileReader();\n fileReader.onload = function (e) {\n const image = input.files[0];\n const imageName = image.name;\n const imageSize = image.size;\n const imageExt = imageName.split('.').pop().toLowerCase();\n const validExt = ['jpeg' , 'jpg' , 'png'];\n const validSize = 2000000; // image size of 2 000 000 bytes = 2MB\n const imageExtIsValid = validExt.includes(imageExt); // validates to true if it is a valid image file\n const imageSizeIsValid = imageSize <= validSize; // validates to true if it is a valid image size\n let messageDiv = document.getElementById('sermon-banner-message');\n let message = '';\n\n if (!imageExtIsValid && !imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a valid image file less than 2MB\n </small>`;\n sermonImgTagPreview.setAttribute('src', '');\n\n } else if (imageExtIsValid && !imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a smaller image file less than 2MB\n </small>`;\n sermonImgTagPreview.setAttribute('src', '');\n\n } else if (!imageExtIsValid && imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a valid image file\n </small>`;\n sermonImgTagPreview.setAttribute('src', '');\n\n } else {\n messageDiv.style.display = 'none';\n sermonImgTagPreview.setAttribute('src', e.target.result);\n }\n\n messageDiv.innerHTML = message;\n messageDiv.style.display = 'block';\n \n }\n fileReader.readAsDataURL(input.files[0]);\n }\n}", "function previewBackground(e){\n var maxWidth = 0;\n var maxHeight = 0;\n var img = $(\"#bg_file\").val().toString().split(\"\\\\\");\n img = img[img.length - 1].split(\".\");\n\n var ext = img[img.length - 1].toUpperCase();\n var imgFile = this.files;\n\n if(imgFile == undefined || imgFile.length == 0)\n return false;\n\n imgFile = this.files[0];\n var imgFileType = imgFile.type;\n var match = [\"image/jpeg\", \"image/png\", \"image/jpg\", \"image/gif\"];\n\n if(!((imgFileType == match[0]) || (imgFileType == match[1]) || (imgFileType == match[2]))){\n alert(\"Type file \" + ext + \" not supported\");\n return false;\n }else{\n if(imgFile.size > 7168000){\n alert(\"File dimension exceeded\");\n return false;\n }\n var reader = new FileReader();\n reader.onload = function(event) {\n var src = event.target.result;\n var newImg = $('<img id=bg_fake src=\"' + src + '\" style=\"display:none;\">');\n\n $(\"#bg_fake\").replaceWith(newImg);\n newImg.on('load', function() {\n if(position == \"Categories\"){\n maxWidth = 2048;\n maxHeight = 1536;\n if(newImg.outerWidth() > maxWidth || newImg.outerHeight() > maxHeight){\n alert(\"Image dimension not allowed. It will be at most \"+ maxWidth +\" x \"+ maxHeight +\".\");\n return false;\n }else{\n $(\"#set_category_bg\").val(img[0] + \".\" + img[1]);\n $(\"#bg_image\").attr(\"src\", src);\n }\n }else{\n maxWidth = 1080;\n maxHeight = 720;\n if(newImg.outerWidth() < maxWidth || newImg.outerHeight() < maxHeight){\n alert(\"Image dimension not allowed. It will be at least \"+ maxWidth +\" x \"+ maxHeight +\".\");\n return false;\n }else{\n $(\"#bg_image\").attr(\"src\", src);\n }\n }\n });\n };\n reader.onerror = function(event) {\n alert(\"ERROR TYPE: \" + event.target.error.code);\n };\n reader.readAsDataURL(imgFile);\n }\n}", "function parallelExecMosaic() {\n var self = this;\n var rowsDone = 0;\n var WORKER_COUNT = window.WORKER_COUNT\n\n // divide tile-rows among all worker instances\n for (var i = 0; i < WORKER_COUNT; i++) {\n var worker = initWorker(\"/js/img-tools-worker.js\");\n worker.mosaicInstance = self;\n\n // num of tile-rows for the current worker\n var rowsInIter = (i !== WORKER_COUNT - 1 ? Math.floor((self.maxY + 1) / WORKER_COUNT) :\n (Math.floor((self.maxY + 1) / WORKER_COUNT) + (self.maxY + 1) % WORKER_COUNT));\n\n // worker payload\n var tileTaskArr = [];\n\n // iterate through those tile-rows and construct the payload for the worker\n for (var q = rowsDone; q < rowsDone + rowsInIter; q++) {\n for (var p = 0; p <= self.maxX; p++) {\n\n var tileImgData = self.getTileDataAt(p, q);\n if (tileImgData) {\n tileImgData = tileImgData.data;\n tileTaskArr.push({\n tileImgData: tileImgData,\n x: p,\n y: q\n });\n }\n }\n }\n\n // the cpu intensive process of computing avgTileColor will done inside a worker\n worker.postMessage({\n tileArr: tileTaskArr\n });\n // increment the num of rows sent away as payload.\n rowsDone += rowsInIter;\n }\n }", "function image_large1() {\r\n return gulp\r\n .src(large1.src, { nodir: true })\r\n .pipe(newer(large1.dist + \"large\"))\r\n .pipe(imageresize({\r\n width: large1.params.width,\r\n height: large1.params.height,\r\n crop: large1.params.crop,\r\n upscale: false\r\n }))\r\n .pipe(imagemin({\r\n progressive: true,\r\n svgoPlugins: [{ removeViewbox: false}, { removeUselessStrokeAndFill: false }]\r\n }))\r\n // .pipe(rename({suffix: '-low'}))\r\n .pipe(gulp.dest(large1.dist + \"large\"));\r\n\r\n}", "function renderImagePreview(files, $container, $inner) {\n\n // empty preview\n $inner.empty();\n\n var file;\n for (var i = 0; i < files.length; i++) {\n file = files[0];\n var imageType = /^image\\//;\n\n if (!imageType.test(file.type)) {\n continue;\n }\n break;\n }\n\n // \n // create image element\n var img = document.createElement(\"img\");\n img.classList.add(\"obj\");\n img.file = file;\n img.setAttribute('style', 'max-width: 100%; max-height: 100%;');\n $inner.append($('<div class=\"image-wrapper\" />').append(img)); // Assuming that \"preview\" is the div output where the content will be displayed.\n\n // build reader\n var reader = new FileReader();\n reader.onload = (function(_img) {\n return function(ev) { \n _img.src = ev.target.result; \n }; \n })(img);\n reader.readAsDataURL(file);\n\n return img;\n}", "function resize_images(frame) {\r\n// console.time('benchmark');\r\n\r\n image = {}\r\n // setup initial hash - account for X number of images next to eachother\r\n for (var i=0; i<20; i++) {\r\n image[i] = {}\r\n }\r\n counter=0;\r\n currentwidth=0;\r\n currentheight=0;\r\n\r\n\r\n\r\n maxheight = THUMB_SIZE;\r\n framemargin = 24;\r\n maxwidth= $(window).width()-20;\r\n\r\n //console.log('RESIZE');\r\n \r\n $(frame).each(function() {\r\n // theory: height must be the same for all pictures\r\n // width must fill the width of the window\r\n // must add/remove picture depending of violating max height\r\n\r\n\r\n\r\n // calculate if 1 or 2 image will fill the screen\r\n \r\n /*image[counter]['height'] = parseInt($(this).attr(\"oheight\"));\r\n image[counter]['width'] = parseInt($(this).attr(\"owidth\"));*/\r\n // rescale to thumbnail size\r\n image[counter]['height'] = THUMB_SIZE;\r\n image[counter]['width'] = Math.floor((THUMB_SIZE/parseInt($(this).attr(\"oheight\")))*parseInt($(this).attr(\"owidth\")));\r\n \r\n //image[counter]['id'] = $(this).attr('id');\r\n image[counter]['item'] = $(this);\r\n\r\n //console.log(JSON.parse(JSON.stringify(image)));\r\n\r\n //image[0]['height'] = $(this).find('img').height();\r\n //console.log('original image:'+counter+' width:'+image[counter]['width']);\r\n //console.log('alternate image:'+counter+' width:'+$(this).width());\r\n\r\n currentwidth += image[counter]['width']\r\n //currentheight += image[counter]['height']\r\n\r\n if (currentwidth > (maxwidth - (counter*framemargin))) {\r\n //console.log('maxwidth reached - width: '+currentwidth+' calculated:'+(currentwidth + (counter*framemargin))+' maxwidth:'+maxwidth+' counter:'+counter);\r\n // we have enough data to fill the line, calculate needed height\r\n adjustperc=((maxwidth - (counter*framemargin))/currentwidth);\r\n //console.log('adjustment:'+adjustperc)\r\n //newwidth=0;\r\n newheight=0;\r\n for (var i=0; i<counter+1; i++) {\r\n // set width\r\n $(image[i]['item']).width(Math.floor(image[i]['width']*adjustperc));\r\n\r\n // make sure height is the same everywhere too - always recalculate based on origin \r\n if (newheight == 0) { \r\n newheight=Math.floor(image[i]['height']*adjustperc)\r\n }\r\n $(image[i]['item']).height(newheight);\r\n \r\n //console.log('adjusting '+i+' id:'+$(image[i]['item']).attr(\"id\")+' w: '+$(image[i]['item']).width()+' h: '+$(image[i]['item']).height()) \r\n //newwidth+=$(image[i]['item']).width();\r\n\r\n }\r\n currentwidth=0;\r\n counter=0;\r\n firstset=1\r\n } else {\r\n counter++;\r\n }\r\n\r\n\r\n // make sure the remaining items have their limits too\r\n if ($(this).attr(\"id\") == $(frame).last().attr(\"id\")) {\r\n //console.log(\"last item detected\");\r\n for (var i=0; i<counter; i++) {\r\n $(image[i]['item']).width( image[i]['width'] );\r\n $(image[i]['item']).height( image[i]['height'] );\r\n }\r\n } \r\n/*\r\n\r\n if (($(this).attr(\"id\") == $(frame).last().attr(\"id\")) && (counter != 0)) {\r\n //console.log('preload more!');\r\n var x=1;\r\n if (bla == 0) {\r\n bla = 1\r\n x = PreloadImages(1);\r\n //x = PreloadImages(1);\r\n //resize_images(\"#gallery_list .frame\");\r\n\r\n }\r\n console.log('x = '+x);\r\n //if (PreloadImages(1) == true) { \r\n // console.log('got an extra image');\r\n //resize_images(\"#gallery_list .frame\");\r\n //}\r\n }\r\n*/\r\n//console.timeEnd('benchmark');\r\n\r\n\r\n });\r\n}", "function imgRepeat() {\n const lockedGrid = preferencesService.lockedGrid;\n var hrefLinkIndex = 0;\n\n // May create a minor memory leak, but the thumbnails are tiny anyway.\n el.empty();\n\n // Use a copy\n let photos = scope.photoLibrary[scope.index.current].data.slice(),\n remainder;\n\n oneHundred();\n\n // Use scroll to rate limit img loading. Prevents net resource errors.\n el.on('scroll', oneHundred);\n\n // Add oneHundred imgs to the DOM.\n function oneHundred() {\n\n el.off('scroll');\n\n remainder = photos.splice(100);\n\n // Add the 100.\n _.each(photos, addImgToDom);\n\n photos = remainder;\n\n // If there's more to do, add back the listener after a delay.\n if (photos.length !== 0) {\n setTimeout(el.on.bind(el, 'scroll', oneHundred), 250);\n }\n\n }\n\n // Add an img to the DOM.\n function addImgToDom(photo, i){\n let div, img = new Image();\n\n if (lockedGrid) {\n div = document.createElement(\"div\");\n div.className = \"import-preview-locked-grid-image-wrapper\"\n img.className = photo.orientClass + ' ' + photo.orientClass + '-scale-up import-preview-locked-grid-image';\n } else {\n let ratio = photo.ratio;\n img.className = photo.orientClass + ' import-preview-fit-to-height';\n if (ratio === 1) {\n img.className += ' ' + photo.orientClass + '-no-scale';\n } else if (1 < ratio && ratio <= 1.5) {\n img.className += ' ' + photo.orientClass + '-medium';\n } else if (ratio > 1.6) {\n img.className += ' ' + photo.orientClass + '-small';\n }\n }\n\n img.src = photo.thumbnail;\n\n if (lockedGrid) {\n el.append(angular.element(div).append(img));\n } else {\n el.append(img);\n }\n\n addImageLink(img);\n\n } // end addImgToDom\n\n function addImageLink(img){\n let idxCopy = hrefLinkIndex++;\n angular.element(img).on('click', function(){\n stateService.store('goTo', idxCopy);\n stateService.transitionTo('importView', scope.photoLibrary[scope.index.current], true);\n })\n } // end addImageLink\n }", "function ImageWorkerManager() {\n \n //////////////////////////////////////////////////////////////\n // ImageMetadata object constructor\n function ImageMetadata(imageCanvas) {\n this.isProcessing = false;\n this.canvas = imageCanvas;\n this.width = 0;\n this.height = 0;\n }\n\n //////////////////////////////////////////////////////////////\n // Private ImageWorkerManager properties\n var workerThread = null;\n var imageMetadataMap = {};\n \n //////////////////////////////////////////////////////////////\n // Private ImageWorkerManager methods\n function ensureInitialized() {\n // Lazy-initialize web worker thread\n if (workerThread == null) {\n workerThread = new Worker(scriptRootURIPath + \"KinectWorker-1.8.0.js\");\n workerThread.addEventListener(\"message\", function (event) {\n var imageName = event.data.imageName;\n if (!imageMetadataMap.hasOwnProperty(imageName)) {\n return;\n }\n var metadata = imageMetadataMap[imageName];\n \n switch (event.data.message) {\n case \"imageReady\":\n // Put ready image data in associated canvas\n var canvasContext = metadata.canvas.getContext(\"2d\");\n canvasContext.putImageData(event.data.imageData, 0, 0);\n metadata.isProcessing = false;\n break;\n \n case \"notProcessed\":\n metadata.isProcessing = false;\n break;\n }\n });\n }\n }\n\n //////////////////////////////////////////////////////////////\n // Public ImageWorkerManager methods\n \n // Send named image data to be processed by worker thread\n // .processImageData(imageName, imageBuffer, width, height)\n //\n // imageName: Name of image to process\n // imageBuffer: ArrayBuffer containing image data\n // width: width of image corresponding to imageBuffer data\n // height: height of image corresponding to imageBuffer data\n this.processImageData = function (imageName, imageBuffer, width, height) {\n ensureInitialized();\n \n if (!imageMetadataMap.hasOwnProperty(imageName)) {\n // We're not tracking this image, so no work to do\n return;\n }\n var metadata = imageMetadataMap[imageName];\n \n if (metadata.isProcessing || (width <= 0) || (height <= 0)) {\n // Don't send more data to worker thread when we are in the middle\n // of processing data already.\n // Also, Only do work if image data to process is of the expected size\n return;\n }\n \n metadata.isProcessing = true;\n\n if ((width != metadata.width) || (height != metadata.height)) {\n // Whenever the image width or height changes, update image tracking metadata\n // and canvas ImageData associated with worker thread\n \n var canvasContext = metadata.canvas.getContext(\"2d\");\n var imageData = canvasContext.createImageData(width, height);\n metadata.width = width;\n metadata.height = height;\n metadata.canvas.width = width;\n metadata.canvas.height = height;\n\n workerThread.postMessage({ \"message\": \"setImageData\", \"imageName\": imageName, \"imageData\": imageData });\n }\n \n workerThread.postMessage({ \"message\": \"processImageData\", \"imageName\": imageName, \"imageBuffer\": imageBuffer });\n };\n\n // Associate specified image name with canvas ImageData object for future usage by\n // worker thread\n // .setImageData(imageName, canvas)\n //\n // imageName: Name of image stream to associate with ImageData object\n // canvas: Canvas to bind to user viewer stream\n this.setImageData = function (imageName, canvas) {\n ensureInitialized();\n\n if (canvas != null) {\n var metadata = new ImageMetadata(canvas);\n imageMetadataMap[imageName] = metadata;\n } else if (imageMetadataMap.hasOwnProperty(imageName)) {\n // If specified canvas is null but we're already tracking image data,\n // remove metadata associated with this image.\n delete imageMetadataMap[imageName];\n }\n };\n }", "function _enableImagePreviews() {\n if (_options.enableImagePreviews) {\n $(\".pfsd-image\").each(function () {\n var path = $(this).data(\"path\"),\n name = FileUtils.getBaseName(path),\n previewId = name.replace(/[ .,:&%$#@~]/g, \"\"),\n bgColor = $(\".modal-body\").css(\"background-color\"),\n previewHtml = Mustache.render(ImagePreview, {\n previewId: previewId,\n path: path\n });\n\n $(this).hover(\n function () {\n var $modalBody = $(\".modal-body\"),\n modalBodyRect = $modalBody[0].getBoundingClientRect(),\n modalBodyTop = modalBodyRect.top,\n modalBodyBottom = modalBodyRect.bottom,\n modalBodyLeft = modalBodyRect.left,\n modalBodyRight = modalBodyRect.right,\n itemTop = $(this).offset().top,\n imageLeft = ((modalBodyRight - modalBodyLeft) / 2) - 100,\n modalBodyMiddle = (modalBodyBottom - modalBodyTop / 2) - 40,\n imageTop = itemTop - 486 + $modalBody.scrollTop(),\n $preview = $(previewHtml);\n\n if (itemTop < modalBodyMiddle) imageTop += 186;\n if (_platform === \"win32\") imageTop += 60;\n\n $modalBody.append($preview);\n $preview.hide();\n $preview.css({\n \"left\": imageLeft + \"px\",\n \"top\": imageTop + \"px\"\n });\n $(this).css(\"background-color\", \"#9a823b\");\n $preview.fadeIn();\n },\n function () {\n $(\"#\" + previewId).remove();\n $(this).css(\"background-color\", bgColor);\n }\n );\n });\n }\n }", "@action\n resize() {\n this.compressImage(this.selectedImageUser.value)\n }", "getImagePreviews() {\n // Iterate over all of the files and generate an image preview for each one.\n for (let i = 0; i < this.files.length; i++) {\n // Ensure the file is an image file\n if (/\\.(jpe?g|png|gif)$/i.test(this.files[i].name)) {\n // Creates a new FileReader object\n let reader = new FileReader();\n\n // Add an event listener for when the file has been loaded\n // to update the src on the file preview.\n reader.addEventListener(\n \"load\",\n () => {\n this.$nextTick(function() {\n this.$refs[`${this.id}-image-${i}`][0].src = reader.result;\n });\n },\n false\n );\n\n // Read the data for the file in through the reader. When it has\n // been loaded, we listen to the event propagated and set the image\n // src to what was loaded from the reader.\n reader.readAsDataURL(this.files[i]);\n }\n }\n }", "function uploadIMG(){\r\n image = new SimpleImage(fileinput);\r\n image1 = new SimpleImage(fileinput);\r\n image2 = new SimpleImage(fileinput);\r\n image3 = new SimpleImage(fileinput);\r\n image.drawTo(imgcanvas);\r\n clearAnon();\r\n}", "handleMultipleImage(e) {\n e.preventDefault();\n const file = e.target.files[0];\n this.previewMultipleImage(file);\n }", "function imageTask() {\n return src(files.imagePath)\n .pipe(imagemin())\n .pipe(dest('pub/images'))\n}", "function previewFile() {\n\n for (var j=1; j<=3; j++){\n document.querySelector(\"#uploaded_image\"+(j).toString()).src = \"\";\n $('#'+'uploaded_image'+(j.toString())).hide();\n }\n\n let files = document.querySelector('input[type=file]').files;\n\n // upload supports up to 3 images\n if (files.length>3){\n showMessage('error', \"You can upload up to 3 images!\", 2500);\n let clear_photos = document.querySelector(\"#clear_photos\");\n clear_photos.style.visibility = 'hidden';\n $('#clear_photos').hide();\n //read the files with FileReader\n } else if (files.length>0){\n //console.log(\"fileslength\", files.length);\n for (var i=0; i<files.length; i++) {\n let image = document.querySelector(\"#uploaded_image\" + (i + 1).toString());\n $('#'+'uploaded_image'+((i+1).toString())).show();\n let file = files[i];\n var reader = new FileReader();\n reader.addEventListener(\"load\", function (event) {\n image.src = event.target.result;\n image.style.visibility = 'visible';\n });\n if (file) {\n reader.readAsDataURL(file);\n }\n }\n // enable the clear photos button\n let clear_photos = document.querySelector(\"#clear_photos\");\n clear_photos.style.visibility = 'visible';\n $('#clear_photos').show();\n }\n\n}", "function image_small1() {\r\n return gulp\r\n .src(small1.src, { nodir: true })\r\n .pipe(newer(small1.dist + \"small\"))\r\n .pipe(imageresize({\r\n width: small1.params.width,\r\n height: small1.params.height,\r\n crop: small1.params.crop,\r\n upscale: false\r\n }))\r\n .pipe(imagemin({\r\n progressive: true,\r\n svgoPlugins: [{ removeViewbox: false}, { removeUselessStrokeAndFill: false }]\r\n }))\r\n .pipe(gulp.dest(small1.dist + \"small\"));\r\n\r\n}", "function imageTask() {\n return src(files.imagePath)\n .pipe(imagemin())\n .pipe(dest('pub/images'));\n}", "function imagePreview(input) {\n if (input.files && input.files[0]) {\n let fileReader = new FileReader();\n fileReader.onload = function (e) {\n // console.log(e);\n const image = input.files[0];\n const imageName = image.name;\n const imageSize = image.size;\n const imageExt = imageName.split('.').pop().toLowerCase();\n const validExt = ['jpeg' , 'jpg' , 'png'];\n const validSize = 2000000; // image size of 2 000 000 bytes = 2MB\n const imageExtIsValid = validExt.includes(imageExt); // validates to true if it is a valid image file\n const imageSizeIsValid = imageSize <= validSize; // validates to true if it is a valid image size\n let messageDiv = document.getElementById('blog-banner-message');\n let message = '';\n\n if (!imageExtIsValid && !imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a valid image file less than 2MB\n </small>`;\n blogImgTagPreview.setAttribute('src', '');\n\n } else if (imageExtIsValid && !imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a smaller image file less than 2MB\n </small>`;\n blogImgTagPreview.setAttribute('src', '');\n\n } else if (!imageExtIsValid && imageSizeIsValid) {\n\n message += `<small class=\"txt-red\">\n Please upload a valid image file\n </small>`;\n blogImgTagPreview.setAttribute('src', '');\n\n } else {\n messageDiv.style.display = 'none';\n blogImgTagPreview.setAttribute('src', e.target.result);\n }\n\n messageDiv.innerHTML = message;\n messageDiv.style.display = 'block';\n }\n fileReader.readAsDataURL(input.files[0]);\n }\n}", "function preview(file) {\n // only do this for images\n if (file.type.match(/image.*/)) {\n // show activity indicator\n loading.show();\n\n var reader = new FileReader();\n\n // read the file from disk\n reader.readAsDataURL(file);\n\n reader.onload = function (e) {\n // use this image element to get the aspect ratio of the image\n var imageData = e.target.result,\n image = $('<img src=\"' + imageData + '\"/>').css('visibility', 'hidden'),\n previewAreaReferenceOffset = {\n left: dropZone.offset().left + (dropZone.outerWidth() - dropZone.innerWidth()) / 2,\n top: dropZone.offset().top + (dropZone.outerHeight() - dropZone.innerHeight()) / 2\n };\n\n // add the image to the preview area so we can read its width/height\n previewArea.append(image).width(dropZone.width()).height(dropZone.height());\n\n image.bind('load', function (e) {\n var dropZoneAspectRatio = dropZone.innerWidth() / dropZone.innerHeight(),\n imageAspectRatio = image.width() / image.height(),\n previewSize = {};\n\n // size the preview according to the preview area's aspect ratio\n if (imageAspectRatio > dropZoneAspectRatio) {\n previewSize.width = Math.round(dropZone.innerHeight() * imageAspectRatio);\n previewSize.height = dropZone.innerHeight();\n } else {\n previewSize.width = dropZone.innerWidth();\n previewSize.height = Math.round(dropZone.innerWidth() / imageAspectRatio);\n }\n\n // render the image data in the preview area and remove the helper image\n previewArea.offset(previewAreaReferenceOffset).css({\n 'background-image': 'url(' + imageData + ')',\n 'background-size': previewSize.width + 'px ' + previewSize.height + 'px',\n 'background-position': '0 0',\n 'background-repeat': 'no-repeat',\n 'width': previewSize.width + 'px',\n 'height' : previewSize.height + 'px',\n 'opacity': '1'\n }).empty();\n\n // reposition the preview image on drag\n if (previewSize.width > dropZone.innerWidth() || previewSize.height > dropZone.innerHeight()) {\n // show the 'move' cursor \n previewArea.css('cursor', 'move');\n\n previewArea.bind('mousedown', function (e) {\n var origin = { // where we click\n X: e.clientX,\n Y: e.clientY\n },\n currentOffset = previewArea.offset();\n\n previewArea.bind('mousemove', function (e) {\n var newOffset = { // compute how far we traveled and add to the current background position\n left: currentOffset.left + (e.clientX - origin.X),\n top: currentOffset.top + (e.clientY - origin.Y)\n };\n \n // adjustments\n if (newOffset.top > previewAreaReferenceOffset.top) { newOffset.top = previewAreaReferenceOffset.top; }\n if (newOffset.left > previewAreaReferenceOffset.left) { newOffset.left = previewAreaReferenceOffset.left; }\n if (previewAreaReferenceOffset.top - newOffset.top + dropZone.innerHeight() > previewArea.height()) {\n newOffset.top = previewAreaReferenceOffset.top - (previewArea.height() - dropZone.innerHeight());\n }\n if (previewAreaReferenceOffset.left - newOffset.left + dropZone.innerWidth() > previewArea.width()) {\n newOffset.left = previewAreaReferenceOffset.left - (previewArea.width() - dropZone.innerWidth());\n }\n\n // redraw\n previewArea.offset(newOffset);\n });\n\n previewArea.bind('mouseup', function (e) {\n // make sure there's only one 'mousemove' handler registered at all times\n previewArea.unbind('mousemove');\n });\n\n e.preventDefault(); // this prevents the cursor from transforming into a 'select' cursor\n });\n }\n\n // hide the activity indicator\n loading.fadeOut();\n });\n };\n }\n }", "function resizeImage() {\n\t\tstopSlideshow();\n\t\t_setShrunk(!_isShrunk());\n\t\t_changeItem();\n\t}", "function resize_images(cb) {\n return src(art_src + '/**.*')\n .pipe(responsive({\n\n \"*\": [\n {\n width: 600,\n rename: {suffix: \"-600\"},\n }, {\n width: 800,\n rename: {suffix: \"-800\"},\n }, {\n width: 1000,\n rename: {suffix: \"-1000\"},\n }, {\n width: 1200,\n rename: {suffix: \"-1200\"},\n }, {\n width: 1600,\n rename: {suffix: \"-1600\"},\n },\n ],\n\n }, { // Global configuration for all images\n passThroughUnused: true,\n errorOnUnusedImage: false,\n errorOnEnlargement: false,\n skipOnEnlargement: true\n }))\n .pipe(dest(art_dest));\n cb();\n}", "function ReplaceResizeImage($imageCropper, image_src, media_preset_height, media_preset_width, is_popup, callback) {\n //'destroy not working as expected, below line is added. this will remove already included image'\n $imageCropper.find('.cropit-preview-image-container').remove();\n\n if (is_popup) {\n $imageCropper.addClass('popup-class');\n }\n var originalHeight = parseFloat(media_preset_height);\n var originalWidth = parseFloat(media_preset_width);\n // We customize image editor dimensions as real dimensions cant be shown.\n // on the page. Image dimensions are also be scaled based on image editor dimensions to maintain aspect ratio.\n var screen_width = parseInt(jQuery(\"div.image-editor\").width());\n var screen_height = 650;\n if(screen_width > screen_height ) { \n if (originalWidth > screen_width && originalHeight > screen_height ) {\n if (originalWidth >= originalHeight) {\n var previewScale = (originalWidth / screen_width);\n var resize = parseFloat((screen_width * 100) / originalWidth);\n \n } else {\n var previewScale = (originalHeight / screen_height);\n var resize = parseFloat((screen_height * 100) / originalHeight);\n }\n var previewHeight = originalHeight / previewScale;\n var previewWidth = originalWidth / previewScale;\n }\n else if(originalWidth > screen_width ){\n var previewScale = (originalWidth / screen_width);\n var resize = parseFloat((screen_width * 100) / originalWidth);\n var previewHeight = originalHeight / previewScale;\n var previewWidth = originalWidth / previewScale;\n }\n else if (originalHeight > screen_height){\n var previewScale = (originalHeight / screen_height);\n var resize = parseFloat((screen_height * 100) / originalHeight);\n var previewHeight = originalHeight / previewScale;\n var previewWidth = originalWidth / previewScale;\n }\n else {\n var previewHeight = originalHeight;\n var previewWidth = originalWidth;\n resize = 100;\n previewScale = 1;\n }\n }\n else{\n var previewScale = (originalWidth / screen_width);\n var resize = parseFloat((screen_width * 100) / originalWidth);\n var previewHeight = originalHeight / previewScale;\n var previewWidth = originalWidth / previewScale;\n }\n \n resizeImage(image_src, resize, function(resizeDataURL) {\n $imageCropper.cropit({\n allowDragNDrop: false,\n imageBackground: false,\n imageState: {\n src: resizeDataURL,\n //src: 'your_image_path/to_be_crop_image.jpg',\n },\n //freeMove: 'true',\n minZoom: 'fill',\n maxZoom: 10,\n smallImage: 'allow',\n width: previewWidth,\n height: previewHeight,\n exportZoom: previewScale,\n onZoomChange: function(){\n // console.log('zoom level changing');\n if(!jQuery('.controls-wrapper button').hasClass('activated')){\n var currentZoom = $imageCropper.cropit('zoom');\n if(currentZoom == 1){\n console.log('no display');\n jQuery('.controls-wrapper button').addClass('invisible'); \n }\n else{\n jQuery('.controls-wrapper button').removeClass('invisible'); \n }\n }\n\n },\n \n onImageLoading: function() {\n // console.log('image is loading...');\n },\n onImageLoaded: function() {\n // console.log('image is loaded callback');\n var img_width = $imageCropper.cropit('imageSize').width;\n var img_height = $imageCropper.cropit('imageSize').height;\n\n callback($imageCropper);\n },\n onZoomDisabled: function() {\n //console.log('zoom is disabled');\n var current_max_zoom = $imageCropper.cropit('maxZoom');\n //console.log(current_max_zoom);\n $imageCropper.cropit('maxZoom', current_max_zoom + 1 );\n },\n });\n });\n }", "previewLogo() {\n let logoFiles = document.getElementById(\"upload-logo\").files;\n\n if (logoFiles.length > 0) {\n this.set('logoSize', Math.floor(logoFiles[0].size / 1024));\n this.set('invalidImage', this.get('logoSize') > this.get('maxSize'));\n const reader = new FileReader();\n reader.readAsDataURL(logoFiles[0]);\n\n reader.onload = () => {\n this.set('newLogo', reader.result);\n this.set('showNewLogoPreview', true);\n resetCroppr();\n addCroppr(this);\n };\n\n reader.onerror = error => console.error(error);\n }\n }", "function imageHandler(e) {\n fileName = e.target.files[0];\n mpImg = new MegaPixImage(fileName);\n setTimeout(presentImage, 1000);\n}", "function img(cb) {\n src(pic.in)\n\t\t//.pipe(imagemin())\n\t\t.pipe(cache(imagemin({\n\t\t interlaced: true\n\t\t })))\n .pipe(dest(pic.out))\n watch(pic.watch, series(img, browsersync.reload))\n cb()\n}", "function image_smaller1() {\r\n return gulp\r\n .src(smaller1.src, { nodir: true })\r\n .pipe(newer(smaller1.dist + \"smaller\"))\r\n .pipe(imageresize({\r\n width: smaller1.params.width,\r\n height: smaller1.params.height,\r\n crop: smaller1.params.crop,\r\n upscale: false\r\n }))\r\n .pipe(imagemin({\r\n progressive: true,\r\n svgoPlugins: [{ removeViewbox: false}, { removeUselessStrokeAndFill: false }]\r\n }))\r\n .pipe(gulp.dest(smaller1.dist + \"smaller\"));\r\n\r\n}", "function preview(input,maxsize = 2000000){\n $(\".file-upload .text\").html(\"Loading..\");\n //check on file\n if (input.files && input.files[0]) {\n var reader = new FileReader(); // using filereader api\n var filename = input.files[0].name; // get filename\n var filesize = input.files[0].size; // get file size\n // validate filesize\n if(filesize > maxsize) \n {\n $(\".file-upload .text\").html(\"Image size is too large <br> Click here to upload again\");\n return false;\n }\n reader.onload = function(e) {\n // check if file is video\n if(extension(filename) == \"mp4\"){\n $('.videoPreview').removeClass(\"d-none\");\n $('.imagePreview').addClass(\"d-none\");\n $('.videoPreview').attr('src', e.target.result);\n } \n // check if file is image\n else if(extension(filename) == \"png\" || extension(filename) == \"jpg\" || extension(filename) == \"jpeg\"){\n $('.videoPreview').addClass(\"d-none\");\n $('.imagePreview').removeClass(\"d-none\");\n $('.imagePreview').attr('src', e.target.result);\n }\n // set file name\n $(\".file-upload .text\").html(filename + \"<br>\" + \"Click to change\");\n }\n reader.readAsDataURL(input.files[0]); // convert to base64 string\n }\n}", "function setImage() {\n var imgElementId = imgId + i;\n \n reader.onload = function (e) {\n //console.log(imgElementId); // For debugging\n\n // Create image element and set attributes\n var imgElement = document.createElement('img');\n imgElement.src = e.target.result;\n imgElement.className = cssClass;\n imgElement.id = imgElementId; \n // Append image element to the parent element\n parent.appendChild(imgElement);\n\n // increment counter to get right element ID\n i++;\n\n // check if any images are still in the queue\n if (images.length > 0) {\n // Images still left, set the next one\n setImage();\n } else{\n // no images left, exits function\n }\n };\n // Will get the image data and remove it from the queue\n var imageData = images.shift();\n reader.readAsDataURL(imageData);\n }", "function previewImage(what, previewArea, defaultPicObj) {\n\t\n\tdefaultPic = defaultPicObj.value;\n\t\n\tvar source = what.value;\n\tsource = Trim(source);\n\t\n\tvar clearAction = false;\n\tif (source == \"\")\n\t\tclearAction = true;\n\t\t\n var ext = source.substring(source.lastIndexOf(\".\")+1, source.length).toLowerCase();\n \n for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;\n \n globalPreviewArea = previewArea;\n globalPic = new Image();\n \n if (i<fileTypes.length) { \n\t globalPic.src = source; \n\t \n\t} else {\n\t\t\n \tglobalPic.src = defaultPic;\n \t\n \tif (!clearAction) {\n \talert(\"THAT IS NOT A VALID IMAGE\\nPlease load an image with an extention of one of the following:\\n\\n\"+fileTypes.join(\", \"));\n \t}\n }\n \n setTimeout(\"applyChanges()\",200);\n \n} // end previewImage", "function imageTask() {\n return src(files.imgPath)\n .pipe(imagemin())\n .pipe(dest('pub/img'));\n}", "function onDeviceCamera(event) {\nif(DEBUG) console.log('onCamera Event(' + JSON.stringify(event.detail) + ') received ...');\nvar imageFullPath = event.detail.image;\nvar filename = event.detail.image.substr(event.detail.image.lastIndexOf('/') + 1);\nvar path = event.detail.image.substr(0, event.detail.image.lastIndexOf('/') + 1);\nvar newFilename;\n\tif(event.detail.image!=null) {\n//\t\tvar image = new Image(800, 600);\n\t\tvar image = new Image(400, 300);\n\t\timage.src = event.detail.image;\n\t\t\n\t\tif((workflow.status==IntumWorkFlow.prototype.WORKFLOW_STATES.Idle) || (workflow.status==IntumWorkFlow.prototype.WORKFLOW_STATES.PictureBefore)) {\n\t\t\tworkflow.setPictureBefore(imageFullPath);\n\t\t\tnewFilename = workorder.id + '-' + activity.id + '-' + task.id + '-p1-' + collaborator.id + '-' + filename;\n\t\t\trenameFile(filename, path, newFilename);\t// Now we rename the Image in cache using the long filename \n//\t\t\tpictureBefore = new Document(-1, collaborator.id, 1, filename, 'Description of Pic. Before', uriDocument + '/' + filename, urlUploadServer + picUploadDir + newFilename, urlDataServer, task.executed, 0, urlPhpServices);\n\n\t\t\tpictureBefore = new Document(-1, collaborator.id, 1, newFilename, 'Description of Pic. Before', uriDocument + '/' + newFilename, urlUploadServer + picUploadDir + newFilename, urlDataServer, task.executed, 0, urlPhpServices);\n\t\t\tpictureBefore.assignEvent(appName);\n\t\t\tpictureBefore.create();\n\t\t}\n\t\t\n\t\tif(workflow.status==IntumWorkFlow.prototype.WORKFLOW_STATES.PictureAfter) {\n\t\t\tworkflow.setPictureAfter(imageFullPath);\n\t\t\tnewFilename = workorder.id + '-' + activity.id + '-' + task.id + '-p2-' + collaborator.id + '-' + filename; \n\t\t\trenameFile(filename, path, newFilename);\t// Now we rename the Image in cache using the long filename\n//\t\t\tpictureAfter = new Document(-1, collaborator.id, 1, filename, 'Description of Pic. After', uriDocument + '/' + filename, urlUploadServer + picUploadDir + newFilename, urlDataServer, task.executed, 0, urlPhpServices);\n\t\t\t\n\t\t\tpictureAfter = new Document(-1, collaborator.id, 1, newFilename, 'Description of Pic. After', uriDocument + '/' + newFilename, urlUploadServer + picUploadDir + newFilename, urlDataServer, task.executed, 0, urlPhpServices);\n\t\t\tpictureAfter.assignEvent(appName);\n\t\t\tpictureAfter.create();\n\t\t}\n\t}\n\telse {\n\t\tconsole.log('Could not take Snapshot ...');\n\t}\n}", "function avatar_preview(e){\n var maxWidth = 0;\n var maxHeight = 0;\n var size_gap = 0;\n var img = $(\"#avatar_file\").val().toString().split(\"\\\\\");\n img = img[img.length - 1].split(\".\");\n\n var ext = img[img.length - 1].toUpperCase();\n var imgFile = this.files;\n\n if(imgFile == undefined || imgFile.length == 0)\n return false;\n\n imgFile = this.files[0];\n var imgFileType = imgFile.type;\n var match = [\"image/jpeg\", \"image/png\", \"image/jpg\", \"image/gif\"];\n\n if(!((imgFileType == match[0]) || (imgFileType == match[1]) || (imgFileType == match[2]))){\n alert(\"Type file \" + ext + \" not supported\");\n return false;\n }else{\n if(imgFile.size > 5168000){\n alert(\"File dimension exceeded\");\n return false;\n }\n var reader = new FileReader();\n reader.onload = function(event) {\n var src = event.target.result;\n var newImg = $('<img id=avatar_fake src=\"' + src + '\" style=\"display:none;\">');\n\n $(\"#avatar_fake\").replaceWith(newImg);\n newImg.on('load', function() {\n maxWidth = 1280;\n maxHeight = 1280;\n size_gap = newImg.outerWidth() - newImg.outerHeight();\n if(newImg.outerWidth() > maxWidth || newImg.outerHeight() > maxHeight || size_gap < 0 || size_gap > 100){\n alert(\"Image dimension not allowed. The image must be as square as possible.\");\n return false;\n }else{\n avatar_upload(imgFile);\n $(\"#avatar_img\").attr(\"src\", src);\n }\n });\n };\n reader.onerror = function(event) {\n alert(\"ERROR TYPE: \" + event.target.error.code);\n };\n reader.readAsDataURL(imgFile);\n }\n}", "function PhotoCollect(_type, _thumbWidth, _thumbHeight, _wallWidth, _wallHeight, _numCols, _numRows, _cycleName, _containerName, _withText)\r\n {\r\n var _p = PhotoCollect.prototype = this;\r\n var _isInit = false;\r\n\r\n var _isLocking = false;\r\n\r\n var _dom;\r\n\r\n var Doms =\r\n {\r\n };\r\n\r\n var _imageIdList = [];\r\n\r\n var _tlStageIn;\r\n\r\n var PAGE_SIZE = _numCols * _numRows;\r\n var _numPages;\r\n var _currentPage = -1;\r\n\r\n var _inImageShow = false;\r\n\r\n var _thumbList = [];\r\n\r\n _p.stageIn = function (cb, option)\r\n {\r\n if (!_isInit) loadAndBuild(stageIn_start);\r\n else stageIn_start();\r\n\r\n function stageIn_start()\r\n {\r\n MainFrame.firstPlayBgm();\r\n MainFrame.exitLoadingMode(0);\r\n _isLocking = true;\r\n $(\".main_container\").append(_dom);\r\n _p.windowResize();\r\n\r\n _tlStageIn.restart();\r\n\r\n TweenLite.delayedCall(_tlStageIn.duration(), function ()\r\n {\r\n _isLocking = false;\r\n if (cb)cb.apply();\r\n });\r\n }\r\n };\r\n\r\n _p.stageOut = function (cb)\r\n {\r\n _isLocking = true;\r\n\r\n if(_inImageShow)\r\n {\r\n _inImageShow = false;\r\n\r\n ImageShow.hide(function()\r\n {\r\n _isLocking = false;\r\n $(_dom).detach();\r\n if (cb)cb.apply();\r\n });\r\n }\r\n else\r\n {\r\n var tl = new TimelineLite();\r\n tl.to(_dom,.5, {alpha: 0});\r\n\r\n TweenLite.delayedCall(tl.duration(), function ()\r\n {\r\n _isLocking = false;\r\n $(_dom).detach();\r\n if (cb)cb.apply();\r\n });\r\n }\r\n };\r\n\r\n _p.windowResize = windowResize;\r\n\r\n /** private methods **/\r\n function loadAndBuild(cb)\r\n {\r\n\r\n\r\n var frames =\r\n [\r\n {url: \"_collection.html\", startWeight: 30, weight: 70, dom: null}\r\n ];\r\n\r\n MainFrame.toLoadingMode(null, execute);\r\n\r\n\r\n function execute()\r\n {\r\n Core.load(null, frames, function()\r\n {\r\n\r\n DataManager.execute(\"get_data\", {table:_type}, function(response)\r\n {\r\n _imageIdList = response.images;\r\n// _imageIdList = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];\r\n\r\n _numPages = Math.ceil(_imageIdList.length / PAGE_SIZE);\r\n\r\n build();\r\n\r\n MainFrame.exitLoadingMode(1, function()\r\n {\r\n _isInit = true;\r\n cb.apply();\r\n });\r\n\r\n\r\n }, null, false, true);\r\n\r\n });\r\n }\r\n\r\n function build()\r\n {\r\n _dom = document.createElement(\"div\");\r\n $(\"#invisible_container\").append(_dom);\r\n $(_dom).append($($(frames[0].dom).find(\".main_container\")[0]).children(\"div\"));\r\n\r\n if(_containerName) _dom.className = _containerName;\r\n\r\n Doms.thumbWall = Core.extract(\".collection_thumb_wall\");\r\n Doms.btnPrev = Core.extract(\".arrow_prev\");\r\n Doms.btnNext = Core.extract(\".arrow_next\");\r\n\r\n $(Doms.thumbWall).css(\"width\", _wallWidth).css(\"height\", _wallHeight).css(\"margin-left\", -_wallWidth *.5).css(\"margin-top\", -_wallHeight *.5);\r\n\r\n toPage(0);\r\n\r\n buildTimeline();\r\n bindFunc();\r\n\r\n if (_dom.parentNode) _dom.parentNode.removeChild(_dom);\r\n }\r\n }\r\n\r\n function toPage(pageIndex, toLeft)\r\n {\r\n if(_currentPage == pageIndex) return;\r\n\r\n _isLocking = true;\r\n\r\n var isFirstRun = (_thumbList.length == 0);\r\n\r\n _currentPage = pageIndex;\r\n\r\n TweenMax.to(Doms.btnPrev,.3, {alpha:0});\r\n TweenMax.to(Doms.btnNext,.3, {alpha:0});\r\n\r\n var oldThumbList = _thumbList.concat([]);\r\n createThumbs(!isFirstRun);\r\n\r\n\r\n if(!isFirstRun)\r\n {\r\n var offsetX = toLeft? 1000: -1000;\r\n var tl = new TimelineMax();\r\n var i, thumb;\r\n for(i=0;i<oldThumbList.length;i++)\r\n {\r\n thumb = oldThumbList[i];\r\n tl.to(thumb,1, {left:thumb.targetX+offsetX, ease:Power1.easeInOut, alpha:0}, 0);\r\n }\r\n\r\n\r\n for(i=0;i<_thumbList.length;i++)\r\n {\r\n thumb = _thumbList[i];\r\n tl.from(thumb,1, {left:thumb.targetX-offsetX, ease:Power1.easeInOut, alpha:0}, 0);\r\n }\r\n\r\n\r\n tl.add(function()\r\n {\r\n for(var i=0;i<oldThumbList.length;i++)\r\n {\r\n var thumb = oldThumbList[i];\r\n $(thumb).detach();\r\n }\r\n\r\n _isLocking = false;\r\n showArrows();\r\n });\r\n }\r\n else\r\n {\r\n _isLocking = false;\r\n showArrows();\r\n }\r\n }\r\n\r\n function showArrows()\r\n {\r\n\r\n (_currentPage <= 0)? $(Doms.btnPrev).css(\"display\", \"none\"): $(Doms.btnPrev).css(\"display\", \"block\");\r\n (_currentPage >= (_numPages-1))? $(Doms.btnNext).css(\"display\", \"none\"): $(Doms.btnNext).css(\"display\", \"block\");\r\n\r\n\r\n TweenMax.to(Doms.btnPrev,.3, {alpha:1});\r\n TweenMax.to(Doms.btnNext,.3, {alpha:1});\r\n }\r\n\r\n function createThumbs(hideIt)\r\n {\r\n _thumbList = [];\r\n var startIndex = _currentPage * PAGE_SIZE;\r\n var endIndex = startIndex + PAGE_SIZE;\r\n if(endIndex > _imageIdList.length) endIndex = _imageIdList.length;\r\n\r\n var row = 0;\r\n var col = 0;\r\n\r\n for(var i=startIndex;i<endIndex;i++)\r\n {\r\n var obj = _imageIdList[i];\r\n var thumb = new ThumbBlock(_type, i, obj, col, row, _thumbWidth, _thumbHeight, _withText);\r\n\r\n //if(hideIt) TweenMax.set(thumb, {alpha:0});\r\n Doms.thumbWall.appendChild(thumb);\r\n _thumbList.push(thumb);\r\n\r\n $(thumb).click(function()\r\n {\r\n if(_isLocking) return;\r\n\r\n toImageMode(this.getIndex());\r\n });\r\n\r\n col ++;\r\n if(col >= 5)\r\n {\r\n col=0; row++;\r\n }\r\n }\r\n }\r\n\r\n function toImageMode(index)\r\n {\r\n _isLocking = true;\r\n\r\n _p.selectedIndex = index;\r\n\r\n Core.toStage(_cycleName);\r\n }\r\n\r\n function showThumbs(cb)\r\n {\r\n var tl = new TimelineMax();\r\n\r\n var position = 0;\r\n\r\n for(var i=0;i<_thumbList.length;i++)\r\n {\r\n var thumb = _thumbList[i];\r\n tl.to(thumb,.5, {alpha:1},position);\r\n position += .05;\r\n }\r\n\r\n if(cb) tl.add(cb);\r\n }\r\n\r\n function buildTimeline()\r\n {\r\n var tl = _tlStageIn = new TimelineMax();\r\n tl.set(_dom, {alpha: 0}, 0);\r\n tl.to(_dom, .5, {alpha: 1}, 0);\r\n\r\n tl.add(function()\r\n {\r\n showThumbs();\r\n }, 0);\r\n\r\n tl.stop();\r\n }\r\n\r\n function bindFunc()\r\n {\r\n $(Doms.btnPrev).click(function()\r\n {\r\n if(_isLocking) return;\r\n\r\n var targetPage = _currentPage-1;\r\n if(targetPage < 0) targetPage = _numPages-1;\r\n toPage(targetPage, true);\r\n\r\n });\r\n\r\n $(Doms.btnNext).click(function()\r\n {\r\n if(_isLocking) return;\r\n\r\n var targetPage = _currentPage+1;\r\n if(targetPage >= _numPages) targetPage = 0;\r\n toPage(targetPage, false);\r\n\r\n });\r\n }\r\n\r\n /** resize and deform **/\r\n function windowResize()\r\n {\r\n }\r\n }", "function resizeImages() {\n return src('src/public/images/src/**/*.{png,jpg,jpeg}')\n .pipe(dest('src/public/images/dist'))\n .pipe(debug({ title : 'Resize'}))\n // .pipe(changed('src/public/images/dist'))\n .pipe(responsive(\n {\n '**/*.{png,jpg,webp}': generateGulpResponsiveConfiguration()\n },\n // Globals\n { \n withoutEnlargement: true,\n skipOnEnlargement: true,\n errorOnEnlargement: false, // Change this to allow to skip crops\n quality: 85,\n progressive: true,\n withMetadata: false,\n }\n ))\n .pipe(dest('src/public/images/dist'));\n}", "function imageLoader(event) {\n displayImage(event)\n previewFile()\n}", "function ImageFlow(){this.defaults={animationSpeed:50,aspectRatio:1.964,buttons:!1,captions:!0,circular:!1,imageCursor:\"default\",ImageFlowID:\"imageflow\",imageFocusM:1,imageFocusMax:4,imagePath:\"\",imageScaling:!0,imagesHeight:.67,imagesM:1,onClick:function(){document.location=this.url},opacity:!1,opacityArray:[10,8,6,4,2],percentLandscape:118,percentOther:100,preloadImages:!0,reflections:!0,reflectionGET:\"\",reflectionP:.5,reflectionPNG:!1,reflectPath:\"\",scrollbarP:.6,slider:!0,sliderCursor:\"e-resize\",sliderWidth:14,slideshow:!1,slideshowSpeed:1500,slideshowAutoplay:!1,startID:1,glideToStartID:!0,startAnimation:!1,xStep:150};var t=this;this.init=function(e){for(var i in t.defaults)this[i]=void 0!==e&&void 0!==e[i]?e[i]:t.defaults[i];var n=document.getElementById(t.ImageFlowID);if(n&&(n.style.visibility=\"visible\",this.ImageFlowDiv=n,this.createStructure())){this.imagesDiv=document.getElementById(t.ImageFlowID+\"_images\"),this.captionDiv=document.getElementById(t.ImageFlowID+\"_caption\"),this.navigationDiv=document.getElementById(t.ImageFlowID+\"_navigation\"),this.scrollbarDiv=document.getElementById(t.ImageFlowID+\"_scrollbar\"),this.sliderDiv=document.getElementById(t.ImageFlowID+\"_slider\"),this.buttonNextDiv=document.getElementById(t.ImageFlowID+\"_next\"),this.buttonPreviousDiv=document.getElementById(t.ImageFlowID+\"_previous\"),this.buttonSlideshow=document.getElementById(t.ImageFlowID+\"_slideshow\"),this.indexArray=[],this.current=0,this.imageID=0,this.target=0,this.memTarget=0,this.firstRefresh=!0,this.firstCheck=!0,this.busy=!1;var o=this.ImageFlowDiv.offsetWidth,s=Math.round(o/t.aspectRatio);document.getElementById(t.ImageFlowID+\"_loading_txt\").style.paddingTop=.5*s-22+\"px\",n.style.height=s+\"px\",this.loadingProgress()}},this.createStructure=function(){for(var e,i,n,o,s=t.Helper.createDocumentElement(\"div\",\"images\"),r=t.ImageFlowDiv.childNodes.length,a=0;r>a;a++)e=t.ImageFlowDiv.childNodes[a],e&&1==e.nodeType&&\"IMG\"==e.nodeName&&(t.reflections===!0&&(i=t.reflectionPNG?\"3\":\"2\",n=t.imagePath+e.getAttribute(\"src\",2),n=t.reflectPath+\"reflect\"+i+\".php?img=\"+n+t.reflectionGET,e.setAttribute(\"src\",n)),o=e.cloneNode(!0),s.appendChild(o));if(t.circular){var l=t.Helper.createDocumentElement(\"div\",\"images\"),c=t.Helper.createDocumentElement(\"div\",\"images\");if(r=s.childNodes.length,r<t.imageFocusMax&&(t.imageFocusMax=r),r>1){var u;for(u=0;r>u;u++)e=s.childNodes[u],u<t.imageFocusMax&&(o=e.cloneNode(!0),l.appendChild(o)),r-u<t.imageFocusMax+1&&(o=e.cloneNode(!0),c.appendChild(o));for(u=0;r>u;u++)e=s.childNodes[u],o=e.cloneNode(!0),c.appendChild(o);for(u=0;u<t.imageFocusMax;u++)e=l.childNodes[u],o=e.cloneNode(!0),c.appendChild(o);s=c}}if(t.slideshow){var h=t.Helper.createDocumentElement(\"div\",\"slideshow\");s.appendChild(h)}var d=t.Helper.createDocumentElement(\"p\",\"loading_txt\"),p=document.createTextNode(\" \");d.appendChild(p);var f=t.Helper.createDocumentElement(\"div\",\"loading\"),m=t.Helper.createDocumentElement(\"div\",\"loading_bar\");f.appendChild(m);var g=t.Helper.createDocumentElement(\"div\",\"caption\"),v=t.Helper.createDocumentElement(\"div\",\"scrollbar\"),y=t.Helper.createDocumentElement(\"div\",\"slider\");if(v.appendChild(y),t.buttons){var b=t.Helper.createDocumentElement(\"div\",\"previous\",\"button\"),w=t.Helper.createDocumentElement(\"div\",\"next\",\"button\");v.appendChild(b),v.appendChild(w)}var x=t.Helper.createDocumentElement(\"div\",\"navigation\");x.appendChild(g),x.appendChild(v);var _=!1;if(t.ImageFlowDiv.appendChild(s)&&t.ImageFlowDiv.appendChild(d)&&t.ImageFlowDiv.appendChild(f)&&t.ImageFlowDiv.appendChild(x)){for(r=t.ImageFlowDiv.childNodes.length,a=0;r>a;a++)e=t.ImageFlowDiv.childNodes[a],e&&1==e.nodeType&&\"IMG\"==e.nodeName&&t.ImageFlowDiv.removeChild(e);_=!0}return _},this.loadingProgress=function(){var e=t.loadingStatus();(100>e||t.firstCheck)&&t.preloadImages?t.firstCheck&&100==e?(t.firstCheck=!1,window.setTimeout(t.loadingProgress,100)):window.setTimeout(t.loadingProgress,40):(document.getElementById(t.ImageFlowID+\"_loading_txt\").style.display=\"none\",document.getElementById(t.ImageFlowID+\"_loading\").style.display=\"none\",window.setTimeout(t.Helper.addResizeEvent,1e3),t.refresh(),t.max>1&&(t.MouseWheel.init(),t.MouseDrag.init(),t.Touch.init(),t.Key.init(),t.slideshow&&t.Slideshow.init(),t.slider&&(t.scrollbarDiv.style.visibility=\"visible\")))},this.loadingStatus=function(){for(var e=t.imagesDiv.childNodes.length,i=0,n=0,o=null,s=0;e>s;s++)o=t.imagesDiv.childNodes[s],o&&1==o.nodeType&&\"IMG\"==o.nodeName&&(o.complete&&n++,i++);var r=Math.round(n/i*100),a=document.getElementById(t.ImageFlowID+\"_loading_bar\");a.style.width=r+\"%\",t.circular&&(i-=2*t.imageFocusMax,n=1>r?0:Math.round(i/100*r));var l=document.getElementById(t.ImageFlowID+\"_loading_txt\"),c=document.createTextNode(\"loading images \"+n+\"/\"+i);return l.replaceChild(c,l.firstChild),r},this.refresh=function(){this.imagesDivWidth=t.imagesDiv.offsetWidth+t.imagesDiv.offsetLeft,this.maxHeight=Math.round(t.imagesDivWidth/t.aspectRatio),this.maxFocus=t.imageFocusMax*t.xStep,this.size=.5*t.imagesDivWidth,this.sliderWidth=.5*t.sliderWidth,this.scrollbarWidth=(t.imagesDivWidth-2*Math.round(t.sliderWidth))*t.scrollbarP,this.imagesDivHeight=Math.round(t.maxHeight*t.imagesHeight),t.ImageFlowDiv.style.height=t.maxHeight+\"px\",t.imagesDiv.style.height=t.imagesDivHeight+\"px\",t.navigationDiv.style.height=t.maxHeight-t.imagesDivHeight+\"px\",t.captionDiv.style.width=t.imagesDivWidth+\"px\",t.captionDiv.style.paddingTop=\"0px\",t.scrollbarDiv.style.width=t.scrollbarWidth+\"px\",t.scrollbarDiv.style.marginTop=\"0px\",t.scrollbarDiv.style.marginLeft=Math.round(t.sliderWidth+(t.imagesDivWidth-t.scrollbarWidth)/2)+\"px\",t.sliderDiv.style.cursor=t.sliderCursor,t.sliderDiv.onmousedown=function(){return t.MouseDrag.start(this),!1},t.buttons&&(t.buttonPreviousDiv.onclick=function(){t.MouseWheel.handle(1)},t.buttonNextDiv.onclick=function(){t.MouseWheel.handle(-1)});for(var e=t.reflections===!0?t.reflectionP+1:1,i=t.imagesDiv.childNodes.length,n=0,o=null,s=0;i>s;s++)o=t.imagesDiv.childNodes[s],null!==o&&1==o.nodeType&&\"IMG\"==o.nodeName&&(this.indexArray[n]=s,o.url=o.getAttribute(\"longdesc\"),o.xPosition=-n*t.xStep,o.i=n,t.firstRefresh&&(null!==o.getAttribute(\"width\")&&null!==o.getAttribute(\"height\")?(o.w=o.getAttribute(\"width\"),o.h=o.getAttribute(\"height\")*e):(o.w=o.width,o.h=o.height)),o.w>o.h/(t.reflectionP+1)?(o.pc=t.percentLandscape,o.pcMem=t.percentLandscape):(o.pc=t.percentOther,o.pcMem=t.percentOther),t.imageScaling===!1&&(o.style.position=\"relative\",o.style.display=\"inline\"),o.style.cursor=t.imageCursor,n++);this.max=t.indexArray.length,t.imageScaling===!1&&(o=t.imagesDiv.childNodes[t.indexArray[0]],this.totalImagesWidth=o.w*t.max,o.style.paddingLeft=t.imagesDivWidth/2+o.w/2+\"px\",t.imagesDiv.style.height=o.h+\"px\",t.navigationDiv.style.height=t.maxHeight-o.h+\"px\"),t.firstRefresh&&(t.firstRefresh=!1,t.imageID=t.startID-1,t.imageID<0&&(t.imageID=0),t.circular&&(t.imageID=t.imageID+t.imageFocusMax),maxId=t.circular?t.max-t.imageFocusMax-1:t.max-1,t.imageID>maxId&&(t.imageID=maxId),t.glideToStartID===!1&&t.moveTo(-t.imageID*t.xStep),t.startAnimation&&t.moveTo(5e3)),t.max>1&&t.glideTo(t.imageID),t.moveTo(t.current)},this.moveTo=function(e){this.current=e,this.zIndex=t.max;for(var i=0;i<t.max;i++){var n=t.imagesDiv.childNodes[t.indexArray[i]],o=i*-t.xStep;if(t.imageScaling)if(o+t.maxFocus<t.memTarget||o-t.maxFocus>t.memTarget)n.style.visibility=\"hidden\",n.style.display=\"none\";else{var s=(Math.sqrt(1e4+e*e)+100)*t.imagesM,r=e/s*t.size+t.size;n.style.display=\"block\";var a=n.h/n.w*n.pc/s*t.size,l=0;switch(a>t.maxHeight){case!1:l=n.pc/s*t.size;break;default:a=t.maxHeight,l=n.w*a/n.h}var c=t.imagesDivHeight-a+a/(t.reflectionP+1)*t.reflectionP;switch(n.style.left=r-n.pc/2/s*t.size+\"px\",l&&a&&(n.style.height=a+\"px\",n.style.width=l+\"px\",n.style.top=c+\"px\"),n.style.visibility=\"visible\",0>e){case!0:this.zIndex++;break;default:this.zIndex=t.zIndex-1}switch(n.i==t.imageID){case!1:n.onclick=function(){t.glideTo(this.i)};break;default:this.zIndex=t.zIndex+1,\"\"!==n.url&&(n.onclick=t.onClick)}n.style.zIndex=t.zIndex}else{if(o+t.maxFocus<t.memTarget||o-t.maxFocus>t.memTarget)n.style.visibility=\"hidden\";else switch(n.style.visibility=\"visible\",n.i==t.imageID){case!1:n.onclick=function(){t.glideTo(this.i)};break;default:\"\"!==n.url&&(n.onclick=t.onClick)}t.imagesDiv.style.marginLeft=e-t.totalImagesWidth+\"px\"}e+=t.xStep}},this.glideTo=function(e){var i,n;t.circular&&(e+1===t.imageFocusMax&&(n=t.max-t.imageFocusMax,i=-n*t.xStep,e=n-1),e===t.max-t.imageFocusMax&&(n=t.imageFocusMax-1,i=-n*t.xStep,e=n+1));var o=-e*t.xStep;this.target=o,this.memTarget=o,this.imageID=e;var s=t.imagesDiv.childNodes[e].getAttribute(\"alt\");if((\"\"===s||t.captions===!1)&&(s=\"&nbsp;\"),t.captionDiv.innerHTML=s,t.MouseDrag.busy===!1&&(this.newSliderX=t.circular?(e-t.imageFocusMax)*t.scrollbarWidth/(t.max-2*t.imageFocusMax-1)-t.MouseDrag.newX:e*t.scrollbarWidth/(t.max-1)-t.MouseDrag.newX,t.sliderDiv.style.marginLeft=t.newSliderX-t.sliderWidth+\"px\"),t.opacity===!0||t.imageFocusM!==t.defaults.imageFocusM){t.Helper.setOpacity(t.imagesDiv.childNodes[e],t.opacityArray[0]),t.imagesDiv.childNodes[e].pc=t.imagesDiv.childNodes[e].pc*t.imageFocusM;for(var r=0,a=0,l=0,c=t.opacityArray.length,u=1;u<t.imageFocusMax+1;u++)r=u+1>c?t.opacityArray[c-1]:t.opacityArray[u],a=e+u,l=e-u,a<t.max&&(t.Helper.setOpacity(t.imagesDiv.childNodes[a],r),t.imagesDiv.childNodes[a].pc=t.imagesDiv.childNodes[a].pcMem),l>=0&&(t.Helper.setOpacity(t.imagesDiv.childNodes[l],r),t.imagesDiv.childNodes[l].pc=t.imagesDiv.childNodes[l].pcMem)}i&&t.moveTo(i),t.busy===!1&&(t.busy=!0,t.animate())},this.animate=function(){switch(t.target<t.current-1||t.target>t.current+1){case!0:t.moveTo(t.current+(t.target-t.current)/3),window.setTimeout(t.animate,t.animationSpeed),t.busy=!0;break;default:t.busy=!1}},this.glideOnEvent=function(e){t.slideshow&&t.Slideshow.interrupt(),t.glideTo(e)},this.Slideshow={direction:1,init:function(){t.slideshowAutoplay?t.Slideshow.start():t.Slideshow.stop()},interrupt:function(){t.Helper.removeEvent(t.ImageFlowDiv,\"click\",t.Slideshow.interrupt),t.Slideshow.stop()},addInterruptEvent:function(){t.Helper.addEvent(t.ImageFlowDiv,\"click\",t.Slideshow.interrupt)},start:function(){t.Helper.setClassName(t.buttonSlideshow,\"slideshow pause\"),t.buttonSlideshow.onclick=function(){t.Slideshow.stop()},t.Slideshow.action=window.setInterval(t.Slideshow.slide,t.slideshowSpeed),window.setTimeout(t.Slideshow.addInterruptEvent,100)},stop:function(){t.Helper.setClassName(t.buttonSlideshow,\"slideshow play\"),t.buttonSlideshow.onclick=function(){t.Slideshow.start()},window.clearInterval(t.Slideshow.action)},slide:function(){var e=t.imageID+t.Slideshow.direction,i=!1;e===t.max&&(t.Slideshow.direction=-1,i=!0),0>e&&(t.Slideshow.direction=1,i=!0),i?t.Slideshow.slide():t.glideTo(e)}},this.MouseWheel={init:function(){window.addEventListener&&t.ImageFlowDiv.addEventListener(\"DOMMouseScroll\",t.MouseWheel.get,!1),t.Helper.addEvent(t.ImageFlowDiv,\"mousewheel\",t.MouseWheel.get)},get:function(e){var i=0;e||(e=window.event),e.wheelDelta?i=e.wheelDelta/120:e.detail&&(i=-e.detail/3),i&&t.MouseWheel.handle(i),t.Helper.suppressBrowserDefault(e)},handle:function(e){var i=!1,n=0;e>0?t.imageID>=1&&(n=t.imageID-1,i=!0):t.imageID<t.max-1&&(n=t.imageID+1,i=!0),i&&t.glideOnEvent(n)}},this.MouseDrag={object:null,objectX:0,mouseX:0,newX:0,busy:!1,init:function(){t.Helper.addEvent(t.ImageFlowDiv,\"mousemove\",t.MouseDrag.drag),t.Helper.addEvent(t.ImageFlowDiv,\"mouseup\",t.MouseDrag.stop),t.Helper.addEvent(document,\"mouseup\",t.MouseDrag.stop),t.ImageFlowDiv.onselectstart=function(){var e=!0;return t.MouseDrag.busy&&(e=!1),e}},start:function(e){t.MouseDrag.object=e,t.MouseDrag.objectX=t.MouseDrag.mouseX-e.offsetLeft+t.newSliderX},stop:function(){t.MouseDrag.object=null,t.MouseDrag.busy=!1},drag:function(e){var i=0;if(e||(e=window.event),e.pageX?i=e.pageX:e.clientX&&(i=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft),t.MouseDrag.mouseX=i,null!==t.MouseDrag.object){var n=t.MouseDrag.mouseX-t.MouseDrag.objectX+t.sliderWidth;n<-t.newSliderX&&(n=-t.newSliderX),n>t.scrollbarWidth-t.newSliderX&&(n=t.scrollbarWidth-t.newSliderX);var o,s;t.circular?(o=(n+t.newSliderX)/(t.scrollbarWidth/(t.max-2*t.imageFocusMax-1)),s=Math.round(o)+t.imageFocusMax):(o=(n+t.newSliderX)/(t.scrollbarWidth/(t.max-1)),s=Math.round(o)),t.MouseDrag.newX=n,t.MouseDrag.object.style.left=n+\"px\",t.imageID!==s&&t.glideOnEvent(s),t.MouseDrag.busy=!0}}},this.Touch={x:0,startX:0,stopX:0,busy:!1,first:!0,init:function(){t.Helper.addEvent(t.navigationDiv,\"touchstart\",t.Touch.start),t.Helper.addEvent(document,\"touchmove\",t.Touch.handle),t.Helper.addEvent(document,\"touchend\",t.Touch.stop)},isOnNavigationDiv:function(e){var i=!1;if(e.touches){var n=e.touches[0].target;(n===t.navigationDiv||n===t.sliderDiv||n===t.scrollbarDiv)&&(i=!0)}return i},getX:function(t){var e=0;return t.touches&&(e=t.touches[0].pageX),e},start:function(e){t.Touch.startX=t.Touch.getX(e),t.Touch.busy=!0,t.Helper.suppressBrowserDefault(e)},isBusy:function(){var e=!1;return t.Touch.busy&&(e=!0),e},handle:function(e){if(t.Touch.isBusy&&t.Touch.isOnNavigationDiv(e)){var i=t.circular?t.max-2*t.imageFocusMax-1:t.max-1;t.Touch.first&&(t.Touch.stopX=(i-t.imageID)*(t.imagesDivWidth/i),t.Touch.first=!1);var n=-(t.Touch.getX(e)-t.Touch.startX-t.Touch.stopX);0>n&&(n=0),n>t.imagesDivWidth&&(n=t.imagesDivWidth),t.Touch.x=n;var o=Math.round(n/(t.imagesDivWidth/i));o=i-o,t.imageID!==o&&(t.circular&&(o+=t.imageFocusMax),t.glideOnEvent(o)),t.Helper.suppressBrowserDefault(e)}},stop:function(){t.Touch.stopX=t.Touch.x,t.Touch.busy=!1}},this.Key={init:function(){document.onkeydown=function(e){t.Key.handle(e)}},handle:function(e){var i=t.Key.get(e);switch(i){case 39:t.MouseWheel.handle(-1);break;case 37:t.MouseWheel.handle(1)}},get:function(t){return t=t||window.event,t.keyCode}},this.Helper={addEvent:function(t,e,i){t.addEventListener?t.addEventListener(e,i,!1):t.attachEvent&&(t[\"e\"+e+i]=i,t[e+i]=function(){t[\"e\"+e+i](window.event)},t.attachEvent(\"on\"+e,t[e+i]))},removeEvent:function(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent&&(void 0===t[e+i]&&alert(\"Helper.removeEvent \\xbb Pointer to detach event is undefined - perhaps you are trying to detach an unattached event?\"),t.detachEvent(\"on\"+e,t[e+i]),t[e+i]=null,t[\"e\"+e+i]=null)},setOpacity:function(e,i){t.opacity===!0&&(e.style.opacity=i/10,e.style.filter=\"alpha(opacity=\"+10*i+\")\")},createDocumentElement:function(e,i,n){var o=document.createElement(e);return o.setAttribute(\"id\",t.ImageFlowID+\"_\"+i),void 0!==n&&(i+=\" \"+n),t.Helper.setClassName(o,i),o},setClassName:function(t,e){t&&(t.setAttribute(\"class\",e),t.setAttribute(\"className\",e))},suppressBrowserDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,!1},addResizeEvent:function(){var e=window.onresize;window.onresize=\"function\"!=typeof window.onresize?function(){t.refresh()}:function(){e&&e(),t.refresh()}}}}", "function image_medium2() {\r\n return gulp\r\n .src(medium2.src, { nodir: true })\r\n .pipe(newer(medium2.dist + \"medium\"))\r\n .pipe(imageresize({\r\n width: medium2.params.width,\r\n height: medium2.params.height,\r\n crop: medium2.params.crop,\r\n upscale: false\r\n }))\r\n .pipe(imagemin({\r\n progressive: true,\r\n svgoPlugins: [{ removeViewbox: false}, { removeUselessStrokeAndFill: false }]\r\n }))\r\n .pipe(gulp.dest(medium2.dist + \"medium\"));\r\n\r\n}", "function PicturE_auto(imgurl,imgid,framew,frameh,topIs){\t\t\n\t\t/*picture:width,heightpicture:width,heightpicture:width,height*/\n\t\t//custom the img's object\n\t\tvar img=new Image();\n\t\t//set the object img's src\n\t\timg.src=imgurl;\n\t\t\t\t\n\t\timg.onload=function(){\n\t\t\t //computer the img w and h based on frame\n\t\t\t \timgsw=img.width;\n\t\t\t imgsh=img.height;\n\t\t\t if(framew>=imgsw && frameh>=imgsh){\n\t\t\t\tvar imgnw=imgsw;\n\t\t\t\tvar imgnh=imgsh;\n\t\t\t }\n\t\t\t else if(framew>=imgsw && frameh<imgsh){\n\t\t\t\t\tvar imgnh=frameh;\n\t\t\t\t\tvar rate=imgsh/imgnh;\n\t\t\t\t\tvar imgnw=imgsw/rate;\n\t\t\t }\n\t\t\t else if(framew<imgsw && frameh>=imgsh){\n\t\t\t\t\tvar imgnw=framew;\n\t\t\t\t\tvar rate=imgsw/imgnw;\n\t\t\t\t\tvar imgnh=imgsh/rate;\n\t\t\t }\n\t\t\t else if(framew<imgsw && frameh<imgsh){\n\t\t\t \tif(imgsw>imgsh){\n\t\t\t\t\tvar rate=imgsw/framew;\n\t\t\t\t\tvar imgnh=imgsh/rate;\n\t\t\t\t\tvar imgnw=framew;\t\t\t\t\t\n\t\t\t\t\tif(imgnh>frameh){\n\t\t\t\t\t\tvar rate=imgnh/frameh;\n\t\t\t\t\t\tvar imgnw=imgnw/rate;\n\t\t\t\t\t\tvar imgnh=frameh;\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t \t\t\n\t\t\t \t}\n\t\t\t \telse{\n\t\t\t\t\tvar rate=imgsh/frameh;\n\t\t\t\t\tvar imgnw=imgsw/rate;\n\t\t\t\t\tvar imgnh=frameh;\n\t\t\t\t\tif(imgnw>framew){\n\t\t\t\t\t\tvar rate=imgnw/framew;\n\t\t\t\t\t\tvar imgnh=imgnh/rate;\n\t\t\t\t\t\tvar imgnw=framew;\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t \t\t\n\t\t\t \t}\t\t\n\t\t\t }\n\t\t\t //set the imgset the imgset the imgset the imgset the img\n\t\t\t\t //w and h\n\t\t\t\t if(typeof(imgid)!='string'){\n\t\t\t\t\t \timgid.css('width',imgnw+'px');\n\t\t\t\t\t imgid.css('height',imgnh+'px');\n\t\t\t\t\t //position\n\t\t\t\t\t if(!topIs){\n\t\t\t\t\t\t var positionR=(frameh-imgnh)/2;\n\t\t\t\t\t\t imgid.css('top',positionR+'px'); \t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t //url\n\t\t\t\t\t imgid.attr('src',imgurl); \t\t\t\t \t\n\t\t\t\t }else{\n\t\t\t\t\t \t$(imgid).css('width',imgnw+'px');\n\t\t\t\t\t $(imgid).css('height',imgnh+'px');\n\t\t\t\t\t //position\n\t\t\t\t\t if(!topIs){\n\t\t\t\t\t\t var positionR=(frameh-imgnh)/2;\n\t\t\t\t\t\t $(imgid).css('top',positionR+'px'); \t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t //url\n\t\t\t\t\t $(imgid).attr('src',imgurl); \t\t\t\t \t\n\t\t\t\t }\n \t\t\t\t\t\t\n\t\t}\t\t\t\t\t\n}", "function image_large2() {\r\n return gulp\r\n .src(large2.src, { nodir: true })\r\n .pipe(newer(large2.dist + \"large\"))\r\n .pipe(imageresize({\r\n width: large2.params.width,\r\n height: large2.params.height,\r\n crop: large2.params.crop,\r\n upscale: false\r\n }))\r\n .pipe(imagemin({\r\n progressive: true,\r\n svgoPlugins: [{ removeViewbox: false}, { removeUselessStrokeAndFill: false }]\r\n }))\r\n // .pipe(rename({suffix: '-hi'}))\r\n .pipe(gulp.dest(large2.dist + \"large\"));\r\n\r\n}", "function showMyImage(fileInput, imagePreview) {\n var files = fileInput.files;\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n var imageType = /image.*/;\n if (!file.type.match(imageType)) {\n continue;\n }\n var img = document.getElementById(imagePreview);\n img.file = file;\n var reader = new FileReader();\n reader.onload = (function (aImg) {\n return function (e) {\n aImg.src = e.target.result;\n };\n })(img);\n reader.readAsDataURL(file);\n }\n files = \"\";\n img = \"\";\n}", "function Largeimage() {\n var $obj = this;\n this.node = new Image();\n this.loadimage = function (url) {\n //showing preload\n loader.show();\n this.url = url;\n this.node.style.position = 'absolute';\n this.node.style.border = '0px';\n this.node.style.display = 'none';\n this.node.style.left = '-5000px';\n this.node.style.top = '0px';\n document.body.appendChild(this.node);\n this.node.src = url; // fires off async\n };\n this.fetchdata = function () {\n var image = $(this.node);\n var scale = {};\n this.node.style.display = 'block';\n $obj.w = image.width();\n $obj.h = image.height();\n $obj.pos = image.offset();\n $obj.pos.l = image.offset().left;\n $obj.pos.t = image.offset().top;\n $obj.pos.r = $obj.w + $obj.pos.l;\n $obj.pos.b = $obj.h + $obj.pos.t;\n scale.x = ($obj.w / smallimage.w);\n scale.y = ($obj.h / smallimage.h);\n el.scale = scale;\n document.body.removeChild(this.node);\n $('.zoomWrapperImage', el).empty().append(this.node);\n //setting lens dimensions;\n lens.setdimensions();\n };\n this.node.onerror = function () {\n alert('Problems while loading the big image.');\n throw 'Problems while loading the big image.';\n };\n this.node.onload = function () {\n //fetching data\n $obj.fetchdata();\n loader.hide();\n el.largeimageloading = false;\n el.largeimageloaded = true;\n if (settings.zoomType == 'drag' || settings.alwaysOn) {\n lens.show();\n stage.show();\n lens.setcenter();\n }\n };\n this.setposition = function () {\n var left = -el.scale.x * (lens.getoffset().left - smallimage.bleft + 1);\n var top = -el.scale.y * (lens.getoffset().top - smallimage.btop + 1);\n $(this.node).css({\n 'left': left + 'px',\n 'top': top + 'px'\n });\n };\n return this;\n }", "function previewImage(input)\n\t{\n\t\tif (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n $('.previewHolder').attr('src', e.target.result);\n $('.userPic img').attr('src', e.target.result);\n $('.menuBigPic img').attr('src', e.target.result);\n }\n\n reader.readAsDataURL(input.files[0]);\n }\n\t}", "constructor(opts){\n this.image = opts.img_data || this.get_image(opts.img_tag);\n this.canv = opts.canvas;\n this.w = this.image.width;\n this.h = this.image.height;\n this.opts = opts;\n\n this.ofscr = this.canv.transferControlToOffscreen();\n this.worker = new Worker('mode7_worker.js');\n this.worker.postMessage({\n cmd: 'init',\n\n canv: this.ofscr,\n image: this.image,\n }, [this.ofscr]);\n this.worker.postMessage({\n cmd: 'start'\n });\n }", "function resizeImage(image_src, resize, fn) {\n var fileReader = new FileReader();\n if (image_src == '' || typeof image_src == 'undefined') {\n // \tvar dataurl = 'https://image.shutterstock.com/image-photo/waterfall-deep-forest-huay-mae-600w-351772952.jpg'; \n fn('blank');\n } else {\n var dataurl = image_src;\n var request = new XMLHttpRequest();\n request.open('GET', dataurl, true);\n request.responseType = 'blob';\n request.onload = function() {\n fileReader.readAsDataURL(request.response);\n };\n request.send();\n fileReader.onload = function(event) {\n var img = new Image();\n img.onload = function() {\n // console.log('image onload');\n var canvas = document.createElement(\"canvas\");\n var context = canvas.getContext(\"2d\");\n context.imageSmoothingQuality = 'high';\n canvas.width = parseFloat((img.width * resize) / 100);\n canvas.height = parseFloat((img.height * resize) / 100);\n // canvas.width = parseInt((img.width * resize) / 100);\n // canvas.height = parseInt((img.height * resize) / 100);\n context.drawImage(img, 0, 0, canvas.width, canvas.height);\n // context.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height);\n fn(canvas.toDataURL());\n }\n img.src = event.target.result;\n };\n }\n }", "function loadImage() {\n\tif (fileList.indexOf(fileIndex) < 0) {\n\t\tvar reader = new FileReader();\n\t\treader.onload = (function(theFile) {\n\t\t\treturn function(e) {\n\t\t\t\t// check if positions already exist in storage\n\n\t\t\t\t// Render thumbnail.\n\t\t\t\tvar span = document.getElementById('imageholder');\n\t\t\t\tspan.innerHTML = '<canvas id=\"imgcanvas\"></canvas>';\n\t\t\t\tvar canvas = document.getElementById('imgcanvas')\n\t\t\t\tvar cc = canvas.getContext('2d');\n\t\t\t\tvar img = new Image();\n\t\t\t\timg.onload = function() {\n\t\t\t\t\tcanvas.setAttribute('width', img.width);\n\t\t\t\t\tcanvas.setAttribute('height', img.height);\n\t\t\t\t\tcc.drawImage(img,0,0,img.width, img.height);\n\n scale = 1.0;\n\t\t\t\t\t// check if parameters already exist\n\t\t\t\t\tvar positions = localStorage.getItem(fileList[fileIndex].name)\n\t\t\t\t\tif (positions) {\n\t\t\t\t\t\tpositions = JSON.parse(positions);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// estimating parameters\n\t\t\t\t\t\tpositions = estimatePositions();\n\t\t\t\t\t\tif (!positions) {\n\t\t\t\t\t\t\tclear()\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// put boundary on estimated points\n\t\t\t\t\t\tfor (var i = 0;i < positions.length;i++) {\n\t\t\t\t\t\t\tif (positions[i][0][0] > img.width) {\n\t\t\t\t\t\t\t\tpositions[i][0][0] = img.width;\n\t\t\t\t\t\t\t} else if (positions[i][0][0] < 0) {\n\t\t\t\t\t\t\t\tpositions[i][0][0] = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (positions[i][0][1] > img.height) {\n\t\t\t\t\t\t\t\tpositions[i][0][1] = img.height;\n\t\t\t\t\t\t\t} else if (positions[i][0][1] < 0) {\n\t\t\t\t\t\t\t\tpositions[i][0][1] = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (positions) {\n\t\t\t\t\t\t// render points\n\t\t\t\t\t\trenderPoints(positions, img.width, img.height);\n\t\t\t\t\t\tstoreCurrent();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclear();\n\t\t\t\t\t\tconsole.log(\"Did not manage to detect position of face in this image. Please select position of face by clicking 'manually select face' and dragging a box around the face.\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\timg.src = e.target.result;\n\t\t\t};\n\t\t})(fileList[fileIndex]);\n\t\treader.readAsDataURL(fileList[fileIndex]);\n\t}\n\tdocument.getElementById('imagenumber').innerHTML = (fileIndex+1)+\" / \"+fileList.length;\n}", "function replaceImages(_this, counter) {\n var height;\n var imgType;\n var newURL;\n var width;\n var counter = counter;\n\n var width = Math.floor(_this.outerWidth());\n var height = Math.floor(_this.outerHeight());\n var backgroundSize;\n // console.log('element width: ', width, 'element height: ', height);\n\n // check if the image is bigger than 1 x 1 pixels\n if ( (width >= 1) && (height >= 1) ) {\n\n // Cycle through the different placecage options\n counter++;\n result = imgCounter(counter);\n imgType = result.imgType;\n counter = result.counter;\n\n // Set up dimensions of current element as strings to be used for css rules later\n var widthString = 'width: ' + width + 'px;';\n var heightString = 'height: ' + height + 'px;';\n // console.log('widthString: ', widthString, 'heightString: ', heightString);\n\n // Check if the element is very wide or very tall. if it is, set new dimensions as needed so we can add a tiled background image\n var isWideOrTall = isWideOrTallRectangle(width, height, _this);\n // console.log('isWideOrTall: ', isWideOrTall);\n\n if (isWideOrTall.wideOrTall === \"wide\") {\n width = isWideOrTall.newWidth;\n backgroundSize = isWideOrTall.newBackgroundSize;\n } else if (isWideOrTall.wideOrTall === \"tall\") {\n height = isWideOrTall.newHeight;\n backgroundSize = isWideOrTall.newBackgroundSize;\n }\n\n // If a wide or tall rectangle was found, give the image a tiled background image and take out the original image\n if (isWideOrTall.wideOrTall) {\n // create url for new image\n newUrl = 'background-image: url(\"' + settings.placeholderSite + imgType + width + '/' + height + '\");';\n // combine image url with height and width rules to use in cssText\n var cssTextVar = widthString + heightString + newUrl;\n _this.css({\n 'display' : 'block',\n 'cssText': cssTextVar,\n 'background-size' : backgroundSize,\n 'background-repeat' : 'repeat',\n 'background-position' : 'center center'\n });\n // remove inline image attributes\n _this.attr({\n src : '',\n alt : '',\n title : ''\n })\n // add classes to see it was changed\n _this.addClass('cagified cagified--image--bg-image');\n _this.removeAttr(\"srcset\");\n }\n // If the image wasn't a wide or tall rectangle, just replace the image source\n else {\n newUrl = settings.placeholderSite + imgType + width + \"/\" + height;\n _this.addClass('cagified cagified--image');\n _this.attr(\"src\", newUrl);\n _this.removeAttr(\"srcset\");\n\n // add classes to see it was changed\n _this.addClass('cagified cagified--image');\n }\n }\n return counter;\n }", "function resizeImage(width, height) {\n return plugins.gm(function (gmfile) {\n return gmfile.resize(100, 100);\n } <% if (imageConverter == 'useImageMagick') { %>, { imageMagick: true <% } %> });\n }", "initializeImageResizer() {\n this.imageResizerDivElement = document.createElement('div');\n this.imageResizerDivElement.style.zIndex = '1';\n this.imageResizerDivElement.style.display = 'none';\n this.viewer.pageContainer.appendChild(this.imageResizerDivElement);\n }", "resizeImage(image, targetWidth, targetHeight) {\n // Resizing in steps refactored to use a solution from\n // https://blog.uploadcare.com/image-resize-in-browsers-is-broken-e38eed08df01\n image = this.protect(image);\n let steps = Math.ceil(Math.log2(image.width / targetWidth));\n\n if (steps < 1) {\n steps = 1;\n }\n\n let sW = targetWidth * 2 ** (steps - 1);\n let sH = targetHeight * 2 ** (steps - 1);\n const x = 2;\n\n while (steps--) {\n const canvas = document.createElement('canvas');\n canvas.width = sW;\n canvas.height = sH;\n canvas.getContext('2d').drawImage(image, 0, 0, sW, sH);\n image = canvas;\n sW = Math.round(sW / x);\n sH = Math.round(sH / x);\n }\n\n return image;\n }", "loadImages(input_files) {\n this.stateMap.images_still_loading += input_files.length;\n for (let file of input_files) {\n const reader = new FileReader();\n reader.onload = () => {\n let image = new Image();\n image.onload = () => {\n spa.imagelistmodel.addImagebox(file.name,file.lastModified,image);\n this.imageLoadEnded();\n };\n image.onerror = () => {\n this.imageLoadEnded();\n };\n image.src = reader.result;\n };\n reader.onabort = () => {this.imageLoadEnded();};\n reader.onerror = () => {this.imageLoadEnded();};\n reader.readAsDataURL(file);\n }\n\n // tell loaderbox that images are being loaded\n spa.loaderbox.handleLoad();\n \n return true;\n }", "function drawImages() {\n if (counter < project.renderImages.length) {\n var imageForm = new FormData();\n ctx.clearRect(0, 0, canvasRender.width, canvasRender.height);\n var image = project.renderImages[counter];\n var posX = parseInt((res.width / 2) - (image.originalWidth / 2));\n var posY = parseInt((res.height / 2) - (image.originalHeight / 2));\n ctx.putImageData(image, posX, posY);\n var imgData = canvasRender.toDataURL(\"image/jpeg\", 1.0);\n // convert base64 string to blob\n var blobBin = atob(imgData.split(',')[1]);\n var array = [];\n for (var j = 0; j < blobBin.length; j++) {\n array.push(blobBin.charCodeAt(j));\n }\n var file = new Blob([new Uint8Array(array)], {\n type: 'image/jpeg'\n });\n\n var fieldname = filename = \"image\" + counter;\n console.log(\"making\", filename);\n imageForm.append('projectID', project.getProjectID());\n imageForm.append('currImageNum', counter + 1);\n imageForm.append(fieldname, file, filename + \".jpg\");\n\n var request = new XMLHttpRequest();\n request.open(\"POST\", \"/render\");\n request.send(imageForm);\n request.onreadystatechange = function() {\n if (request.readyState == 4) {\n if (request.status === 200) {\n drawImages();\n } else {\n swal(\"Error\", \"There was a problem with the image upload. Try again\", \"error\");\n }\n }\n }\n counter += 1;\n } else {\n done = true;\n formData.append('currImageNum', counter);\n }\n }", "precargar(){\r\n this.gif = this.app.createImg('./Recursos/Balon.gif');\r\n this.gif.size(95, 95);\r\n }", "function showMyImage(fileInput) {\n var files = fileInput.files;\n for (var i = 0; i < files.length; i++) { \n var file = files[i];\n var imageType = /image.*/; \n if (!file.type.match(imageType)) {\n continue;\n } \n var img=document.getElementById(\"thumbnil\"); \n img.file = file; \n var reader = new FileReader();\n reader.onload = (function(aImg) { \n return function(e) { \n aImg.src = e.target.result; \n }; \n })(img);\n reader.readAsDataURL(file);\n } \n }", "reflow (){\n\n let images = document.querySelectorAll(this.opts.responsiveClass);\n\n for (let i=0;i<images.length;i++){\n if(this.imageIsAlreadyInArray(images[i]) === false){\n this.responsiveImages.push(new ResponsiveImg(images[i]));\n }\n }\n\n this.swapImgs();\n\n return this;\n }", "function showPreviewImage(input) {\n if (input.files && input.files[0] && (/\\.(gif|jpe?g|png|svg)$/i).test(input.files[0].name)) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n var stroke = $(input).closest('.admin-stroke');\n if (stroke.length == 0) { stroke = $(input).closest('.admin-stroke--no') }\n stroke.find('.js__image-preview').attr('src', e.target.result);\n }\n reader.readAsDataURL(input.files[0]);\n }\n}", "function setup() {\n createCanvas(640, 480);\n\n // here you pass how many images of a specific class you have\n //create_imageList(173);\n\n input = createFileInput(handleFile); \n input.position(640, 240); \n\n poseNet = ml5.poseNet(onloaded);\n poseNet.on(\"pose\", getposes);\n\n // let options = {\n // inputs: 34,\n // outputs: 5,\n // task: 'classification',\n // debug: true\n // }\n\n // brain = ml5.neuralNetwork(options);\n\n // call for the first image here\n //openImage(image_list[img_num]);\n}", "function generateHighResImage(postcardid) {\n // This function is only called after the order is completed so \n // the global vars will not exist (objPostcard, objPanes, etc)\n\n // get postcard details from database\n getPostcardDetails(templateid, postcardid).done(function(resp){\n // populate temp object\n var objPostcard = $.parseJSON(resp);\n\n if (objPostcard.length) {\n templateid = objPostcard[0].templateid;\n\n // create new hidden canvas\n var newCanvas = document.createElement(\"canvas\");\n var tempcanvas = new fabric.Canvas(newCanvas);\n tempcanvas.setWidth(Math.round(objPostcard[0].width / Math.round(canvasReducePct/10),0));\n tempcanvas.setHeight(Math.round(objPostcard[0].height / Math.round(canvasReducePct/10),0)); \n var ctx = tempcanvas.getContext('2d');\n\n // get all the template panels\n getAllTemplatePanels(templateid, objPostcard[0].postcardid).done(function(resp){\n // populate temp objPanels object\n var objPanels = $.parseJSON(resp);\n\n if (objPanels.length) {\n // loop and save each panel\n $.each(objPanels, function(i) {\n // populate tempcanvas with panel json\n tempcanvas.loadFromJSON(json, function(){\n // add delay to allow any images to load\n setTimeout(function() {\n tempcanvas.renderAll();\n\n var imgstr = tempcanvas.toDataURL({ format: \"png\", multiplier: 2.25 });\n\n // call server code to generate image on server\n createImageOnServer(panelnum, imgstr, 'hires');\n\n tempcanvas.dispose();\n }, 4000);\n });\n });\n }\n });\n }\n });\n}", "function imageSelected(imageIndex, f) {\r\n\r\n pane.attr(\"indexSelected\", imageIndex);\r\n\r\n var taxonImage = taxonImages[imageIndex];\r\n\r\n //Change all image selector icons to grey image\r\n controlsImageSelectors.find(\"img\").attr(\"src\", core.opts.tombiopath + \"resources/camera.png\");\r\n\r\n //Clear current image and caption\r\n if (pane.css(\"width\") != \"0px\") {\r\n //This prevents pane reducing height to zero when\r\n //image removed and helps avoid flickering/resize of\r\n //surrounding contents. It is reset later.\r\n console.log(\"resizing pane\")\r\n pane.css(\"width\", pane.css(\"width\"));\r\n pane.css(\"height\", pane.css(\"height\"));\r\n }\r\n img.attr(\"src\", null);\r\n cap.html(\"\");\r\n \r\n var imgLoad = new Image;\r\n imgLoad.onerror = function () {\r\n cap.html(\"Couldn't load image'\" + taxonImage.URI + \"'.\");\r\n }\r\n imgLoad.onload = function () {\r\n //Loading images asynchronously with this callback ensures that the\r\n //pane resizing works correctly.\r\n cap.html(taxonImage.Caption);\r\n img.attr(\"src\", this.src);\r\n cap.html(taxonImage.Caption);\r\n\r\n if (container) {\r\n if (!preventContainerResize) {\r\n container.css(\"width\", img.width() + border);\r\n container.css(\"height\", img.height() + border + 30);\r\n }\r\n pane.css(\"height\", \"100%\");\r\n pane.css(\"width\", \"100%\");\r\n } else {\r\n pane.css(\"width\", img.width() + border);\r\n pane.css(\"height\", img.height() + border + 30);\r\n }\r\n\r\n img.css(\"opacity\", 0.2); //Helps with sorting out problems\r\n\r\n pane.find(\"#imgLink\" + imageIndex).attr(\"src\", core.opts.tombiopath + \"resources/cameragreen.png\");\r\n\r\n //Initialise zoom image\r\n var _this = this;\r\n setTimeout(function () {\r\n //Putting this in a timeout prevents an unpredictable problem of the imgZoom\r\n //ending up smaller than img. Presumably because the code was firing when\r\n //img was not somehow at it's full size.\r\n imgZoom\r\n .attr(\"src\", _this.src)\r\n .css(\"width\", img.width())\r\n .css(\"height\", img.height())\r\n .css(\"left\", 0)\r\n .css(\"top\", 0)\r\n .attr(\"viewWidth\", img.width())\r\n .attr(\"viewHeight\", img.height())\r\n .attr(\"xProp\", 0.5)\r\n .attr(\"yProp\", 0.5);\r\n }, 50);\r\n\r\n //If function passed to ImageSelected, execute it once\r\n //image is loaded\r\n if (f) f();\r\n };\r\n\r\n imgLoad.src = taxonImage.URI;\r\n }", "function setupPhotoPreviews($, toUpload) {\n const $container = $(\".photo-preview-container\");\n $(\"#photo\").change(function() {\n for (const file of this.files) {\n resizeAndHandleUploadedFile($, file, $container, toUpload);\n }\n });\n}", "function previewImage(file) {\n \t\tvar galleryId = \"gallery\";\n\n \t\tvar gallery = document.getElementById(galleryId);\n \t\tvar imageType = /image.*/;\n\n \t\tif (!file.type.match(imageType)) {\n \t\t\tthrow \"File Type must be an image\";\n \t\t}\n\n \t\tvar thumb = document.createElement(\"div\");\n \t\tthumb.classList.add('thumbnail');\n\n \t\tvar img = document.createElement(\"img\");\n \t\timg.file = file;\n \t\tthumb.appendChild(img);\n \t\tgallery.appendChild(thumb);\n\n \t\t// Using FileReader to display the image content\n \t\tvar reader = new FileReader();\n \t\treader.onload = (function(aImg) {\n \t\t\treturn function(e) {\n \t\t\t\taImg.src = e.target.result;\n \t\t\t};\n \t\t})(img);\n \t\treader.readAsDataURL(file);\n \t\t\n\t\tupload(thumb, file);\n \t}", "processImages(jq) {\n const maxWidth = ui.dom.messagePane.width() - 30;\n const maxHeight = ui.dom.messagePane.height() - 20;\n\n jq.find('img').wrap(function() {\n return $('<a></a>').attr('href', this.src);\n }).after(function() {\n return $('<span class=\"image-alt\"></span>')\n .text('[image:' + visual.ellipsis(this.src, 64) + ']');\n });\n\n jq.find('img').addClass('rescale').on('load', function() {\n visual.rescale($(this), maxWidth, maxHeight);\n });\n\n if (!config.settings.markup.images) {\n jq.find('img').css('display', 'none').next().css('display', 'inline');\n }\n }", "function handleFiles(files) {\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n\n if (!file.type.startsWith('image/')){ continue }\n\n\t\t\t// img is draggable once loaded so needs this - draggable=\"true\" ondragstart=\"drag(event)\"\n var img = document.createElement(\"img\");\n\t\t// img.ondragstart = drag(event);\n img.classList.add(\"obj\");\n\t\t// img.setAttribute(\"id\", \"drag-img\");\n\t\t// img.setAttribute(\"draggable\", \"true\");\n\t\t// var source = img.src;\n img.file = file;\n // Assuming that \"preview\" is the div output where the content will be displayed.\n\t\tvar preview = document.getElementById(\"preview\");\n\t\tpreview.appendChild(img);\n\t\tconsole.log(\"image source: \" + img);\n\n // // find the div with id preview\n // \tvar imgString = \"\";\n // var imgHolder = document.getElementById('preview');\n //\n // // find all images in imgHolder\n // for (var i = 0; i < imgHolder.length; i++) {\n // \tvar imgs = imghHolder[i].getElementsByTagName('img');\n //\n // \t// print out src\n // \tfor (var j = 0; j < imgs.length; j++) {\n // \t\tvar img = imgs[j];\n // \t\timgString+=img.src + \"<br />\";\n // \t}\n // }\n // document.getElementById(\"result\").innerHTML=imgString;\n // console.log(imgString + ': ')\n\n var reader = new FileReader();\n reader.onload = (function(aImg) {\n\t\t\treturn function(e) {\n\t\t\t\taImg.src = e.target.result;\n\t\t\t\tconsole.log(\"aImage Source: \" + aImg.src);\n\t\t\t};\n\t\t})(img);\n reader.readAsDataURL(file);\nconsole.log(\"Reader file: \" + file)\n // create an array to hold image data src\n\t\t// var imageArr = [];\n\t\t// for(i =0; i < img.length; i++){\n\t\t// \timageArr.push[i];\n\t\t// \tconsole.log(imageArr);\n\t\t// }\n\n }\n}", "setImages() {\n this.img1 = createImage(640, 480);\n this.img2 = createImage(640, 480);\n this.img3 = createImage(640, 480);\n this.img4 = createImage(640, 480);\n }", "function addPrvImg() {\r\n\tvar smallIMGs = new Array();\r\n\tvar usedIMGs = new Array();\r\n\t\r\n\t// identify all relevant small images\r\n\t// a) search for images via their classes\r\n\tfor (var i = 0; i < toWatchClasses.length; i++) {\r\n\t\tvar possibleImages = document.getElementsByClassName(toWatchClasses[i]);\r\n\r\n\t\tfor (var j = 0; j < possibleImages.length; j++) {\r\n\t\t\tif (possibleImages[j].nodeName == 'IMG' && possibleImages[j].src.search(matchRegEx)>0) {\r\n\t\t\t\tsmallIMGs.push(possibleImages[j]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// b) search for images via their parents' classes\r\n\tfor (var i = 0; i < toWatchClasses.length; i++) {\r\n\t\tpossibleParents = document.getElementsByClassName(toWatchParentClasses[i]);\r\n\r\n\t\tfor (var j = 0; j < possibleParents.length; j++) {\r\n\t\tvar possibleImages = possibleParents[j].getElementsByTagName('IMG');\r\n\r\n\t\t\tfor (var k = 0; k < possibleImages.length; k++) {\r\n\t\t\t\tif (possibleImages[k].src.search(matchRegEx)>0) {\r\n\t\t\t\t\tsmallIMGs.push(possibleImages[k]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t// loop small images\r\n\tfor (var i = 0; i < smallIMGs.length; i++) {\r\n\t\tvar thisIMG = smallIMGs[i];\r\n\t\t\r\n\t\t// get target source from image source file name\r\n\t\tvar targetSrc = thisIMG.src.replace(matchRegEx,replaceString);\r\n\r\n\t\t// Collect target sources for images which are still active in the document\r\n\t\tusedIMGs.push(targetSrc);\r\n\r\n\t\tif (thisIMG.getAttribute(\"targetSrc\")!=targetSrc) {\r\n\t\t\t// set \"targetSrc\" attribute to the target's source. it will be used by the event functions to locate the big preview image\r\n\t\t\tthisIMG.setAttribute(\"targetSrc\", targetSrc);\r\n\r\n\t\t\t// only cache preview image if it does not already exist (somewhere else in the document)\r\n\t\t\tif (!(imgCache.hasOwnProperty(targetSrc))) {\r\n\t\t\t\timgCache[targetSrc] = new Image();\r\n\t\t\t\timgCache[targetSrc].src = targetSrc;\r\n\t\t\t}\r\n\t\r\n\t\t\t// activate event listeners for small preview image\r\n\t\t\tthisIMG.addEventListener('mouseover', mouseOver, false);\r\n\t\t\tthisIMG.addEventListener('mousemove', mouseMove, false);\r\n\t\t\tthisIMG.addEventListener('mouseout', mouseOut, false);\r\n\t\t}\r\n\t}\r\n\t\r\n\t// remove unused images from imgCache\r\n\tfor (image in imgCache) {\r\n\t\tif (usedIMGs.indexOf(image)<0) {\r\n\t\t\tdelete imgCache[image];\r\n\t\t}\r\n\t}\r\n}", "function createHDR() {\n if (counter < NUMBER_OF_PHOTOS) {\n console.log(`${NUMBER_OF_PHOTOS}`, \" pictures are needed\");\n return;\n }\n\n console.log(\"createHDR is called !\");\n\n // STEP 1. Capture multiple images with various exposure levels.\n let src1 = cv.imread(takePhotoCanvas1);\n let src2 = cv.imread(takePhotoCanvas2);\n let src3 = cv.imread(takePhotoCanvas3);\n let src4 = cv.imread(takePhotoCanvas4);\n console.log('image width: ' + src1.cols + '\\n' +\n 'image height: ' + src1.rows + '\\n' +\n 'image size: ' + src1.size().width + '*' + src1.size().height +\n '\\n' +\n 'image depth: ' + src1.depth() + '\\n' +\n 'image channels ' + src1.channels() + '\\n' +\n 'image type: ' + src1.type() + '\\n');\n\n let srcArray = new cv.MatVector();\n srcArray.push_back(src1);\n srcArray.push_back(src2);\n srcArray.push_back(src3);\n srcArray.push_back(src4);\n\n // STEP 2. Align images , need to expose properly in Photo module JS bindings.\n /*\n let alignMTB = new cv.AlignMTB();\n alignMTB.process(srcArray, srcArray);\n console.log(\"Aligning the images are done !\");\n */\n\n // STEP 3. Estimate Camera Response Function (CRF).\n let response = new cv.Mat();\n let calibration = new cv.CalibrateDebevec();\n // let times = exposureTimeArray.slice();\n let times = new cv.matFromArray(exposureTimeArray.length, 1, cv.CV_32F,\n exposureTimeArray);\n exposureTimeArray.forEach(function (element) {\n console.log(element);\n });\n\n // process (InputArrayOfArrays src, OutputArray dst, InputArray times)\n console.log(\"call calibration.process\");\n var t0 = performance.now();\n calibration.process(srcArray, response, times);\n var t1 = performance.now();\n console.log(\"calibration.process took \" + (t1 - t0) + \" milliseconds.\");\n\n // STEP 4. Merge exposures to HDR image.\n console.log(\"MergeDebevec is called\");\n let hdr_debevec = new cv.Mat();\n let merge_debevec = new cv.MergeDebevec();\n t0 = performance.now();\n merge_debevec.process(srcArray, hdr_debevec, times, response);\n t1 = performance.now();\n console.log(\"merge_debevec.process took \" + (t1 - t0) + \" milliseconds.\");\n console.log(\"HDR done !! woooo \");\n\n let dst = new cv.Mat();\n cv.cvtColor(hdr_debevec, dst, cv.COLOR_BGRA2RGBA, 0);\n\n // STEP 5. Tonemap HDR image if you don't have HDR screen to display.\n console.log(\"TonemapReinhard is called\");\n let ldr = new cv.Mat();\n let tonemap_reinhard = new cv.TonemapReinhard(gamma = 2.2);\n t0 = performance.now();\n let hdr_debevec_dst = new cv.Mat();\n cv.cvtColor(hdr_debevec, hdr_debevec_dst, cv.COLOR_BGRA2BGR);\n tonemap_reinhard.process(hdr_debevec_dst, ldr);\n t1 = performance.now();\n console.log(\"tonemap_reinhard took \" + (t1 - t0) + \" milliseconds.\");\n console.log(\"Tonemapping done !! woooo \");\n // STEP 6. Display\n cv.imshow('outputCanvasLDR', ldr);\n\n // Fusion : First align and then merge.\n // Align not properly exposed in JS, so ignore the align call now.\n //console.log(\"MergeMertens is called\");\n //let fusion = new cv.Mat();\n //let merge_mertens = new cv.MergeMertens();\n //merge_mertens.process(srcArray, fusion);\n\n // Convert the tye to cv.CV_8UC4\n let dest = new cv.Mat();\n\n // Display in canvas.\n /*\n let output_canvas = document.getElementById(outputCanvas);\n let ctx = output_canvas.getContext('2d');\n\n ctx.clearRect(0, 0, output_canvas.width, output_canvas.height);\n output_canvas.width = imgData.width;\n output_canvas.height = imgData.height;\n ctx.putImageData(imgData, 0, 0);\n */\n // https://github.com/opencv/opencv/issues/13459\n //cv.imwrite('fusion.png', fusion * 255);\n /*\n cv.imwrite('ldr.png', ldr * 255);\n cv.imwrite('hdr.png', hdr * 255);\n cv.imshow('outputCanvas', ldr);\n */\n /* Fix colorspace\n https://docs.opencv.org/3.1.0/d7/d1b/group__imgproc__misc.html\n data read from canvas is a Uint8ClampedArray.\n Mat used here is CV_32F\n */\n\n //cv.imwrite(\"hdr.png\", hdr_debevec);\n\n // Cleanup.\n src1.delete();\n src2.delete();\n src3.delete();\n src4.delete();\n srcArray.delete();\n dest.delete();\n hdr_debevec.delete();\n merge_debevec.delete();\n //merge_mertens.delete();\n //fusion.delete();\n ldr.delete();\n tonemap_reinhard.delete();\n dst.delete();\n}", "nonResizedImage() {\n return (\n <div style={{ width: this.props.maxWidth, height: this.props.maxHeight }}>\n <Image src={this.props.src} onLoad={this.handleImageLoaded} />\n </div>\n );\n }", "function imageMin() {\n return src(files.imgPath)\n .pipe(imagemin())\n .pipe(dest('pub/images')\n );\n}", "function updatePicture($productPreview){\n // need to make sure this built URL is correct for project\n var url = pathToImages + \"/\" + folder + \"/\" + frameNum + imageNameSuffix;\n $productPreview.css(\"background\",\"url('\" + url + \"') no-repeat center center\"); \n $productPreview.css(\"background-size\",\"100%\"); \t\n }", "function imagePreview(src){\n\t\t\n\t\t/* Remove preview */\n\t\timgPreview.getElement().setHtml(\"\");\n\t\t\n\t\tif(src == \"base64\") {\n\t\t\t\n\t\t\t/* Disable Checkboxes */\n\t\t\tif(urlCB) urlCB.setValue(false, true);\n\t\t\tif(fileCB) fileCB.setValue(false, true);\n\t\t\t\n\t\t} else if(src == \"url\") {\n\t\t\t\n\t\t\t/* Ensable Image URL Checkbox */\n\t\t\tif(urlCB) urlCB.setValue(true, true);\n\t\t\tif(fileCB) fileCB.setValue(false, true);\n\t\t\t\n\t\t\t/* Load preview image */\n\t\t\tif(urlI) imagePreviewLoad(urlI.getValue());\n\t\t\t\n\t\t} else if(fsupport) {\n\t\t\t\n\t\t\t/* Ensable Image File Checkbox */\n\t\t\tif(urlCB) urlCB.setValue(false, true);\n\t\t\tif(fileCB) fileCB.setValue(true, true);\n\t\t\t\n\t\t\t/* Read file and load preview */\n\t\t\tvar fileI = t.getContentElement(\"tab-source\", \"file\");\n\t\t\tvar n = null;\n\t\t\ttry { n = fileI.getInputElement().$; } catch(e) { n = null; }\n\t\t\tif(n && \"files\" in n && n.files && n.files.length > 0 && n.files[0]) {\n\t\t\t\tif(\"type\" in n.files[0] && !n.files[0].type.match(\"image.*\")) return;\n\t\t\t\tif(!FileReader) return;\n\t\t\t\timgPreview.getElement().setHtml(\"Loading...\");\n\t\t\t\tvar fr = new FileReader();\n\t\t\t\tfr.onload = (function(f) { return function(e) {\n\t\t\t\t\timgPreview.getElement().setHtml(\"\");\n\t\t\t\t\timagePreviewLoad(e.target.result);\n\t\t\t\t}; })(n.files[0]);\n\t\t\t\tfr.onerror = function(){ imgPreview.getElement().setHtml(\"\"); };\n\t\t\t\tfr.onabort = function(){ imgPreview.getElement().setHtml(\"\"); };\n\t\t\t\tfr.readAsDataURL(n.files[0]);\n\t\t\t}\n\t\t}\n\t}", "createPreview(architect) {\n if (this.showPreview && this.hasPreview) {\n let root = architect.createDiv(this.getPreviewClasses);\n\n let h2 = architect.createH(2, \"is-size-6\");\n h2.innerHTML(`Uploaded ${this.files.length} file(s) successfully.`);\n\n // Creating the reset button\n let thumbnails = architect.createElement(TThumbnails);\n for (let index in this.files) {\n let file = this.files[index];\n let thumbnail = architect.createElement(TThumbnail);\n thumbnail.setKey(`${this.id}-thumb-${index}`);\n let img = architect.createImg(\"image is-128x128\");\n img.setKey(`${this.id}-image-${index}`);\n img.setRef(`${this.id}-image-${index}`, true);\n\n let name = architect.createH();\n name.innerHTML(file.name);\n\n thumbnail.addChild(img);\n thumbnail.addChild(name);\n thumbnails.addChild(thumbnail);\n }\n root.addChild(h2, this.isUploadSuccess);\n root.addChild(thumbnails);\n\n architect.addChild(root);\n }\n }", "function ReplaceResizeImage($imageCropper, image_src, media_preset_height, media_preset_width, is_popup, callback) {\n //'destroy not working as expected, below line is added. this will remove already included image'\n $imageCropper.find('.cropit-preview-image-container').remove();\n var finished_size = parseFloat(media_preset_width) + 'w x ' + parseFloat(media_preset_height) + 'h';\n $imageCropper.find('.right-header .size').text(finished_size);\n if (is_popup) {\n $imageCropper.addClass('popup-class');\n }\n var originalHeight = parseFloat(media_preset_height);\n var originalWidth = parseFloat(media_preset_width);\n // if media preset height and weight is greater than 250px, we customize image editor dimensions as real dimensions cant be shown.\n // on the page. Image dimensions are also scaled based on image editor to maintain aspect ratio.\n if (originalHeight > 250 && originalWidth > 250) {\n if (originalWidth > originalHeight) {\n var previewScale = (originalHeight / 250);\n var resize = parseFloat((250 * 100) / originalHeight);\n } else {\n var previewScale = (originalWidth / 250);\n var resize = parseFloat((250 * 100) / originalWidth);\n }\n var previewHeight = originalHeight / previewScale;\n var previewWidth = originalWidth / previewScale;\n } else {\n var previewHeight = originalHeight;\n var previewWidth = originalWidth;\n resize = 100;\n previewScale = 1;\n }\n resizeImage(image_src, resize, function(resizeDataURL) {\n $imageCropper.cropit({\n allowDragNDrop: false,\n imageBackground: false,\n imageState: {\n src: resizeDataURL,\n //src: 'your_image_path/to_be_crop_image.jpg',\n },\n //freeMove: 'true',\n minZoom: 'fill',\n maxZoom: 4,\n smallImage: 'allow',\n width: previewWidth,\n height: previewHeight,\n exportZoom: previewScale,\n onImageLoading: function() {\n console.log('image is loading...');\n },\n onImageLoaded: function() {\n console.log('image is loaded callback');\n var img_width = $imageCropper.cropit('imageSize').width;\n var img_height = $imageCropper.cropit('imageSize').height;\n callback($imageCropper);\n },\n });\n });\n }", "function setImagePreview() {\n const imageFile = document.querySelector(\"#imageFile\");\n const imageContainer = document.querySelector(\"#imagePreview\");\n const imagePreview = imageContainer.querySelector(\".image-preview__real\");\n const imageText = imageContainer.querySelector(\".image-preview__text\");\n\n imageFile.addEventListener(\"change\", function () {\n const file = this.files[0];\n\n if (file) {\n const reader = new FileReader();\n\n imageText.style.display = \"none\";\n imagePreview.style.display = \"block\";\n\n reader.addEventListener(\"load\", function () {\n imagePreview.setAttribute(\"src\", this.result);\n });\n reader.readAsDataURL(file);\n } else {\n imageText.style.display = null;\n imagePreview.style.display = null;\n }\n });\n\n // delete image File\n document.querySelector(\"#btnRemove\").addEventListener(\"click\", function () {\n imageFile.value = null;\n imageText.style.display = null;\n imagePreview.style.display = null;\n });\n\n // endlarge image\n imagePreview.addEventListener(\"click\", function () {\n const imageContainer = document.getElementById(\"enlargeImage\");\n const image = imageContainer.querySelector(\"img\");\n const modal = new bootstrap.Modal(imageContainer);\n\n image.src = this.src;\n image.style.width = \"100%\";\n\n modal.show();\n });\n}", "function loadImg(e){var files=e.target.files;if(files.length){[].forEach.call(files,function(file){var reader=new FileReader();//проветка на тип зашруженного файла и размер\nexchangeByteForMb(file.size)>5&&console.log('55');if(testTypeImage(file,['gif','jpeg','pjpeg','png'])&&exchangeByteForMb(file.size)<5){reader.onload=function(e){var fileData=e.target.result;//base64\nvar error=e.target.error;error&&log('Файл не загрузился!');var block='<div class=\"blockFlexImgInfo\">\\n <img src=\"'+fileData+'\" alt=\"\">\\n <a href=\"#\" class=\"deleteImg \"></a>\\n <div class=\"blockFlexImgInfo__name\">'+file.name.split('.')[0]+'</div>\\n <div class=\"blockFlexImgInfo__size\">'+exchangeByteForMb(file.size)+' Mb</div>\\n </div>';document.querySelector('.blockFlexImg__square').insertAdjacentHTML('afterEnd',block);};reader.readAsDataURL(file);}else if(testTypeImage(file,['gif','jpeg','pjpeg','png'])){var errorSize=document.createElement('div');errorSize.classList.add('errorSizeImg');errorSize.innerHTML='Error: '+file.name.split('.')[0]+' \\u043F\\u0440\\u0435\\u0432\\u044B\\u0448\\u0430\\u0435\\u0442 \\u043C\\u0430\\u043A\\u0441\\u0438\\u043C\\u0430\\u043B\\u044C\\u043D\\u044B\\u0439 \\u0440\\u0430\\u0437\\u043C\\u0435\\u0440 5 Mb!';document.querySelector('.errorSizeImgConteiner').appendChild(errorSize);setTimeout(function(){return document.querySelector('.errorSizeImg').remove();},7000);log(66666);}else{var blockNoImage='<article class=\"infoNoImage\">\\n <div class=\"flex\">\\n <pre class=\"infoNoImage__info-maxSize\">1. '+file.name.split('.')[0]+'</pre>\\n <pre class=\"infoNoImage__info\">'+file.type.split('/')[1]+'</pre>\\n <pre class=\"infoNoImage__info\">'+exchangeByteForMb(file.size)+' Mb</pre>\\n </div>\\n <pre class=\"infoNoImage__info__delete \">Delete </pre>\\n </article>';document.querySelector('.startFlex__column').insertAdjacentHTML('beforeEnd',blockNoImage);}});e.target.value='';}}", "function PreviewImage(par,x){\n\t\tvar typex \t= par.files[0].type;\n\t\tvar sizex\t= par.files[0].size;\n\t\tvar namex\t= par.files[0].name;\n\t\t\n\t\tif(typex =='image/png'||typex =='image/jpg'||typex =='image/jpeg'|| typex =='image/gif'){ //validasi format\n\t\t\tif(sizex>(900*900)){ //validasi size\n\t\t\t\t$('#viewimg_'+x).html('<span class=\"label label-important\">ukuran max 1 MB</span>');\n\t\t\t\t$('#bukegTB_'+x).val('');\n\t\t\t\treturn false;\t\n\t\t\t}else{ \n\t\t\t\t$('#viewimg_'+x).html('<img src=\"../img/loader.gif\">');\n\t\t\t\tvar reader = new FileReader();\n\t\t\t\treader.readAsDataURL(par.files[0]);\n\t\n\t\t\t\treader.onload = function (oFREvent){\n\t\t\t\t\tvar urlx = oFREvent.target.result;\n\t\t\t\t\tvar itemx = '<img class=\"vwimg\" src=\"'+urlx+'\">';\n\t\t\t\t\t$('#viewimg_'+x).html(itemx);\n\t\t\t\t};\n\t\t\t}\n\t\t}else{ // format salah\n\t\t\t$('#viewimg_'+x).html('<img src=\"../img/loader.gif\">');\n\t\t\t$('#viewimg_'+x).html('<span class=\"label label-important\">hanya file gambar(.jpg,.jpeg,.png,.gif)</span>');\n\t\t\t$('#bukegTB_'+x).val('');\n\t\t\treturn false;\n\t\t}\n\t}", "function processImage() {\n // if there is an image tag inside the container\n // and it has a src setted\n if(f.o.src && f.o.src != \"\")\n {\n\n // if container size if not setted resize it to the image size\n if (Math.floor(f.$el.height()) <= 0) { f.o.clearhg = true; f.$el.height(f.o.naturalimghg); } \n if (Math.floor(f.$el.width()) <= 0) { f.o.clearwd = true; f.$el.width(f.o.naturalimgwd ); }\n\n // get the container size\n f.o.containerwd = f.$el.width();\n f.o.containerhg = f.$el.height();\n\n // get the size of the visible area for the image we need this \n // to not draw the image outside the parent container\n f.o.imghg = ((f.o.naturalimgwd/f.o.naturalimghg < f.o.containerwd/f.o.containerhg) ? \n f.o.containerhg :\n Math.ceil(f.o.containerwd/f.o.naturalimgwd * f.o.naturalimghg)); \n\n f.o.imgwd = ((f.o.naturalimgwd/f.o.naturalimghg < f.o.containerwd/f.o.containerhg) ? \n Math.ceil(f.o.containerhg/f.o.naturalimghg * f.o.naturalimgwd) :\n f.o.containerwd);\n\n }\n else {\n // if no principal image takes the container size \n f.o.imgwd = f.o.containerwd = f.$el.width();\n f.o.imghg = f.o.containerhg = f.$el.height();\n }\n // calculate margin for horizontal alingment inside the container\n f.o.marginleft = (f.o.containerwd > f.o.imgwd) ? (f.o.containerwd/2) - (f.o.imgwd/2) : 0;\n\n }", "function uploadFile({...files}) {\n const types = /jpg|jpeg|png|gif|pdf/;\n errorContainer.innerHTML = '';\n document.getElementById(\"preview-container\").innerHTML = '';\n for (let prop in files) {\n if (types.test(files[prop].type)) {\n let reader = new FileReader();\n let newPreviewImg = new Image();\n reader.onloadend = function () {\n newPreviewImg.src = reader.result;\n document.getElementById('preview-container').appendChild(newPreviewImg);\n }\n if (files) reader.readAsDataURL(files[prop]);\n dataImgs.set(files[prop].name, files[prop])\n } else {\n errorMessege(files[prop].name)\n }\n }\n}", "function showImage(input){\n if(input.files && input.files[0]){\n \n // Read the image to load it in \n var reader = new FileReader();\n\n // Call the onload function when the reader starts reading in the next line.\n reader.onload = function(e){\n $(\"#image\")\n .attr(\"src\",e.target.result)\n .Jcrop({\n // updateCoords will be called whenever the selector box is altered or moved(dragged).\n onChange: updateCoords,\n onSelect: updateCoords,\n\n // Set the width for the image which in turn will set the scale for the image automatically.\n boxWidth: 450, boxHeight: 400\n },function(){\n\n // Save the current jcrop instance for setting rotate variable in above functions.\n jcrop_api = this;\n }); \n\n };\n\n // Load the image to the image tag.\n reader.readAsDataURL(input.files[0]);\n }\n }", "function class_buildTableBigImageResize()\r\n\t{\r\n\t\tif ( currentViewType === '2' )\r\n\t\t{\r\n\t\t\tclass_buildTableBigImage();\r\n\t\t}\r\n\t}", "queueImage(figure){\n if(!figure) return;\n\n var self = this;\n\n let resolved = (response) => {\n this.isProcessing = false;\n var _figure = self.queue.dequeue();\n\n if(_figure){\n process(_figure);\n }\n };\n\n let rejected = (error) => {\n console.log('Error: an image could not be loaded: ',error);\n };\n\n let process = (figure) => {\n this.isProcessing = true;\n this.loadImage(figure).then(resolved, rejected);\n };\n\n if(!this.isProcessing){\n process(figure);\n }else{\n this.queue.enqueue(figure);\n }\n }", "async function handleImageSelection(e){\n console.log(\"handleImageSelection\")\n const preview = document.querySelector(\".preview\");\n while(preview.firstChild){\n preview.removeChild(preview.firstChild);\n }\n\n const list = document.createElement(\"ol\");\n preview.appendChild(list);\n\n const curFiles = e.target.files;\n let imgArray = [];\n console.log(`Length: ${curFiles.length}`);\n \n for(const file of curFiles){\n imgArray.push(\n await toBase64(file)\n );\n const listItem = document.createElement(\"li\");\n if(fileTypes.includes(file.type)){\n\n console.log(\"loop\");\n\n const image = document.createElement(\"img\");\n image.src = URL.createObjectURL(file);\n image.style.width = \"60px\";\n listItem.appendChild(image);\n list.appendChild(listItem);\n\n }\n }\n\n setImages(imgArray);\n\n \n\n }", "function New_Image_Display(n) {\n image_index += n;\n if (image_index > image_files_in_dir.length) {\n image_index = 1\n }\n if (image_index < 1) {\n image_index = image_files_in_dir.length\n };\n \n val_obj = {descriptionInput:'', taglist:'', imgMain:image_files_in_dir[image_index - 1]}\n //view_annotate_module.Annotation_DOM_Alter(val_obj)\n\n //UNOCMMENT LATER!!!!\n tagging_view_annotate.Annotation_DOM_Alter(val_obj)\n\n //Load_State_Of_Image()\n\n //UNOCMMENT LATER!!!!\n Load_State_Of_Image_IDB() \n\n}", "function preview(input){\n if(input.files && input.files[0]){\n var reader = new FileReader();\n reader.onload = function (e) {\n $(\"#div-img\").html(\"<img src='\"+e.target.result+\"' class='img-circle img_cambia'>\");\n }\n reader.readAsDataURL(input.files[0]);\n }\n }", "renderZoomImages(){\n <View style={{borderWidth: 5, flex: 1}}>\n <ImageZoom cropWidth={Dimensions.get('window').width}\n cropHeight={Dimensions.get('window').height}\n imageWidth={200}\n imageHeight={200}>\n {this.imageList()}\n </ImageZoom>\n </View>\n }", "function main(){\n\n // create the server\n const app = express();\n\n // static files such as js and css of the webpage\n app.use(express.static(path.join(__dirname, 'public/')));\n\n //Initialize the queues with dummies\n const upload_dir = path.resolve(path.join(__dirname, config.upload_dir));\n var stream_queue = [path.join(upload_dir, 'stream.jpeg')];\n var thermal_queue = [path.join(upload_dir, 'thermal.jpeg')]\n var visible_queue = [path.join(upload_dir, 'visible.jpeg')];\n replace_with_dummy(stream_queue);\n replace_with_dummy(thermal_queue);\n replace_with_dummy(visible_queue);\n \n // start the image request handler\n app.get('/image/stream', returnImage(stream_queue));\n app.get('/image/thermal', returnImage(thermal_queue));\n app.get('/image/visible', returnImage(visible_queue));\n\n // returns the main webpage index.html\n app.get('/', function(req, res) {\n res.sendFile(path.join(__dirname + '/index.html'));\n // console.log('index');\n });\n \n // This handles the camera uploads and updates the queues\n app.use(busboy()); \n app.post('/upload', function(req, res) {\n // We pipe the uploaded file to the upload directory\n var fstream;\n req.pipe(req.busboy);\n req.busboy.on('file', function (fieldname, file, filename) {\n // console.log(\"Uploading: \" + filename); \n file_path = path.join(upload_dir, filename);\n fstream = fs.createWriteStream(file_path);\n file.pipe(fstream);\n // handle what happens after uploading completes\n fstream.on('close', function () {\n res.end();\n // We put the new file in the queue\n stream_queue.push(file_path);\n // if the queue is at max capacity, we remove the oldest file\n if(stream_queue.length > config.queue_capacity){\n var to_delete = stream_queue.shift();\n fs.unlink(to_delete, ()=>{});\n }\n // TODO: extract the visible image and put it in the visible queue\n });\n });\n });\n\n // start listening\n app.listen(config.web_server.network.port, function () {\n console.log(`Listening on port ${config.web_server.network.port}!`);\n });\n\n process.on('exit', function () {\n console.log('About to exit, waiting for remaining connections to complete');\n app.close();\n });\n}", "function ImageQueueRequester(maxQueuedElements) {\n var self = new Emitter(this);\n var processedImages = new Array();\n var worker = new Worker('src/app/Media/Video/ImageProcessWorker.js');\n var play = false;\n var numberOfRequestsInProcess = 0;\n\n worker.addEventListener('message', function (e) {\n\n e.data.image = new Uint8Array(e.data.imageInArrayBuffer);\n processedImages.push(e.data);\n\n console.log('VideoSource: FullImage received, queue at capacity: ' + (processedImages.length * 100) / maxQueuedElements);\n self.emit('capacity_consumed_in_percentage', (processedImages.length * 100) / maxQueuedElements);\n //if (processedImages.length > maxQueuedElements) {\n // throw 'how the fuck';\n //}\n if (processedImages.length == maxQueuedElements) {\n self.emit('full');\n }\n \n numberOfRequestsInProcess--;\n console.log('VideoSource: Number of request in progress : ' + numberOfRequestsInProcess);\n if (play) {\n self.requestImageIfNeeded();\n }\n\n if (play == false && numberOfRequestsInProcess == 0) {\n self.emit('stoped');\n }\n }, false);\n\n\n self.consume = function () {\n setTimeout(self.requestImageIfNeeded, 20);\n\n return processedImages.shift();\n };\n\n self.requestImageIfNeeded = function () {\n if (numberOfRequestsInProcess < maxQueuedElements && processedImages.length < maxQueuedElements) {\n numberOfRequestsInProcess++;\n worker.postMessage({ cmd: 'processImageAhead'});\n }\n };\n\n self.start = function () {\n play = true;\n self.requestImageIfNeeded();\n }\n\n self.requestStop = function () {\n play = false;\n if (numberOfRequestsInProcess == 0) {\n self.emit('stoped');\n }\n }\n\n self.addFrame = function (frame) {\n worker.postMessage({ cmd: 'addFrame', args: frame });\n }\n}", "function resizeImage(image_src, resize, fn) {\n var fileReader = new FileReader();\n if (image_src == '' || typeof image_src == 'undefined') {\n // \tvar dataurl = 'https://image.shutterstock.com/image-photo/waterfall-deep-forest-huay-mae-600w-351772952.jpg'; \n fn('blank');\n } else {\n var dataurl = image_src;\n var request = new XMLHttpRequest();\n request.open('GET', dataurl, true);\n request.responseType = 'blob';\n request.onload = function() {\n fileReader.readAsDataURL(request.response);\n };\n request.send();\n fileReader.onload = function(event) {\n var img = new Image();\n img.onload = function() {\n // console.log('image onload');\n var canvas = document.createElement(\"canvas\");\n var context = canvas.getContext(\"2d\");\n canvas.width = parseFloat((img.width * resize) / 100);\n canvas.height = parseFloat((img.height * resize) / 100);\n context.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height);\n fn(canvas.toDataURL());\n }\n img.src = event.target.result;\n };\n }\n }", "function paintImage(imgNumber) {\n const image = new Image();\n image.src = `images/${imgNumber + 1}.jpg`;\n image.classList.add(\"bgImage\");\n body.prepend(image);\n}", "function resizeImg(canvas, _ref, imgType, cb) {\n var maxWidth = _ref.maxWidth,\n maxHeight = _ref.maxHeight;\n\n var originalWidth = canvas.width;\n var originalHeight = canvas.height;\n\n var finish_cb = function finish_cb(canvas) {\n var resizeRatio = void 0;\n if (originalWidth) {\n resizeRatio = canvas.width / originalWidth;\n } else {\n resizeRatio = 1;\n }\n cb({\n imgUri: canvas.toDataURL('image/' + imgType),\n w: canvas.width,\n h: canvas.height,\n resizeRatio: resizeRatio\n });\n };\n\n // determine target width and height based on max dimensions\n var targetWidth = void 0,\n targetHeight = void 0;\n if (typeof maxWidth === 'number' && typeof maxHeight !== 'number') {\n maxHeight = Infinity;\n targetWidth = maxWidth;\n targetHeight = maxWidth * canvas.height / canvas.width;\n } else if (typeof maxWidth !== 'number' && typeof maxHeight === 'number') {\n maxWidth = Infinity;\n targetWidth = maxHeight * canvas.width / canvas.height;\n targetHeight = maxHeight;\n } else {\n // both maxima exist\n if (canvas.height / canvas.width > maxHeight / maxWidth) {\n targetWidth = maxHeight * canvas.width / canvas.height;\n targetHeight = maxHeight;\n } else {\n targetWidth = maxWidth;\n targetHeight = maxWidth * canvas.height / canvas.width;\n }\n }\n\n if (canvas.width <= maxWidth && canvas.height <= maxHeight) {\n finish_cb(canvas);\n } else {\n // Use different resizing method based on original image size(3500)\n if (canvas.width > 3500 || canvas.height > 3500) {\n new _hermiteResize2.default().resample(canvas, targetWidth, targetHeight, true, function () {\n finish_cb(canvas);\n });\n } else {\n var resizeCanvas = document.createElement('canvas'),\n resizeContext = resizeCanvas.getContext('2d'),\n resizing = {\n prev: {\n w: canvas.width,\n h: canvas.height,\n dx: 0\n },\n next: {\n w: Math.round(canvas.width / 2),\n h: Math.round(canvas.height / 2),\n dx: canvas.width\n }\n };\n resizeCanvas.width = canvas.width * 2; // twice as wide to allow room for drawing successively halved images\n resizeCanvas.height = canvas.height;\n resizeContext.drawImage(canvas, 0, 0); // copy canvas over, align to left of resize canvas\n\n while (resizing.next.w > maxWidth || resizing.next.h > maxHeight) {\n // first, resize by half repeatedly\n resizeContext.drawImage(resizeCanvas, resizing.prev.dx, 0, resizing.prev.w, resizing.prev.h, resizing.next.dx, 0, resizing.next.w, resizing.next.h);\n resizing.prev.dx = resizing.next.dx;\n resizing.prev.w = resizing.next.w;\n resizing.prev.h = resizing.next.h;\n resizing.next.dx += resizing.next.w;\n resizing.next.w = Math.round(resizing.next.w / 2);\n resizing.next.h = Math.round(resizing.next.h / 2);\n }\n\n // finally, resize to target width\n var outputCanvas = document.createElement('canvas'),\n outputContext = outputCanvas.getContext('2d');\n outputCanvas.width = targetWidth;\n outputCanvas.height = targetHeight;\n outputContext.drawImage(resizeCanvas, resizing.prev.dx, 0, resizing.prev.w, resizing.prev.h, 0, 0, outputCanvas.width, outputCanvas.height);\n finish_cb(outputCanvas);\n }\n }\n}", "async function onFilesDroppedOrSelected(fileList) {\n const images = [];\n // Use DataTransferItemList interface to access the file(s)\n for (let i = 0; i < fileList.length; i++) {\n // If dropped items aren't files, reject them\n const file = fileList[i];\n if (file.type.split('/')[0] == 'image') {\n images.push({\n name: file.name,\n file,\n });\n }\n }\n\n if (images.length == 0) {\n console.log('No image found');\n return;\n }\n\n const url = URL.createObjectURL(images[0].file);\n image = await loadImage(url);\n imageData = await readImageData(image);\n\n p.remove();\n\n IMAGE_SIZE = [imageData.width, imageData.height];\n min_omega = (Math.PI * 2) / (0.05 * IMAGE_SIZE[0]);\n max_omega = (Math.PI * 2) / (300.0 * IMAGE_SIZE[0]);\n lpf1 = new LowpassFilter(rate, lowpass1_cutoff * rate);\n lpf2 = new LowpassFilter(rate, lowpass2_cutoff * rate);\n lpf3 = new LowpassFilter(rate, lowpass3_cutoff * rate);\n\n new p5((p_) => {\n p = p_;\n p.setup = function () {\n const renderer = p.createCanvas(imageData.width, imageData.height);\n p.pixelDensity(1);\n\n resizer.canvas = renderer.canvas;\n resizer.dimension = [imageData.width, imageData.height];\n resizer.calculateDimensions();\n resizer.addStyles();\n resizer.canvas.style.width = `${resizer.styleWidth}px`;\n resizer.canvas.style.height = `${resizer.styleHeight}px`;\n\n const pContext = p.drawingContext;\n pContext.putImageData(imageData, 0, 0);\n\n draw();\n };\n }, elements.container);\n}" ]
[ "0.6110448", "0.56923664", "0.5627865", "0.5626599", "0.56240946", "0.5608498", "0.5601916", "0.5593498", "0.558684", "0.55845207", "0.55675715", "0.55589616", "0.5557858", "0.5547128", "0.55332875", "0.5467738", "0.54672444", "0.5462436", "0.54510015", "0.54483396", "0.54419476", "0.543827", "0.5403698", "0.5387381", "0.5378857", "0.5369206", "0.5368662", "0.53682786", "0.5363112", "0.5351887", "0.5350318", "0.534565", "0.5323349", "0.5312489", "0.53015023", "0.5299425", "0.52879924", "0.5283378", "0.5265618", "0.52634025", "0.52596754", "0.52589387", "0.5246373", "0.5235675", "0.5232926", "0.52243656", "0.5214344", "0.51996535", "0.51924396", "0.51881534", "0.5186334", "0.5177025", "0.5163919", "0.5163809", "0.5162709", "0.51575243", "0.51545185", "0.5151675", "0.5148824", "0.5144063", "0.51439065", "0.51426363", "0.5141166", "0.5132603", "0.513207", "0.51306355", "0.5126192", "0.5125486", "0.5124481", "0.51195395", "0.5113254", "0.5108544", "0.51070696", "0.5104842", "0.5102178", "0.50973874", "0.50931627", "0.50896317", "0.5088887", "0.50741976", "0.5073963", "0.5072359", "0.5072292", "0.50714654", "0.5069599", "0.50651526", "0.506217", "0.5057609", "0.50547785", "0.5052593", "0.5046446", "0.5040116", "0.5033709", "0.5029935", "0.5027806", "0.5027002", "0.50215757", "0.50210464", "0.5019455", "0.5017676" ]
0.6013363
1
Remove all metadata (Exif, ICC, photoshop stuff, etc.)
function filterJpegPreview(buffer) { buffer = image_traverse.jpeg_segments_filter(buffer, segment => { if (segment.id >= 0xE1 && segment.id < 0xF0) return false; return true; }); return buffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stripMetadata(data) {\n return data.Properties;\n }", "function cleanMeta(obj) {\n delete obj._id;\n delete obj._rev;\n delete obj.docType;\n}", "function i(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}", "function m(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}", "removeMetadata(aOldAddon) {\n // This add-on has disappeared\n logger.debug(\"Add-on \" + aOldAddon.id + \" removed from \" + aOldAddon.location);\n XPIDatabase.removeAddonMetadata(aOldAddon);\n }", "async removeMetadata(id) {\n let filename = this._formatMetadataFilename(id);\n\n await fs.unlink(filename);\n }", "function clear_meta_images(){\n $('.meta-thumbs').html(\"\");\n }", "function resetMetadata() {\n deleteMetadata(BaseClass);\n deleteMetadata(BaseClass, 'staticBaseMethod');\n deleteMetadata(BaseClass.prototype, 'baseMethod');\n deleteMetadata(SubClass);\n deleteMetadata(SubClass, 'staticSubMethod');\n deleteMetadata(SubClass.prototype, 'subMethod');\n deleteMetadata(SubClass.prototype, 'baseMethod');\n }", "uncommentMetadata_(contents) {\n if (contents.includes(HIDDEN_FRONT_MATTER_PREFIX)) {\n contents = contents\n .replace(HIDDEN_FRONT_MATTER_PREFIX, FRONT_MATTER_DELIMITER)\n .replace(HIDDEN_FRONT_MATTER_POSTFIX, FRONT_MATTER_DELIMITER);\n }\n return contents;\n }", "function cleanMatInfo()\n{\n for(var i=0; i<matInfo.length; i++) {\n if(matInfo[i].endtag == \"-1\") {\n\n //shift everything down\n for(var j=i; j<matInfo.length-1; j++)\n matInfo[j]=matInfo[j+1];\n\n i--;//there might be two in a row\n\n delete matInfo[matInfo.length-1];//remove garbage value\n matInfo.length--;//after deletion, there will be an \"undefined\" value there so we need this line to actually shrink the array\n }\n }\n}", "function stripMetadata(url, topic, cb){\n\n // Content Spec Metadata object\n var md = {'serverurl': url}, \n err,\n spec = topic.xml;\n \n md.specrevision = topic.revision;\n md.spec = topic.xml;\n \n // Put the spec into a line-by-line array\n var array = spec.split(\"\\n\");\n \n // Iterate over the lines in the array and match against our regex patterns\n for (var i = 0; i < array.length; i ++){\n for (var j = 0; j < ContentSpecMetadataSchema.length; j++){\n if (array[i].match(ContentSpecMetadataSchema[j].rule))\n { \n // remove trailing and leading whitespaces with regex\n md[ContentSpecMetadataSchema[j].attr] = array[i].split('=')[1].replace(/^\\s+|\\s+$/g,'');\n }\n }\n } \n \n// console.log(md);\n cb(err, md);\n}", "function removeMetadata(uipath) {\n var r = \"\"; // resulting string\n var i = 0;\n while (true) {\n var j = uipath.indexOf(\"[\", i);\n if (j == -1) {\n r = r + uipath.slice(i);\n return r;\n }\n else {\n r = r + uipath.slice(i, j);\n var k = uipath.indexOf(\"]\", j);\n if (k > 0) {\n i = k + 1;\n }\n else {\n console.log(\"removeMetada() called on incorrect label: \" + uipath);\n return uipath;\n }\n }\n }\n}", "function removeAllNoteIcon() {\n removeTagsByName('icnote');\n}", "function deleteFromMetaFile(index) {\n files_meta = deleteElementFromJSON(files_meta, '_'+index);\n}", "function getExifPropClean(prop, value) {\n\tvar cleansed=new Object();\n\tcleansed.name=null;\n\tcleansed.desc=null;\n\tswitch(prop) {\n\t\tcase \"Make\": \n\t\t\tcleansed.name=\"Camera\";\n\t\t\tcleansed.desc=value;\n\t\tbreak;\n\t\tcase \"Model\": \n\t\t\tcleansed.name=prop; \n\t\t\tcleansed.desc=value;\n\t\tbreak;\n\t\tcase \"Flash\": \n\t\t\tcleansed.name=\"Flash Used\"; \n\t\t\tcleansed.desc=value;\n\t\tbreak;\n\t\tcase \"ApertureValue\":\n\t\t\tcleansed.name=\"Aperture\";\n\t\t\tcleansed.desc=Math.round(value*100)/100;\n\t\tbreak;\n\t\tcase \"ISOSpeedRatings\":\n\t\t\tcleansed.name=\"ISO\";\n\t\t\tcleansed.desc=value;\n\t\tbreak;\n\t\tcase \"FocalLength\":\n\t\t\tcleansed.name=\"Focal Length\";\n\t\t\tcleansed.desc=value + \"mm\";\n\t\tbreak;\n\t\tcase \"ExposureTime\":\n\t\t\tcleansed.name=\"Exposure\";\n\t\t\tcleansed.desc=value;\n\t\tbreak;\n\t\tcase \"DateTimeOriginal\":\n\t\t\tcleansed.name=\"Date Taken\";\n\t\t\tvar date = new Date(value.substring(0,10).replace(/:/g, \"/\"));\n\t\t\tcleansed.desc=date.toLocaleDateString();\n\t\tbreak;\n\t\tcase \"FNumber\":\n\t\t\tcleansed.name=\"F-Stop\";\n\t\t\tcleansed.desc=\"f/\"+value;\n\t\tbreak;\n\t}\n\treturn cleansed;\n}", "function findImgAndRemove(){\r\n var imgs,i;\r\n imgs=document.getElementsByTagName('img');\r\n for(i in imgs){\r\n if(/2010-un-anno-100-foto.jpg/.test(imgs[i].src)){\r\n imgs[i].style.display = 'none';\r\n }\r\n }\r\n}", "function build_meta_information(object) {\n var res = {\n \"timestamp\": object.timestamp,\n \"version\": object.version,\n \"changeset\": object.changeset,\n \"user\": object.user,\n \"uid\": object.uid\n };\n for (var k in res)\n if (res[k] === undefined)\n delete res[k];\n return res;\n }", "function build_meta_information(object) {\n var res = {\n \"timestamp\": object.timestamp,\n \"version\": object.version,\n \"changeset\": object.changeset,\n \"user\": object.user,\n \"uid\": object.uid\n };\n for (var k in res)\n if (res[k] === undefined)\n delete res[k];\n return res;\n }", "function Reset_Image(){\n tagging_view_annotate.Reset_Image_View(image_files_in_dir)\n}", "removeMeta(key, name) {\n let meta = get(this, 'meta.'+key);\n if(meta) {\n set(meta, name);\n }\n }", "function FreeMetadata(metadata) {\n binding.FreeMetadata(metadata);\n}", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n }", "function cleanPreviewModal() {\n\n $('.3pictures').html(\"\");\n $('#product-image-big').attr(\"src\", \"\");\n $('#product-desc').find(\"h4\").text(\"\");\n $('#product-desc').find(\"p\").text(\"\");\n $(\"#price\").text(\"\");\n}", "function remove_meta_image(tn_index){\n var thumbArray = get_meta_images();\n thumbArray.splice(tn_index, 1);\n $('#msb-images').val(thumbArray.toString());\n }", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}", "function clrImgTags() {\n var node = document.getElementById(\"playback\");\n var child = node.firstChild;\n while (child) {\n node.removeChild(child);\n child = node.firstChild;\n }\n}", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = utils.pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}", "function cleanDocs(docs) {\n\t for (var i = 0; i < docs.length; i++) {\n\t var doc = docs[i];\n\t if (doc._deleted) {\n\t delete doc._attachments; // ignore atts for deleted docs\n\t } else if (doc._attachments) {\n\t // filter out extraneous keys from _attachments\n\t var atts = Object.keys(doc._attachments);\n\t for (var j = 0; j < atts.length; j++) {\n\t var att = atts[j];\n\t doc._attachments[att] = pick(doc._attachments[att],\n\t ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n\t }\n\t }\n\t }\n\t}", "function cleanDocs(docs) {\n\t for (var i = 0; i < docs.length; i++) {\n\t var doc = docs[i];\n\t if (doc._deleted) {\n\t delete doc._attachments; // ignore atts for deleted docs\n\t } else if (doc._attachments) {\n\t // filter out extraneous keys from _attachments\n\t var atts = Object.keys(doc._attachments);\n\t for (var j = 0; j < atts.length; j++) {\n\t var att = atts[j];\n\t doc._attachments[att] = pick(doc._attachments[att],\n\t ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n\t }\n\t }\n\t }\n\t}", "function removeMetafromArrayJSON(data) {\n var multyValuesArray = new Array([\"Audience\", \"Technology\", \"Functionality\", \"ProductOptionVersions\"]);\n var metaToRemove = new Array([\"BookletId\", \"Author\", \"BookletSummary\", \"State\", \"Revision\", \"ReleaseId\",\n \"ProductOptionVersions\", \"Product\", \"Version\", \"MasterProductVersion\", \"Language\"]);\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n if (multyValuesArray.indexOf(key) > -1) {\n if (data[i][key] !== null) {\n var items = data[i][key].split(\",\");\n delete data[i][key];\n\n var newArray = [];\n for (var j = 0; j < items.length; j++) {\n // Add property to object\n newArray.push(items[j].replace(\" \", \"\").replace(\".\", \"\"));\n }\n data[i][key] = newArray;\n }\n }\n\n if (metaToRemove.indexOf(key) > -1) {\n delete data[i][key];\n }\n }\n }\n\n }\n\n return data;\n }", "function filterOutMetaWithId(metas) {\n metas = Array.prototype.slice.call(metas || []);\n return metas.filter(function (meta) {\n return !meta.id;\n });\n}", "extract_exif(object) {\n\t\tvar exif_data = {\n\t\t\tgeneral: [],\n\t\t\texif: [],\n\t\t};\n\n\t\t//exif data\n\t\tEXIF.getData(object, function () {\n\t\t\texif_data.exif = this.exifdata;\n\t\t\tdelete this.exifdata.thumbnail;\n\t\t});\n\n\t\t//general\n\t\tif (object.name != undefined)\n\t\t\texif_data.general.Name = object.name;\n\t\tif (object.size != undefined)\n\t\t\texif_data.general.Size = this.Helper.number_format(object.size / 1000, 2) + ' KB';\n\t\tif (object.type != undefined)\n\t\t\texif_data.general.Type = object.type;\n\t\tif (object.lastModified != undefined)\n\t\t\texif_data.general['Last modified'] = this.Helper.format_time(object.lastModified);\n\n\t\treturn exif_data;\n\t}", "function removeTracingAttrs()\n{\n var bodyNode = dreamweaver.getDocumentDOM('document').body;\n\n //look for tracing attributes - if any are found, toggle\n //the global boolean to true and remove all attributes\n if (cbRemoveDWComments.checked){\n if (bodyNode.getAttribute(\"tracingsrc\") ||\n bodyNode.getAttribute(\"tracingopacity\") ||\n bodyNode.getAttribute(\"tracingx\") ||\n bodyNode.getAttribute(\"tracingy\"))\n {\n //remove all tracing image attributes\n bodyNode.removeAttribute(\"tracingsrc\");\n bodyNode.removeAttribute(\"tracingopacity\");\n bodyNode.removeAttribute(\"tracingx\");\n bodyNode.removeAttribute(\"tracingy\");\n bRemovedTracing=true;\n }\n }\n}", "function cleanup() {\n importedEntityIDs.forEach(function(id) {\n Entities.deleteEntity(id);\n });\n Camera.mode = \"first person\";\n Controller.disableMapping(\"Handheld-Cam-Space-Bar\");\n MyAvatar.skeletonModelURL = originalAvatar;\n }", "removeDuplicates(attachments) {\n const embeddedImages = this.state.embeddedImgList;\n embeddedImages.forEach((img) => {\n // The name of the image is obtained from <img alt= value\n var imgName = img.match(/alt\\s*=\\s*\"(.+?)\"/gm);\n if (imgName) {\n var name = imgName[0].split(\"=\")[1];\n var name = name.replace(/\"/g, \"\");\n const i = attachments.findIndex((att) => name === att.name);\n attachments.splice(i, 1);\n }\n });\n return attachments;\n }", "removeUsedProps(aProps) {\n\t\t//METODO: change this to actual source cleanup\n\t\tdelete aProps[\"text\"];\n\t\tdelete aProps[\"maxLength\"];\n\t}", "removeUsedProps(aProps) {\n\t\t//METODO: change this to actual source cleanup\n\t\tdelete aProps[\"input\"];\n\t\tdelete aProps[\"markup\"];\n\t\tdelete aProps[\"spacingMarkup\"];\n\t\tdelete aProps[\"noItemsMarkup\"];\n\t}", "function tagCleanup() {\n\n\t}", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pouchdbUtils.pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n}", "removeUsedProps(aProps) {\n\t\t//METODO: change this to actual source cleanup\n\t\tdelete aProps[\"text\"];\n\t}", "function replaceCustomMetadataPart(partId, metadataPart)\n{\n //alert(\"DELETING CUSTOM PIECE\");\n\tMLA.deleteCustomXMLPart(partId);\n\n\t//alert(\"ADDING CUSTOM PIECE\");\n\tMLA.addCustomXMLPart(metadataPart);\n\n}", "loadMeta(meta) {\n if (!this.metaElement) {\n this.metaElement = {};\n }\n for (const key of MetaCopyableProperty) {\n const value = meta[key];\n if (typeof value !== \"undefined\") {\n setMetaProperty(this.metaElement, key, value);\n }\n else {\n delete this.metaElement[key];\n }\n }\n }", "function _getMetadata(anchor) {\n\t\treturn '';\n\t}", "function clearInfo() {\n if (photoEditor.hasMiniSize) {\n $(\"#preview_s\").css({ marginLeft: 0, marginTop: 0 });\n }\n $(\"#preview_m\").css({ marginLeft: 0, marginTop: 0 });\n \n $(\".fileinfo #imagefilesetting\").val(\"0,0,\" + photoEditor.imgSizeMW + \",\" + photoEditor.imgSizeMH);\n }", "function clean_img() {\n return del('./dist/img/');\n}", "function _cleanupAttributes(target) {\n\t for (var n in this.attributes) {\n\t target.removeAttribute(n);\n\t }\n\t }", "function applyMetadata()\n {\n\n\n // get metadata values\n var metadata = groovebox[\"metadata\"];\n\n\n // get the current audio file name\n var currentAudioFile = $(\".track-info\").attr(\"file\");\n\n\n // check if the (new) metadata is different than the currently playing song\n if (groovebox[\"stream\"][\"track\"] !== currentAudioFile)\n {\n\n\n // update the metadata\n\n\n // update the track name\n $(\".track-info .track-name\").html(metadata[\"title\"]).attr(\"title\", metadata[\"title\"]);\n\n\n // update the track artist\n $(\".track-info .track-artist\").html(metadata[\"artist\"]).attr(\"title\", metadata[\"artist\"]);\n\n\n // update the cover-art\n $(\".album-art img\").attr(\"src\", metadata[\"coverArt\"] +\"&\"+ new Date().getTime());\n\n\n // update the current audio file\n $(\".track-info\").attr(\"file\", groovebox[\"stream\"][\"track\"]);\n\n\n }\n\n\n }", "function removeUnknownProps(doc){\n\tdelete doc.created;\n\tdelete doc.modified;\n\tdelete doc.id;\n\tdelete doc._id\n\treturn doc\n}", "function clearAllProperties() {\n PropertiesService.getDocumentProperties().deleteAllProperties();\n }", "function cleanUp() {\n $(\"audio\").remove();\n $(\"img\").remove();\n $(\"h2\").remove();\n audioTags = [];\n h2s = [];\n imgs = [];\n var curRow = 0;\n var curCol = 0;\n }", "function debugExif(exif) {\n for (const ifd in exif) {\n if (ifd == 'thumbnail') {\n const thumbnailData = exif[ifd] === null ? \"null\" : exif[ifd];\n console.log(`- thumbnail: ${thumbnailData}`);\n } else {\n console.log(`- ${ifd}`);\n for (const tag in exif[ifd]) {\n console.log(` - ${piexif.TAGS[ifd][tag]['name']}: ${exif[ifd][tag]}`);\n }\n }\n }\n}", "prepareMetadata_() {\n if (this.jekyllMetadata.iconId) {\n this.jekyllMetadata.icon_id = this.jekyllMetadata.iconId;\n }\n }", "function removeNotUsedAttributes(masterList) {\n var unusedAttributes = [\"updatedBy\",\"createdBy\",\"ssoId\",\"privateGroup\",\n \"domain\",\"selfRegister\"];\n\n _.forEach(masterList, function(group) {\n _.forEach(unusedAttributes, function(attribute){\n delete group[attribute];\n });\n })\n \n}", "removeTagElement(meta) {\n if (meta) {\n this._dom.remove(meta);\n }\n }", "removeTagElement(meta) {\n if (meta) {\n this._dom.remove(meta);\n }\n }", "removeTagElement(meta) {\n if (meta) {\n this._dom.remove(meta);\n }\n }", "removeTagElement(meta) {\n if (meta) {\n this._dom.remove(meta);\n }\n }", "removeTagElement(meta) {\n if (meta) {\n this._dom.remove(meta);\n }\n }", "removeTagElement(meta) {\n if (meta) {\n this._dom.remove(meta);\n }\n }", "function testWithoutNullCharacterTermination() {\n // Create exif with a value that does not end with null character.\n const data = new Uint8Array(0x10000);\n writeDirectory_(data, /** @type {!ExifEntry} */ ({\n id: 0x10f, // Manufacturer Id.\n format: 2, // String format.\n componentCount: 8, // Length of value 'Manufact'.\n value: 'Manufact',\n }));\n\n // Parse the exif data.\n const tags = parseExifData_(data);\n\n // The parsed value should end in a null character.\n const parsedTag = tags[/** @type {!Exif.Tag<number>} */ (0x10f)];\n assertEquals(9, parsedTag.componentCount);\n assertEquals('Manufact\\0', parsedTag.value);\n}", "function beginClean(done) {\n del([iconURL, graphicURL]);\n done();\n}", "clear () {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n this.forEach(function (_value, key, map) {\n typeMapDelete(transaction, map, key)\n })\n })\n } else {\n /** @type {Map<string, any>} */ (this._prelimContent).clear()\n }\n }", "function deduplicteMediaItems() {\n\n}", "function getMetadata(metadata) {\n\n var metadataHtml=d3.select(\"#sample-metadata\");\n // clean metadata tabel if data exists\n metadataHtml.html(\"\");\n // and append current sample metadata to html\n Object.entries(metadata).forEach(([key, value]) => metadataHtml.append(\"p\").text(`${key}: ${value}`)\n );\n}", "function removeDotcomOnlyImagesFromEnterprise (markdownImageData) {\n for (const image in markdownImageData) {\n const imageVersions = markdownImageData[image]\n if (!Object.prototype.hasOwnProperty.call(imageVersions, 'enterprise-server')) {\n supported.forEach(enterpriseReleaseNumber => {\n const imagePath = path.join(__dirname, '../..', `/assets/enterprise/${enterpriseReleaseNumber}`, image)\n if (fs.existsSync(imagePath)) fs.unlinkSync(imagePath)\n })\n }\n if (!Object.prototype.hasOwnProperty.call(imageVersions, 'github-ae')) {\n const imagePath = path.join(__dirname, '../..', '/assets/enterprise/github-ae', image)\n if (fs.existsSync(imagePath)) fs.unlinkSync(imagePath)\n }\n }\n}", "function gameInventory_checkForRemovedAttributes(){\n var modifierObj;\n for (var itemId in project_project.gameInventory) {\n modifierObj = project_project.gameInventory[itemId].modifiers;\n\n\n for(var modifier in modifierObj){\n if(gameAttributes_attemptFind(modifierObj[modifier].attributePath) == false|| gameAttributes_attemptFind(modifierObj[modifier].attributePath) == undefined){\n modifierObj[modifier] = null;\n delete modifierObj[modifier];\n }\n\n }\n }\n }", "function xmpMetadataParser() {\n var imageIndex = 0, depthImageIndex = 0, outputPath = \"\";\n parser = sax.parser();\n\n // Extract data when specific data attributes are encountered\n parser.onattribute = function (attr) {\n if ((attr.name == \"IMAGE:DATA\") || (attr.name == \"GIMAGE:DATA\")) {\n outputPath = inputJpgFile.substring(0, inputJpgFile.length - 4) + \"_\" + imageIndex + \".jpg\";\n var atob = require('atob'), b64 = attr.value, bin = atob(b64);\n fs.writeFileSync(outputPath, bin, 'binary');\n imageIndex++;\n } else if ((attr.name == \"DEPTHMAP:DATA\") || (attr.name == \"GDEPTH:DATA\")) {\n outputPath = inputJpgFile.substring(0, inputJpgFile.length - 4) + \"_depth_\" + depthImageIndex + \".png\";\n var atob = require('atob'), b64 = attr.value, bin = atob(b64);\n fs.writeFileSync(outputPath, bin, 'binary');\n depthImageIndex++;\n }\n };\n\n parser.onend = function () {\n console.log(\"All done!\")\n }\n}", "function clearFileInfo() {\n fileInfo.find('.file-name').html(fileInfoDefaultMsg);\n fileInfo.attr('title', '');\n\n fileInputField.attr('title', fileInfoDefaultMsg);\n\n fileInfo.find('.clear').hide();\n }", "clear () {\n for (let attribute in this.data) {\n if (this.data.hasOwnProperty(attribute)) {\n delete this.data[attribute]\n }\n }\n }", "clear() {\n this._imgLoaded = {};\n this._imgAlias = {};\n this._audioLoaded = {};\n this._audioAlias = {};\n this._fileLoaded = {};\n this._fileAlias = {};\n }", "function removeWikiNoise(text) {\n // remove things like [[Kategorie:Moravske Toplice| Moravske Toplice]]\n var namespaceNoiseRegEx = /\\[\\[.*?\\:.*?\\]\\]/g;\n // remove things like {{NewZealand-writer-stub}}\n var commentNoiseRegEx = /\\{\\{.*?\\}\\}/g;\n // remove things like align=\"center\"\n var htmlAttributeRegEx = /\\w+\\s*\\=\\s*\\\"\\w+\\\"/g;\n // remove things like {{\n var openingCommentParenthesisRegEx = /\\{\\{/g;\n // remove things like }}\n var closingCommentParenthesisRegEx = /\\}\\}/g;\n text = text.replace(namespaceNoiseRegEx, '')\n .replace(commentNoiseRegEx, ' ')\n .replace(htmlAttributeRegEx, ' ')\n .replace(openingCommentParenthesisRegEx, ' ')\n .replace(closingCommentParenthesisRegEx, ' ')\n .replace(/\\n/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n text = strip_tags(text);\n return text;\n}", "function resetPortrait(){\r\n\r\n\t\t\t$('.bio-portrait').each(function(){\r\n\t\t\t\t$(this).removeClass('de-expanded-portrait');\r\n\t\t\t})\r\n\t\t}", "function clearPreviousData(){\r\n\tif( $(\"#imageInput\").length > 0 ){\r\n\t\tdocument.getElementById(\"imageInput\").innerHTML = \"\";\t\r\n\t\t$(\"#imageFile\").val(\"\");\r\n\t\t$(\"#fileField\").val(\"\");\r\n\t\t$('#imgCaption').hide();\r\n\t\tvar attr = $('#imageOutput').attr(\"src\");\r\n\t\t\r\n\t\t// For some browsers, `attr` is undefined; for others `attr` is false. Check for both.\r\n\t\tif ( (typeof attr !== typeof undefined) && (attr !== false) ) {\r\n\t\t\t$('#imageOutput').removeAttr(\"src\").removeAttr(\"style\").removeClass(\"image_output\");\r\n\t\t}\r\n\t}\r\n\t\r\n}", "function m_removeall()\n{\n\twhile(c_alldata.length>0)\n\t{\n\t\tc_alldata[c_alldata.length-1].c_disp.innerHTML=\"\";\n\t\tc_alldata.pop();\n\t}\n\t ref_thumb();\n}", "[_delistFromMeta] () {\n const root = this.root\n if (!root.realpath || !this.path)\n return\n root.inventory.delete(this)\n root.tops.delete(this)\n if (root.meta)\n root.meta.delete(this.path)\n /* istanbul ignore next - should be impossible */\n debug(() => {\n if ([...root.inventory.values()].includes(this))\n throw new Error('failed to delist')\n })\n }", "function CleanTrending() {\n const removeTrendingGrilla = document.querySelectorAll(\".imageTrend\");\n removeTrendingGrilla.forEach(element => element.remove());\n}", "cleanXunitBuildInfo (metadata) {\n return {};\n }", "function pruneImageCache(keep) {\n for (var imageId in gImageCache) {\n imageId = parseInt(imageId);\n if (gImageCache[imageId] !== undefined && keep.indexOf(imageId) === -1) {\n delete gImageCache[imageId];\n }\n }\n }", "function removeIgnoreColumns(metadata, table, result) {\r\n var fkpk = metadata.constraints;\r\n if (!fkpk.insert || !fkpk.insert || !fkpk.insert.ignore || !table._name || !result || !result.length) {\r\n return result;\r\n }\r\n var removeTheseCol = fkpk.insert.ignore[table._name];\r\n if (!removeTheseCol) {\r\n return result;\r\n }\r\n //copy the data which is to be inserted\r\n var newResult = JSON.parse(JSON.stringify(result));\r\n //remove ignore columns from each result\r\n newResult.forEach(function (eachRes) {\r\n Object.keys(eachRes).forEach(function (k) {\r\n if (removeTheseCol.indexOf(k) >= 0) {\r\n delete eachRes[k];\r\n }\r\n });\r\n });\r\n return newResult;\r\n}", "function metadata(json) {\n\tvar result = {};\n\tfor (var key in json) {\n\t\tif (key in metadata_keys) {\n\t\t\tresult[key] = json[key];\n\t\t}\n\t}\n\treturn result;\n}", "function clearHead() {\n var links = document.querySelectorAll('link');\n\n for (var i = 0; i < links.length; i++) {\n var id = links[i].getAttribute('id');\n if (IDS.indexOf(id) === -1) {\n links[i].parentNode.removeChild(links[i]);\n }\n }\n\n var styles = document.querySelectorAll('style');\n\n for (var i = 0; i < styles.length; i++) {\n var id = styles[i].getAttribute('id');\n if (IDS.indexOf(id) === -1) {\n styles[i].parentNode.removeChild(styles[i]);\n }\n }\n}", "function clearMapViews() {\n\tif (parseInt(dhis2version.split(\".\")[1]) >= 32) {\n\t\tdelete metaData.mapViews;\n\t}\n}", "function clean({ fileName, data }) {\n const allowedEls = ['path', 'g'];\n Object.keys(data).forEach(k => {\n // $ refers to own properties\n if (k === '$') {\n return;\n }\n\n // Remove disallowed elements.\n if (!allowedEls.includes(k)) {\n delete data[k];\n } else {\n // clean child nodes if allowed element\n data[k].forEach(el => {\n clean({ fileName, data: el });\n });\n }\n });\n\n // Remove unsupported keys\n const allowedProps = [\n 'version',\n 'id',\n 'xmlns',\n 'width',\n 'height',\n 'viewBox',\n 'd'\n ];\n\n if (data.$) {\n Object.keys(data.$).forEach(k => {\n if (!allowedProps.includes(k)) {\n delete data.$[k];\n }\n });\n }\n\n // Only runs on top level element\n if (data.$ && data.$.viewBox) {\n data.$.id = fileName.replace('.svg', '');\n\n // if width or height attributes have px definitions then remove\n if (typeof data.$.width === 'string' || typeof data.$.height === 'string') {\n data.$.width = data.$.width.replace('px', '');\n data.$.height = data.$.height.replace('px', '');\n }\n }\n\n return data;\n}", "function fCleanUp() // CLEANS: This function cleans up the data after the previously loaded image\r\n{\r\n expandedImg.innerHTML = \"\";\r\n}", "function $cleanUp () {\n [\n 'asic-ref',\n // 'asic-bind-expression',\n 'asic-for',\n 'asic-for-data',\n ].forEach(value => {\n document.querySelectorAll(`[${value}]`).forEach(element => {\n element.removeAttribute(value);\n });\n });\n\n for (let eventName in $events) {\n document.querySelectorAll(`[asic-event-${eventName}]`).forEach(element => {\n element.removeAttribute(`asic-event-${eventName}`);\n });\n }\n}", "function removeUnseenImages() {\r\n\t\tvar images = $(\"#images img\");\r\n\t\t$.each(images, function(i,item) {\r\n\t\t\tvar $item=$(item);\r\n\t\t\tvar pos = $item.attr('class').replace('file','').split('-');\r\n\t\t\tvar point = new Point(parseInt($item.css('left')), parseInt($item.css('top')));\r\n\t\t\tif(notInRange(pos[0],point)) {\r\n\t\t\t\t$item.remove();\r\n\t\t\t\t$['mapsettings'].loaded[pos[0]+\"-\"+pos[1]+\"-\"+pos[2]+\"-\"+pos[3]] = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}", "_cleanMeta(meta) {\n\t\tthis._sleep(get(meta, 'worker'));\n\t\tthis.get('_cache').removeObject(meta);\n\t}", "function setNimManualMetadata(data, path, filename) {\n\tvar thisNimFolderPath = path + '.nim/',\n\t\tphotoshopFilePath = thisNimFolderPath + 'photoshop-metadata.nim',\n\t\tthisNimFolder = new Folder(thisNimFolderPath),\n\t\tphotoshopFile = new File(photoshopFilePath),\n\t\tphotoshopFileTempPath = thisNimFolderPath + 'photoshop-metadata-temp.nim',\n\t\tphotoshopFileTemp,\n\t\tfileString = filename + ':',\n\t\tcurrentLine,\n\t\tfileStringPos,\n\t\tfoundFileString = false,\n\t\tthisMetadataString = '';\n\n\tif (!thisNimFolder.exists) {\n\t\tif (!thisNimFolder.create()) {\n\t\t\talert('Error creating the following directory to store NIM metadata: ' + thisNimFolderPath);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tfor (var key in data)\n\t\tthisMetadataString += '\\n ' + key + '=' + data[key];\n\n\tthisMetadataString += '\\n';\n\n\tif (photoshopFile.exists) {\n\t\tif (!photoshopFile.open('e')) {\n\t\t\talert('Error editing the following file: ' + photoshopFilePath);\n\t\t\treturn false;\n\t\t}\n\t\twhile (!photoshopFile.eof) // Read lines until we get to end of file so we don't overwrite existing stuff\n\t\t\tphotoshopFile.readln();\n\t}\n\telse {\n\t\tif (!photoshopFile.open('w')) {\n\t\t\talert('Error creating the following file: ' + photoshopFilePath);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tphotoshopFile.lineFeed = 'Unix';\n\n\t// Write metadata for this new file\n\tphotoshopFile.writeln(fileString + thisMetadataString);\n\tphotoshopFile.close();\n\treturn true;\n}", "function fillMetaData() {\n var o = {};\n o.cid = activeCollectionId();\n o.path = collectionPath(o.cid);\n o.dia = getLastMarkedEntry(o.cid);\n\n if (! o.dia) {\n statusError('no marked image/collection found');\n return ;\n }\n o.pos = getEntryPos(o.dia);\n o.name = getDiaName(o.dia);\n fillMetaFromServer(o);\n\n}", "function clean(cb) {\n rimraf(DIST + '/img', cb);\n}", "wipeGeneData() {\n var me = this;\n this.vcfData = null;\n this.fbData = null;\n this.bamData = null;\n }", "function removeKeyValuePairs(object) {\n\n let removableKeys = [\n \"_id\",\n \"blockedUsers\", \n \"email\", \n \"password\", \n \"name\", \n \"surname\", \n \"movingDate\", \n \"img\",\n \"description\",\n \"lastActive\",\n \"creationTime\",\n \"__v\",\n \"targetProfile\",\n \"user\",\n ];\n\n object.forEach(obj => {\n for(let i = 0; i < removableKeys.length; i++) {\n delete obj[removableKeys[i]];\n }\n obj[\"petTypes\"].map(function (o) { \n delete o._id; \n });\n obj[\"hobbies\"].map(function (o) { \n delete o._id; \n });\n });\n return object;\n}", "async _removeObsoleteBuildInfos() {\n const debugFiles = await this.getDebugFilePaths();\n const validBuildInfos = new Set();\n for (const debugFile of debugFiles) {\n const buildInfoFile = await this._getBuildInfoFromDebugFile(debugFile);\n if (buildInfoFile !== undefined) {\n validBuildInfos.add(path.resolve(path.dirname(debugFile), buildInfoFile));\n }\n }\n const buildInfoFiles = await this.getBuildInfoPaths();\n for (const buildInfoFile of buildInfoFiles) {\n if (!validBuildInfos.has(buildInfoFile)) {\n log(`Removing buildInfo '${buildInfoFile}'`);\n await fs_extra_1.default.unlink(buildInfoFile);\n }\n }\n }", "function cleanUp(){\n setPicture(null)\n setRecipeName('')\n setIngredients([{ingredient: \"\", amount: \"\"}])\n setDescription('')\n setTags([])\n\n return console.log(\"Recipe Saved and page cleared\")\n }" ]
[ "0.6675288", "0.640114", "0.63121706", "0.61797065", "0.5982011", "0.59794635", "0.5946059", "0.59440136", "0.5847914", "0.58420014", "0.5819018", "0.57720083", "0.57626057", "0.573764", "0.56843233", "0.562532", "0.5587533", "0.5587533", "0.5422192", "0.54016703", "0.5361417", "0.53281385", "0.5316338", "0.53162575", "0.5314244", "0.5314244", "0.5314244", "0.5314244", "0.5314244", "0.5314244", "0.5314244", "0.5314244", "0.53049684", "0.5302786", "0.5298795", "0.5298795", "0.5294502", "0.5284358", "0.52757823", "0.52514714", "0.5242043", "0.5220449", "0.52180487", "0.5206623", "0.5190908", "0.5188607", "0.51606506", "0.51165724", "0.50831413", "0.5078722", "0.5077741", "0.5061039", "0.50471276", "0.5044442", "0.5033759", "0.5028427", "0.5025155", "0.5009042", "0.49955958", "0.49921775", "0.4989196", "0.49887842", "0.49887842", "0.49887842", "0.49887842", "0.49887842", "0.49758008", "0.49702778", "0.4960192", "0.49598607", "0.49435437", "0.49376023", "0.4937232", "0.49363288", "0.4930158", "0.49194673", "0.48840907", "0.48837754", "0.4882927", "0.48828742", "0.48771465", "0.48756906", "0.48732972", "0.48683888", "0.48678857", "0.48643902", "0.48630902", "0.4862067", "0.48614576", "0.48588488", "0.48571327", "0.48536772", "0.4847035", "0.4845324", "0.48306155", "0.4826916", "0.48257673", "0.4817277", "0.48150188", "0.4810547", "0.4806602" ]
0.0
-1
Remove metadata (ICC, photoshop stuff, etc.), and filter exif
function filterJpegImage(buffer, comment) { buffer = image_traverse.jpeg_segments_filter(buffer, segment => { if (segment.id >= 0xE2 && segment.id < 0xF0) return false; return true; }); buffer = image_traverse.jpeg_exif_tags_filter(buffer, entry => { return entry.data_length < 100; }); if (comment) { buffer = image_traverse.jpeg_add_comment(buffer, comment); } return buffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExifPropClean(prop, value) {\n\tvar cleansed=new Object();\n\tcleansed.name=null;\n\tcleansed.desc=null;\n\tswitch(prop) {\n\t\tcase \"Make\": \n\t\t\tcleansed.name=\"Camera\";\n\t\t\tcleansed.desc=value;\n\t\tbreak;\n\t\tcase \"Model\": \n\t\t\tcleansed.name=prop; \n\t\t\tcleansed.desc=value;\n\t\tbreak;\n\t\tcase \"Flash\": \n\t\t\tcleansed.name=\"Flash Used\"; \n\t\t\tcleansed.desc=value;\n\t\tbreak;\n\t\tcase \"ApertureValue\":\n\t\t\tcleansed.name=\"Aperture\";\n\t\t\tcleansed.desc=Math.round(value*100)/100;\n\t\tbreak;\n\t\tcase \"ISOSpeedRatings\":\n\t\t\tcleansed.name=\"ISO\";\n\t\t\tcleansed.desc=value;\n\t\tbreak;\n\t\tcase \"FocalLength\":\n\t\t\tcleansed.name=\"Focal Length\";\n\t\t\tcleansed.desc=value + \"mm\";\n\t\tbreak;\n\t\tcase \"ExposureTime\":\n\t\t\tcleansed.name=\"Exposure\";\n\t\t\tcleansed.desc=value;\n\t\tbreak;\n\t\tcase \"DateTimeOriginal\":\n\t\t\tcleansed.name=\"Date Taken\";\n\t\t\tvar date = new Date(value.substring(0,10).replace(/:/g, \"/\"));\n\t\t\tcleansed.desc=date.toLocaleDateString();\n\t\tbreak;\n\t\tcase \"FNumber\":\n\t\t\tcleansed.name=\"F-Stop\";\n\t\t\tcleansed.desc=\"f/\"+value;\n\t\tbreak;\n\t}\n\treturn cleansed;\n}", "function stripMetadata(data) {\n return data.Properties;\n }", "extract_exif(object) {\n\t\tvar exif_data = {\n\t\t\tgeneral: [],\n\t\t\texif: [],\n\t\t};\n\n\t\t//exif data\n\t\tEXIF.getData(object, function () {\n\t\t\texif_data.exif = this.exifdata;\n\t\t\tdelete this.exifdata.thumbnail;\n\t\t});\n\n\t\t//general\n\t\tif (object.name != undefined)\n\t\t\texif_data.general.Name = object.name;\n\t\tif (object.size != undefined)\n\t\t\texif_data.general.Size = this.Helper.number_format(object.size / 1000, 2) + ' KB';\n\t\tif (object.type != undefined)\n\t\t\texif_data.general.Type = object.type;\n\t\tif (object.lastModified != undefined)\n\t\t\texif_data.general['Last modified'] = this.Helper.format_time(object.lastModified);\n\n\t\treturn exif_data;\n\t}", "uncommentMetadata_(contents) {\n if (contents.includes(HIDDEN_FRONT_MATTER_PREFIX)) {\n contents = contents\n .replace(HIDDEN_FRONT_MATTER_PREFIX, FRONT_MATTER_DELIMITER)\n .replace(HIDDEN_FRONT_MATTER_POSTFIX, FRONT_MATTER_DELIMITER);\n }\n return contents;\n }", "function findImgAndRemove(){\r\n var imgs,i;\r\n imgs=document.getElementsByTagName('img');\r\n for(i in imgs){\r\n if(/2010-un-anno-100-foto.jpg/.test(imgs[i].src)){\r\n imgs[i].style.display = 'none';\r\n }\r\n }\r\n}", "function debugExif(exif) {\n for (const ifd in exif) {\n if (ifd == 'thumbnail') {\n const thumbnailData = exif[ifd] === null ? \"null\" : exif[ifd];\n console.log(`- thumbnail: ${thumbnailData}`);\n } else {\n console.log(`- ${ifd}`);\n for (const tag in exif[ifd]) {\n console.log(` - ${piexif.TAGS[ifd][tag]['name']}: ${exif[ifd][tag]}`);\n }\n }\n }\n}", "function i(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}", "function parseEXIFData(data) {\n var exif = {};\n\n var byteorder = data.getUint8(0);\n if (byteorder === 0x4D) { // big endian\n byteorder = false;\n } else if (byteorder === 0x49) { // little endian\n byteorder = true;\n } else {\n throw Error('invalid byteorder in EXIF segment');\n }\n\n if (data.getUint16(2, byteorder) !== 42) { // magic number\n throw Error('bad magic number in EXIF segment');\n }\n\n var offset = data.getUint32(4, byteorder);\n\n parseIFD(data, offset, byteorder, exif);\n\n if (exif.EXIFIFD) {\n parseIFD(data, exif.EXIFIFD, byteorder, exif);\n delete exif.EXIFIFD;\n }\n\n if (exif.GPSIFD) {\n parseIFD(data, exif.GPSIFD, byteorder, exif);\n delete exif.GPSIFD;\n }\n\n return exif;\n }", "function stripMetadata(url, topic, cb){\n\n // Content Spec Metadata object\n var md = {'serverurl': url}, \n err,\n spec = topic.xml;\n \n md.specrevision = topic.revision;\n md.spec = topic.xml;\n \n // Put the spec into a line-by-line array\n var array = spec.split(\"\\n\");\n \n // Iterate over the lines in the array and match against our regex patterns\n for (var i = 0; i < array.length; i ++){\n for (var j = 0; j < ContentSpecMetadataSchema.length; j++){\n if (array[i].match(ContentSpecMetadataSchema[j].rule))\n { \n // remove trailing and leading whitespaces with regex\n md[ContentSpecMetadataSchema[j].attr] = array[i].split('=')[1].replace(/^\\s+|\\s+$/g,'');\n }\n }\n } \n \n// console.log(md);\n cb(err, md);\n}", "function createExifDisplay(exif) {\n\tconsole.log(exif);\n\t\n\tvar exifStr=\"\";\n\tfor (var prop in exif) {\n\t\tif (exif.hasOwnProperty(prop) && prop != \"UserComment\" && prop != \"size\") {\n\t\t\tvar propInfo = getExifPropClean(prop, exif[prop]);\n\t\t\tif(propInfo.name != null) {\n\t\t\t\texifStr += propInfo.name + \": \" + \"<em>\" + propInfo.desc + \"</em><br>\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$(\"#\"+g_locationId).html(exifStr); \n}", "function m(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}", "function n$6(n){const{exifInfo:e,exifName:a,tagName:u}=n;if(!e||!a||!u)return null;const f=e.find((n=>n.name===a));return f?t({tagName:u,tags:f.tags}):null}", "function getExif(object) {\n let exifObject;\n if (object !== undefined) {\n const array = object.exif;\n let time;\n let camera;\n for (item of array) {\n if (item.tag === 'Model') {\n camera = item.raw._content;\n }\n else if (item.tag === 'DateTimeOriginal') {\n time = item.raw._content;\n time = time.split(' ').join(' // ')\n }\n else {\n continue;\n }\n }\n exifObject = {\n 'time': time,\n 'camera': camera\n };\n }\n else {\n exifObject = \"Metadata not available.\";\n }\n return exifObject;\n}", "function testWithoutNullCharacterTermination() {\n // Create exif with a value that does not end with null character.\n const data = new Uint8Array(0x10000);\n writeDirectory_(data, /** @type {!ExifEntry} */ ({\n id: 0x10f, // Manufacturer Id.\n format: 2, // String format.\n componentCount: 8, // Length of value 'Manufact'.\n value: 'Manufact',\n }));\n\n // Parse the exif data.\n const tags = parseExifData_(data);\n\n // The parsed value should end in a null character.\n const parsedTag = tags[/** @type {!Exif.Tag<number>} */ (0x10f)];\n assertEquals(9, parsedTag.componentCount);\n assertEquals('Manufact\\0', parsedTag.value);\n}", "function xmpMetadataParser() {\n var imageIndex = 0, depthImageIndex = 0, outputPath = \"\";\n parser = sax.parser();\n\n // Extract data when specific data attributes are encountered\n parser.onattribute = function (attr) {\n if ((attr.name == \"IMAGE:DATA\") || (attr.name == \"GIMAGE:DATA\")) {\n outputPath = inputJpgFile.substring(0, inputJpgFile.length - 4) + \"_\" + imageIndex + \".jpg\";\n var atob = require('atob'), b64 = attr.value, bin = atob(b64);\n fs.writeFileSync(outputPath, bin, 'binary');\n imageIndex++;\n } else if ((attr.name == \"DEPTHMAP:DATA\") || (attr.name == \"GDEPTH:DATA\")) {\n outputPath = inputJpgFile.substring(0, inputJpgFile.length - 4) + \"_depth_\" + depthImageIndex + \".png\";\n var atob = require('atob'), b64 = attr.value, bin = atob(b64);\n fs.writeFileSync(outputPath, bin, 'binary');\n depthImageIndex++;\n }\n };\n\n parser.onend = function () {\n console.log(\"All done!\")\n }\n}", "function removeMetadata(uipath) {\n var r = \"\"; // resulting string\n var i = 0;\n while (true) {\n var j = uipath.indexOf(\"[\", i);\n if (j == -1) {\n r = r + uipath.slice(i);\n return r;\n }\n else {\n r = r + uipath.slice(i, j);\n var k = uipath.indexOf(\"]\", j);\n if (k > 0) {\n i = k + 1;\n }\n else {\n console.log(\"removeMetada() called on incorrect label: \" + uipath);\n return uipath;\n }\n }\n }\n}", "function cleanMeta(obj) {\n delete obj._id;\n delete obj._rev;\n delete obj.docType;\n}", "function orientation(img, canvas) {\n var ctx = canvas.getContext(\"2d\");\n var exifOrientation = '';\n var width = img.width,\n height = img.height;\n // Check orientation in EXIF metadatas\n EXIF.getData(img, function() {\n var allMetaData = EXIF.getAllTags(this);\n exifOrientation = allMetaData.Orientation;\n console.log('Exif orientation: ' + exifOrientation);\n console.log(allMetaData);\n });\n // set proper canvas dimensions before transform & export\n if (jQuery.inArray(exifOrientation, [5, 6, 7, 8]) > -1) {\n canvas.width = height;\n canvas.height = width;\n } else {\n canvas.width = width;\n canvas.height = height;\n }\n switch (exifOrientation) {\n case 2:\n ctx.transform(-1, 0, 0, 1, width, 0);\n break;\n case 3:\n ctx.transform(-1, 0, 0, -1, width, height);\n break;\n case 4:\n ctx.transform(1, 0, 0, -1, 0, height);\n break;\n case 5:\n ctx.transform(0, 1, 1, 0, 0, 0);\n break;\n case 6:\n ctx.transform(0, 1, -1, 0, height, 0);\n break;\n case 7:\n ctx.transform(0, -1, -1, 0, height, width);\n break;\n case 8:\n ctx.transform(0, -1, 1, 0, 0, width);\n break;\n default:\n ctx.transform(1, 0, 0, 1, 0, 0);\n }\n ctx.drawImage(img, 0, 0, width, height);\n}", "function generateIcon(flickr_img, exif_data) {\n var exif = exif_data.photo.exif;\n var exif_string = \"\";\n var exif_blocks = [];\n for (var ei = 0, el = exif.length; ei < el; ei++) {\n var exifObj = exif[ei];\n var exifTag = exifObj.tag.toLowerCase();\n var exifLabel = exifObj.label.toLowerCase();\n var pos = exif_block_tags.indexOf(exifLabel);\n if (pos !== -1) {\n var exifProperty = new exif_block_handlers[exifLabel](exifTag, exifObj);\n exif_blocks[pos] = exifProperty.getHtml();\n }\n }\n if (exif_blocks.length > 0) {\n for (var bi = 0; bi < exif_block_tags.length; bi++) {\n var exif_block = exif_blocks[bi];\n if (exif_block) {\n exif_string += exif_block;\n } else {\n var exifProperty = new ExifProperty(exifTag, null);\n exif_string += exifProperty.getHtml();\n }\n }\n }\n if (exif_string) {\n var _node = jQuery(flickr_img.node);\n var width = _node.width() + parseInt(_node.css('border-left-width'), 10) + parseInt(_node.css('border-right-width'), 10) + parseInt(_node.css('margin-left'), 10) + parseInt(_node.css('margin-right'), 10) + parseInt(_node.css('padding-left'), 10) + parseInt(_node.css('padding-right'), 10);\n var p = jQuery(\"<div class='\" + container_class + \"' style='width:\" + width + \"px'><div class='\" + container_class + \"-block'>\" + exif_string + \"</div></div>\");\n jQuery(flickr_img.node).before(p);\n jQuery(flickr_img.node).parent().addClass('flickr-exif-container');\n }\n }", "function removeAllNoteIcon() {\n removeTagsByName('icnote');\n}", "function cleanMatInfo()\n{\n for(var i=0; i<matInfo.length; i++) {\n if(matInfo[i].endtag == \"-1\") {\n\n //shift everything down\n for(var j=i; j<matInfo.length-1; j++)\n matInfo[j]=matInfo[j+1];\n\n i--;//there might be two in a row\n\n delete matInfo[matInfo.length-1];//remove garbage value\n matInfo.length--;//after deletion, there will be an \"undefined\" value there so we need this line to actually shrink the array\n }\n }\n}", "function removeDotcomOnlyImagesFromEnterprise (markdownImageData) {\n for (const image in markdownImageData) {\n const imageVersions = markdownImageData[image]\n if (!Object.prototype.hasOwnProperty.call(imageVersions, 'enterprise-server')) {\n supported.forEach(enterpriseReleaseNumber => {\n const imagePath = path.join(__dirname, '../..', `/assets/enterprise/${enterpriseReleaseNumber}`, image)\n if (fs.existsSync(imagePath)) fs.unlinkSync(imagePath)\n })\n }\n if (!Object.prototype.hasOwnProperty.call(imageVersions, 'github-ae')) {\n const imagePath = path.join(__dirname, '../..', '/assets/enterprise/github-ae', image)\n if (fs.existsSync(imagePath)) fs.unlinkSync(imagePath)\n }\n }\n}", "function orientation(img_element) {\n var canvas = document.createElement('canvas');\n // Set variables\n var ctx = canvas.getContext(\"2d\");\n var exifOrientation = '';\n var width = img_element.width,\n height = img_element.height;\n\n // Check orientation in EXIF metadatas\n EXIF.getData(img_element, function () {\n var allMetaData = EXIF.getAllTags(this);\n exifOrientation = allMetaData.Orientation;\n });\n\n // set proper canvas dimensions before transform & export\n if (jQuery.inArray(exifOrientation, [5, 6, 7, 8]) > -1) {\n canvas.width = height;\n canvas.height = width;\n } else {\n canvas.width = width;\n canvas.height = height;\n }\n\n // transform context before drawing image\n switch (exifOrientation) {\n case 2:\n ctx.transform(-1, 0, 0, 1, width, 0);\n break;\n case 3:\n ctx.transform(-1, 0, 0, -1, width, height);\n break;\n case 4:\n ctx.transform(1, 0, 0, -1, 0, height);\n break;\n case 5:\n ctx.transform(0, 1, 1, 0, 0, 0);\n break;\n case 6:\n ctx.transform(0, 1, -1, 0, height, 0);\n break;\n case 7:\n ctx.transform(0, -1, -1, 0, height, width);\n break;\n case 8:\n ctx.transform(0, -1, 1, 0, 0, width);\n break;\n default:\n ctx.transform(1, 0, 0, 1, 0, 0);\n }\n\n // Draw img_element into canvas\n ctx.drawImage(img_element, 0, 0, width, height);\n var __return = canvas.toDataURL();\n $(canvas).remove();\n return __return;\n}", "async removeMetadata(id) {\n let filename = this._formatMetadataFilename(id);\n\n await fs.unlink(filename);\n }", "removeDuplicates(attachments) {\n const embeddedImages = this.state.embeddedImgList;\n embeddedImages.forEach((img) => {\n // The name of the image is obtained from <img alt= value\n var imgName = img.match(/alt\\s*=\\s*\"(.+?)\"/gm);\n if (imgName) {\n var name = imgName[0].split(\"=\")[1];\n var name = name.replace(/\"/g, \"\");\n const i = attachments.findIndex((att) => name === att.name);\n attachments.splice(i, 1);\n }\n });\n return attachments;\n }", "function removeImgClasses() {\n\t\tvar classes = $( '#img' ).attr( 'class' ).split( /\\s+/);\n\t\t$.each( classes, function( index, item ) {\n\t\t if ( item.indexOf( 'filter' ) !== -1 || item.indexOf( 'pb' ) !== -1 ) {\n\t\t $( '#img' ).removeClass( item );\n\t\t }\n\t\t});\n\t}", "function preformatRawData(metaData, parser) {\n\t\t//fix title, year and journal abbreviation\n\t\tmetaData[\"citation_download\"] = metaData[\"citation_download\"].replace(/(?:JA|JO|PY)[\\t\\ ]+[\\-]+[\\t\\ ]+/g,\"BIT - \").trim();\n\t}", "removeMetadata(aOldAddon) {\n // This add-on has disappeared\n logger.debug(\"Add-on \" + aOldAddon.id + \" removed from \" + aOldAddon.location);\n XPIDatabase.removeAddonMetadata(aOldAddon);\n }", "function getExifData() {\n\tvar exif=null;\n\ttry {\n\t\tvar exif = $(\"#\"+g_photoId).exifAll();\n\t\texif=exif[0];\n\t} catch (e) {\n\t\texif=null;\n\t}\n\t\n\tif(exif != null && exif.size() > 0) {\n\t\tclearInterval(g_timer);\n\t\tg_timer = null;\n\t\tcreateExifDisplay(exif);\n\t}\n}", "function parseImage(filename, tags, logFile) {\n\n // open image file\n //var buffer = fs.readFileSync(__dirname + \"/\" + filename);\n var buffer = fs.readFileSync(filename);\n\n // parse using exif-parser\n const parser = require('exif-parser').create(buffer);\n parser.enableSimpleValues(false);\n var allExif = parser.parse(); // returns all exif data in photo\n\n // pull just our tag values into results object\n var subsetExif = {};\n \n for (let i = 0; i < tags.length; i++) {\n var tag = tags[i];\n if (allExif.tags.hasOwnProperty(tag)) {\n subsetExif[tag] = allExif.tags[tag];\n } else {\n if (logFile) logFile.write(\"\\t\" + tag + \" not found\\n\");\n }\n }\n \n return subsetExif;\n }", "function JpegFilter(options) {\n if (!(this instanceof JpegFilter)) return new JpegFilter(options);\n\n options = options || {};\n\n this.output = [];\n\n this._state = FILE_START;\n\n //\n // Parser options\n //\n\n // remove ICC profile (2-10 kB)\n this._removeICC = options.removeICC;\n\n // `true` - remove Exif completely, `false` - filter it and remove thumbnail\n this._removeExif = options.removeExif;\n\n // remove other meta data (XMP, Photoshop, etc.)\n this._filter = options.filter;\n\n // remove JPEG COM segments\n this._removeComments = options.removeComments;\n\n // remove the rest of the image (everything except metadata);\n // if it's `true`, output will be a series of segments, and NOT a valid jpeg\n this._removeImage = options.removeImage;\n\n // add a comment at the beginning of the JPEG\n // (it's added after JFIF, but before anything else)\n this._comment = options.comment;\n\n // exif options (passed for exif parser as is)\n this._maxEntrySize = options.maxEntrySize;\n this._onIFDEntry = options.onIFDEntry;\n\n // internal data\n this._markerCode = 0;\n this._bytesLeft = 0;\n this._segmentLength = 0;\n this._app1buffer = null;\n this._app1pos = 0;\n this._bytesRead = 0;\n\n //\n this._BufferConstructor = null;\n this._bufferUseAlloc = false;\n this._bufferUseFrom = false;\n}", "function processFileInfo() {\n var i = 0, field;\n\n while(i < 24) {\n field = metadata[i/2];\n field.length = buffer.readUInt16BE(i); i += 2;\n }\n}", "function Reset_Image(){\n tagging_view_annotate.Reset_Image_View(image_files_in_dir)\n}", "function clear_meta_images(){\n $('.meta-thumbs').html(\"\");\n }", "function removeTracingAttrs()\n{\n var bodyNode = dreamweaver.getDocumentDOM('document').body;\n\n //look for tracing attributes - if any are found, toggle\n //the global boolean to true and remove all attributes\n if (cbRemoveDWComments.checked){\n if (bodyNode.getAttribute(\"tracingsrc\") ||\n bodyNode.getAttribute(\"tracingopacity\") ||\n bodyNode.getAttribute(\"tracingx\") ||\n bodyNode.getAttribute(\"tracingy\"))\n {\n //remove all tracing image attributes\n bodyNode.removeAttribute(\"tracingsrc\");\n bodyNode.removeAttribute(\"tracingopacity\");\n bodyNode.removeAttribute(\"tracingx\");\n bodyNode.removeAttribute(\"tracingy\");\n bRemovedTracing=true;\n }\n }\n}", "function SetOverlayForImagesWithoutMetadata(container) {\n $(container).find(\".bloom-imageContainer\").each(function () {\n var img = $(this).find('img');\n if (!CreditsAreRelevantForImage(img)) {\n return;\n }\n var container = $(this);\n\n UpdateOverlay(container, img);\n\n //and if the bloom program changes these values (i.e. the user changes them using bloom), I\n //haven't figured out a way (apart from polling) to know that. So for now I'm using a hack\n //where Bloom calls click() on the image when it wants an update, and we detect that here.\n $(img).click(function () {\n UpdateOverlay(container, img);\n });\n });\n}", "function filterJpegPreview(buffer) {\n buffer = image_traverse.jpeg_segments_filter(buffer, segment => {\n if (segment.id >= 0xE1 && segment.id < 0xF0) return false;\n return true;\n });\n\n return buffer;\n}", "function clrImgTags() {\n var node = document.getElementById(\"playback\");\n var child = node.firstChild;\n while (child) {\n node.removeChild(child);\n child = node.firstChild;\n }\n}", "function filterOutMetaWithId(metas) {\n metas = Array.prototype.slice.call(metas || []);\n return metas.filter(function (meta) {\n return !meta.id;\n });\n}", "transformPhotos(line){\n let data = line.split(/,(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/);\n let reformatted = [];\n let incomplete;\n\n if (data.length === 1) {\n data = data[0] + '\"';\n data = data.split(',');\n }\n\n if (data.length !== this.numberOfFields) {\n incomplete = line;\n } else {\n // skip id if no id\n reformatted.push(this.validNum(data[0], 'number'));\n if (!reformatted) {\n return null;\n }\n // check style id if integer, else 0\n reformatted.push(this.validNum(data[1], 'number'));\n // check url for url, else default url\n reformatted.push(this.nullCheckOk(data[2], 'http://rthotel.com/wp/wp-content/uploads/2015/04/default_image_01.png', 'url'));\n // check thumbnail url for url, else null ok\n reformatted.push(this.nullCheckOk(data[3], 'http://rthotel.com/wp/wp-content/uploads/2015/04/default_image_01.png', 'thumbnail_url'));\n\n return reformatted + '\\n';\n }\n return incomplete;\n }", "function remove_meta_image(tn_index){\n var thumbArray = get_meta_images();\n thumbArray.splice(tn_index, 1);\n $('#msb-images').val(thumbArray.toString());\n }", "function removeWikiNoise(text) {\n // remove things like [[Kategorie:Moravske Toplice| Moravske Toplice]]\n var namespaceNoiseRegEx = /\\[\\[.*?\\:.*?\\]\\]/g;\n // remove things like {{NewZealand-writer-stub}}\n var commentNoiseRegEx = /\\{\\{.*?\\}\\}/g;\n // remove things like align=\"center\"\n var htmlAttributeRegEx = /\\w+\\s*\\=\\s*\\\"\\w+\\\"/g;\n // remove things like {{\n var openingCommentParenthesisRegEx = /\\{\\{/g;\n // remove things like }}\n var closingCommentParenthesisRegEx = /\\}\\}/g;\n text = text.replace(namespaceNoiseRegEx, '')\n .replace(commentNoiseRegEx, ' ')\n .replace(htmlAttributeRegEx, ' ')\n .replace(openingCommentParenthesisRegEx, ' ')\n .replace(closingCommentParenthesisRegEx, ' ')\n .replace(/\\n/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n text = strip_tags(text);\n return text;\n}", "prepareMetadata_() {\n if (this.jekyllMetadata.iconId) {\n this.jekyllMetadata.icon_id = this.jekyllMetadata.iconId;\n }\n }", "function exifRotate(img) {\n var exif = img._exif;\n\n if (exif && exif.tags && exif.tags.Orientation) {\n switch (img._exif.tags.Orientation) {\n case 1:\n // Horizontal (normal)\n // do nothing\n break;\n\n case 2:\n // Mirror horizontal\n img.mirror(true, false);\n break;\n\n case 3:\n // Rotate 180\n img.rotate(180, false);\n break;\n\n case 4:\n // Mirror vertical\n img.mirror(false, true);\n break;\n\n case 5:\n // Mirror horizontal and rotate 270 CW\n img.rotate(-90, false).mirror(true, false);\n break;\n\n case 6:\n // Rotate 90 CW\n img.rotate(-90, false);\n break;\n\n case 7:\n // Mirror horizontal and rotate 90 CW\n img.rotate(90, false).mirror(true, false);\n break;\n\n case 8:\n // Rotate 270 CW\n img.rotate(-270, false);\n break;\n\n default:\n break;\n }\n }\n\n return img;\n} // parses a bitmap from the constructor to the JIMP bitmap property", "function normalise ( data ) {\n // Remove inkscape props\n if ( data.startsWith( \"<?xml \" ) ) {\n data = data.replace( /(inkscape|sodipodi):[^= \"]+=\\\"[^\"]*\\\"/g, \"\" ); // Remove inkscape propterties\n data = data.replace( /-inkscape-[^;\"]+;/g, \"\" ); // Custom inkscape CSS\n data = data.replace( / xmlns:(inkscape|sodipodi)=\"[^\"]+\"/g, \"\" ); // Remove xml namespaces\n // Find and remove unused ids\n const ids = data.match( /\\(#[^)]+\\)\"/g ).map( id => id.slice( 2, -2 ) ).sort();\n const regxId = new RegExp( ` id=\"(?!${ids.join(\"|\")})[^\"]+\"`, \"g\" );\n data = data.replace( regxId, \"\" );\n // Fix svg links\n data = data.replace( /xlink:href/g, 'href' );\n }\n\n // Turns to one line\n data = data.replace( /\\s*[\\r\\n]+\\s*/g, \" \" );\n // Drop comments\n data = data.replace( /\\/\\*.*?\\*\\//g, \"\" ).replace( /<!--.*?-->/g, \"\" );\n // Drop spaces between and within tags\n data = data.replace( />\\s+</g, '><' ).replace( / \\/>/g, '/>' );\n // Minor trims\n data = data.replace( / +>/g, \" \" );\n\n // Set build time\n data = data.replace( /\\$DATE_BUILD/g, new Date().toISOString().split( /T/ )[0] );\n if ( ! data.includes( '<p>' ) ) {\n data = data.replace( /font-(stretch|style|variant|weight):normal;/g, \"\" );\n data = data.replace( /<sodipodi:namedview\\b.*?<\\/sodipodi:namedview>/g, \"\" );\n data = data.replace( /<metadata\\b.*?<\\/metadata>/g, \"\" );\n return data;\n }\n\n // Fix multiline sentences\n data = data.replace( /\\.(?=[A-Z])/g, \". \" );\n\n // Convert number range to ruby\n data = data.replace( /<data value=\"(\\d+)\">[^<]+<\\/data>/g, ( match, v ) => {\n return `<span title=\"${v}\">${+((+v).toPrecision(3))}</span>`;\n } );\n data = data.replace( /<data value=\"(\\d+)-(\\d+)\">[^<]+<\\/data>/g, ( match, a, b ) => {\n const min = +a, max = +b, avg = ( min + max ) / 2, deviation = Math.min( avg-min, max-avg );\n return `<span title=\"${min} – ${max}\">${+(avg.toPrecision(3))}<small> ±${+(deviation.toPrecision(2))}</small></span>`;\n } );\n\n // Convert list to <details>\n data = data.replace( /(<[ou]l class=\"desc)/g , '<details open=\"open\" class=\"leaf\"><summary>Description</summary>$1' );\n data = data.replace( /(<[ou]l class=\"key)/g , '<details open=\"open\" class=\"leaf\"><summary>Basics</summary>$1' );\n data = data.replace( /(<[ou]l class=\"use)/g , '<details open=\"open\" class=\"leaf\"><summary>Usages</summary>$1' );\n data = data.replace( /(<[ou]l class=\"note)/g , '<details open=\"open\" class=\"leaf\"><summary>Notes</summary>$1' );\n \n data = data.replace( /(<[ou]l class=\"vgood)/g, '<details open=\"open\" class=\"leaf\"><summary class=\"vgood\">Recommended</summary>$1' );\n data = data.replace( /(<[ou]l class=\"good)/g , '<details open=\"open\" class=\"leaf\"><summary class=\"good\">Good</summary>$1' );\n data = data.replace( /(<[ou]l class=\"maybe)/g, '<details open=\"open\" class=\"leaf\"><summary class=\"maybe\">Situational</summary>$1' );\n data = data.replace( /(<[ou]l class=\"bad)/g , '<details open=\"open\" class=\"leaf\"><summary class=\"bad\">Bad</summary>$1' );\n \n data = data.replace( /(<[ou]l summary=\"([^\"]+)\")/g, '<details open=\"open\" class=\"leaf\"><summary>$2</summary>$1' );\n data = data.replace( /<\\/ul>/g, '</ul></details>' );\n data = data.replace( /<\\/ol>/g, '</ol></details>' );\n\n return data;\n}", "function removeFilter(element) {\n\tif(element.style.removeAttribute){\n\t\telement.style.removeAttribute('filter');\n\t}\n}", "function removeMetafromArrayJSON(data) {\n var multyValuesArray = new Array([\"Audience\", \"Technology\", \"Functionality\", \"ProductOptionVersions\"]);\n var metaToRemove = new Array([\"BookletId\", \"Author\", \"BookletSummary\", \"State\", \"Revision\", \"ReleaseId\",\n \"ProductOptionVersions\", \"Product\", \"Version\", \"MasterProductVersion\", \"Language\"]);\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n if (multyValuesArray.indexOf(key) > -1) {\n if (data[i][key] !== null) {\n var items = data[i][key].split(\",\");\n delete data[i][key];\n\n var newArray = [];\n for (var j = 0; j < items.length; j++) {\n // Add property to object\n newArray.push(items[j].replace(\" \", \"\").replace(\".\", \"\"));\n }\n data[i][key] = newArray;\n }\n }\n\n if (metaToRemove.indexOf(key) > -1) {\n delete data[i][key];\n }\n }\n }\n\n }\n\n return data;\n }", "function applyDebugMeta(event) {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap = {};\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.keys(filenameDebugIdMap).forEach(filename => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id: filenameDebugIdMap[filename],\n });\n });\n}", "function handleFile(event) {\n\n var image = event.target.result;\n\n image = image.replace(\"data:image/jpeg;base64,\", \"\"); // remove jpeg header (if it exists)\n image = image.replace(\"data:image/png;base64,\", \"\"); // remove png header (if it exists)\n queryCloudVisionApi(image);\n}", "function preformatRawData(metaData, parser) {\n\t\t//fix title, year and journal abbreviation\n\t\tmetaData[\"citation_download\"] = metaData[\"citation_download\"].replace(/TI[\\t\\ ]+[\\-]+[\\t\\ ]+/,\"T1 - \").replace(/JO[\\t\\ ]+[\\-]+[\\t\\ ]+/,\"JF - \").replace(/PY[\\t\\ ]+[\\-]+[\\t\\ ]+/,\"Y1 - \").trim();\n\t}", "function computeTrimInfo(img, cb) {\n cp.exec(\"convert \" + img + \" -trim info:-\", function(err, stdout, stderr) {\n if (stdout) {\n var rs = stdout.trim().split(\" \");\n var size = rs[2].split(\"x\");\n var offset = rs[3].split(\"+\").slice(1, 3);\n var sourceSize = rs[3].split(\"+\")[0].split(\"x\");\n\n var trimedInfo = {\n sx: Number(offset[0]),\n sy: Number(offset[1]),\n sw: Number(sourceSize[0]),\n sh: Number(sourceSize[1]),\n w: Number(size[0]),\n h: Number(size[1]),\n trimedFile: getTrimedImageName(img),\n };\n if (cb) {\n cb(trimedInfo)\n }\n }\n });\n}", "async getMetadata(id) {\n const filename = this._formatMetadataFilename(id);\n\n const contents = await fs.readFile(filename);\n\n return imagery.Image.fromObject(JSON.parse(contents));\n }", "phototaked(file) {}", "function build_meta_information(object) {\n var res = {\n \"timestamp\": object.timestamp,\n \"version\": object.version,\n \"changeset\": object.changeset,\n \"user\": object.user,\n \"uid\": object.uid\n };\n for (var k in res)\n if (res[k] === undefined)\n delete res[k];\n return res;\n }", "function build_meta_information(object) {\n var res = {\n \"timestamp\": object.timestamp,\n \"version\": object.version,\n \"changeset\": object.changeset,\n \"user\": object.user,\n \"uid\": object.uid\n };\n for (var k in res)\n if (res[k] === undefined)\n delete res[k];\n return res;\n }", "function hideImageObject(type) {\n if (type == 'featureda') {\n $('.s7-fancy-video img').hide();\n $('.featurea-play-button-overlay').hide();\n } else {\n $('.inline_callout_image').hide();\n }\n }", "function cleanPreviewModal() {\n\n $('.3pictures').html(\"\");\n $('#product-image-big').attr(\"src\", \"\");\n $('#product-desc').find(\"h4\").text(\"\");\n $('#product-desc').find(\"p\").text(\"\");\n $(\"#price\").text(\"\");\n}", "function ImageMetadata (fileref, filename, size) {\n this.filename = filename\n this.size = size\n this.fileref = fileref // image url or local file ref.\n this.regions = []\n this.file_attributes = new Map() // image attributes\n this.base64_img_data = '' // image data stored as base 64\n}", "removeDataFilter() {\n this.configureDecoder(undefined, {\n filterDescription: null\n });\n }", "function editor_filterOutput(objname) {\r\n editor_updateOutput(objname);\r\n var contents = document.all[objname].value;\r\n var config = document.all[objname].config;\r\n\r\n // ignore blank contents\r\n if (contents.toLowerCase() == '<p>&nbsp;</p>') { contents = \"\"; }\r\n\r\n // filter tag - this code is run for each HTML tag matched\r\n var filterTag = function(tagBody,tagName,tagAttr) {\r\n tagName = tagName.toLowerCase();\r\n var closingTag = (tagBody.match(/^<\\//)) ? true : false;\r\n\r\n // fix placeholder URLS - remove absolute paths that IE adds\r\n if (tagName == 'img') { tagBody = tagBody.replace(/(src\\s*=\\s*.)[^*]*(\\*\\*\\*)/, \"$1$2\"); }\r\n if (tagName == 'a') { tagBody = tagBody.replace(/(href\\s*=\\s*.)[^*]*(\\*\\*\\*)/, \"$1$2\"); }\r\n\r\n // add additional tag filtering here\r\n\r\n // convert to vbCode\r\n// if (tagName == 'b' || tagName == 'strong') {\r\n// if (closingTag) { tagBody = \"[/b]\"; } else { tagBody = \"[b]\"; }\r\n// }\r\n// else if (tagName == 'i' || tagName == 'em') {\r\n// if (closingTag) { tagBody = \"[/i]\"; } else { tagBody = \"[i]\"; }\r\n// }\r\n// else if (tagName == 'u') {\r\n// if (closingTag) { tagBody = \"[/u]\"; } else { tagBody = \"[u]\"; }\r\n// }\r\n// else {\r\n// tagBody = \"\"; // disallow all other tags!\r\n// }\r\n\r\n return tagBody;\r\n };\r\n\r\n // match tags and call filterTag\r\n RegExp.lastIndex = 0;\r\n var matchTag = /<\\/?(\\w+)((?:[^'\">]*|'[^']*'|\"[^\"]*\")*)>/g; // this will match tags, but still doesn't handle container tags (textarea, comments, etc)\r\n\r\n contents = contents.replace(matchTag, filterTag);\r\n\r\n // remove nextlines from output (if requested)\r\n if (config.replaceNextlines) { \r\n contents = contents.replace(/\\r\\n/g, ' ');\r\n contents = contents.replace(/\\n/g, ' ');\r\n contents = contents.replace(/\\r/g, ' ');\r\n }\r\n\r\n // update output with filtered content\r\n document.all[objname].value = contents;\r\n\r\n}", "function ImageMetadata(fileref, filename, size) {\n this.filename = filename;\n this.size = size;\n this.fileref = fileref; // image url or local file ref.\n this.regions = [];\n this.file_attributes = {}; // image attributes\n this.base64_img_data = ''; // image data stored as base 64\n}", "function applyMetadata()\n {\n\n\n // get metadata values\n var metadata = groovebox[\"metadata\"];\n\n\n // get the current audio file name\n var currentAudioFile = $(\".track-info\").attr(\"file\");\n\n\n // check if the (new) metadata is different than the currently playing song\n if (groovebox[\"stream\"][\"track\"] !== currentAudioFile)\n {\n\n\n // update the metadata\n\n\n // update the track name\n $(\".track-info .track-name\").html(metadata[\"title\"]).attr(\"title\", metadata[\"title\"]);\n\n\n // update the track artist\n $(\".track-info .track-artist\").html(metadata[\"artist\"]).attr(\"title\", metadata[\"artist\"]);\n\n\n // update the cover-art\n $(\".album-art img\").attr(\"src\", metadata[\"coverArt\"] +\"&\"+ new Date().getTime());\n\n\n // update the current audio file\n $(\".track-info\").attr(\"file\", groovebox[\"stream\"][\"track\"]);\n\n\n }\n\n\n }", "toMetadata(metadata) {\n const metadataEntry = metadata.metadataEntry;\n let targetId;\n switch (metadataEntry.metadataType.valueOf()) {\n case MetadataType_1.MetadataType.Mosaic:\n targetId = new MosaicId_1.MosaicId(metadataEntry.targetId);\n break;\n case MetadataType_1.MetadataType.Namespace:\n targetId = NamespaceId_1.NamespaceId.createFromEncoded(metadataEntry.targetId);\n break;\n default:\n targetId = undefined;\n }\n return new Metadata_1.Metadata(metadata.id, new MetadataEntry_1.MetadataEntry(metadataEntry.version || 1, metadataEntry.compositeHash, Address_1.Address.createFromEncoded(metadataEntry.sourceAddress), Address_1.Address.createFromEncoded(metadataEntry.targetAddress), UInt64_1.UInt64.fromHex(metadataEntry.scopedMetadataKey), metadataEntry.metadataType.valueOf(), Convert_1.Convert.decodeHex(metadataEntry.value), targetId));\n }", "function deleteFromMetaFile(index) {\n files_meta = deleteElementFromJSON(files_meta, '_'+index);\n}", "function loadMetadata() {\n\tvar s = '<thead><td class=\"textcell1\">Type</td><td class=\"textcell2\"><span id=\"mprop\"></span></td><td class=\"textcell3\"><span id=\"mval\"></span></td><td class=\"textcell4\">Information</td></thead>';\n\ts += '<tbody>';\n\ts += stringLine4Val( 'codeMetadata', '<span id=\"tytitle\">-</span>', '-', '', '<span id=\"infotytitle\">-</span>', 'writehalf' );\n\ts += stringLine4Val( 'codeMetadata', 'Transcription', '<span id=\"tyname\">-</span>', '', '<span id=\"infotyname\">-</span>', 'writehalf' ); // put 'readonly' if edit the filename in metadata is not permitted anymore\n\ts += stringLine4Val( 'codeMetadata', 'Transcription', '<span id=\"tyloc\">-</span>', '', '<span id=\"infotyloc\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', 'Transcription', '<span id=\"tydate\">-</span>', '', '<span id=\"infotydate\">-</span>', 'writehalf' );\n\ts += stringLine4Val( 'codeMetadata', 'Transcription', '<span id=\"typlacen\">-</span>', '', '<span id=\"infoplacen\">-</span>', 'writehalf' );\n\ts += stringLine4Val( 'codeMetadata', 'Media', '<span id=\"tymname\">-</span>', '', '<span id=\"infotymname\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', 'Media', '<span id=\"tymrelloc\">-</span>', '', '<span id=\"infotymrelloc\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', 'Media', '<span id=\"tymloc\">-</span>', '', '<span id=\"infotymloc\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', 'Media', '<span id=\"tymtype\">-</span>', '', '<span id=\"infotymtype\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', 'Media', '<span id=\"tymdur\">-</span>', '', '<span id=\"infotymdur\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', '-', '-', '-', '---', 'readonly' );\n\t/*\n\t * et on y ajoute les notes s'il y en a (compatibilité anciens formats)\n\t */\n\tif (trjs.data.note) {\n\t\tfor (var i = 0; i < trjs.data.note.length; i++) {\n s += stringLine4Val( 'codeMetadata', trjs.data.note[i]['type'], trjs.data.note[i]['property'], trjs.data.note[i]['value'], trjs.data.note[i]['info'] );\n\t\t}\n\t}\n\ts += stringLine4Val( 'codeMetadata', '-', '-', '-', '---', 'readonly' );\n\tif (trjs.data.metadata) {\n for (var i=0 ; i < trjs.data.metadata.length; i++) {\n s += stringLine4Val( 'codeMetadata', trjs.data.metadata[i]['type'], trjs.data.metadata[i]['property'], trjs.data.metadata[i]['value'], trjs.data.metadata[i]['info'] );\n }\n\t}\n\ts += '</tbody>';\n\t$('#metadata').html(s);\n}", "function getNimMetadata() {\n\t// Try getting classID from file metadata\n\tvar classID = getMetadata('classID');\n\t// If that worked, everything else should also be there\n\tif (classID) {\n\t\treturn {\n\t\t\tclassID: classID,\n\t\t\tclassName: getMetadata('className'),\n\t\t\tserverID: getMetadata('serverID'),\n\t\t\tserverPath: getMetadata('serverPath'),\n\t\t\ttaskID: getMetadata('taskID'),\n\t\t\ttaskName: getMetadata('taskName'),\n\t\t\ttaskFolder: getMetadata('taskFolder'),\n\t\t\tbasename: getMetadata('basename'),\n\t\t\tfileID: getMetadata('fileID')\n\t\t};\n\t}\n\t// If not, look in NIM Photoshop metadata file\n\telse {\n\t\ttry {\n\t\t\t// This line will fail if the file hasn't been saved yet (activeDocument.path won't exist)\n\t\t\tvar thisNimFolderPath = activeDocument.path.absoluteURI + '/.nim/';\n\t\t}\n\t\tcatch(e) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar photoshopFilePath = thisNimFolderPath + 'photoshop-metadata.nim',\n\t\t\tthisNimFolder = new Folder(thisNimFolderPath),\n\t\t\tphotoshopFile = new File(photoshopFilePath),\n\t\t\tfileString = activeDocument.name + ':',\n\t\t\tcurrentLine,\n\t\t\tfileStringPos,\n\t\t\tfoundFileString = false,\n\t\t\tequalPos,\n\t\t\tkeyValue,\n\t\t\tmetadata = {};\n\n\t\t// Will get a \"no metadata\" error back in file that calls this function\n\t\tif (!thisNimFolder.exists || !photoshopFile.exists)\n\t\t\treturn false;\n\n\t\t// More specific error + the \"no metadata\" error\n\t\tif (!photoshopFile.open('r')) {\n\t\t\talert('Error reading the following file: ' + photoshopFilePath);\n\t\t\treturn false;\n\t\t}\n\n\t\twhile (!photoshopFile.eof) {\n\t\t\tcurrentLine = photoshopFile.readln();\n\t\t\tfileStringPos = currentLine.indexOf(fileString);\n\t\t\tif (fileStringPos == -1) continue;\n\t\t\tfoundFileString = true;\n\t\t\twhile (!photoshopFile.eof) {\n\t\t\t\tcurrentLine = photoshopFile.readln();\n\t\t\t\tequalPos = currentLine.indexOf('=');\n\t\t\t\tif (equalPos == -1) break;\n\t\t\t\tkeyValue = currentLine.split('=');\n\t\t\t\tmetadata[keyValue[0].trim()] = keyValue[1].trim();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tphotoshopFile.close();\n\n\t\tif (!foundFileString)\n\t\t\treturn false;\n\t\t\n\t\treturn metadata;\n\t}\n}", "function image_process_streamization() { \r\n\r\n}", "function cleanPIIString(pii_raw){\n\treturn pii_raw.replace(/\\/\\*[\\s\\S]*?\\*\\/|([^\\\\:]|^)\\/\\/.*$/gm, '$1').replace(/\\s/g,\"\");\t\n}", "function stripEffect(line) {\n i = 0;\n while (i < line.length) {\n line = line.replace(\"\\n\", \" \");\n line = line.replace(\"<b>\", \"**\");\n line = line.replace(\"</b>\", \"**\");\n line = line.replace(\"<b>\", \"**\");\n line = line.replace(\"</b>\", \"**\");\n line = line.replace(\"\\n\", \"\");\n line = line.replace(\"<i>\", \"_\");\n line = line.replace(\"</i>\", \"_\");\n line = line.replace(\"#\", \"\");\n line = line.replace(\"$\", \"\");\n line = line.replace(\"[x]\", \"\"); // Why does this show up on cards?\n i++;\n }\n return line;\n}", "function processExif(dataView, dataOffsetAMS){\n\t\t//\tEXIF Header\n\t\tif(dataView.getUint16(dataOffsetAMS) != 0x4578 || dataView.getUint16(dataOffsetAMS+2) != 0x6966){\n\t\t\tEXIF.validEXIFHeader = false;\n\t\t\treturn false;\n\t\t}\n\n\t\tconsole.log(\"Valid EXIF Header\");\n\n\t\t//\tTIFF Header\n\t\tif(dataView.getUint16(dataOffsetAMS+6) != 0x4949 && dataView.getUint16(dataOffsetAMS+6) != 0x4d4d){\n\t\t\tEXIF.validTIFFHeader = false;\n\t\t\treturn false;\n\t\t}\n\n\t\tconsole.log(\"Valid TIFF Header\");\n\t\treturn true;\n\t}", "function exif (file) {\n \"use strict\"; \n var deferred = Q.defer(), o = {};\n \n new ExifImage({ image : file }, function (error, data) {\n if (error) \n {\n // callback.call(\"error \" + file);\n deferred.reject(\"ERROR\"); \n }\n if (data)\n {\n o.file = file;\n o.data = data; \n deferred.resolve(o); \n }\n });\n \n return deferred.promise;\n }", "function preformatRawData(metaData, parser) {\n\t\t//do nothing, as there is no dynamic citation export being requested\n\t}", "function replaceCustomMetadataPart(partId, metadataPart)\n{\n //alert(\"DELETING CUSTOM PIECE\");\n\tMLA.deleteCustomXMLPart(partId);\n\n\t//alert(\"ADDING CUSTOM PIECE\");\n\tMLA.addCustomXMLPart(metadataPart);\n\n}", "function dwscripts_stripCFOutputTags(expression)\n{\n var retVal = expression.toString();\n\n var exp1 = /<cfoutput[^>]*>/gi;\n var exp2 = /<\\/cfoutput[^>]*>/gi;\n\n retVal = retVal.replace(exp1,\"\");\n retVal = retVal.replace(exp2,\"\");\n\n return retVal;\n}", "function standardizeImageObjects(data, filters) {\n const shouldShowGray = filters.shouldShowGray;\n const images = data.map(image => {\n const imageUrl = image.url;\n return {\n baseUrl: image.url,\n imageUrl: shouldShowGray ? `${image.url}?grayscale=true` : image.url,\n domain: imageUrl.split('/')[2],\n id: imageUrl.split('/')[4],\n width: imageUrl.split('/')[5],\n height: imageUrl.split('/')[6],\n params: shouldShowGray ? `?grayscale=true` : '',\n }\n });\n\n // Get rid of duplicate images\n let uniqueImages = [];\n images.forEach(function (image) {\n let i = uniqueImages.findIndex(x => x.id == image.id);\n if (i <= -1) {\n uniqueImages.push(image);\n }\n });\n\n return uniqueImages;\n}", "function cleanConditionally(e, tag) {\n var tagsList = e.getElementsByTagName(tag);\n var curTagsLength = tagsList.length;\n\n /**\n * Gather counts for other typical elements embedded within.\n * Traverse backwards so we can remove nodes at the same time without effecting the traversal.\n *\n * TODO: Consider taking into account original contentScore here.\n **/\n for (var i = curTagsLength - 1; i >= 0; i--) {\n var weight = getClassWeight(tagsList[i]);\n\n dbg(\"Cleaning Conditionally \" + tagsList[i] + \" (\" + tagsList[i].className + \":\" + tagsList[i].id + \")\" + ((typeof tagsList[i].readability != 'undefined') ? (\" with score \" + tagsList[i].readability.contentScore) : ''));\n\n if (weight < 0) {\n tagsList[i].parentNode.removeChild(tagsList[i]);\n } else if (getCharCount(tagsList[i], ',') < 10) {\n /**\n * If there are not very many commas, and the number of\n * non-paragraph elements is more than paragraphs or other ominous signs, remove the element.\n **/\n\n var p = tagsList[i].getElementsByTagName(\"p\").length;\n var img = tagsList[i].getElementsByTagName(\"img\").length;\n var li = tagsList[i].getElementsByTagName(\"li\").length - 100;\n var input = tagsList[i].getElementsByTagName(\"input\").length;\n\n var embedCount = 0;\n var embeds = tagsList[i].getElementsByTagName(\"embed\");\n for (var ei = 0, il = embeds.length; ei < il; ei++) {\n if (embeds[ei].src && embeds[ei].src.search(regexps.videoRe) == -1) {\n embedCount++;\n }\n }\n\n var linkDensity = getLinkDensity(tagsList[i]);\n var contentLength = getInnerText(tagsList[i]).length;\n var toRemove = false;\n\n if (img > p && img > 1) {\n toRemove = true;\n } else if (li > p && tag != \"ul\" && tag != \"ol\") {\n toRemove = true;\n } else if (input > Math.floor(p / 3)) {\n toRemove = true;\n } else if (contentLength < 25 && (img == 0 || img > 2)) {\n toRemove = true;\n } else if (weight < 25 && linkDensity > .2) {\n toRemove = true;\n } else if (weight >= 25 && linkDensity > .5) {\n toRemove = true;\n } else if ((embedCount == 1 && contentLength < 75) || embedCount > 1) {\n toRemove = true;\n }\n\n if (toRemove) {\n tagsList[i].parentNode.removeChild(tagsList[i]);\n }\n }\n }\n}", "function removeNonTrusted() {\n var trusted = \"/static/img/trusted.png\",\n vip = \"/static/img/vip.gif\";\n $('tr:not(:first, :last, :has(img[src=\"'+ trusted +'\"]), :has(img[src=\"'+ vip +'\"]))').hide(); \n }", "function clean_img() {\n return del('./dist/img/');\n}", "function deconvert(img) {\n\tif (!img.hasClass(\"cat\")) { return; }\n\t// revert src\n\timg.attr(\"src\", img.attr(\"old-src\"));\n\timg.removeAttr(\"old-src\");\n\t// revert class\n\tif (!img.prop(\"hadclass\")) {\n\t\timg.removeAttr(\"class\");\n\t} else {\n\t\timg.removeClass(\"cat\");\n\t}\n\t// revert style\n\tif (!img.prop(\"hadstyle\")) {\n\t\timg.removeAttr(\"style\");\n\t} else {\n\t\timg.css(\"background-image\", \"\")\n\t\t\t.css(\"background-repeat\", \"\")\n\t\t\t.css(\"background-size\", \"\")\n\t\t\t.css(\"background-position-x\", \"\")\n\t\t\t.css(\"background-position-y\", \"\");\n\t}\n\t// revert dimensions\n\tif (!img.prop(\"hadwidth\")) { img.one(\"load\", function(){ $(this).removeAttr(\"width\"); })}\n\tif (!img.prop(\"hadheight\")) { img.one(\"load\", function(){ $(this).removeAttr(\"height\"); })}\n}", "function renderImageInfo(imageinfo) {\n console.log('imageinfo', imageinfo);\n\n var divloader = document.querySelector('#loader');\n var divoutput = document.querySelector('#output');\n divloader.style.display = \"none\";\n divoutput.style.display = \"block\";\n\n var divinfo = document.querySelector('#info');\n var divexif = document.querySelector('#exif');\n\n // Render general image data.\n var datacells = divinfo.querySelectorAll('td');\n renderCells(datacells, imageinfo);\n\n // If EXIF data exists, unhide the EXIF table and render.\n if (imageinfo['exif'] && !isEmpty(imageinfo['exif'])) {\n divexif.style.display = 'block';\n var exifcells = divexif.querySelectorAll('td');\n renderCells(exifcells, imageinfo['exif']);\n }\n}", "function ExifImage (options, callback) {\n if (!(this instanceof ExifImage)) {\n if (typeof(options)===\"string\") {\n options = {\n image: options\n }\n }\n\n assert(typeof(options)===\"object\", \"Invalid options object\");\n \n var exifImage = new ExifImage(options, function(error, data) {\n if (error) {\n return callback(error);\n }\n \n callback(null, data, options.image); \n });\n \n return exifImage;\n }\n\n if (typeof(options)===\"string\") {\n options= {\n image: options\n }\n } else if (options instanceof Buffer) {\n options= {\n image: options\n }\n }\n \n var ops={};\n if (options) {\n for(var k in options) {\n ops[k]=options[k];\n }\n }\n this.options=ops;\n\n // Default option values\n [\"ifd0MaxEntries\", \"ifd1MaxEntries\", \"maxGpsEntries\", \"maxInteroperabilityEntries\", \"agfaMaxEntries\", \"epsonMaxEntries\", \n \"fujifilmMaxEntries\", \"olympusMaxEntries\", \"panasonicMaxEntries\", \"sanyoMaxEntries\"].forEach(function(p) {\n if (ops[p]===undefined) {\n ops[p]=DEFAULT_MAX_ENTRIES;\n }\n });\n\n this.exifData = {\n image : {}, // Information about the main image\n thumbnail : {}, // Information about the thumbnail\n exif : {}, // Exif information\n gps : {}, // GPS information\n interoperability: {}, // Exif Interoperability information\n makernote : {} // Makernote information\n };\n \n this.offsets={};\n if (ops.tiffOffsets) {\n exifData.offsets=offsets;\n }\n \n debug(\"New ExifImage options=\",options);\n\n if (!ops.image) {\n // If options image is not specified, the developper must call loadImage() to parse the image.\n// callback(new Error('You have to provide an image, it is pretty hard to extract Exif data from nothing...'));\n return;\n }\n\n if (typeof callback !== 'function') {\n throw new Error('You have to provide a callback function.');\n }\n \n var self=this;\n setImmediate(function() {\n self.loadImage(ops.image, function (error, exifData) {\n if (error) {\n return callback(error);\n }\n \n callback(null, exifData, ops.image);\n });\n });\n}", "function ExifImage (options, callback) {\n if (!(this instanceof ExifImage)) {\n if (typeof(options)===\"string\") {\n options = {\n image: options\n }\n }\n\n assert(typeof(options)===\"object\", \"Invalid options object\");\n \n var exifImage = new ExifImage(options, function(error, data) {\n if (error) {\n return callback(error);\n }\n \n callback(null, data, options.image); \n });\n \n return exifImage;\n }\n\n if (typeof(options)===\"string\") {\n options= {\n image: options\n }\n } else if (options instanceof Buffer) {\n options= {\n image: options\n }\n }\n \n var ops={};\n if (options) {\n for(var k in options) {\n ops[k]=options[k];\n }\n }\n this.options=ops;\n\n // Default option values\n [\"ifd0MaxEntries\", \"ifd1MaxEntries\", \"maxGpsEntries\", \"maxInteroperabilityEntries\", \"agfaMaxEntries\", \"epsonMaxEntries\", \n \"fujifilmMaxEntries\", \"olympusMaxEntries\", \"panasonicMaxEntries\", \"sanyoMaxEntries\"].forEach(function(p) {\n if (ops[p]===undefined) {\n ops[p]=DEFAULT_MAX_ENTRIES;\n }\n });\n\n this.exifData = {\n image : {}, // Information about the main image\n thumbnail : {}, // Information about the thumbnail\n exif : {}, // Exif information\n gps : {}, // GPS information\n interoperability: {}, // Exif Interoperability information\n makernote : {} // Makernote information\n };\n \n this.offsets={};\n if (ops.tiffOffsets) {\n exifData.offsets=offsets;\n }\n \n debug(\"New ExifImage options=\",options);\n\n if (!ops.image) {\n // If options image is not specified, the developper must call loadImage() to parse the image.\n// callback(new Error('You have to provide an image, it is pretty hard to extract Exif data from nothing...'));\n return;\n }\n\n if (typeof callback !== 'function') {\n throw new Error('You have to provide a callback function.');\n }\n \n var self=this;\n setImmediate(function() {\n self.loadImage(ops.image, function (error, exifData) {\n if (error) {\n return callback(error);\n }\n \n callback(null, exifData, ops.image);\n });\n });\n}", "static get tag() {\n return \"filtered-image\";\n }", "function parseImageMetadata(file, metadata, callback, errback) {\n console.log('fallback parsing metadata for', file.name);\n if (!errback) {\n errback = function(e) {\n console.error('ImageMetadata ', String(e));\n };\n }\n\n var url = URL.createObjectURL(file);\n offscreenImage.src = url;\n\n offscreenImage.onerror = function() {\n // XXX When launched as an inline activity this gets into a failure\n // loop where this function is called over and over. Unsetting\n // onerror here works around it. I don't know why the error is\n // happening in the first place..\n offscreenImage.onerror = null;\n URL.revokeObjectURL(url);\n offscreenImage.src = null;\n errback('Image failed to load');\n };\n\n offscreenImage.onload = function() {\n URL.revokeObjectURL(url);\n metadata.width = offscreenImage.width;\n metadata.height = offscreenImage.height;\n\n // If we've already got a thumbnail, we're done\n if (metadata.thumbnail) {\n offscreenImage.src = null;\n callback(metadata);\n return;\n }\n\n // Create a thumbnail image\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n canvas.width = THUMBNAIL_WIDTH;\n canvas.height = THUMBNAIL_HEIGHT;\n var scalex = canvas.width / offscreenImage.width;\n var scaley = canvas.height / offscreenImage.height;\n\n // Take the larger of the two scales: we crop the image to the thumbnail\n var scale = Math.max(scalex, scaley);\n\n // If the image was already thumbnail size, it is its own thumbnail\n if (scale >= 1) {\n offscreenImage.src = null;\n metadata.thumbnail = file;\n callback(metadata);\n return;\n }\n\n // Calculate the region of the image that will be copied to the\n // canvas to create the thumbnail\n var w = Math.round(THUMBNAIL_WIDTH / scale);\n var h = Math.round(THUMBNAIL_HEIGHT / scale);\n var x = Math.round((offscreenImage.width - w) / 2);\n var y = Math.round((offscreenImage.height - h) / 2);\n\n // Draw that region of the image into the canvas, scaling it down\n context.drawImage(offscreenImage, x, y, w, h,\n 0, 0, THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT);\n\n // We're done with the image now\n offscreenImage.src = null;\n\n // Now extract the thumbnail from the canvas as a jpeg file\n metadata.thumbnail = canvas.mozGetAsFile(file.name + '.thumbnail.jpeg',\n 'image/jpeg');\n callback(metadata);\n };\n }", "removeNoImage() {\n var newcharacters = this.state.characters.filter(function(character) {\n return character.thumbnail.path !== noImage;\n });\n this.setState({\n characters: newcharacters,\n characterCount: newcharacters.length\n });\n }", "function clearPreviousData(){\r\n\tif( $(\"#imageInput\").length > 0 ){\r\n\t\tdocument.getElementById(\"imageInput\").innerHTML = \"\";\t\r\n\t\t$(\"#imageFile\").val(\"\");\r\n\t\t$(\"#fileField\").val(\"\");\r\n\t\t$('#imgCaption').hide();\r\n\t\tvar attr = $('#imageOutput').attr(\"src\");\r\n\t\t\r\n\t\t// For some browsers, `attr` is undefined; for others `attr` is false. Check for both.\r\n\t\tif ( (typeof attr !== typeof undefined) && (attr !== false) ) {\r\n\t\t\t$('#imageOutput').removeAttr(\"src\").removeAttr(\"style\").removeClass(\"image_output\");\r\n\t\t}\r\n\t}\r\n\t\r\n}", "function processHorrorFilter(img, filename){\n let image = img.clone();\n image.scan(0, 0, image.bitmap.width, image.bitmap.height, function (x, y, idx) {\n\t\n if (isPixelSurrounded(image.bitmap.data, image.bitmap.width, image.bitmap.height, idx, 1)){\n let northMeanRed = (image.bitmap.data[idx - (image.bitmap.width * 4) - 4] + image.bitmap.data[idx - (image.bitmap.width * 4)] + image.bitmap.data[idx-(image.bitmap.width * 4) + 4]) / 3\n let northMeanGreen = (image.bitmap.data[idx - (image.bitmap.width * 4) - 3] + image.bitmap.data[idx - (image.bitmap.width * 4) + 1] + image.bitmap.data[idx-(image.bitmap.width * 4) + 5]) / 3\n let northMeanBlue = (image.bitmap.data[idx - (image.bitmap.width * 4) - 2] + image.bitmap.data[idx - (image.bitmap.width * 4) + 2] + image.bitmap.data[idx-(image.bitmap.width * 4) + 6]) / 3\n\t\t\t\n let eastMeanRed = (image.bitmap.data[idx - (image.bitmap.width * 4) + 4] + image.bitmap.data[idx + 4] + image.bitmap.data[idx + (image.bitmap.width * 4) + 4]) / 3\n let eastMeanGreen = (image.bitmap.data[idx - (image.bitmap.width * 4) + 5] + image.bitmap.data[idx + 5] + image.bitmap.data[idx + (image.bitmap.width * 4) + 5]) / 3\n let eastMeanBlue = (image.bitmap.data[idx - (image.bitmap.width * 4) + 6] + image.bitmap.data[idx + 6] + image.bitmap.data[idx + (image.bitmap.width * 4) + 6]) / 3\n\t\t \n let southMeanRed = (image.bitmap.data[idx + (image.bitmap.width * 4) - 4] + image.bitmap.data[idx - (image.bitmap.width * 4)] + image.bitmap.data[idx-(image.bitmap.width * 4) + 4]) / 3\n let southMeanGreen = (image.bitmap.data[idx + (image.bitmap.width * 4) - 3] + image.bitmap.data[idx - (image.bitmap.width * 4) + 1] + image.bitmap.data[idx-(image.bitmap.width * 4) + 5]) / 3\n let southMeanBlue = (image.bitmap.data[idx + (image.bitmap.width * 4) - 2] + image.bitmap.data[idx - (image.bitmap.width * 4) + 2] + image.bitmap.data[idx-(image.bitmap.width * 4) + 6]) / 3\n\t\t\t\n let westMeanRed = (image.bitmap.data[idx - (image.bitmap.width * 4) - 4] + image.bitmap.data[idx + (image.bitmap.width * 4)] + image.bitmap.data[idx + (image.bitmap.width * 4) + 4]) / 3\n let westMeanGreen = (image.bitmap.data[idx - (image.bitmap.width * 4) - 3] + image.bitmap.data[idx + (image.bitmap.width * 4) + 1] + image.bitmap.data[idx + (image.bitmap.width * 4) + 5]) / 3\n let westMeanBlue = (image.bitmap.data[idx - (image.bitmap.width * 4) - 2] + image.bitmap.data[idx + (image.bitmap.width * 4) + 2] + image.bitmap.data[idx + (image.bitmap.width * 4) + 6]) / 3\n\t\t\t\n image.bitmap.data[idx] = Math.min(northMeanRed, eastMeanRed, southMeanRed, westMeanRed, 100);\n image.bitmap.data[idx + 1] = Math.min(northMeanGreen, eastMeanGreen, southMeanGreen, westMeanGreen, 100);\n image.bitmap.data[idx + 2] = Math.min(northMeanBlue, eastMeanBlue, southMeanBlue, westMeanBlue, 100);\n\t\t\t\n image.bitmap.data[idx + 3] = 255;\n } \n\t\n });\n\n image.write(filename);\n console.log(getCurrentTime() + '> Horror Filter version of image saved as <' + filename + '>.');\n\n return image;\n}", "_filterData(imageData) {\n //todo no filter for now \n const filterType = 0; //no filter\n const { width, height, data } = imageData;\n const byteWidth = width * 4; //r,g,b,a\n var filtered = new Uint8Array((byteWidth + 1) * height);\n var filterTypePos = 0;\n var fromPos = 0;\n for (var i = 0; i < height; i++) {\n filtered[filterTypePos] = filterType; //we need to write one additional byte with filter value each in row at the beginning \n PngWriter.copy(data, filtered, filterTypePos + 1, byteWidth, fromPos); // just copy the data without filtering\n filterTypePos += (byteWidth + 1);\n fromPos += byteWidth;\n }\n return filtered;\n }", "function metadata(json) {\n\tvar result = {};\n\tfor (var key in json) {\n\t\tif (key in metadata_keys) {\n\t\t\tresult[key] = json[key];\n\t\t}\n\t}\n\treturn result;\n}", "function removeProblematicParametersFilter(filter) {\n var rawFilter = filter.split('\\n')\n var filterFormatted = \"\"\n\n rawFilter.forEach(line => {\n if (!(line.includes(\"patterns_dir\") || (line.includes(\"patterns_files_glob \")))) {\n filterFormatted += line + \"\\n\"\n }\n });\n\n return filterFormatted\n}", "function setupMetadataWatcher(luvio) {\n // Watch for object info changes. Since we don't have enough information to understand to which\n // extent an object info change may impact the application the only thing we do is to clear all\n // the persistent storages.\n luvio.storeWatch(OBJECT_INFO_PREFIX, entries => {\n for (let i = 0, len = entries.length; i < len; i++) {\n const entry = entries[i];\n const isObjectInfoUpdated = entry.inserted === false;\n if (isObjectInfoUpdated) {\n mark(STORAGE_DROP_MARK_NAME, STORAGE_DROP_MARK_CONTEXT);\n clearStorages().catch(() => {\n /* noop */\n });\n break;\n }\n }\n });\n}", "function cleanArtistTrack(artist, track) {\n\n // Do some cleanup\n artist = artist.replace(/^\\s+|\\s+$/g,'');\n track = track.replace(/^\\s+|\\s+$/g,'');\n\n // Strip crap\n track = track.replace(/\\s*\\*+\\s?\\S+\\s?\\*+$/, ''); // **NEW**\n track = track.replace(/\\s*\\[[^\\]]+\\]$/, ''); // [whatever]\n track = track.replace(/\\s*\\([^\\)]*version\\)$/i, ''); // (whatever version)\n track = track.replace(/\\s*\\.(avi|wmv|mpg|mpeg|flv)$/i, ''); // video extensions\n track = track.replace(/\\s*(of+icial\\s*)?(music\\s*)?video/i, ''); // (official)? (music)? video\n track = track.replace(/\\s*\\(\\s*of+icial\\s*\\)/i, ''); // (official)\n track = track.replace(/\\s*\\(\\s*[0-9]{4}\\s*\\)/i, ''); // (1999)\n track = track.replace(/\\s+\\(\\s*(HD|HQ)\\s*\\)$/, ''); // HD (HQ)\n track = track.replace(/\\s+(HD|HQ)\\s*$/, ''); // HD (HQ)\n track = track.replace(/\\s*video\\s*clip/i, ''); // video clip\n track = track.replace(/\\s+\\(?live\\)?$/i, ''); // live\n track = track.replace(/\\(\\s*\\)/, ''); // Leftovers after e.g. (official video)\n track = track.replace(/^(|.*\\s)\"(.*)\"(\\s.*|)$/, '$2'); // Artist - The new \"Track title\" featuring someone\n track = track.replace(/^(|.*\\s)'(.*)'(\\s.*|)$/, '$2'); // 'Track title'\n track = track.replace(/^[\\/\\s,:;~-]+/, ''); // trim starting white chars and dash\n track = track.replace(/[\\/\\s,:;~-]+$/, ''); // trim trailing white chars and dash\n\n return {artist: artist, track: track};\n }", "function renameImgWithEXIF(imgPath, img, cwd){\n return exif.read(imgPath).then((data) => {\n console.log(img + ': ' + data.image.ImageDescription);\n }).catch(console.error)\n}", "function fCleanUp() // CLEANS: This function cleans up the data after the previously loaded image\r\n{\r\n expandedImg.innerHTML = \"\";\r\n}", "function getMetadata(metadata) {\n\n var metadataHtml=d3.select(\"#sample-metadata\");\n // clean metadata tabel if data exists\n metadataHtml.html(\"\");\n // and append current sample metadata to html\n Object.entries(metadata).forEach(([key, value]) => metadataHtml.append(\"p\").text(`${key}: ${value}`)\n );\n}", "function parseMetadata(lines) {\n var retVal = {};\n lines.each(function (line) {\n line = line.replace(config.metadataMarker, '');\n line = line.compact();\n if (line.has('=')) {\n var firstIndex = line.indexOf('=');\n retVal[line.first(firstIndex)] = line.from(firstIndex + 1);\n }\n });\n\n // NOTE: Some metadata is added in generateHtmlAndMetadataForFile().\n\n // Merge with site default metadata\n Object.merge(retVal, postFormatter.siteMetadata, false, function(key, targetVal, sourceVal) {\n // Ensure that the file wins over the defaults.\n console.log('overwriting \"' + sourceVal + '\" with \"' + targetVal);\n return targetVal;\n });\n\n return retVal;\n }", "function cleanDocs(docs) {\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (doc._deleted) {\n delete doc._attachments; // ignore atts for deleted docs\n } else if (doc._attachments) {\n // filter out extraneous keys from _attachments\n var atts = Object.keys(doc._attachments);\n for (var j = 0; j < atts.length; j++) {\n var att = atts[j];\n doc._attachments[att] = pick(doc._attachments[att],\n ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);\n }\n }\n }\n }", "[REMOVE_IMAGE] (state,image) {\n state.images.splice(state.images.indexOf(image),1);\n if((state.featuredImage != undefined) && (image.name === state.featuredImage.name)) {\n state.featuredImage = undefined;\n }\n }", "function deduplicteMediaItems() {\n\n}", "function tagToFalse(tag){\n switch(tag){\n case 'filtro_fecha_captura':\n filtros.min_taken_date = undefined;\n filtros.max_taken_date = undefined;\n break;\n case 'filtro_titulo':\n filtros.text = undefined;\n break;\n case 'filtro_etiquetas':\n filtros.tags = undefined;\n break;\n case 'filtro_localizacion':\n filtros.bbox = undefined;\n break;\n case 'filtro_fecha_subida':\n filtros.min_upload_date = undefined;\n filtros.max_upload_date = undefined;\n break;\n case 'filtro_visitas':\n filtros.extras = undefined;\n break;\n }\n query_type = \"none\";\n getImages();\n}" ]
[ "0.599326", "0.59427935", "0.56942064", "0.55306035", "0.54907334", "0.5378107", "0.536386", "0.53288746", "0.5325352", "0.5261711", "0.5199587", "0.51725966", "0.51718825", "0.5148193", "0.5137347", "0.50965416", "0.50762236", "0.5048262", "0.5035441", "0.50271004", "0.50232524", "0.49971688", "0.49745595", "0.49666306", "0.49568203", "0.4943274", "0.4942993", "0.49298745", "0.49198866", "0.4886768", "0.4871085", "0.48543954", "0.48336953", "0.48331022", "0.48326033", "0.48287836", "0.48261696", "0.48177105", "0.48082334", "0.48081538", "0.48062152", "0.47973484", "0.47937986", "0.47928506", "0.47668508", "0.4739756", "0.47269467", "0.47160324", "0.47134238", "0.4694888", "0.4691579", "0.46822277", "0.46660063", "0.46658814", "0.46658814", "0.46644065", "0.46623594", "0.46597248", "0.4648085", "0.46475172", "0.46427506", "0.4640845", "0.46034247", "0.46032086", "0.46010068", "0.45952886", "0.45945078", "0.45877513", "0.4585262", "0.4569857", "0.45412418", "0.4539887", "0.4535866", "0.45358217", "0.45351398", "0.4523222", "0.45204663", "0.45133445", "0.45127326", "0.4511728", "0.45048913", "0.45048913", "0.4504263", "0.44994694", "0.44959447", "0.44812766", "0.4477236", "0.44569698", "0.44522515", "0.44516307", "0.4450013", "0.44453734", "0.44404194", "0.44403985", "0.44391987", "0.4438692", "0.4437936", "0.44365346", "0.44355175", "0.4429374" ]
0.5274883
9
Origin of coordinates is topright.
function posToBrgDst(x1, y1, x2, y2) { var dx = x2-x1; var dy = y2-y1; return [ Math.atan2(dx,dy), Math.sqrt(dx*dx+dy*dy) ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get right() {\n // x is left position + the width to get end point\n return this.x + this.width\n }", "reverse() {\n return Point(\n 0 - this.x,\n 0 - this.y\n )\n }", "moveToBottomRight([horizontal, vertical], context) {\n return context.changeHorizontalPosition(horizontal, 1) + (+vertical - 1);\n }", "set TopRight(value) {}", "putRight(b, xOffset = 0, yOffset = 0) {\n let a = this\n b.x = (a.x + a.width) + xOffset\n b.y = (a.y + a.halfHeight - b.halfHeight) + yOffset\n }", "get leftEnd () {\n return this.position.x - this.size.x / 2;\n }", "function Origin(){\n this.x = midWidth;\n this.y = midHeight;\n}", "origin() {\n\t\treturn { x: -3, y: -4 };\n\t}", "set BottomRight(value) {}", "get true_position() { return this.position.copy().rotateX(Ribbon.LATITUDE).rotateZ(Earth.rotation).rotateZ(Ribbon.LONGITUDE); }", "getRight(pos){\n const x = pos[0]+1;\n const y = pos[1];\n // pretty sure all grids are square, but..\n // do check of specific row anyway, w/e\n return [x,y];\n }", "right() {\n switch (this.f) {\n case NORTH:\n this.f = EAST;\n break;\n case SOUTH:\n this.f = WEST;\n break;\n case EAST:\n this.f = SOUTH;\n break;\n case WEST:\n default:\n this.f = NORTH;\n }\n }", "get TopRight() {}", "rtnStartPos() {\n this.x = this.plyrSrtPosX;\n this.y = this.plyrSrtPosY;\n}", "getRightHandPoint(){\n return this.position.transformPoint(this.rightHand.cx(), this.rightHand.cy());\n }", "get right(): number {\n return this.position.x + this.width\n }", "function getOriginY() {\n\t\treturn Math.min(this.originY, this.finalY);\n\t}", "function coord_CurrentRightDown (x,y,h,w)\n {\n var mapCoord = {};\n \n mapCoord[1] = (y + h -1)/ h;\n mapCoord[0] = (x + w -1) / w;\n \n mapCoord[0] = Math.floor(mapCoord[0]-1);\n mapCoord[1] = Math.floor(mapCoord[1]-1);\n \n return mapCoord; \n }", "function rightAscension(lon, lat) { return atan(sin(lon) * cos(e) - tan(lat) * sin(e), cos(lon)); }", "function coord_CornerDownRight (x,y,h,w)\n {\n var mapCoord = {};\n \n mapCoord[0] = (x + w) / w;\n mapCoord[1] = (y + h)/ h;\n \n mapCoord[0] = Math.floor(mapCoord[0]-1);\n mapCoord[1] = Math.floor(mapCoord[1]-1);\n \n return mapCoord;\n }", "set RightCenter(value) {}", "get BottomRight() {}", "get origin() {\n return { x: this.x, y: this.y };\n }", "_getOrigin() {\n const isLtr = !this._dir || this._dir.value == 'ltr';\n const position = this.position;\n let originPosition;\n if (position == 'above' || position == 'below') {\n originPosition = { originX: 'center', originY: position == 'above' ? 'top' : 'bottom' };\n }\n else if (position == 'before' ||\n (position == 'left' && isLtr) ||\n (position == 'right' && !isLtr)) {\n originPosition = { originX: 'start', originY: 'center' };\n }\n else if (position == 'after' ||\n (position == 'right' && isLtr) ||\n (position == 'left' && !isLtr)) {\n originPosition = { originX: 'end', originY: 'center' };\n }\n else if (typeof ngDevMode === 'undefined' || ngDevMode) {\n throw getMatTooltipInvalidPositionError(position);\n }\n const { x, y } = this._invertPosition(originPosition.originX, originPosition.originY);\n return {\n main: originPosition,\n fallback: { originX: x, originY: y }\n };\n }", "get adjustedY() { return this.y - this.originY }", "get RightCenter() {}", "get position() {\n return this._boundingBox.topLeft.rotate(this.rotation, this.pivot);\n }", "getEndPosition() {\n const radius = (this.tunnelWidth - 1) / 2\n if (this.direction === 'NORTH') {\n return { x: this.x + radius, y: this.y }\n } else if (this.direction === 'SOUTH') {\n return { x: this.x + radius, y: (this.y + this.height) - 1 }\n } else if (this.direction === 'EAST') {\n return { x: (this.x + this.width) - 1, y: this.y + radius }\n } else if (this.direction === 'WEST') {\n return { x: this.x, y: this.y + radius }\n }\n return null\n }", "function coord_CurrentRight (x,y,h,w)\n {\n var mapCoord = {};\n \n mapCoord[1] = (y)/ h;\n mapCoord[0] = (x + w -1) / w;\n \n mapCoord[0] = Math.floor(mapCoord[0]-1);\n mapCoord[1] = Math.floor(mapCoord[1]-1);\n \n return mapCoord; \n }", "function coord_DownRight (x,y,h,w)\n {\n var mapCoord = {};\n \n mapCoord[0] = (x + w -1) / w;\n mapCoord[1] = (y + h)/ h;\n \n mapCoord[0] = Math.floor(mapCoord[0]-1);\n mapCoord[1] = Math.floor(mapCoord[1]-1);\n \n return mapCoord; \n }", "function setPosition() {\n\n var bottom = window.innerHeight-startBottom-y;\n bottom = (bottom>0)? bottom : 0;\n bottom = ((bottom+elem[0].getBoundingClientRect().height)<window.innerHeight)?bottom:(window.innerHeight-elem[0].getBoundingClientRect().height-40);\n\n var right = window.innerWidth-startRight-x;\n right = (right>0)? right : 0;\n right = ((right+elem[0].getBoundingClientRect().width)<window.innerWidth)?right:(window.innerWidth-elem[0].getBoundingClientRect().width);\n\n elem.css({\n bottom: bottom + 'px',\n right: right + 'px'\n });\n }", "get top() {\n // origin is at top left so just return y\n return this.y\n }", "get topLeft() {\n return new Vector(this._x, this._y);\n }", "function alignRight (){\n\t\t\tvar selectedGr = canvas.getActiveGroup();\n\t\t\tif (!selectedGr) return;\n\t\t\tvar pointC = new fabric.Point(0,0);\n\t\t\tvar deltaX = 0;\n\t\t\tvar firstObjW = 0;\n\t\t\tvar coordY1 = 0;\n\t\t\tvar coordY2 = 0;\n\t\t\ti=0;\n\t\t\tselectedGr.forEachObject(function(obj) {\n\t\t\t\ti++;\n\t\t\t\tobj.setOriginX('left');\n\t\t\t\tobj.setOriginY('top');\t\t\n\t\t\t\t//console.log( i + ' Point Left = ' + obj.left );\n\t\t\t\tvar boundObj = obj.getBoundingRect();\n\t\n\t\t\t\tif (i > 1 ){\n\t\t\t\t\tpointC.x = obj.left;\n\t\t\t\t\tdeltaX = boundObj.left - coordY1;\n\t\t\t\t\t//console.log(i + ' DELTA= ' + deltaX);\n\t\t\t\t\tpointC.x -= deltaX+boundObj.width-firstObjW;\t\n\t\t\t\t\tpointC.y = obj.top;\n\t\t\t\t\tobj.setLeft(pointC.x); \n \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcoordY1 = boundObj.left;\n\t\t\t\t\tfirstObjW = boundObj.width;\n\n\t\t\t\t}\n\t\t\t\t\t//console.log(' LEFT N '+i + ' = ' + boundObj.left + ' LEFT1 = ' + coordY1 );\n\t\t\t});\n\t\t\t\tcanvas.discardActiveGroup();\n\t\t\t\tselectGrpParam();\n\t\t\t\tcanvas.renderAll();\n\t\t}", "get left() {\n // origin is at top left so just return x\n return this.x\n }", "function moveRight() {\n undraw()\n const reachedRightEdge = curT.some(index => (curPos + index) % width === width - 1)\n if (!reachedRightEdge) curPos += 1\n if (curT.some(index => squares[curPos + index].classList.contains('taken'))) {\n // if the position has been taken by another figure, push the tetromino back\n curPos -= 1 \n }\n draw()\n }", "get plotAreaMarginRight() {\n return this.i.of;\n }", "moveToRight([horizontal, vertical], context) {\n return context.changeHorizontalPosition(horizontal, 1) + vertical;\n }", "baseDirection() {\n return new Vector(Math.sign(x), Math.sign(y));\n }", "function getQuadrant(){\n var ns = \"S\";\n var ew = \"W\";\n var concat;\n\n if(pos.lat > 45.523063){\n ns = \"N\";\n }\n if(pos.lng > -122.667677){\n ew = \"E\";\n }\n concat = ns + ew;\n return concat;\n}", "getStartingPosition(){\n return [this.x,this.y];\n }", "moveRight() {\n this.shinobiPos.x += 30\n }", "function moveRight() {\n undraw();\n //check if any of the tetromino's cells are on the right edge\n const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % width === width-1);\n //move tetromino to the right if none of its cells is at the left edge\n if(!isAtRightEdge) {\n currentPosition += 1;\n }\n \n //move tetromino one column to the right if any of its cells try and occupy a 'taken' cell\n if(currentTetromino.some(index=> squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1; \n }\n\n draw();\n }", "outsideCanvas() {\n if(this.y > 400){\n this.y = 380;\n }\n if(this.x > 400){\n this.x = 400;\n }\n else if(this.x < 0){\n this.x = 0;\n }\n }", "right(pos) { return this.d*pos+1; }", "_computePositionFromOrigin(origin) {\n const dir = this._getLayoutDirection();\n if ((dir == 'ltr' && origin <= 0) || (dir == 'rtl' && origin > 0)) {\n return 'left-origin-center';\n }\n return 'right-origin-center';\n }", "function handleReversedCoordinates(){\n if (complexScope.aLeftUpper > complexScope.aRightBottom) {\n complexScope.changer = complexScope.aLeftUpper;\n complexScope.aLeftUpper = complexScope.aRightBottom;\n complexScope.aRightBottom = complexScope.changer;\n // if you create the new area from right to left\n }\n if (complexScope.bLeftUpper < complexScope.bRightBottom) {\n complexScope.changer = complexScope.bLeftUpper;\n complexScope.bLeftUpper = complexScope.bRightBottom;\n complexScope.bRightBottom = complexScope.changer;\n // if you create the new area from right to left\n }\n }", "function rightAscension(l, b) { return atan(sin(l) * cos(e) - tan(b) * sin(e), cos(l)); }", "function rightAscension(l, b) { return atan(sin(l) * cos(e) - tan(b) * sin(e), cos(l)); }", "getUp(pos){\n const x = pos[0];\n const y = pos[1]-1;\n return [x,y];\n }", "resetPos() {\n this.x = 2 * this.rightLeft;\n this.y = 4 * this.upDown + 54;\n }", "get position() {\n\t\t\treturn {x: this.x, y: this.y};\n\t\t}", "getAdjacent() {\n return [\n new Coord([this.x + 1, this.y]), // RIGHT >\n new Coord([this.x - 1, this.y]), // LEFT >\n new Coord([this.x, this.y - 1]), // UP >\n new Coord([this.x, this.y + 1]), // DOWN >\n ];\n }", "get adjustedX() { return this.x - this.originX }", "get left () {\n return this.pos.x - this.size.x / 2;\n }", "static get DIRECTION_RIGHT() {\n return \"right\";\n }", "function calculateCoords() {\n\t\tvar localNE = this.ne;\n\t\tvar remoteNE = this.connection.originPort == this ? this.connection.destinationPort.ne : this.connection.originPort.ne;\n\t\tif (remoteNE.x == localNE.x) {\n\t\t\tthis.side = remoteNE.y > localNE.y ? BOTTOM : TOP;\n\t\t} else {\n\t\t\tif (this.connection.middlePoint == LEFT_CORNER) {\n\t\t\t\tif (localNE.x > remoteNE.x) {\n\t\t\t\t\tthis.side = LEFT;\n\t\t\t\t} else {\n\t\t\t\t\tthis.side = localNE.y > remoteNE.y ? TOP : BOTTOM;\n\t\t\t\t}\n\t\t\t} else if (this.connection.middlePoint == RIGHT_CORNER) {\n\t\t\t\tif (localNE.x > remoteNE.x) {\n\t\t\t\t\tthis.side = localNE.y > remoteNE.y ? TOP : BOTTOM;\n\t\t\t\t} else {\n\t\t\t\t\tthis.side = RIGHT;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar slope = (remoteNE.y - localNE.y) / (remoteNE.x - localNE.x);\n\t\t\t\tif (slope < 1 && slope > -1) {\n\t\t\t\t\tthis.side = localNE.x > remoteNE.x ? LEFT : RIGHT;\n\t\t\t\t} else {\n\t\t\t\t\tthis.side = localNE.y > remoteNE.y ? TOP : BOTTOM;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "setRightTop(_point) {\n this.right = _point.x;\n this.top = _point.y;\n this.updateSecondaryValues();\n return this;\n }", "moveTo() {\n return this.offsetTo.apply(this, arguments);\n }", "function moverobotRight () {\n var pos = robotObj[0].offsetLeft;\n if (pos >= 700) {\n console.log(pos);\n pos = 600;\n }\n pos += 100;\n robotObj[0].style.left = pos + 'px';\n}", "toRightOf(p1, p2, p)\n {\n let nx = p2.getY() - p1.getY()\n let ny = p1.getX() - p2.getX() \n let vx = p.getX() - p1.getX()\n let vy = p.getY() - p1.getY()\n let s = nx * vx + ny * vy\n return s < 0\n }", "_reverseY() {\n this._dy = -this._dy;\n }", "cornerCoords(b,t){\n let bTL = {x: b.x-b.width/2, y: b.y-b.height/2};\n let bBR = {x: b.x+b.width/2, y: b.y+b.height/2};\n let tTL = t.getTopLeft();\n let tBR = t.getBottomRight();\n let minX = Math.min(bTL.x, tTL.x);\n let maxX = Math.max(bBR.x, tBR.x);\n let minY = Math.min(bTL.y, tTL.y);\n let maxY = Math.max(bBR.y, tBR.y);\n\n //ordered from top left, clockwise\n return [{x:minX, y:minY},\n {x:maxX, y:minY},\n {x:maxX, y:maxY},\n {x:minX, y:maxY}];\n }", "returnToLastPos() {\n if (this.previousPos) {\n this.x = this.previousPos.x\n this.y = this.previousPos.y\n }\n }", "setStartPosition() {\n this.x = DrunkenSailor.canvas.width - 20;\n this.y = 560;\n }", "getRightTile() {\n\t\treturn (this.position + this.sizeW - 1);\n\t}", "function clipspaceMousePos() {\n return [2.0 * mousePosition[0] / canvas.width - 1.0, -2.0 * mousePosition[1] / canvas.height + 1.0]\n}", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "setOrigin (event) {\n const { left, top, width, height } = options.getBoundingClientRect(event)\n const origin = {\n x: left + Math.floor(width / 2),\n y: top + Math.floor(height / 2)\n }\n this.setState({ origin })\n }", "function drawOrigin() {\n context.beginPath()\n context.strokeStyle = '#9E9E9E'\n context.moveTo(origin.x, 0)\n context.lineTo(origin.x, canvas.height)\n context.moveTo(0, origin.y)\n context.lineTo(canvas.width, origin.y)\n context.closePath()\n context.stroke()\n context.strokeStyle = '#000000'\n }", "get position() {\n return {\n x: this.x,\n y: this.y\n };\n }", "coordinates () {\n return this._position.coordinates()\n }", "get coords() {\n return [this.x, this.y];\n }", "function PolarCoordinates() {\r\n}", "get Center() { return [this.x1 + (0.5 * this.x2 - this.x1), this.y1 + (0.5 * this.y2 - this.y1)]; }", "get Center() { return [this.x1 + (0.5 * this.x2 - this.x1), this.y1 + (0.5 * this.y2 - this.y1)]; }", "towards(x, y) {\n // Get the position vector (r) for this.position->(x,y)\n const r = [\n toInt(x) - this.position[0],\n toInt(y) - this.position[1],\n ];\n // Get the position vector angle\n const heading = Math.atan2(r[0], r[1]);\n // Return heading in degrees\n return heading * 180 / Math.PI;\n }", "moveToTopRight([horizontal, vertical], context) {\n return context.changeHorizontalPosition(horizontal, 1) + (+vertical + 1);\n }", "rotateVertical() {\r\n\t\tif (this.isUpright) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar x = this.height\r\n\t\t\tthis.height = this.length;\r\n\t\t\tthis.length = x;\r\n\t\t\treturn;\r\n\t\t}\r\n }", "function upperRightCorner(x,y,w,h,angle){\n var coor = new Array();\n \n angle = toRadians(angle);\n var angle_off = Math.tan(h/w);\n var distance = (Math.sqrt(Math.pow(w,2) +Math.pow(h,2)))/2;\n var angle_rel = angle + angle_off;\n var relPoint = toRect(distance,angle_rel);\n \n var cx = x + (w/2);\n var cy = y + (h/2);\n \n coor[0] = cx + relPoint[0];\n coor[1] = cy + relPoint[1];\n \n return coor;\n }", "function upperRightCorner(x,y,w,h,angle){\n var coor = new Array();\n \n angle = toRadians(angle);\n var angle_off = Math.tan(h/w);\n var distance = (Math.sqrt(Math.pow(w,2) +Math.pow(h,2)))/2;\n var angle_rel = angle + angle_off;\n var relPoint = toRect(distance,angle_rel);\n \n var cx = x + (w/2);\n var cy = y + (h/2);\n \n coor[0] = cx + relPoint[0];\n coor[1] = cy + relPoint[1];\n \n return coor;\n }", "function addCoordinates() {\n L.control.coordinates({\n position: \"bottomright\",\n decimals: 2,\n enableUserInput: false,\n useLatLngOrder: true\n }).addTo(mapImpl);\n }", "getExit(position, direction) {\n const pos = {x: position.x, y: position.y}\n if (direction === 'NORTH') {\n pos.y = this.y - 1\n } else if (direction === 'SOUTH') {\n pos.y = this.y + this.height\n } else if (direction === 'WEST') {\n pos.x = this.x - 1\n } else {\n pos.x = this.x + this.width\n }\n return pos\n }", "get tileOrigin() {\n return { x: Math.round(this.x / 8), y: Math.round(this.y / 8) }\n }", "getScreenCoordinatesTLCorner(){\n var cornersInScreenCoordinates = []\n var cornersInPSCoordinates = this.getCorners();\n for (var i = 0; i < 4; i++){\n cornersInScreenCoordinates[i] = this.parent.getScreenCoordinatesFromPSCoordinates(cornersInPSCoordinates[i]);\n }\n\n var cornersSortedByLeftness = DrawingArea.sortCornersByLeftness(cornersInScreenCoordinates)\n\n var leftCorners = cornersSortedByLeftness.slice(0,2)\n var cornersSortedByTopness = DrawingArea.sortCornersByTopness(leftCorners)\n var upperLeftCorner = cornersSortedByTopness[0];\n return upperLeftCorner\n }", "function getAbsoluteRight(elem) {\n return elem.getBoundingClientRect().right;\n}", "function getAbsoluteRight(elem) {\n return elem.getBoundingClientRect().right;\n}", "get position() {\n return {x: this.x, y: this.y}\n }", "rightTurn() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "get cursorY() {\n\t\treturn this._cursorPos[1];\n\t}", "function SpreadFromRight(tree) {\n\n return Spread(+tree.getAttribute(\"data-x\") + 1,\n +tree.getAttribute(\"data-y\"));\n\n}", "function physics2Origin(point){ return [point[0] - Globals.origin[0], point[1] - Globals.origin[1]]; }", "function setOrigin(ctx, axis) {\n\tctx.translate(-1 * axis.xLeftRange + axis.blank,\n\t\t-1 * axis.yRightRange + axis.blank);\n}", "function moveRight()\r\n {\r\n undraw()\r\n const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % 10 === 9)\r\n\r\n if(!isAtRightEdge)\r\n currentPosition +=1\r\n if(currentTetromino.some(index => squares[currentPosition + index].classList.contains('taken')))\r\n currentPosition -= 1\r\n draw()\r\n }", "function move_right(val){\n if (parseInt(right_pad.getAttribute(\"y\"))+val>=0 && parseInt(right_pad.getAttribute(\"y\"))+val+parseInt(right_pad.getAttribute(\"height\")) <= parseInt(canvas.getAttribute(\"height\"))){\n\tright_pad.setAttribute(\"y\",parseInt(right_pad.getAttribute(\"y\"))+val);\n }\n}", "get abs() {\n return Math.hypot(this.x, this.y);\n }", "function position(eyePosition) {\n if (distanceBetweenPoints(eyePosition, mousePosition) <= eyeMoveRadius) {\n return mousePosition;\n}\n\n// funcion que permite que los ojos sigan el cursor para esto se usa vectores unitarios\nconst vector = getVector(eyePosition, mousePosition);\n return {\n x: eyePosition.x + eyeMoveRadius * Math.sin(vector.x),\n y: eyePosition.y + eyeMoveRadius * Math.sin(vector.y),\n };\n}", "_updatePosFromBottom() {\n this._topLeft = this._bottomRight.$subtract(this._size);\n this._updateCenter();\n }", "bpos()\n\t{\n\t\treturn [this.x + DIRS[this.dir][0], this.y + DIRS[this.dir][1]];\n\t}", "setMiddleCanva(){\n this.setX(this.canvas.width/2);\n this.setY(this.canvas.height/2);\n this.setDx(0);\n this.setDy(0);\n }", "function checkRight(targetOffset,tooltipLayerStyleLeft,tooltipOffset,windowSize,tooltipLayer){if(targetOffset.left+tooltipLayerStyleLeft+tooltipOffset.width>windowSize.width){// off the right side of the window\ntooltipLayer.style.left=\"\".concat(windowSize.width-tooltipOffset.width-targetOffset.left,\"px\");return false;}tooltipLayer.style.left=\"\".concat(tooltipLayerStyleLeft,\"px\");return true;}" ]
[ "0.61981183", "0.6040655", "0.60228854", "0.6018739", "0.5838677", "0.5786062", "0.576662", "0.57398444", "0.5737066", "0.5726313", "0.5708169", "0.5681476", "0.567363", "0.56489915", "0.5635827", "0.5630266", "0.5628155", "0.56176966", "0.5615726", "0.55727214", "0.5563737", "0.55625993", "0.5560276", "0.55451417", "0.5534193", "0.5512128", "0.54880905", "0.5462137", "0.5448435", "0.54423624", "0.5422646", "0.5411657", "0.5388455", "0.5383129", "0.5374435", "0.5338143", "0.5333641", "0.53325546", "0.5321283", "0.5316293", "0.5309999", "0.5295618", "0.52947867", "0.52826554", "0.5279802", "0.52786934", "0.5272219", "0.5264925", "0.5264925", "0.5260709", "0.52561975", "0.5250178", "0.52441454", "0.5229972", "0.52256674", "0.52206534", "0.5212807", "0.52105594", "0.52026355", "0.5199786", "0.5192695", "0.5191801", "0.51849866", "0.5182046", "0.5180047", "0.51768714", "0.51738274", "0.5171244", "0.51627946", "0.5162138", "0.5157732", "0.5154962", "0.5154707", "0.5154591", "0.5147243", "0.5147243", "0.5139149", "0.5136614", "0.5124878", "0.5118045", "0.5118045", "0.51169723", "0.51107633", "0.51045054", "0.5103209", "0.5102279", "0.5102279", "0.5099809", "0.5098097", "0.509785", "0.5094183", "0.50898206", "0.5086345", "0.50754625", "0.50732654", "0.5068339", "0.5063375", "0.5063035", "0.5061679", "0.5061138", "0.50596666" ]
0.0
-1
Given an angle in Artemis' format, return the angle in degrees as a prettyprinted string.. Pi becomes 0 (north) Pi/2 becomes 90 (east) 0 becomes 180 (south) Pi/2 becomes 270 (west) Pi becomes 360 (north)
function radianToDegrees(rad) { if (isNaN(rad)) { return 'N/A'; } var degrees = 180 + ( 180*rad/Math.PI ); return degrees.toFixed(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function format_angle(x, pos_char, neg_char, is_html, a) {\n if (!a)\n a = expand_angle(Math.abs(x), settings.degrees_format);\n var s = '';\n var symbols = [is_html? '&deg;' : '', \"'\", '\"'];\n var space = is_html? '&nbsp;' : ' ';\n for (var i = 0; i <= settings.degrees_format; i++)\n s += (i == 0? '' : space) + a[i] + symbols[i];\n if (x < 0)\n if (neg_char)\n s += space + neg_char;\n else\n s = '-' + s;\n else if (pos_char)\n s += space + pos_char;\n\n return s;\n}", "function printAngle(name, value) {\n\tif (!debug) { return; }\n\tconsole.log(name.toString() + \": \" + (value*(180/pi)).toString());\n}", "function angle(n) {\n\treturn (n - 2) * 180\n}", "function format_angle_dp(_x, is_html) {\n if (settings.degrees_format == 0)\n return settings.round_bearing(_x) + '&deg;';\n\n // each additional component (minutes or seconds) counts as two decimal places\n var dp = settings.decimal_places;\n var a;\n var x = Math.abs(_x);\n var d = Math.floor(x);\n x = 60 * (x - d);\n dp -= 2;\n if (dp < 0) dp = 0;\n if (settings.degrees_format == 1) {\n a = [d, _round(x, dp)];\n } else {\n var m = Math.floor(x);\n x = 60 * (x - m);\n dp -= 2;\n if (dp < 0) dp = 0;\n a = [d, m, _round(x, dp)];\n }\n\n return format_angle(_x, null, null, is_html, a);\n}", "function angles(angle) {\n var rad = ((angle * Math.PI) / 180);\n document.write(\"<p> Seno: \" + Math.sin(rad) + \"</p>\");\n document.write(\"<p> Coseno: \" + Math.cos(rad) + \"</p>\");\n document.write(\"<p> Tangente: \" + Math.floor(Math.tan(rad)) + \"</p>\");\n}", "static simplifyAngle(angle) {\n return angle % (2*Math.PI);\n }", "function fixangle(a)\n{\n return a - 360.0 * (Math.floor(a / 360.0));\n}", "function determineAngle(angle) {\n\treturn angle * Math.PI / 180;\n}", "function angleOfType(angle) {\n if(angle < 90) {\n return \"Acute angle.\";\n }\n if(angle === 90) {\n return \"Right angle.\";\n }\n if(angle < 180) {\n return \"Obtuse angle.\";\n }\n return \"Straight angle.\";\n}", "function toDegrees(angle){return angle*180/Math.PI}", "function getActualAngle(angle) {\n if (angle >= 0 && angle < 270) {\n // rotates the 0 point to where player craft renders\n return angle + 90;\n } else if (angle >= 270) {\n return angle - 270;\n } else if (angle >= -90 && angle < 0) {\n return 360 + angle - 270;\n } else {\n return 360 + angle + 90;\n }\n }", "static getAngleLabel(n) {\n\t\tlet alphabet = ['alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta', 'eta', 'theta', 'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi', 'omicron', 'pi', 'rho', 'sigma', 'tau', 'upsilon', 'phi', 'chi', 'psi', 'omega'];\n\t\treturn n <= 23 ? alphabet[n] : alphabet[Math.floor(n / 23) - 1] + alphabet[n % 23];\n\t}", "degreesToString() {\n let str = '';\n let degrees = this.degrees;\n\n degrees.sort((a, b) => a.degree - b.degree + (a.accidentalClass - b.accidentalClass) * 0.1);\n\n for (let d of degrees.filter(x => x.included)) {\n switch (d.source) {\n case DegreeSource.QUALITY:\n str += d + ' ';\n break;\n case DegreeSource.ALTERATION:\n str += `alt-${d} `;\n break;\n case DegreeSource.ALT_AUG:\n str += `aug-${d} `;\n break;\n case DegreeSource.ALT_DIM:\n str += `dim-${d} `;\n break;\n case DegreeSource.ALT_HDIM:\n str += `hdim-${d} `;\n break;\n case DegreeSource.SUSPENSION:\n str += `sus-${d} `;\n break;\n }\n }\n\n str += '\\n excl: ';\n for (let d of degrees.filter(x => !x.included)) {\n switch (d.source) {\n case DegreeSource.NO:\n str += `no-${d} `;\n break;\n case DegreeSource.SUSPENDED_THIRD:\n str += `no-${d}(sus) `;\n break;\n default:\n str += `excl-alt-${d} `;\n break;\n }\n }\n\n return str;\n }", "function getActualAngle(angle) {\n if (angle >= 0 && angle < 270) {\n // rotates the 0 point to where player craft renders\n return angle + 90;\n } else if (angle >= 270) {\n return angle - 270;\n } else if (angle >= -90 && angle < 0) {\n return 360 + angle - 270;\n } else {\n return 360 + angle;\n }\n}", "function torad(angleInDegrees) {\n return Math.PI * angleInDegrees / 180;\n}", "function getActualAngle(angle) {\r\n if (angle >= 0 && angle < 270) {\r\n // rotates the 0 point to where player craft renders\r\n return angle + 90;\r\n } else if (angle >= 270) {\r\n return angle - 270;\r\n } else if (angle >= -90 && angle < 0) {\r\n return 360 + angle - 270;\r\n } else {\r\n return 360 + angle + 90;\r\n }\r\n }", "function formatBearing(deg) {\n\tvar val = Math.floor((deg / 22.5) + .5);\n\t// var arr = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW'];\n\tvar arr = ['N','NE','E','SE','S','SW','W','NW'];\n\treturn arr[(val % 8)];\n}", "function degrees(value) {\n\t return value * 90 + 'deg';\n\t}", "function getActualAngle(angle) {\r\n if (angle >= 0 && angle < 270) {\r\n // rotates the 0 point to where player craft renders\r\n return angle + 90;\r\n } else if (angle >= 270) {\r\n return angle - 270;\r\n } else if (angle >= -90 && angle < 0) {\r\n return 360 + angle - 270;\r\n } else {\r\n return 360 + angle;\r\n }\r\n}", "function normalizeAngle(angle) {\n if (angle === undefined) {\n return undefined;\n }\n\n return (angle % 360 + 360) % 360;\n }", "function radians_to_direction(angle) {\n\n if (angle <= (-0.875 * Math.PI) || angle > (0.875 * Math.PI)) {\n return 1;\n }\n else if (angle > (-0.875 * Math.PI) && angle <= (-0.625 * Math.PI)) {\n return 2;\n }\n else if (angle > (-0.625 * Math.PI) && angle <= (-0.375 * Math.PI)) {\n return 3;\n }\n else if (angle > (-0.375 * Math.PI) && angle <= (-0.125 * Math.PI)) {\n return 4;\n } \n else if (angle > (-0.125 * Math.PI) && angle <= (0.125 * Math.PI)) {\n return 5;\n }\n else if (angle > (0.125 * Math.PI) && angle <= (0.375 * Math.PI)) {\n return 6;\n }\n else if (angle > (0.375 * Math.PI) && angle <= (0.625 * Math.PI)) {\n return 7;\n }\n else if (angle > (0.625 * Math.PI) && angle <= (0.875 * Math.PI)) {\n return 0;\n }\n\n}", "function convertAngle(angle) {\n if (angle < 0) \n angle += 2 * Math.PI;\n angle = 2 * Math.PI - angle;\n angle += Math.PI / 2;\n if (angle >= 2 * Math.PI)\n angle -= 2 * Math.PI;\n return angle;\n}", "function calculateNiceAngle(angle) {\n\t\tangle = deg(angle);\n\t\tangle = 360 - angle;\n\t\tangle -= 270;\n\t\tangle = angle % 360;\n\t\tif(angle < 0) angle += 360;\n\n\t\treturn angle;\n\t}", "angle() {\n return this.get(Math.PI * 2, true)\n }", "function angleForPercentage(percentage) {\n var PI = 3.1415; // 2 * PI = 360\n return (percentage * 1.61 * PI);\n}", "function getCardinal(angle) {\n //easy to customize by changing the number of directions you have \n var directions = 8;\n \n var degree = 360 / directions;\n angle = angle + degree/2;\n \n if (angle >= 0 * degree && angle < 1 * degree)\n return \"norte\";\n if (angle >= 1 * degree && angle < 2 * degree)\n return \"noreste\";\n if (angle >= 2 * degree && angle < 3 * degree)\n return \"este\";\n if (angle >= 3 * degree && angle < 4 * degree)\n return \"sudeste\";\n if (angle >= 4 * degree && angle < 5 * degree)\n return \"sur\";\n if (angle >= 5 * degree && angle < 6 * degree)\n return \"suroeste\";\n if (angle >= 6 * degree && angle < 7 * degree)\n return \"oeste\";\n if (angle >= 7 * degree && angle < 8 * degree)\n return \"noroeste\";\n //Should never happen: \n return \"norte\";\n}", "function minutesToAngle(minutes) {\n return (360 / 60) * minutes;\n}", "function minutesToAngle(minutes) {\n return (360 / 60) * minutes;\n}", "function todeg(angleInRadians) {\n return 180 * angleInRadians / Math.PI;\n}", "function getRotation() {\n return 'rotate(' + rotation +', ' + c + ', ' + c + ')';\n }", "function getCardinal(angle) {\r\n //easy to customize by changing the number of directions you have\r\n // thank you basarat from github\r\n var directions = 8;\r\n\r\n var degree = 360 / directions;\r\n angle = angle + degree/2;\r\n\r\n if (angle >= 0 * degree && angle < 1 * degree)\r\n return \"N\";\r\n if (angle >= 1 * degree && angle < 2 * degree)\r\n return \"NE\";\r\n if (angle >= 2 * degree && angle < 3 * degree)\r\n return \"E\";\r\n if (angle >= 3 * degree && angle < 4 * degree)\r\n return \"SE\";\r\n if (angle >= 4 * degree && angle < 5 * degree)\r\n return \"S\";\r\n if (angle >= 5 * degree && angle < 6 * degree)\r\n return \"SW\";\r\n if (angle >= 6 * degree && angle < 7 * degree)\r\n return \"W\";\r\n if (angle >= 7 * degree && angle < 8 * degree)\r\n return \"NW\";\r\n //Should never happen:\r\n return \"N\";\r\n}", "getAngle(matrix) {\n var values = matrix.split('(')[1],\n values = values.split(')')[0],\n values = values.split(',');\n\n var a = values[0]; // 0.866025\n var b = values[1]; // 0.5\n\n return Math.round(Math.atan2(b, a) * (180/Math.PI));\n }", "function formatDirection(degree){\r\n\t\t\t\t\t\t\tvar direction = '';\r\n\t\t\t\t\t\t\tif(degree >= 337.5 && degree <= 22.5){\r\n\t\t\t\t\t\t\t\tdirection = 'Northerly';\r\n\t\t\t\t\t\t\t}else if(degree > 22.5 && degree < 67.5){\r\n\t\t\t\t\t\t\t\tdirection = 'North Easterly';\r\n\t\t\t\t\t\t\t}else if(degree >= 67.5 && degree <= 112.5){\r\n\t\t\t\t\t\t\t\tdirection = 'Easterly';\r\n\t\t\t\t\t\t\t}else if(degree > 112.5 && degree < 157.5){\r\n\t\t\t\t\t\t\t\tdirection = 'South Easterly';\r\n\t\t\t\t\t\t\t}else if(degree >= 157.5 && degree <= 202.5){\r\n\t\t\t\t\t\t\t\tdirection = 'Southerly';\r\n\t\t\t\t\t\t\t}else if(degree > 202.5 && degree < 247.5){\r\n\t\t\t\t\t\t\t\tdirection = 'South Westerly';\r\n\t\t\t\t\t\t\t}else if(degree >= 247.5 && degree <= 292.5){\r\n\t\t\t\t\t\t\t\tdirection = 'Westerly';\r\n\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\tdirection = 'North Westerly';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn direction;\r\n\t\t\t\t\t\t}", "function rotate(degrees) {\n\n return ' rotate(' + degrees + 'deg) ';\n\n }", "function toTextualDescription(degree){\r\nvar sectors = ['Northerly','North Easterly','Easterly','South Easterly','Southerly','South Westerly','Westerly','North Westerly'];\r\n degree += 22.5;\r\n var which = parseInt(degree / 45);\r\n return sectors[which%8];\r\n}", "function angleMod(angle) {\n return (angle % 360 + 540) % 360 - 180;\n}", "get angleUnit() {\n if (this._useDegrees) return \"degrees\";\n else return \"radians\"\n }", "function secondsToAngle(seconds) {\n return (360 / 60) * seconds;\n}", "function secondsToAngle(seconds) {\n return (360 / 60) * seconds;\n}", "function secondsToAngle(seconds) {\n return (360 / 60) * seconds;\n}", "function torad(degrees) {\n \treturn degrees * Math.PI / 180;\n }", "function degrees(xx) {return (180.0 * xx / Math.PI);}", "function angle(v) {\n return Math.atan2(-v[1], v[0]) * 180 / Math.PI;\n}", "function toCompass(angle){\n return -1*angle;\n }", "function toCompass(angle){\n return -1*angle;\n }", "function angleToScreen(angle) {\n if (angle == 0)\n return 0;\n return Math.PI / 2 - angle;\n}", "function toDegrees(angle){\n return (angle * 180)/Math.PI;\n}", "function getAngle(d) {\n //alert(\"angle\");\n // Offset the angle by 90 deg since the '0' degree axis for arc is Y axis, while\n // for text it is the X axis.\n var thetaDeg = (180 / Math.PI * (arc.startAngle()(d) + arc.endAngle()(d)) / 2 - 90);\n // If we are rotating the text by more than 90 deg, then \"flip\" it.\n // This is why \"text-anchor\", \"middle\" is important, otherwise, this \"flip\" would\n // a little harder.\n return (thetaDeg > 90) ? thetaDeg - 180 : thetaDeg;\n }", "_degreeToRadian(angle) {\n return angle * Math.PI / 180;\n }", "calculateAngle() {\n const normalizedData = this.gameOver ? ((this.time / -this.terminalVelocity) / 2) + 0.5 : this.time / -this.terminalVelocity;\n this.angle = this.gameOver ? normalizedData * -135 + 90 : normalizedData * -45;\n }", "degreeToRad(angle){\n return Math.PI*angle/180;\n }", "function getTurnAngle() {\n if(up) {\n if(right) {\n return 45;\n }\n if(left) {\n return 315;\n }\n }\n \n if(down) {\n if(right) {\n return 135;\n }\n if(left) {\n return 225;\n }\n \n return 180;\n }\n \n if(right) {\n return 90;\n }\n if(left) {\n return 270;\n }\n \n return 0;\n }", "function angleMod(angle) {\n\t return (angle % 360 + 540) % 360 - 180;\n\t}", "function angleMod(angle) {\n\t return (angle % 360 + 540) % 360 - 180;\n\t}", "function convertAngle(c,x) { return c._useDegrees ? (x*pi/180) : x; }", "function getDirection(angle) {\n var directions = ['North', 'North-West', 'West', 'South-West', 'South', 'South-East', 'East', 'North-East'];\n return directions[Math.round(((angle %= 360) < 0 ? angle + 360 : angle) / 45) % 8];\n }", "function cleanAngle(angle) {\n\treturn angle - 2 * Math.PI * Math.trunc(angle * i2pi + Math.sign(angle) * .5);\n}", "function rads (x) { \n return Math.PI * x / 180; \n }", "function asinDeg(x) {\n return Math.asin(x) * 360.0 / PIx2;\n}", "function fixangr(a)\n{\n return a - (2 * Math.PI) * (Math.floor(a / (2 * Math.PI)));\n}", "function radiansToDegrees(angle){\n return angle * 180 / Math.PI;\n }", "function rad2deg(θ) {\r\n return θ * 180 / π;\r\n}", "function angle(d){\n var a=(d.startAngle+ d.endAngle)*90/Math.PI-90;\n return a>90 ? a-180 : a;\n }", "function getAngleCardinal(angle) {\n //get special case for N, x <11.25 and x > 348.75\n if (angle < 11.25 || angle > 348.75)\n return \"N\";\n\n var cardinal = \"nil\";\n\n //check angle range and assign a value to cardinal.\n var cardinalPointsArr\n = [ \"NE\", \"ENE\", \"E\", \"ESE\", \"SE\", \"SSE\", \"S\", \"SSW\", \"SW\", \"WSW\", \"W\", \"WNW\", \"NW\", \"NNW\"];\n\n currCardinalRange = [\n {\"min\": 11.25, \"max\": 33.75, \"car_point\": \"NNE\"}\n ];\n\n var step = 22.5;\n cardinalPointsArr.forEach(function (cardinal) {\n currCardinalRange.push(\n { \"min\": currCardinalRange[currCardinalRange.length - 1].max + 0.01,\n \"max\": currCardinalRange[currCardinalRange.length - 1].max + step,\n \"car_point\": cardinal});\n }\n );\n\n currCardinalRange.forEach(function (cardinalRange) {\n if (angle >= cardinalRange.min && angle <= cardinalRange.max) {\n cardinal = cardinalRange.car_point;\n }\n })\n\n return cardinal;\n}", "function toDegrees (angle) {\n return angle * (180 / Math.PI);\n}", "_getQuadrant(angle) {\n if (angle > 270) {\n return 4;\n }\n else if (angle > 180) {\n return 3;\n }\n else if (angle > 90) {\n return 2;\n }\n else {\n return 1;\n }\n }", "function degree(d,r) {\nvar Degreex = d * 3.14 / 180;\nconsole.log (Degreex); \n}", "function toDegree() {\n current_input = current_input * (180 / Math.PI);\n displayCurrentInput();\n}", "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "function toDegrees (angle) {\n return angle * (180 / Math.PI);\n}", "function toDegrees(angle){\r\n\t\treturn angle * (180/Math.PI);\r\n\t}", "function angle(d) {\n\t\t\t\tvar a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n\t\t\t\treturn a > 90 ? a - 180 : a;\n\t\t\t}", "function missingAngle(angle1, angle2) {\n let triangle = 180;\n let res = triangle - (angle1 + angle2);\n if (res == 90 ) {\n return \"right\";\n } else if (res < 90 ){\n return \"acute\" ;\n }else{\n return \"obtuse\" ;\n }\n}", "function dtr(degrees){\r\n\t\treturn degrees * (Math.PI/180);\r\n\t}", "function triangle(...angles) {\n if (angles.some(isZero) || angles.reduce(sum) !== 180) {\n return 'invalid';\n } else if (angles.some(isNinetyDegrees)) {\n return 'right';\n } else if (angles.some(isGreaterThanNinety)) {\n return 'obtuse'\n } else {\n return 'acute';\n }\n}", "function angleForSpeed(speed) {\n var PI = 3.1415; // 2 * PI = 360\n var degree = 0;\n\n if (speed <= 1) { // 0 - 0.27\n degree = (0 * 0.27) + (speed * 0.27);\n }\n else if (speed <= 4) { // 0.27 - 0.54\n degree = (1 * 0.27) + ((speed - 1) / 3 * 0.27);\n }\n else if (speed <= 8) { // 0.54 - 0.81\n degree = (2 * 0.27) + ((speed - 4) / 4 * 0.27);\n }\n else if (speed <= 24) { // 0.81 - 1.08\n degree = (3 * 0.27) + ((speed - 8) / 16 * 0.27);\n }\n else if (speed <= 50) { // 1.08 - 1.35\n degree = (4 * 0.27) + ((speed - 24) / 26 * 0.27);\n }\n else { // 1.35 - 1.61\n degree = (5 * 0.27) + ((speed - 50) / 50 * 0.26);\n }\n\n return degree * PI;\n}", "angle () {\n \treturn Math.atan2(this.y,this.x );\n }", "angle() {\n return Math.atan2(this.y, this.x);\n }", "function todeg(radians) {\n \treturn radians * 180 / Math.PI;\n }", "function degToRad(angle)\r\n{\r\n\treturn angle*(Math.PI)/180;\r\n}", "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "angle() {\n // Use simulated time.\n const clocksPerRevolution = Math.round(this.machine.clockHz / (RPM / 60));\n return (this.machine.tStateCount % clocksPerRevolution) / clocksPerRevolution;\n }", "function toradians(deg)\n{\n return deg * Math.PI / 180.0;\n}", "getCorrectiveRotation() {\n const slope = (this.initialPosition.top - 50) / (this.initialPosition.left - 50);\n return Math.atan(slope);\n }", "function deg2text(deg, letters) {\n var letter;\n if (deg < 0) {\n letter = letters[1]\n } else {\n letter = letters[0]\n }\n\n var position = Math.abs(deg);\n\n var degrees = Math.floor(position);\n\n position -= degrees;\n position *= 60;\n\n var minutes = Math.floor(position);\n\n position -= minutes;\n position *= 60;\n\n var seconds = Math.floor(position * 100) / 100;\n\n return degrees + \"° \" + minutes + \"' \" + seconds + \"\\\" \" + letter;\n }", "function rad2deg(θ) {\n return θ * 180 / π;\n }", "function angle(d) {\n\t\t var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n\t\t return a > 90 ? a - 180 : a;\n\t\t}", "function angle(d) {\n\t\t var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n\t\t return a > 90 ? a - 180 : a;\n\t\t}", "function degCompass (num) {\n if (num === undefined) {\n return '';\n } else {\n const direction = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N'];\n const degrees = Math.trunc((num/22.5) + 0.5);\n return direction[degrees];\n }\n}", "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "function toRads(num){\n\treturn num * Math.PI / 180;\n}", "function degreesToRads(val) {\n return val * Math.PI / 180;\n}", "function createATriangle(height, theCharacter) {\n\n height = typeof height !== 'undefined' ? height : 5;\n theCharacter = typeof theCharacter !== 'undefined' ? theCharacter : '$';\n\n var theTriangle = '';\n for (var row = 0; row < height; row++) {\n theTriangle += repeatCharacter(theCharacter, row + 1) + \"\\n\";\n }\n return theTriangle;\n}", "function radsToDegrees(val){\n return val * 180/Math.PI;\n\n}", "function toDegrees(angle) {\n return angle * (180 / Math.PI);\n }", "_normalizeAngle(angle) {\n angle = angle % 360;\n\n if (angle < 0) {\n angle += 360;\n }\n\n return angle;\n }" ]
[ "0.7214117", "0.702506", "0.69961894", "0.6696864", "0.6584051", "0.65414405", "0.6492527", "0.649025", "0.6393008", "0.6379663", "0.6338646", "0.6286558", "0.6284792", "0.626988", "0.6259668", "0.62576634", "0.624441", "0.6235654", "0.62316", "0.6228806", "0.622699", "0.6181964", "0.61805683", "0.6168669", "0.6120511", "0.6110822", "0.60948503", "0.60948503", "0.6083482", "0.6073187", "0.6069744", "0.60455024", "0.60155785", "0.6010984", "0.6004258", "0.59635353", "0.5940435", "0.59404117", "0.59404117", "0.59404117", "0.5927158", "0.5899706", "0.58937675", "0.58887714", "0.58887714", "0.5887477", "0.5877606", "0.5876161", "0.58702683", "0.58655643", "0.58644754", "0.5855628", "0.584944", "0.584944", "0.5848136", "0.584453", "0.58441263", "0.5828399", "0.5813396", "0.58022684", "0.57951933", "0.57896066", "0.57833004", "0.57715786", "0.57709783", "0.57661843", "0.5755779", "0.57493347", "0.5745409", "0.5745409", "0.57407033", "0.57406545", "0.57328534", "0.5732329", "0.573055", "0.5723765", "0.57203627", "0.5716177", "0.5710283", "0.5703379", "0.5701371", "0.5689335", "0.5689335", "0.5689335", "0.5673758", "0.5667684", "0.5660178", "0.56570756", "0.5649216", "0.5642267", "0.5642267", "0.56392354", "0.5634724", "0.5634724", "0.5634724", "0.56302345", "0.5626338", "0.56221133", "0.56186616", "0.56094444", "0.56088704" ]
0.0
-1
Function to find numbers with repeated digits
function findRepeatedDigit(number) { let tempNumber = number; if (number > 10) { let lastDigit = number % 10; number = parseInt(number / 10); let firstDigit = number % 10; if (lastDigit == firstDigit) return tempNumber; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sameDigits(a,b) {\n //solution here\n}", "function findDigits(n) {\n let digitArray = n.toString();\n let count = 0;\n for (let i = 0; i <= digitArray.length; i += 1) {\n if (n % digitArray[i] === 0) {\n count++;\n }\n }\n return count;\n}", "function findDigits(n) {\r\n var k=n.toString();\r\n \r\n var count=0\r\n for(var i=0;i<k.length;i++){\r\n if(n%k[i]==0)\r\n {\r\n count++\r\n }\r\n \r\n }\r\n return count\r\n \r\n }", "function areAllDigitsSame()\n{\n var sameDigits = true;\n for (var i=0; i<numInString.length; i++)\n {\n if (numInString[0] != numInString[i])\n {\n sameDigits = false;\n }\n }\n return sameDigits;\n}", "function findDigits(n) {\n let num = n * 10;\n let count = 0;\n while (num > 9) {\n num = Math.floor(num / 10);\n let lastDigit = num % 10;\n if (n % lastDigit === 0) count++;\n }\n // if (n % (n % (10**(n.length-1))) === 0) count++\n return count;\n}", "function findRepeat(numbers) {\n\n let floor = 1;\n let ceiling = numbers.length - 1;\n\n while (floor < ceiling) {\n\n // Divide our range 1..n into an upper range and lower range\n // (such that they don't overlap)\n // lower range is floor..midpoint\n // upper range is midpoint+1..ceiling\n const midpoint = Math.floor(floor + ((ceiling - floor) / 2));\n const lowerRangeFloor = floor;\n const lowerRangeCeiling = midpoint;\n const upperRangeFloor = midpoint + 1;\n const upperRangeCeiling = ceiling;\n\n const distinctPossibleIntegersInLowerRange = lowerRangeCeiling - lowerRangeFloor + 1;\n\n // Count number of items in lower range\n let itemsInLowerRange = 0;\n numbers.forEach(item => {\n\n // Is it in the lower range?\n if (item >= lowerRangeFloor && item <= lowerRangeCeiling) {\n itemsInLowerRange += 1;\n }\n });\n\n if (itemsInLowerRange > distinctPossibleIntegersInLowerRange) {\n\n // There must be a duplicate in the lower range\n // so use the same approach iteratively on that range\n floor = lowerRangeFloor;\n ceiling = lowerRangeCeiling;\n } else {\n\n // There must be a duplicate in the upper range\n // so use the same approach iteratively on that range\n floor = upperRangeFloor;\n ceiling = upperRangeCeiling;\n }\n }\n\n // Floor and ceiling have converged\n // We found a number that repeats!\n return floor;\n}", "function checkDigitDiference(num1, num2) {\n var check = num1 + '' + num2;\n var checkLength = check.length;\n var found = true;\n \n for (var i = 0; i < checkLength; i++) {\n if (+check[i] % 2 === 0){\n continue;\n } else {\n found = false;\n return found;\n }\n }\n return found; \n }", "function findRepeats1(integers){\n\t// sort array in place. Takes O(n log n) time and O(1) space\n\tintegers.sort((a, b) => {\n\t\treturn a - b;\n\t});\n\n\tfor(let i = 0; i < integers.length; i++){\n\t\tif(integers[i] === integers[i - 1]){\n\t\t\treturn integers[i];\n\t\t}\n\t}\n\n\treturn 'Error no duplicates';\n}", "function deDeCheck(tin) {\n // Split digits into an array for further processing\n var digits = tin.split('').map(function (a) {\n return parseInt(a, 10);\n }); // Fill array with strings of number positions\n\n var occurences = [];\n\n for (var i = 0; i < digits.length - 1; i++) {\n occurences.push('');\n\n for (var j = 0; j < digits.length - 1; j++) {\n if (digits[i] === digits[j]) {\n occurences[i] += j;\n }\n }\n } // Remove digits with one occurence and test for only one duplicate/triplicate\n\n\n occurences = occurences.filter(function (a) {\n return a.length > 1;\n });\n\n if (occurences.length !== 2 && occurences.length !== 3) {\n return false;\n } // In case of triplicate value only two digits are allowed next to each other\n\n\n if (occurences[0].length === 3) {\n var trip_locations = occurences[0].split('').map(function (a) {\n return parseInt(a, 10);\n });\n var recurrent = 0; // Amount of neighbour occurences\n\n for (var _i = 0; _i < trip_locations.length - 1; _i++) {\n if (trip_locations[_i] + 1 === trip_locations[_i + 1]) {\n recurrent += 1;\n }\n }\n\n if (recurrent === 2) {\n return false;\n }\n }\n\n return algorithms.iso7064Check(tin);\n}", "function deDeCheck(tin) {\n // Split digits into an array for further processing\n var digits = tin.split('').map(function(a) {\n return parseInt(a, 10);\n }); // Fill array with strings of number positions\n var occurences = [];\n for(var i = 0; i < digits.length - 1; i++){\n occurences.push('');\n for(var j = 0; j < digits.length - 1; j++)if (digits[i] === digits[j]) occurences[i] += j;\n } // Remove digits with one occurence and test for only one duplicate/triplicate\n occurences = occurences.filter(function(a) {\n return a.length > 1;\n });\n if (occurences.length !== 2 && occurences.length !== 3) return false;\n // In case of triplicate value only two digits are allowed next to each other\n if (occurences[0].length === 3) {\n var trip_locations = occurences[0].split('').map(function(a) {\n return parseInt(a, 10);\n });\n var recurrent = 0; // Amount of neighbour occurences\n for(var _i = 0; _i < trip_locations.length - 1; _i++)if (trip_locations[_i] + 1 === trip_locations[_i + 1]) recurrent += 1;\n if (recurrent === 2) return false;\n }\n return algorithms.iso7064Check(tin);\n}", "function checkRoundingDigits(d, i, rm, repeating) {\n var di, k, r, rd;\n\n // Get the length of the first word of the array d.\n for (k = d[0]; k >= 10; k /= 10) --i;\n\n // Is the rounding digit in the first word of d?\n if (--i < 0) {\n i += LOG_BASE;\n di = 0;\n } else {\n di = Math.ceil((i + 1) / LOG_BASE);\n i %= LOG_BASE;\n }\n\n // i is the index (0 - 6) of the rounding digit.\n // E.g. if within the word 3487563 the first rounding digit is 5,\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\n k = mathpow(10, LOG_BASE - i);\n rd = d[di] % k | 0;\n\n if (repeating == null) {\n if (i < 3) {\n if (i == 0) rd = rd / 100 | 0;else if (i == 1) rd = rd / 10 | 0;\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\n } else {\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\n }\n } else {\n if (i < 4) {\n if (i == 0) rd = rd / 1000 | 0;else if (i == 1) rd = rd / 100 | 0;else if (i == 2) rd = rd / 10 | 0;\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\n } else {\n r = ((repeating || rm < 4) && rd + 1 == k || !repeating && rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\n }\n }\n\n return r;\n }", "function checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n}", "function checkRoundingDigits(d, i, rm, repeating) {\n var di, k, r, rd;\n\n // Get the length of the first word of the array d.\n for (k = d[0]; k >= 10; k /= 10) {--i;}\n\n // Is the rounding digit in the first word of d?\n if (--i < 0) {\n i += LOG_BASE;\n di = 0;\n } else {\n di = Math.ceil((i + 1) / LOG_BASE);\n i %= LOG_BASE;\n }\n\n // i is the index (0 - 6) of the rounding digit.\n // E.g. if within the word 3487563 the first rounding digit is 5,\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\n k = mathpow(10, LOG_BASE - i);\n rd = d[di] % k | 0;\n\n if (repeating == null) {\n if (i < 3) {\n if (i == 0) rd = rd / 100 | 0;else\n if (i == 1) rd = rd / 10 | 0;\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\n } else {\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\n }\n } else {\n if (i < 4) {\n if (i == 0) rd = rd / 1000 | 0;else\n if (i == 1) rd = rd / 100 | 0;else\n if (i == 2) rd = rd / 10 | 0;\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\n } else {\n r = ((repeating || rm < 4) && rd + 1 == k ||\n !repeating && rm > 3 && rd + 1 == k / 2) &&\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\n }\n }\n\n return r;\n }", "function checkRoundingDigits(d, i, rm, repeating) {\n var di, k, r, rd;\n\n // Get the length of the first word of the array d.\n for (k = d[0]; k >= 10; k /= 10) --i;\n\n // Is the rounding digit in the first word of d?\n if (--i < 0) {\n i += LOG_BASE;\n di = 0;\n } else {\n di = Math.ceil((i + 1) / LOG_BASE);\n i %= LOG_BASE;\n }\n\n // i is the index (0 - 6) of the rounding digit.\n // E.g. if within the word 3487563 the first rounding digit is 5,\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\n k = mathpow(10, LOG_BASE - i);\n rd = d[di] % k | 0;\n\n if (repeating == null) {\n if (i < 3) {\n if (i == 0) rd = rd / 100 | 0;\n else if (i == 1) rd = rd / 10 | 0;\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\n } else {\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\n }\n } else {\n if (i < 4) {\n if (i == 0) rd = rd / 1000 | 0;\n else if (i == 1) rd = rd / 100 | 0;\n else if (i == 2) rd = rd / 10 | 0;\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\n } else {\n r = ((repeating || rm < 4) && rd + 1 == k ||\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\n }\n }\n\n return r;\n }", "function checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n }", "function checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n }", "function checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n }", "function checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n }", "function checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n }", "function checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n }", "function checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n }", "function numberMind(nDigits, guesses) {\n //because it's stated that we have a unique answer, some\n //shortcut are taken\n var i, j, tmp, tmp1;\n //total count of digits that have guessed right\n var totalMatchingDigits = _.reduce(guesses, function(memo, guess) {\n return guess[1] + memo; \n }, 0);\n console.log('totoal matches: ', totalMatchingDigits);\n \n //digit 0 is the most significant digit\n var digitCandidates = [];\n \n //using our guesses to prune down candidates of each digit\n for(i = 0; i < nDigits; i++) {\n //digits that are guessed for digit[i]\n tmp = _.groupBy(guesses, function(guess) {\n return guess[0].charAt(i); \n });\n\n //Add digits that never showed up in the guesses\n //they make fine search candidates with guess count = 0\n //since we're told there is unique solution, corners are cut here\n // -- Only add when there is only one missing number\n if(_.size(tmp) === 9) {\n for(j = 0; j < 10; j++) {\n if(!tmp[j]) {\n tmp[j] = [];\n }\n }\n }\n //exclude digits that showed up in \"0\" matching cases\n digitCandidates[i] = []; \n _.each(tmp, function(guesses, digit) {\n if(!_.some(guesses, function(guess) {\n return (guess[1] == 0); \n })) {\n digitCandidates[i].push({\n digit: digit, \n guesses: guesses,\n count: guesses.length});\n }\n });\n }\n console.log(digitCandidates);\n console.log(JSON.stringify(digitCandidates));\n //for each digits, counts of matches that are possible from right to left\n var counts = [];\n counts[nDigits] = {0:0}; //boundary condition \n for(i = nDigits - 1; i >= 0; i--) {\n tmp = {};\n _.each(digitCandidates[i], function(candidate) {\n return tmp[candidate.count] = candidate.count;\n });\n //cross product\n tmp1 = {};\n _.each(counts[i + 1], function(c1) {\n _.each(tmp, function(c2) {\n tmp1[c1 + c2] = c1 + c2;\n });\n });\n counts[i] = tmp1;\n }\n\n console.log('counts: ', counts);\n //return;\n\n var maxLoopCount = 1000000;\n var loopCount = 0;\n var answer = [];\n var answerCount = 0; //total matching digits of our count\n var loopCount = 0;\n \n /*\n * search solution recursively\n * \n * @param candidates Candidates for each digit\n * @param digit The current digit of interest \n */\n var searchR = function(candidates, digit) {\n loopCount++;\n if(loopCount > maxLoopCount) {\n console.log('stop loop now');\n console.log(answer);\n console.log(digit);\n return false;\n }\n var digitCandidates = candidates;\n //termination condition\n if(digit >= nDigits) {\n if(answerCount !== totalMatchingDigits) {\n return false;\n } \n else {\n console.log(\"found a potential candidate: \", answer);\n //scan all guesses see if we match\n return _.every(guesses, function(guess) {\n //no need to verify \"0\" guesses, because their\n //digits are excluded in our search\n if(guess[1] === 0) {\n return true;\n }\n \n var nMatches = 0;\n var i;\n for(i = 0; i < nDigits; i++) {\n if(answer[i] === guess[0].charAt(i)) {\n nMatches++;\n }\n }\n //debugger;\n return nMatches === guess[1];\n });\n }\n }\n \n return _.some(digitCandidates[digit], function(guess) {\n answer[digit] = guess.digit;\n answerCount += guess.count;\n //candidates for the search of rest of the digits\n //might be further pruned\n var newCandidates = digitCandidates;\n var isCloned = false;\n var remainCount = totalMatchingDigits - answerCount;\n //it is a count that we can reach\n if(counts[digit +1][remainCount] === remainCount) {\n //adjust remaining matching digits\n _.each(guess.guesses, function(v) {\n var i;\n v[1] -= 1;\n if(v[1] === 0 && digit < nDigits - 1) {\n //a new zero, try to prune the search of following digits\n if(!isCloned) {\n //make a shallow clone\n //if any digit's candidates is modified, a clone will\n //be made on demand\n newCandidates = _.map(digitCandidates, function(candidate) {\n return candidate;\n });\n isCloned = true;\n }\n //prune candidates for the search following this one\n for(i = digit + 1; i < nDigits; i++) {\n tmp = v[0].charAt(i); //exclusion\n newCandidates[i] = _.reject(newCandidates[i], function(val) {\n return val.digit === tmp;\n });\n }\n }\n });\n if(searchR(newCandidates, digit + 1)) {\n //found a solution, terminate\n return true;\n }\n //search down this rout failed, rewind\n _.forEach(guess.guesses, function(v) {\n v[1] += 1;\n });\n }\n //rewind\n answerCount -= guess.count;\n });\n };\n\n var searchResult = searchR(digitCandidates, 0);\n console.log('search result: ', searchResult);\n console.log('loop Count', loopCount);\n return answer.join('');\n}", "function repeatDigit(digit, reps){\n\tlet digits = \"\";\n\tfor(let i = 0; i < reps; i++){\n\t\tdigits = digits + digit.toString();\n\t}\n\treturn digits;\n}", "function iqTestRefactor(numbers) {\n let arrInteger = numbers.split(\" \").map((number) => parseInt(number));\n return arrInteger.filter((x) => x % 2 === 0).length >\n arrInteger.filter((x) => x % 2 !== 0).length\n ? arrInteger.findIndex((x) => x == arrInteger.filter((x) => x % 2 !== 0)) +\n 1\n : arrInteger.findIndex((x) => x == arrInteger.filter((x) => x % 2 === 0)) +\n 1;\n}", "function solution_1 (n) {\r\n function sumSquaresOfDigits (n) {\r\n return String(n)\r\n .split('')\r\n .map(digit => +digit)\r\n .reduce((sum, digit) => sum + digit ** 2, 0);\r\n }\r\n const seen = new Set([n]); // this set is here to detect cycles\r\n let processedN = sumSquaresOfDigits(n) // i introduce this variable here to avoid calculating it twice (in the while loop condition and in the subsequent line)\r\n while (processedN !== 1) {\r\n n = processedN;\r\n if (seen.has(n)) return false;\r\n seen.add(n);\r\n processedN = sumSquaresOfDigits(n);\r\n }\r\n return true;\r\n}", "function squareDigitsSequence(n) {\n let set = new Set([n])\n let dup = false\n\n function newN(num){\n let sum = 0\n let arr = num.toString().split('').map(x=>x**2)\n for(let number of arr){\n sum+= number\n }\n return sum\n }\n\n while(dup === false){\n n = newN(n)\n if(set.has(n)) dup = true\n set.add(n)\n }\n return set.size + 1\n}", "function repeatedCharacter(find) {\n for(let i = 0; i <= find.length; i++){\n for(let m = i+1; m <= find.length; m++){\n if(find[m] === find[i]){\n return find[i].repeat(1);\n }\n }\n }\nreturn false;\n}", "function repdigit(n) {\n let ones = n % 10;\n let tens = Math.floor(n / 10);\n if (ones === tens) {\n return 'Repdigit!';\n }\n return 'No Repdigit!';\n}", "function lottery(str) {\n let testRegex = /[0-9]/;\n let result = \"\";\n\n for (let letter of str) {\n if (testRegex.test(letter)) {\n if (result.indexOf(letter) === -1) {\n result += letter;\n }\n }\n }\n if (result === \"\") return \"One more run!\";\n return result;\n}", "function featured(number) {\n while (true) {\n number += 1;\n\n if (number % 7 === 0 && number % 2 !== 0 && digitsAreUnique(number)) {\n return number;\n }\n }\n}", "function findDigit(a, b) {\n while (Math.floor(b / 10) !== 0) {\n if (b % 10 === a) {\n console.log(\"Yes\");\n return;\n } \n b = Math.floor(b / 10);\n }\n if (b === a) {\n console.log(\"Yes\"); \n } else console.log(\"No\");\n}", "function evenDigsBetween(num1, num2) {\n let resArr = [];\n let resArrFinal = [];\n for (let i = num1; i <= num2; i++) {\n resArr.push(i);\n }\n for (let i = 0; i < resArr.length; i++) {\n let tempNum = resArr[i].toString().split(\"\");\n // for (let j = 0; j < resArr[i].toString().length; j++){\n // if (tempNum)\n // }\n if (tempNum.every((dig) => Number(dig) % 2 === 0)) {\n resArrFinal.push(tempNum.join(\"\"));\n }\n }\n // console.log(resArrFinal);\n if (resArrFinal.length === 0) {\n return \"Such numbers doesn't exist\";\n } else {\n return resArrFinal;\n }\n}", "function hasDiffNumbers(input) {\n let diffNumbers = false;\n // checks the first digit in the number array against the rest of them:\n for (let i = 1; i < input.length; i++) {\n if (input[0] !== input[i]) {\n diffNumbers = true;\n }\n }\n return diffNumbers;\n}", "function main() {\n \n var t = parseInt(readLine());\n \n for(var a0 = 0; a0 < t; a0++){\n var n = parseInt(readLine());\n var digits = (\"\"+n).split(\"\");\n //console.log(digits);\n var cnt = 0;\n for (i = 0; i < digits.length; i++)\n {\n if (n % digits[i] == 0 && digits[i] != 0)\n {\n cnt++;\n }\n \n }\n console.log(cnt);\n //console.log(n);\n \n }\n \n \n\n}", "function findAll(sum,n){\n let result=[];\n let lowerLimit='1';\n for(let i=n;i>1;i--){\n lowerLimit+='0';\n }\n let upperLimit='9';\n for(let i=n;i>1;i--){\n upperLimit+='9';\n }\n for(let i=upperLimit;i>=lowerLimit;i--){\n if(sumOfDigits(i)==sum.toString() && digitsInDecreasingOrder(i)){\n result.push(i);\n }\n }\n return result;\n}", "function solution(digits){\n let arr = digits.split('');\n let slice = arr.slice(arr.length - 5, arr.length);\n\n for (let i = arr.length - 6; i > 0; i--) {\n let newSlice = arr.slice(i, i + 5);\n if (Number(newSlice.join('')) > Number(slice.join(''))) {\n slice = newSlice;\n } \n }\n return Number(slice.join(''));\n}", "function findDuplicate(numberArray) {\n var matches = [];\n for (var _i = 0, numberArray_1 = numberArray; _i < numberArray_1.length; _i++) {\n var num = numberArray_1[_i];\n if (matches.indexOf(num) == -1)\n matches.push(num);\n else\n return num;\n }\n return undefined;\n}", "function findMultipleDuplicates(numberArray) {\n var matches = [];\n var duplicates = [];\n for (var _i = 0, numberArray_2 = numberArray; _i < numberArray_2.length; _i++) {\n var num = numberArray_2[_i];\n if (matches.indexOf(num) == -1)\n matches.push(num);\n else\n duplicates.push(num);\n }\n return duplicates;\n}", "function findNoOfDigits(x) {\n return x.toString().length;\n}", "function calculateCheckDigit(number) {\n var N = new Array(11);\n for (var i = 0; i < N.length; i++) {\n N[i] = number.substring(i, i + 1);\n }\n\n var check = 11 - ((N[0] * 8 + N[1] * 4 + N[2] * 3 + N[3] * 2 + N[4] * 7 + N[5] * 6 + N[6] * 5 + N[7] * 7 + N[8] * 4 + N[9] * 3 + N[10] * 2) % 11);\n\n if (check > 9) {\n return check - 10;\n } else {\n return check;\n }\n}", "function howManyRepeated(str){\n let sum = 0;\n const strArr = str.toLowerCase().split(\"\").sort().join(\"\").match(/(.)\\1+/g);\n return strArr;\n}", "function isThereRepeted () {\n var repeatedNumbers = []; //Array para ir guardando los repetidos.\n\n for (let i = 0, j, isOnARRAY; i < ARRAY.length-1; i++){\n isOnARRAY = false; // salir antes del While si hay un repetido\n j = i+1; //Mirarmos repetidos a partir de los que ha hemos comprobado.\n if (repeatedNumbers.indexOf (ARRAY[i]) === -1) { //Si el número ya está en los repetidos no hace falta buscarlos ni guardarlo\n while (j < ARRAY.length && isOnARRAY === false){ //Recorremos el array hasta que encontremos repetido o el final del array\n if (ARRAY[i] === ARRAY[j]) { // Si encontramos repetido se guarda y salimos del bucle.\n isOnARRAY = true;\n repeatedNumbers.push(ARRAY[i]);\n } else {\n j++;\n }//end if\n }//end while\n }//end if\n }//end for\n\n return (repeatedNumbers);\n}//end function", "function evenNumbers(num1, num2) {\r\n\r\nfor (var i = 0; i<=num2; i++) {\r\n if (num1<=i && i%2==0) {\r\nvar exist = false;\r\n var newDigit = i%10;\r\n var newNum = (i-newDigit)/10;\r\n var str = \"\" + newNum;\r\n var length = str.length;\r\n for (var f=0; f<=length; f++) {\r\n if ((newNum%10)%2===0) {\r\n exist = false;\r\n break;\r\n }\r\n var newDigit2 = newNum%10;\r\n newNum = (newNum-newDigit2)/10;\r\n console.log(i);\r\n }\r\n }\r\n }\r\n}", "function powerfulDigitCounts() {\n var count = 0;\n //we only need to search 1 through 9, anything above 10 is hopeless\n var base, exp, val, digit;\n for (base = 1; base <= 9; base++) {\n val = base;\n exp = 1;\n digit = 1;\n while (val >= digit && val < digit * 10) {\n count++;\n val *= base;\n exp++;\n digit *= 10;\n\n }\n }\n return count;\n}", "function findRepeats(integers){\n\n\tconst set = new Set();\n\tconst duplicates = new Set();\n\n\tfor(let i = 0; i < integers.length; i++){\n\t\tif(set.has(integers[i])){\n\t\t\tduplicates.add(integers[i])\n\t\t}\n\n\t\tset.add(integers[i]);\n\t}\n\n\treturn duplicates;\n}", "function findSequence (n, start) {\n const result = [];\n let count = start;\n\n while (result.length < n) {\n const digitsSum = `${count}`.split('').reduce((acc, item) => acc + parseInt(item), 0);\n\n if (count % digitsSum === 0) result.push(count);\n\n count++;\n }\n\n return result;\n}", "function isDupBits(/*String:digit string for checking*/ digit, /*int:current index of recursive function*/curIdx){\n if(curIdx == digit.length) {\n return false;//return false after checking the last bit of the digit string\n }\n var curBit = digit[curIdx];\n for(var i = curIdx+1;i<digit.length;i++) {\n if(curBit == digit[i]) {\n return true;\n }\n }\n curIdx++;\n if(isDupBits(digit,curIdx)){//check the bubbled result of sub function\n return true;\n }else{\n return false;\n };\n}", "function repeatedString(s, n) {\n let numA = s.split('').filter(x => x === 'a').length;\n if (Number.isInteger(n / s.length)) {\n return n / s.length * numA;\n } else {\n let extra = n - (Math.floor(n / s.length) * s.length);\n let plus = 0;\n s.split('').forEach((ele, i, a) => { \n if (i < extra && ele === 'a') {\n plus++;\n console.log(plus);\n } \n })\n return Math.floor(n / s.length) * numA + plus;\n }\n}", "function allRepeats() { \n for (var i = 1; i < str.length; i++) {\n if (str.charAt(i) === first) {\n return 0;\n }\n }\n }", "function allRepeats() { \n for (var i = 1; i < str.length; i++) {\n if (str.charAt(i) === first) {\n return 0;\n }\n }\n }", "function twice(number) {\n if (/^(\\d+)\\1$/.test(`${number}`)) {\n return number;\n }\n return number * 2;\n}", "function repeatedFind (str) {\n\t\tconst repeated = str.match(/(.)\\1+/gi);//. any character, \\1 match the first parenthesized pattern \n\t\treturn repeated; \n\t}", "function generateNumber(arr, n) {\n let a = arr.find(num => num === n);\n if (!a) return n;\n else \n let values = [];\n let cool = null;\n\n for (let i = 1; i <= 9; i++) {\n for (let j = 9; j >= 1; j--) {\n if (i + j === n) {\n values.push(parseInt(`${i}${j}`));\n }\n }\n }\n\n for (let i = 0; i < values.length; i++) {\n if (!arr.includes(values[i])) {\n cool = values[i];\n break;\n }\n }\n return cool;\n }", "function digitnPowers(n) {\n // Good luck!\n let powers = (new Array(9)).fill(0).map((_, idx) => idx ** n);\n let digits = new Array(n).fill(0);\n digits[digits.length - 1] = 2;\n\n const rolodex = function(arr) {\n let place = arr.length - 1;\n if (arr[place] < 9) {\n arr[place] += 1;\n return;\n }\n\n while (arr[place] === 9 && place > 0) place--;\n if (place === 0 && arr[0] === 9) {\n arr[place] = 1;\n arr.push(0);\n }\n else {\n arr[place] += 1;\n }\n place++;\n while (place < arr.length) {\n arr[place] = 0;\n place++;\n }\n return;\n };\n\n let LIMIT = 9 ** n;\n for (let i = 9, addLimit = 9 ** n; i < LIMIT;) {\n LIMIT += addLimit;\n i = (i * 10) + 9;\n }\n\n let resultSum = 0;\n for (let i = 2; i <= LIMIT; i++) {\n let test = digits.reduce((acc, num) => acc + (num ** n), 0);\n if (i === test) {\n resultSum += test;\n\n }\n rolodex(digits);\n }\n console.log(resultSum);\n return resultSum;\n}", "function findPassword() {\n let count = 0\n for (let i = 165432; i <= 707912; i++) {\n if (adjacentDigits(i) && doesNotDecrease(i)) {\n count++\n }\n }\n return count\n}", "function digitsOfNumber(nr) {\n\tvar arr=[];\n\tvar arrInv=[];\n\tvar dubluraNr=nr;\n\twhile(dubluraNr!=0) {\n\t\tarr.push(dubluraNr%10);\n\t\tdubluraNr=parseInt(dubluraNr/10);\n\t}\n\tfor(let i=arr.length-1; i>=0; --i) {\n\t\tarrInv.push(arr[i]);\n\t}\n\treturn arrInv;\n}", "function digits(num) {\r\n var ctr = 0;\r\n while (num) {\r\n ctr += 1;\r\n num = Math.floor(num / 10);\r\n }\r\n return ctr;\r\n }", "function findUniques(a){\n let result = []\n for (num of a){\n let match = false;\n for (unum of result){\n if (num == unum){\n match = true;\n }\n }\n if (!match){\n result.push(num);\n }\n }\n return result;\n}", "function is_increasing_digits_Sequence(num) {\n\n var arr_num = ('' + num).split('');\n\n for (var i = 0; i<arr_num.length - 1; i++) {\n\n if (parseInt(arr_num[i]) >= parseInt(arr_num[i+1]))\n\n return false;\n }\n \n }", "function findNumPasswords(lower, upper) {\n let sum = 0;\n\n // Convert the number to string?\n // Given current lower/upper, may not have to.\n for (let i = lower; i <= upper; i++) {\n const numLength = String(i).length;\n\n if (numLength > 6 || numLength != String(lower).length || numLength != String(upper).length) {\n console.log('Input is outside of range, trying next number.');\n return;\n }\n\n let previous = String(i).charAt(0);\n let adjacentFound = false;\n let incrementingDigits = true;\n let digitCountArr = [];\n let digitCount = 1;\n\n // We also need to reset everything once we reach each digit...\n const end = String(i).length - 1;\n for (let digit = 1; digit < String(i).length; digit++) {\n\n // Check for adjacent digit is equivalent or digits incrementing.\n const value = String(i).charAt(digit);\n\n // If this is the first adjacent Found, just set it to true and continue.\n if (previous == value) {\n adjacentFound = true;\n digitCount++;\n }\n else if (previous > value) {\n // The digits are not incrementing from left to right, this number is no\n // longer eligible. Add a multiplier value depending on the decrementing digit to\n // further optimize between the input ranges.\n incrementingDigits = false;\n\n let multiplier = 10000;\n for (let i = 1; i < digit; i++ ) {\n multiplier = multiplier / 10;\n }\n\n if (multiplier > 100) {\n i += multiplier;\n }\n break;\n }\n else if (previous != value) {\n // We can now push the digitCount to the digitCountArr.\n digitCountArr.push(digitCount);\n digitCount = 1;\n }\n\n previous = value;\n\n if (digit == end) {\n digitCountArr.push(digitCount);\n }\n }\n\n // See either of these conditions failed, then it is an invalid password. For Part Two, another check\n // is required to see if adjacent digits are not part of a larger group of digits.\n if (!adjacentFound || !incrementingDigits || !digitCountArr.includes(2)) {\n continue;\n }\n\n console.log('Eligible Password: ' + i);\n sum++;\n\n }\n return sum;\n}", "function checkRepeats() {\n var v_ctr;\n for (v_ctr=0; v_ctr<7; v_ctr++) {\n/* console.log(\"340 [\" + v_ctr + \"] [\" +\n a_scaleNotes[v_ctr].substr(0,1) + \"] [\" +\n a_scaleNotes[(v_ctr + 1) % 7].substr(0,1) + \"]\");\n*/\n if (a_scaleNotes[v_ctr].substr(0,1) == a_scaleNotes[(v_ctr + 1) % 7].substr(0,1))\n return true;\n }\n return false;\n}", "function checkNum(array){\r\n let notint=0;\r\n\r\n for(number of array){\r\n\r\n \r\n\r\n if(number >= 0 && number <= 9){ //checks if digit is a number\r\n \r\n }\r\n else {\r\n notint++; //increases if the array value is not an integer, \r\n }\r\n }\r\n if(notint > 0){ //if greater than 0 than its not an integer due to the count\r\n return false\r\n }\r\n else{\r\n return true\r\n }\r\n}", "function printDuplicateNumber(arr) {\n var i, j;\n for (i = 0; i < arr.length; i++) {\n for (j = i + 1; j < arr.length; j++) {\n if (arr[i] === arr[j])\n document.write(\"Repeated Elements are :\" + arr[i] + \"<br>\");\n }\n }\n}", "function areAllDigitsOdd2(n) {\r\n \r\n if(!( n % 2)) {\r\n return false;\r\n }\r\n \r\n let flag = false;\r\n \r\n if(Math.abs(n) < 10) {\r\n flag = true;\r\n }\r\n\r\n if(!flag) {\r\n return isAllDigitsOdd2( Math.floor(n / 10) );\r\n }\r\n \r\n return true;\r\n}", "function evenDigitsOnly(n) {\n let arr = n.toString().split(\"\");\n return arr.every(x => x % 2 === 0)\n}", "function getReducedNumber(number, digit) {\n console.log(\"Remove \" + digit + \" from \" + number);\n let newNumber = 0;\n\n //flag to make sure we do not exclude repeated digits, in case there is 44\n let repeatFlag = false;\n while(number > 0) {\n let t = number % 10;\n\n //assume in loop one we found 1 as smallest, then we will not add one to the new number at all\n if (t != digit) {\n newNumber = (newNumber * 10) + t;\n } else if (t == digit) {\n if (repeatFlag) {\n console.log(\"Repeated min digit \" + t + \"found. Store is : \" + store);\n store = (store * 10) + t;\n console.log(\"Repeated min digit \" + t + \"added to store. Updated store is : \" + store);\n //we found another value that is equal to digit, add it straight to store, it is\n //guaranteed to be minimum\n } else {\n // skip the digit because its added to the store, in main method, set flag so\n // if there is repeated digit then this method add them directly to store\n repeatFlag = true;\n }\n }\n number = Math.floor(number/10);\n }\n console.log(\"Reduced number is : \" + newNumber);\n return newNumber;\n }", "function unusedDigits(...args) {\n let completeNums = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']\n let allNums = []\n \n args.forEach( num => {\n \n })\n\n let answer = completeNums.filter(num => allNums.indexOf(num) < 0).join('')\n return \n}", "function findDuplicateCharacters(input) {\n}", "function findDistinctNumbers(a) { \n return a.filter((num, i) => i === a.indexOf(num));\n}", "function oddSubstringsMS(str) {\n let count = 0;\n while (str.length > 0) {\n for (let i = 0; i < str.length; i++) {\n let currentNum = str.slice(0,i+1);\n if (/[13579]/.test(currentNum.substr(-1))) {count++;}\n }\n str = str.replace(/^./, '');\n }\n return count;\n}", "function findDupe(string) { \n var dupeCheck = /(.)\\1/gi; // look for duplicated characters (character immediately followed by itself)\n var repeatTest = dupeCheck.test(string); // tests if dupe exists in string T/F\n if (repeatTest !== true) { // if doesn't exist\n counter++; // increase counter by 1\n console.log(\"counter is \" + counter);\n } \n }", "function ricerca(arr,num) {\n var i = 0;\n while (i < arr.length) {\n if (num == arr[i]) {\n return true;\n }\n i++\n }\n return false;\n}", "function missing_digits(n) {\n if (n < 10) {\n return 0;\n }\n let last = n % 10;\n let rest = Math.floor(n/10);\n return Math.max(0, last - (rest % 10) - 1) + missing_digits(rest);\n}", "function NumRepeat(Num){\n\t\t\tvar letra;\n\t\t\tfor(var j=0;j<Texto.length;j++){\n\t\t\t\tletra = Texto.substring(j, j+1);\n\t\t\t\tif(MyArray[letra]==Num){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function findTwins(arr) {\n\tif (arr.length === 0) return null;\n\tlet count = {}; \n\tlet ones = 0; //we want to return null if elements don't repeat\n \n\tfor (let i = 0; i < arr.length; i++) { \n\t let num = arr[i];\n\t if (count[num] === undefined) {\n\t\tcount[num] = 0;\n\t } \n\t count[num]++;\n\t} \n\t //if value of count is 2, returns that key\n\tfor (let key in count) {\t \n\t \tif (count[key] === 2) { \n\t\t\treturn parseInt(key);\n\t\t} else {\n\t\t\tif (count[key] === 1) { //{3:1, 2: 1, 1: 1, 4: 1, 5:1}\n\t\t\tones++ //if there are no repeats { 0: 1, 1: 1, 3: 2, 4: 1, 6: 3 }\n\t\t\t//console.log(`these are ${ones}`)\n\t\t\t}\n\t \t}\n\t//if keys added up to the same number as length, we know all the values were 1\n\t}\n\t if (ones === arr.length) {\n\t\treturn null\n\t} \n}", "function featured(number) {\n let counter = number + 1;\n \n while (true) {\n if ((counter % 7 === 0) && (counter % 2 !== 0) && (digitsNotSame(counter))) {\n return counter;\n } else if (counter >= 9876543201) {\n return 'No number meets the requirements.';\n } else counter += 1;\n }\n}", "function evenDigitsOnly(n) {\n return String(n).split(\"\").every(x=>x%2===0)\n}", "function findUnique(numbers) {\n for (el of numbers) {\n if (numbers.lastIndexOf(el) === numbers.indexOf(el)){\n return el\n }\n }\n }", "function checkDigit () {\n c = 0;\n for (i = 0; i < nif.length - 1; ++i) {\n c += Number(nif[i]) * (10 - i - 1);\n }\n c = 11 - (c % 11);\n return c >= 10 ? 0 : c;\n }", "missingNumber(arr, n) {\n const check = {};\n arr.sort((a, b) => a - b);\n const mySet = new Set(arr);\n let k = 1;\n for (let item of mySet) {\n if (item > 0) {\n if (item !== k) {\n break;\n } else {\n k++;\n }\n }\n }\n return k;\n }", "function repeatedString(s, n){\n\n if (!(s === 'a')){\n let repetition = [];\n for(let i=0; i < n; i++){\n repetition.push(s);\n }\n \n let repeated = repetition.toString().replace(/,/ig, \"\").slice(0, n);\n let aOcurrences = repeated.match(/a/ig);\n \n return aOcurrences.length;\n }\n\n return n;\n}", "function repeats(arr){\n\nreturn arr\n//I'll filter the elements from the array that follows this condition: arr.indexOf(element) === arr.lastIndexOf(element)\n.filter(element => arr.indexOf(element) === arr.lastIndexOf(element))\n//I will sum all the filtered values\n.reduce((accumulator, currentValue) => accumulator + currentValue)\n\n}", "function comfortableNumbers(l, r) {\n let count = 0;\n for (let i = l; i < r; i++) {\n let dir = i\n .toString()\n .split(\"\")\n .reduce((a, b) => +a + +b, 0);\n for (let j = i + 1, length = i + dir > r ? r : i + dir; j <= length; j++) {\n if (\n j <= r &&\n j >= l &&\n i <=\n j +\n j\n .toString()\n .split(\"\")\n .reduce((a, b) => +a + +b, 0) &&\n i >=\n j -\n j\n .toString()\n .split(\"\")\n .reduce((a, b) => +a + +b, 0)\n ) {\n count++;\n }\n }\n }\n return count;\n}", "function findEle1(number,n)\n{\n let output=false\n for(let i=0;i<number.length;i++)\n {\n if(number[i]==n)\n {\n output=true\n break\n }\n }\n return output\n}", "function findAllNumbers(numberList) {\n if (!Array.isArray(numberList) || numberList.length === 0) return [];\n return numberList.filter((x) => {\n if (x.toString()[0] % 2 !== 0) return x;\n });\n}", "function missingNumber(nr, 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\tif (arrayNr[0]==2) return 1;\n\tfor(let i=0; i<arrayNr.length-1; ++i) {\n\t\tif(arrayNr[i]+1!=arrayNr[i+1]) return arrayNr[i]+1;\n\t}\n\treturn arrayNr[arrayNr.length-1]+1;\n}", "function plusOne(digits) {\n for(var i = digits.length - 1; i >= 0; i--){\n if(++digits[i] > 9) digits[i] = 0;\n else return digits;\n }\n digits.unshift(1);\n return digits;\n}", "function reciprocalCycles(x){\nvar sequenceLength = 0;\n// we check the unique number we get with every division since at one point they will start repeating\n// the length of repetition can only be as long as there are unique combinations of numbers to divide, therefore we dont need to check the numbers once sequenceLength\n// becomes larger than i\n \nfor (var i = 1000; i > 1; i--) {\n if (sequenceLength >= i) {\n break;\n }\n \n var foundRemainders = new Array(i);\n foundRemainders.fill(0);\n var value = 1;\n var position = 0;\n \n while (foundRemainders[value] == 0 && value != 0) {\n foundRemainders[value] = position;\n value *= 10;\n value %= i;\n position++;\n }\n \n if (position - foundRemainders[value] > sequenceLength) {\n sequenceLength = position - foundRemainders[value];\n }\n return i;\n}\n}", "function solve(nums) {\n\tlet counter = 0;\n\tfor (let i = 0; i < nums.length; i++) {\n\t\tlet val = nums[i].toString();\n\t\tif (parseInt(val.length) % 2 !== 0) {\n\t\t\tcounter++;\n\t\t}\n\t}\n\treturn counter;\n}", "function countNumbers(numb) {\n return numb.replace(/[^0-9]/g,\"\").length ;\n }", "function excessiveSingleCharacterRepeats(str, normed) {\n return /(\\D)\\1{4,}/gi.test(str)\n}", "function pickingNumbers(a) {\n const myArr = a.sort((a, b) => a - b);\n const result = [];\n myArr.forEach((num, i, arr) => {\n let numbers = arr.filter((n) => n == num + 1 || n == num);\n if (numbers.length > 1) {\n result.push(numbers.length);\n }\n });\n return Math.max(...result);\n}", "function repeats(arr){\n var arrRepeted = arr.filter ((v,i,a) => a.indexOf(v) < i);\n return arr.filter(el => !(arrRepeted).includes(el)).reduce((a, b) => a + b);\n}", "function FirstNonRepeatingInt(arr) { \n //check if the 1st element is an integer and isn't repeated by the second element\n if(Number.isInteger(arr[0]) && arr[1] != arr[0]) {\n //if so, return the 0th index\n return arr[0];\n }\n let i =1;\n //loop through until nonrepeating int is found or until entire array is checked\n while(i<arr.length){\n //if it's an integer....\n if(Number.isInteger(arr[i])){\n //check the values before and after and if both are different...\n if(arr[i-1]!=arr[i] && arr[i+1] !=arr[i]){\n //return the current index\n return arr[i];\n }\n }\n //increment\n i++\n }\n //if through the entire array without an answer exit\n console.log('no non repeating integers')\n return(null);\n}", "function compareDigits(num1, num2) {\n let num1Arr = String(num1).split('').sort((a, b) => a - b);\n let num2Arr = String(num2).split('').sort((a, b) => a - b);\n for (let idx = 0; idx < num1Arr.length; idx += 1) {\n if (num1Arr[idx] === num2Arr[idx]) {\n continue;\n } else {\n return false;\n }\n }\n\n return true;\n}", "function is_israeli_id_number(id) {\n id = String(id).trim();\n if (id.length > 9 || isNaN(id)) return false;\n id = id.length < 9 ? (\"00000000\" + id).slice(-9) : id;\n return Array.from(id, Number).reduce((counter, digit, i) => {\n const step = digit * ((i % 2) + 1);\n return counter + (step > 9 ? step - 9 : step);\n }) % 10 === 0;\n}", "function iqTest(numbers){\n numbers = numbers.toString().split(' ');\n let odd =[];\n let even= [];\n for(let i=0; i<numbers.length;i++){\n if(numbers[i]%2===0){\n even.push(numbers[i]);\n }\n else{\n odd.push(numbers[i]);\n }\n }\n let num = (even.length===1)?even[0]:odd[0];\n return numbers.indexOf(num)+1;\n}", "function check(number) {\n var numberArray = number.toString().split(\"\");\n var sum = 0;\n\n // check if a given number has 11 numbers\n if(!isNumberLength_11(numberArray)) {\n var message = \"given number does not have 11 numbers.\"\n return message;\n }\n\n for(var i = (numberArray.length - 1); i >= 0; i-- ) {\n if(i % 2 !== 0) {\n numberArray[i] *= 2;\n if(numberArray[i] > 9) {\n numberArray[i] = makeOneDigit(numberArray[i]);\n }\n }\n sum += Number(numberArray[i]);\n }\n\n return sum % 10 === 0;\n}", "function digits(e){return Array.from(e.toString&&e.toString())}", "function myNumb(numbers){\n if (numbers.indexOf(1) != -1 || numbers.indexOf(3) != -1) \n{\n return true;\n}\nelse{\n return false;\n}\n }" ]
[ "0.70402455", "0.7035918", "0.68731666", "0.67960244", "0.6695744", "0.6534807", "0.653358", "0.6532217", "0.6479978", "0.64749825", "0.6473566", "0.64413553", "0.6434672", "0.64343786", "0.64313453", "0.64313453", "0.64313453", "0.64313453", "0.64313453", "0.64313453", "0.64058375", "0.6314903", "0.6313296", "0.6297894", "0.62836087", "0.6244435", "0.6240285", "0.62351567", "0.62351507", "0.61812264", "0.61785364", "0.6168406", "0.614144", "0.6138889", "0.61278194", "0.609786", "0.60917324", "0.6088685", "0.60818696", "0.60642606", "0.6059486", "0.6052668", "0.6046307", "0.6046063", "0.6040619", "0.6039546", "0.6032845", "0.601803", "0.6009845", "0.6009845", "0.599165", "0.59914005", "0.5981669", "0.5973189", "0.59398496", "0.59366065", "0.5932473", "0.59263134", "0.59249836", "0.59175205", "0.588756", "0.5872561", "0.58686733", "0.5851753", "0.5842954", "0.5838017", "0.5832298", "0.5821868", "0.58199716", "0.580971", "0.58041215", "0.5803614", "0.57972217", "0.5785259", "0.57809526", "0.5746353", "0.5746202", "0.5738159", "0.5734467", "0.57189083", "0.5716266", "0.57133186", "0.57126534", "0.5704994", "0.5703864", "0.57015383", "0.56970674", "0.5693146", "0.5686374", "0.5682788", "0.5681722", "0.5680031", "0.5677117", "0.56732595", "0.56709564", "0.56685054", "0.5667929", "0.56648177", "0.5661736", "0.56604177" ]
0.7518012
0
zone format list pages
function formatToList(arr){ //array to format number list //var arr = [1,2,3,4,8,15,16,17,20,21,30] //arr = arr.map(Number); arr = arr.sort(function(a, b){return a - b}); var start = arr[0]; var end = arr[0]; var result = ""; for(var i in arr){ i = parseInt(i); if (arr[i] === arr[i+1]-1){ end = arr[i+1]; } else{ if (start >= end){ result += start+","; }else{ result += start+"-"+end+","; } start = arr[i+1]; } } result = result.slice(0, result.length-1) result = result.split(",") return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "displaySetup(page,list){\n const end = ( (page*8+8<list.length)?(page*8+8) : list.length )\n this.setState({lastInd: end});\n return(list.slice((page*8), end));\n }", "function CakePhpListLayer() {\n\n}", "function set_up_regions_template(data)\n\t{\n\t\tvar temp;\n\t\tvar str;\n\t\tstr=\"\"; \n\t\tfor (var i = 0; i < data.length; i++) \n\t\t{ \n\t\t\tstr = str + sprintf(\"<li data-val=\\\"%d\\\">%s<ul>\",i,data[i].name);\n\t\t\tfor (var j = 0; j < data[i].areas.length; j++)\n\t\t\t{\n\t\t\t\tstr = str + sprintf(\"<li data-val=\\\"%d\\\">%s</li>\",j, data[i].areas[j].name );\n\t\t\t}\n\t\t\tstr = str + \"</ul></li>\\n\";\n }\n \n \tstr = \"\\n<div class=\\\"icc\\\">\\n<div class=\\\"ic\\\">\\n<ul id=\\\"RegionsListScroller\\\">\\n\" + str + \"\\n</ul>\\n</div>\\n</div>\\n\";\n \n return str; \t\n\n\t}", "function _drawLists() {\n let template = \"\";\n let lists = _store.Lists;\n console.log(lists);\n lists.forEach(list => {\n template += list.template;\n });\n document.querySelector(\"#lists\").innerHTML = template;\n}", "function paginatedPlaces(data) {\n var paginatedPlaces = $(\"#tab-places .related-places\");\n\n var contentPl = '';\n $.each(data.features, function(rInd, rElm) {\n contentPl += '<li>';\n contentPl += '<a href=\"' + Settings.placesPath + '#id=' + rElm.id + '&que=tab-overview\">';\n contentPl += rElm.header;\n contentPl += '</a>';\n contentPl += '</li>';\n });\n\n paginatedPlaces.empty().html(contentPl);\n}", "function processResponse(respObj) {\r\n totalPages = parseInt(respObj);\r\n showOnePageArticleList(type1, pageSize1, curPage, templateFileDir+\"showArticleListByType.template\", contentPos);\r\n var pagestr = \"\";\r\n //var selectedIndex = document.getElementById(\"selectPage\").selectedIndex+1;\r\n if (totalPages <= 1)\r\n pagestr += \"<span>首页</span> <span>上一页</span> <span>第\" + curPage + \"页/共\" + totalPages + \"页</span> <span>下一页</span> <span>尾页</span>\";\r\n else if (curPage == 1) {\r\n pagestr += \"<span>首页</span> <span>上一页</span> <span>第\" + curPage + \"页/共\" + totalPages + \"页</span> <span><a href=\\\"javascript:\" + \"this\" + \".page_onclick(\" + (this.curPage + 1) + \",'\" + type1 + \"',\" + pageSize1 + \",'\" + contentPos + \"','\" + pagePos + \"')\\\">下一页</a></span> <span><a href=\\\"javascript:\" + \"this\" + \".page_onclick(\" + (this.totalPages) + \",'\" + type1 + \"',\" + pageSize1 + \",'\" + contentPos + \"','\" + pagePos + \"')\\\">尾页</a></span>\";\r\n }\r\n else if (curPage == totalPages) {\r\n pagestr += \"<span><a href=\\\"javascript:\" + \"this\" + \".page_onclick(1\" + \",'\" + type1 + \"',\" + pageSize1 + \",'\" + contentPos + \"','\" + pagePos + \"')\\\">首页</a></span> <span><a href=\\\"javascript:\" + \"this\" + \".page_onclick(\" + (this.curPage - 1) + \",'\" + type1 + \"',\" + pageSize1 + \",'\" + contentPos + \"','\" + pagePos + \"')\\\">上一页</a></span> <span>第\" + curPage + \"页/共\" + totalPages + \"页</span> <span>下一页</span> <span>尾页</span>\";\r\n }\r\n else {\r\n pagestr += \"<span><a href=\\\"javascript:\" + \"this\" + \".page_onclick(1\" + \",'\" + type1 + \"',\" + pageSize1 + \",'\" + contentPos + \"','\" + pagePos + \"')\\\">首页</a></span> <span><a href=\\\"javascript:\" + \"this\" + \".page_onclick(\" + (this.curPage - 1) + \",'\" + type1 + \"',\" + pageSize1 + \",'\" + contentPos + \"','\" + pagePos + \"')\\\">上一页</a></span> <span>第\" + curPage + \"页/共\" + totalPages + \"页</span> <span><a href=\\\"javascript:\" + \"this\" + \".page_onclick(\" + (this.curPage + 1) + \",'\" + type1 + \"',\" + pageSize1 + \",'\" + contentPos + \"','\" + pagePos + \"')\\\">下一页</a></span> <span><a href=\\\"javascript:\" + \"this\" + \".page_onclick(\" + (this.totalPages) + \",'\" + type1 + \"',\" + pageSize1 + \",'\" + contentPos + \"','\" + pagePos + \"')\\\">尾页</a></span>\";\r\n }\r\n pagestr += \"<span><select id=\\\"selectPage\\\" onchange=\\\"chg('\" + type1 + \"',\" + pageSize1 + \",'\" + contentPos + \"','\" + pagePos + \"')\\\">\";\r\n //alert(totalPages);\r\n for (i = 1; i <= totalPages; i++) {\r\n if (i == curPage)\r\n pagestr += \"<option selected>\" + i + \"</option>\";\r\n else\r\n pagestr += \"<option>\" + i + \"</option>\";\r\n }\r\n pagestr += \"</select></span>\";\r\n $(pagePos).html(pagestr);\r\n }", "function renderList(res, data, numPages, currentLetter, currentPage) {\n\tres.render('index', {\n\t\ttitle: 'iPlayer A to Z',\n\t\tletters: generateLetters(26),\n\t\tprogrammes: data,\n\t\tpages: generatePagination(numPages),\n\t\tcurrentLetter,\n\t\tcurrentPage\n\t});\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 showPage(list, page){\r\n let startIndex = (page * 9) - 9\r\n let endIndex = page * 9\r\n\r\n student_list.innerHTML = ''\r\n\r\n //Loops through the list of students and creates the dynamic content\r\n for(let i = 0; i < list.length; i++){\r\n let sourceList = list[i]\r\n if(i >= startIndex && i < endIndex) {\r\n student_list.insertAdjacentHTML('beforeend', `\r\n <li class=\"student-item cf\">\r\n <div class=\"student-details\">\r\n <img class=\"avatar\" src=${sourceList.picture.thumbnail} alt=\"Profile Picture\">\r\n <h3>${sourceList.name.first} ${sourceList.name.last}</h3>\r\n <span class=\"email\">${sourceList.email}</span>\r\n </div>\r\n <div class=\"joined-details\">\r\n <span class=\"date\">Joined ${sourceList.registered.date}</span>\r\n </div>\r\n </li>\r\n `)\r\n }\r\n }\r\n}", "function mediaList(req,res,template,block,next) { \n \n // Render the item via the template provided above\n calipso.theme.renderItem(req,res,template,block,{}); \n next();\n \n}", "function _drawLists() {\n console.log(\"we made it to try and draw\")\n let template = \"\";\n store.Lists.forEach(list => (template += list.template));\n document.querySelector(\"#listArea\").innerHTML = template;\n}", "function showPages() {\n\tvar pages = getPages();\n\tvar formHTML = \"<ul>\";\n\tfor (var i = 0; i < pages.length; i++)\n\t{\n\t\tformHTML = formHTML + '<li id=\"li_' + i +'\">' + pages[i].title + ' <button id=\"bt_' + i + '\" onclick=\"selectPage(' + i + ')\">Edit</button></li>';\n\t}\n\tformHTML = formHTML + \"</ul>\";\n\t$( \"div#pagesList\" ).html(formHTML);\n}", "function createHealthCareRegionListPages(page, drupalPagePath, files) {\n const sidebar = page.facilitySidebar;\n\n // Create the top-level facilities status page for Health Care Regions\n const statusEntityUrl = createEntityUrlObj(drupalPagePath);\n const statusObj = {\n mainFacilities: page.reverseFieldRegionPageNode,\n facilitySidebar: sidebar,\n entityUrl: statusEntityUrl,\n alert: page.alert,\n title: page.title,\n };\n\n const statusPage = updateEntityUrlObj(\n statusObj,\n drupalPagePath,\n 'Operating status',\n );\n const statusPath = statusPage.entityUrl.path;\n statusPage.regionOrOffice = page.title;\n statusPage.entityUrl = generateBreadCrumbs(statusPath);\n\n files[`${drupalPagePath}/status/index.html`] = createFileObj(\n statusPage,\n 'health_care_facility_status.drupal.liquid',\n );\n\n // Create the top-level locations page for Health Care Regions\n const locEntityUrl = createEntityUrlObj(drupalPagePath);\n const locObj = {\n mainFacilities: page.mainFacilities,\n otherFacilities: page.otherFacilities,\n fieldOtherVaLocations: page.fieldOtherVaLocations,\n fieldLocationsIntroBlurb: page.fieldLocationsIntroBlurb,\n facilitySidebar: sidebar,\n entityUrl: locEntityUrl,\n alert: page.alert,\n title: page.title,\n };\n const locPage = updateEntityUrlObj(locObj, drupalPagePath, 'Locations');\n const locPath = locPage.entityUrl.path;\n locPage.regionOrOffice = page.title;\n locPage.entityUrl = generateBreadCrumbs(locPath);\n\n files[`${drupalPagePath}/locations/index.html`] = createFileObj(\n locPage,\n 'health_care_region_locations_page.drupal.liquid',\n );\n\n // Create \"A-Z Services\" || \"Our health services\" Page\n // sort and group health services by their weight in drupal\n if (page.fieldClinicalHealthServices) {\n const clinicalHealthServices = sortServices(\n page.fieldClinicalHealthServices.entities,\n );\n\n const hsEntityUrl = createEntityUrlObj(drupalPagePath);\n const hsObj = {\n fieldClinicalHealthServi: page.fieldClinicalHealthCareServi,\n featuredContentHealthServices: page.fieldFeaturedContentHealthser,\n facilitySidebar: sidebar,\n entityUrl: hsEntityUrl,\n alert: page.alert,\n title: page.title,\n regionNickname: page.fieldNicknameForThisFacility,\n clinicalHealthServices,\n };\n\n const hsPage = updateEntityUrlObj(\n hsObj,\n drupalPagePath,\n 'Patient and health services',\n 'health-services',\n );\n const hsPath = hsPage.entityUrl.path;\n hsPage.regionOrOffice = page.title;\n hsPage.entityUrl = generateBreadCrumbs(hsPath);\n\n files[`${drupalPagePath}/health-services/index.html`] = createFileObj(\n hsPage,\n 'health_care_region_health_services_page.drupal.liquid',\n );\n }\n\n // Press Release listing page\n const prEntityUrl = createEntityUrlObj(drupalPagePath);\n const prObj = {\n allPressReleaseTeasers: page.allPressReleaseTeasers,\n fieldPressReleaseBlurb: page.fieldPressReleaseBlurb,\n facilitySidebar: sidebar,\n entityUrl: prEntityUrl,\n title: page.title,\n alert: page.alert,\n };\n const prPage = updateEntityUrlObj(prObj, drupalPagePath, 'News Releases');\n const prPath = prPage.entityUrl.path;\n prPage.regionOrOffice = page.title;\n prPage.entityUrl = generateBreadCrumbs(prPath);\n\n paginatePages(\n prPage,\n files,\n 'allPressReleaseTeasers',\n 'press_releases_page.drupal.liquid',\n 'news releases',\n );\n\n // News Story listing page\n const nsEntityUrl = createEntityUrlObj(drupalPagePath);\n const nsObj = {\n allNewsStoryTeasers: page.allNewsStoryTeasers,\n newsStoryTeasers: page.newsStoryTeasers,\n fieldIntroTextNewsStories: page.fieldIntroTextNewsStories,\n facilitySidebar: sidebar,\n entityUrl: nsEntityUrl,\n title: page.title,\n alert: page.alert,\n };\n const nsPage = updateEntityUrlObj(\n nsObj,\n drupalPagePath,\n 'Community stories',\n 'stories',\n );\n const nsPath = nsPage.entityUrl.path;\n nsPage.regionOrOffice = page.title;\n nsPage.entityUrl = generateBreadCrumbs(nsPath);\n\n paginatePages(\n nsPage,\n files,\n 'allNewsStoryTeasers',\n 'news_stories_page.drupal.liquid',\n 'news stories',\n );\n\n // Staff bio listing page\n const bioEntityUrl = createEntityUrlObj(drupalPagePath);\n page.allStaffProfiles = {\n entities: [...page.fieldLeadership],\n };\n const bioObj = {\n allStaffProfiles: page.allStaffProfiles,\n facilitySidebar: sidebar,\n entityUrl: bioEntityUrl,\n title: page.title,\n alert: page.alert,\n };\n const bioListingPage = updateEntityUrlObj(\n bioObj,\n drupalPagePath,\n 'Leadership',\n );\n const bioPagePath = bioListingPage.entityUrl.path;\n bioListingPage.regionOrOffice = page.title;\n bioListingPage.entityUrl = generateBreadCrumbs(bioPagePath);\n\n paginatePages(\n bioListingPage,\n files,\n 'allStaffProfiles',\n 'leadership_listing.drupal.liquid',\n 'bio',\n );\n}", "function showPage(list, page) {\n // loop over list and show items between page start and page end indexes, hide the rest\n for (let i = 0, j = list.length; i < j; i++) {\n if (i >= (page * per_page) - per_page && i < page * per_page) {\n list[i].style.display = '';\n } else {\n list[i].style.display = 'none';\n }\n }\n}", "function loadZoneDetails() {\n refreshZoneDetails()\n }", "function listContent (geoID) {\r\n var geoIDsansFR = geoID.id.replace(\"id-\",\"\");\r\n var index = -1;\r\n var nameReg = \"Not found\" ;\r\n for (i=0 ; i < dataReg.cumul_par_reg_lasts.length ; i++) {\r\n\r\n if (dataReg.cumul_par_reg_lasts[i].reg_id == geoIDsansFR) {\r\n index = i;\r\n nameReg = dataReg.cumul_par_reg_lasts[i].reg_nom ;\r\n break; \r\n }\r\n }\r\n\r\n if (index != -1) {\r\n var totalDC = dataReg.cumul_par_reg_lasts[index].dc ;\r\n } else {\r\n console.log(\"Erreur: \"+geoIDsansFR+ \" not found\")\r\n }\r\n dcTitle = \"<h2>Mort</h2>\" ;\r\n $(list_title).html(dcTitle);\r\n dcText = nameReg + \" : <em class='num red'>\" + totalDC + \"</em>\" ;\r\n $(geoID).html(dcText);\r\n \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 _drawLists() {\n let template = ''\n _listService.List.forEach((list, index) => {\n template += list.getTemplate(index)\n });\n document.querySelector(\"#lists\").innerHTML = template\n}", "function galleryList(req,res,template,block,next) { \n \n // Render the item via the template provided above\n calipso.theme.renderItem(req,res,template,block,{}); \n next();\n \n}", "function loadStageFormatList() {\n\tLookup.all({where: {'lookup_type':'STAGE_FORMAT'}}, function(err, lookups){\n\t this.stage_format_list = lookups;\n\t next(); // process the next tick. If you don't put it here, it will stuck at this point.\n\t}.bind(this));\n}", "function showPage(list, page){\n\tconst pageStart = (page * 9) - 9; \n\tconst pageEnd = page * 9; \n\tstudentList.innerHTML = '';\n\tfor(let i = 0; i < list.length; i++){ \n\t\tif(i >= pageStart && i < pageEnd){ \n\t studentList.insertAdjacentHTML(\"beforeend\", generateHtml(list[i]))\t\t\t\n\t\t};\n\t};\n}", "function controlContentList(type){\n\n if(type == \"People\"){\n if(people.results.length) constructProfileList(people);\n }\n else{\n switch(type){\n case \"TV Shows\": if(tv.results.length) constructContentList(tv, \"tv\"); break;\n case \"Movies\": if(movies.results.length) constructContentList(movies, \"movie\"); break;\n case \"Collections\": if(collections.results.length) constructContentList(collections); break;\n }\n }\n\n if(currentList.total_pages > 1) updatePageNumbers();\n}", "render(){\n const zoneStyle = styles.zone\n const zipCode = this.props.currentZone.zipCodes[0]\n /*\n ln11: This line is breaking something when adding a zone.\n something to do with the zipCode array above\n */\n\n return(\n <div style={zoneStyle.container}>\n <h2 style={zoneStyle.header}>\n <a style={zoneStyle.title} href=\"#\">{this.props.currentZone.name}</a>\n </h2>\n <span className=\"detail\">{zipCode}</span><br />\n <span className=\"detail\">{this.props.currentZone.numComments} comments</span>\n </div>\n )\n }", "function template(){\n vm.docDefinition = {\n pageSize: 'A4',\n content: [\n {\n image: logo_garuda,\n width: 50,\n height: 50,\n alignment: 'center',\n margin: [0,0,0,5]\n },\n\n {\n text: '' , style: ['nama_instansi', 'nama_judul']\n },\n\n {\n text: 'REPUBLIK INDONESIA', style: 'nama_judul', margin: [0,0,0,15]\n },\n\n {\n text: 'SURAT PERINTAH', style: 'nama_judul'\n },\n\n {\n text: 'NOMOR ' + vm.item.urusan + '-....-' + vm.item.unit + '-'+ ((new Date()).getYear() + 1900) , style: 'judul_nomor'\n },\n\n {\n style: 'demoTable', margin: [0,15,0,0],\n table: {\n widths: [50, 5, '*'],\n body: [\n [{text: 'Nama', bold: true},{text: ':'},{text: '' + vm.item.pegawaiPenandatangan.gelarDepan + vm.item.pegawaiPenandatangan.nama + vm.item.pegawaiPenandatangan.gelarBelakang}],\n [{text: 'Jabatan', bold: true},{text: ':'},{text: '' + vm.item.pegawaiPenandatangan.jabatan}]\n ]\n },\n layout: 'noBorders'\n },\n\n {\n style: 'demoTable', margin: [0,15,0,10],\n table: {\n widths: [80, 5, '*'],\n body: [\n [{text: 'Menimbang', style:'header4'},{text: ':', style:'header5'},\n {\n ol: []\n }\n ],\n [{text: '',margin: [0,0,0,3], colSpan: 3}],\n [{text: 'Dasar', style:'header4'},{text: ':', style:'header5'},\n {\n ol: []\n }\n ]\n ]\n },\n layout: 'noBorders'\n },\n\n {\n text: 'Memberi Perintah', alignment: 'center', fontSize: 12\n },\n\n {\n style: 'demoTable', margin: [0,10,0,15],\n table: {\n widths: [80, 5, '*'],\n body: [\n [{text: 'Kepada', style:'header4'},{text: ':', style:'header5'},\n\n {\n ol: []\n }],\n [{text: '',margin: [0,0,0,3], colSpan: 3}],\n [{text: 'Untuk', style:'header4'},{text: ':', style:'header5'},\n {\n ol : []\n }\n ]\n ]\n },\n layout: 'noBorders'\n },\n\n {\n columns: [\n {\n width: '63%',\n text: ''\n },\n {\n style: 'tandaTangan',\n table: {\n widths: [200],\n body: [\n [{text: '' + vm.item.tempat.toUpperCase() + ', ' + EkinerjaService.IndonesianDateFormat(vm.item.tanggal1), alignment : 'left'}],\n [{text: '' + vm.item.pegawaiPenandatangan.jabatan + ',', alignment : 'left', bold: true}],\n [{text: ' ',margin: [0,20]}],\n [{text: '' + vm.item.pegawaiPenandatangan.gelarDepan + vm.item.pegawaiPenandatangan.nama + vm.item.pegawaiPenandatangan.gelarBelakang, alignment : 'left', bold:true}],\n [{text: '' + vm.item.pegawaiPenandatangan.pangkat, alignment : 'left', bold:true}],\n [{text: 'NIP. ' + vm.item.pegawaiPenandatangan.nipPegawai, alignment : 'left'}]\n ]\n },\n layout: 'noBorders'\n }\n ]\n },\n\n {text: 'Tembusan :'}\n\n ],\n\n styles: {\n header: {\n bold: true,\n fontSize: 14,\n alignment: 'center'\n },\n header2: {\n fontSize: 12,\n alignment: 'center'\n },\n header3: {\n fontSize: 10,\n alignment: 'center'\n },\n nama_judul: {\n alignment : 'center',\n bold: true,\n fontSize: 12\n },\n judul_nomor: {\n alignment : 'center',\n bold: true,\n fontSize: 12\n },\n demoTable: {\n color: '#000',\n fontSize: 12\n },\n tandaTangan: {\n color: '#000',\n fontSize: 12,\n alignment:'right'\n },\n header4: {\n bold: true,\n fontSize: 12\n },\n header5: {\n fontSize: 12\n }\n }\n };\n\n for(var i = 0; i < vm.target.length; i++){\n var dat = {\n widths: ['*', '*', '*'],\n table: {\n body: [\n [{text: 'Nama', bold: true}, {text: ':'}, {text: '' + vm.target[i].gelarDepan + vm.target[i].nama + vm.target[i].gelarBelakang}],\n [{text: 'NIP', bold: true}, {text: ':'}, {text: '' + vm.target[i].nipPegawai}],\n [{text: 'Pangkat/Gol. Ruang', bold: true}, {text: ':'}, {text: '' + vm.target[i].pangkat + ' - ' + vm.target[i].golongan}],\n [{text: 'Jabatan', bold: true}, {text: ':'}, {text: '' + vm.target[i].jabatan}]\n ]\n },\n layout: 'noBorders'\n };\n vm.docDefinition.content[8].table.body[0][2].ol.push(dat);\n }\n\n var tembusan = {\n ol:[]\n }\n\n for(var i = 0; i < vm.tembusanSurat.length; i++)\n tembusan.ol.push(vm.tembusanSurat[i].jabatan);\n vm.docDefinition.content.push(tembusan);\n\n // var menimbang = vm.item.menimbang.split(\"\\n\");\n // for(var i = 0; i < menimbang.length; i++){\n // var kata = '';\n // for(var j = 1; j < (menimbang[i].split(\" \")).length; j++)\n // kata += (menimbang[i].split(\" \"))[j] + ' ';\n // vm.docDefinition.content[6].table.body[0][2].ol.push(kata);\n // }\n for(var i = 0; i < vm.menimbang.length; i++)\n vm.docDefinition.content[6].table.body[0][2].ol.push(vm.menimbang[i].deskripsimenimbang);\n \n // var dasar = vm.item.dasar.split(\"\\n\");\n // for(var i = 0; i < dasar.length; i++){\n // var kata = '';\n // for(var j = 1; j < (dasar[i].split(\" \")).length; j++)\n // kata += (dasar[i].split(\" \"))[j] + ' ';\n // vm.docDefinition.content[6].table.body[2][2].ol.push(kata);\n // }\n for(var i = 0; i < vm.dasar.length; i++)\n vm.docDefinition.content[6].table.body[2][2].ol.push(vm.dasar[i].deskripsidasar);\n \n // var untuk = vm.item.untuk.split(\"\\n\");\n // for(var i = 0; i < untuk.length; i++){\n // var kata = '';\n // for(var j = 1; j < (untuk[i].split(\" \")).length; j++)\n // kata += (untuk[i].split(\" \"))[j] + ' ';\n // vm.docDefinition.content[8].table.body[2][2].ol.push(kata);\n // }\n for(var i = 0; i < vm.untuk.length; i++)\n vm.docDefinition.content[8].table.body[2][2].ol.push(vm.untuk[i].deskripsiuntuk);\n\n if($state.current.name == \"suratperintahnonpejabat\" || $state.current.name == \"perintahnonpejabatterusan\"){\n vm.docDefinition.content[0] = {\n margin:[0,0,0,15],\n table:{\n widths: [100,'*'],\n body: [\n [\n {\n image: logo_bekasi,\n width: 90,\n height: 90,\n alignment: 'center'\n },\n [\n {\n text:[\n {text: 'PEMERINTAHAN KABUPATEN BEKASI\\n', alignment: 'center', style:'header'},\n {text: '' + vm.item.pegawaiPenandatangan.unitKerja.toUpperCase() + '\\n', alignment: 'center', style:'header'},\n {text: 'Komplek Perkantoran Pemerintah Kabupaten\\nBekasi Desa Sukamahi Kecamatan Cikarang Pusat', style: 'header2'}\n ]\n },\n {\n margin: [15,0,0,0],\n table: {\n body: [\n [\n {text: 'Telp. (021) 89970696', style: 'header3'},\n {text: 'Fax. (021) 89970064', style: 'header3'},\n {text: 'email : [email protected]', style: 'header3'}\n ]\n ]\n }, layout: 'noBorders'\n }\n ]\n ],\n [{text:'', colSpan: 2}],\n [{text:'', fillColor: 'black', colSpan: 2}]\n ]\n },\n layout: 'noBorders'\n };\n\n vm.docDefinition.content[1] = {};\n\n vm.docDefinition.content[2] = {};\n }\n else vm.docDefinition.content[1].text += vm.item.pegawaiPenandatangan.jabatan.toUpperCase();\n }", "function dwscripts_getPageNavDisplaySBs(recordsetName, ignoreCase, includeAllType)\n{\n var retVal = null;\n \n var serverObj = dwscripts.getServerImplObject();\n\n if ((serverObj != null) && (serverObj.getPageNavDisplaySBs != null))\n {\n retVal = serverObj.getPageNavDisplaySBs(recordsetName, ignoreCase);\n }\n else\n {\n retVal = new Array();\n \n if (recordsetName && ignoreCase)\n {\n recordsetName = recordsetName.toLowerCase();\n }\n\n var sbObjs = dwscripts.getServerBehaviorsByFileName(\"RepeatedRegion.htm\");\n\n for (var i = 0; i < sbObjs.length; i++)\n {\n if (includeAllType || \n (sbObjs[i].isPageNavigation == null || sbObjs[i].isPageNavigation()))\n {\n if (recordsetName && (sbObjs[i].getRecordsetName != null))\n {\n var sbRsName = sbObjs[i].getRecordsetName();\n\n if (ignoreCase)\n {\n sbRsName = sbRsName.toLowerCase();\n }\n\n if (recordsetName == sbRsName)\n {\n retVal.push(sbObjs[i]);\n }\n }\n else\n {\n retVal.push(sbObjs[i]);\n }\n }\n }\n }\n\n return retVal; \n}", "function outputPageFile(fltCompName)\n{\n // Initialize the name, row, and column parameters\n nextColumnHeader = fltCompName + ccdd.getRootStructureTableNames()[0];\n lastSubStructureName = nextColumnHeader;\n columnStep = 20;\n maxColumnLength = columnStep;\n columnOffset = -columnStep - 1;\n maxNumRows = 46;\n rowCount = maxNumRows;\n columnCount = 0;\n inMiddleOfArray = false;\n\n // Check if structure data is provided\n if (numStructRows != 0)\n {\n // Build the page file name and open the page output file\n var baseName = \"auto_\" + fltCompName + ccdd.getRootStructureTableNames()[0];\n var pageFileName = ccdd.getOutputPath() + baseName + \".page\";\n var pageFile = ccdd.openOutputFile(pageFileName);\n\n // Check if the page output file successfully opened\n if (pageFile != null)\n {\n // Begin building the page display. The \"page\" statement must be on\n // the first row\n ccdd.writeToFileLn(pageFile, \"page \" + baseName);\n ccdd.writeToFileLn(pageFile, \"\");\n outputFileCreationInfo(pageFile);\n ccdd.writeToFileLn(pageFile, \"color default (orange, default)\");\n ccdd.writeToFileLn(pageFile, \"color mnedef (text (white, black) )\");\n ccdd.writeToFileLn(pageFile, \"color subpage (lightblue, blue)\");\n ccdd.writeToFileLn(pageFile, \"color array_fmt (royalblue, black)\");\n ccdd.writeToFileLn(pageFile, \"\");\n\n // Output the telemetry display definitions\n outputMnemonics(pageFile, fltCompName);\n\n // Close the page output file\n ccdd.closeFile(pageFile);\n }\n // The page output file cannot be opened\n else\n {\n // Display an error dialog\n ccdd.showErrorDialog(\"<html><b>Error opening telemetry output file '</b>\" + pageFileName + \"<b>'\");\n }\n }\n}", "getZones(next){\n request(this.zoneUrl(), (error, reponse, body) => {\n let res = this.handleResponse(JSON.parse(body))\n if(res.success){\n next(res) \n } \n })\n }", "function cutList(list, page) {\n let startIndex = 0;\n let tempList = list;\n if (page !== 1) {\n startIndex = (page * context.settings[0].pageMax) - 1;\n }\n console.log(startIndex);\n let displayList = [];\n\n // We are iterating from startIndex (something larger than 0 or 1), going up to startIndex + pageMax\n for (let i = startIndex; i < (startIndex + context.settings[0].pageMax); i++) {\n if (i <= tempList.length) {\n displayList.push(tempList[i]);\n } else {\n setDisplay(displayList);\n }\n }\n\n setDisplay(displayList);\n }", "function relatedPlaces(data) {\n $(\"#tab-places\").empty();\n\n var contentPl = '<h6>Features Associated with ' + shanti.shanti_data.feature.header + '</h6>';\n\n contentPl += '<ul class=\"related-places\">';\n $.each(data.features, function(rInd, rElm) {\n contentPl += '<li>';\n contentPl += '<a href=\"' + Settings.placesPath + '#id=' + rElm.id + '&que=tab-overview\">';\n contentPl += rElm.header;\n contentPl += '</a>';\n contentPl += '</li>';\n });\n contentPl += '</ul>';\n contentPl += '<ul id=\"places-pagination\"></ul>';\n\n var avURL = Settings.placesUrl + '/topics/' + shanti.shanti_data.feature.id + '.json';\n var total_pages = data.total_pages;\n\n contentPl += '<ul id=\"photo-pagination\" class=\"pager\">';\n contentPl += '<li class=\"first-page pager-first first\"><a href=\"' + avURL + '?page=1' + '\"><i class=\"icon\"></i></a></li>';\n contentPl += '<li class=\"previous-page pager-previous\"><a href=\"' + avURL + '?page=1' + '\"><i class=\"icon\"></i></a></li>';\n contentPl += '<li>PAGE</li>';\n contentPl += '<li class=\"pager-current widget\"><input type=\"text\" value=\"1\" class=\"page-input\"></li>';\n contentPl += '<li>OF ' + total_pages + '</li>';\n contentPl += '<li class=\"next-page pager-next\"><a href=\"' + avURL + '?page=2' + '\"><i class=\"icon\"></i></a></li>';\n contentPl += '<li class=\"last-page pager-last last\"><a href=\"' + avURL + '?page=' + total_pages + '\"><i class=\"icon\"></i></a></li>';\n contentPl += '</ul>';\n contentPl += '<div class=\"paginated-spin\"><i class=\"fa fa-spinner\"></i></div>';\n\n $(\"#tab-places\").append(contentPl);\n\n //Add the event listener for the first-page element\n $(\"li.first-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n $.ajax({\n url: currentTarget,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedPlaces)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val('1');\n $('li.previous-page a').attr('href', currentTarget);\n var nextTarget = currentTarget.substr(0, currentTarget.lastIndexOf('=') + 1) + 2;\n $('li.next-page a').attr('href', nextTarget);\n });\n });\n\n //Add the listener for the previous-page element\n $(\"li.previous-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n currentTarget = currentTarget.substr(0, currentTarget.lastIndexOf('=') + 1);\n var newpage = parseInt($('li input.page-input').val()) - 1;\n if (newpage < 1) { newpage = 1; }\n var currentURL = currentTarget + newpage;\n var previousTarget = currentTarget + ((newpage - 1) < 1 ? 1 : (newpage - 1));\n var nextTarget = currentTarget + ((newpage + 1) > parseInt(total_pages) ? total_pages : (newpage + 1));\n $.ajax({\n url: currentURL,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedPlaces)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $(e.currentTarget).attr('href', previousTarget);\n $('li.next-page a').attr('href', nextTarget);\n });\n });\n\n //Add the listener for the next-page element\n $(\"li.next-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n currentTarget = currentTarget.substr(0, currentTarget.lastIndexOf('=') + 1);\n var newpage = parseInt($('li input.page-input').val()) + 1;\n if (newpage > parseInt(total_pages)) { newpage = parseInt(total_pages); }\n var currentURL = currentTarget + newpage;\n var previousTarget = currentTarget + ((newpage - 1) < 1 ? 1 : (newpage - 1));\n var nextTarget = currentTarget + ((newpage + 1) > parseInt(total_pages) ? total_pages : (newpage + 1));\n $.ajax({\n url: currentURL,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedPlaces)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $('li.previous-page a').attr('href', previousTarget);\n $(e.currentTarget).attr('href', nextTarget);\n });\n });\n\n //Add the listener for the pager text input element\n $(\"li input.page-input\").change(function(e) {\n e.preventDefault();\n var currentTarget = avURL + '?page=';\n var newpage = parseInt($(this).val());\n if (newpage > parseInt(total_pages)) { newpage = parseInt(total_pages); }\n if (newpage < 1) { newpage = 1; }\n var currentURL = currentTarget + newpage;\n var previousTarget = currentTarget + ((newpage - 1) < 1 ? 1 : (newpage - 1));\n var nextTarget = currentTarget + ((newpage + 1) > parseInt(total_pages) ? total_pages : (newpage + 1));\n $.ajax({\n url: currentURL,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedPlaces)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $('li.previous-page a').attr('href', previousTarget);\n $('li.next-page a').attr('href', nextTarget);\n });\n });\n\n //Add the event listener for the last-page element\n $(\"li.last-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n var newpage = parseInt(total_pages);\n var previousTarget = avURL + '?page=' + (newpage - 1);\n $.ajax({\n url: currentTarget,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedPlaces)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $('li.previous-page a').attr('href', previousTarget);\n $('li.next-page a').attr('href', currentTarget);\n });\n });\n}", "function _draw() {\n let template = \"\"\n let lists = _listService.list\n lists.forEach((list, index) => {\n template += list.getTemplate(index)\n\n })\n document.querySelector('#list').innerHTML = template\n\n}", "function listPlaces() {\n//Implement print check, so that list gets printed ONCE, not spammed\n if(localStorage['places']){\n a = JSON.parse(localStorage.getItem('places'));\n $('#list').text(\"\");\n for (n=0; n<a.length; n++) {\n var appendConstructor = '<img src='+'\"'+a[n].iconType+'\">' + \" \" + a[n].placeTitle + \"@\" + a[n].lat + \" and \" + a[n].lng + \" added on \" + a[n].dateAdded;\n $('#list').append(\"<li>\"+appendConstructor+\"</li>\");\n $('#list').show();\n }\n } else {\n document.getElementById(\"status\").innerHTML = \"You have no saved places yet. GG\"\n }\n }", "function showPage (list , page){\n\n \n const pageNum = parseInt (page);\n const upperIndex = (page*listNum);\n const lowerIndex = (page*listNum)-listNum;\n\n for (let i=0;i<list.length;i++){\n\n if (i >= lowerIndex && i< upperIndex){\n list[i].style.display = '';\n }; \n\n if(i < lowerIndex || i >= upperIndex ){\n\n list[i].style.display = 'none';\n };\n };\n \n \n}", "function renderData() {\n var drop_list_flag = true;\n var dao = DAO.user;\n var param = {\n 'page': 1,\n 'page_num': 10\n };\n dao.getAccountList(param, function (res) {\n if(res.status == 1){\n var result = [];\n var data = res['data'];\n result['res'] = data['flows'];\n if(!result['res'][0]){\n result['gif_flag'] = 1;\n drop_list_flag = false;\n }\n\n var date_line = [];\n for(var i=0; i<result['res'].length; i++){\n var j = parseInt(i+1, 10);\n date_line[i] = result['res'][i]['dateline'];\n }\n if(result['res'].length > 0){\n result['res'][0]['show_month'] = 1;\n }\n for(var i=0; i+1<date_line.length; i++){\n if(M.time.year_to_month(date_line[i]) != M.time.year_to_month(date_line[i+1])){\n result['res'][i+1]['show_month'] = 1;\n }else {\n result['res'][result['res'].length-1]['show_month'] = 0;\n }\n }\n // prev_page_end = result['res'][result['res'].length-1]['dateline']; //\n\n template.helper(\"dateFormat\", dateFormat);\n $('.expense-list').append(template('list', result));\n if(drop_list_flag){\n dropList();\n }\n }else{\n config_tips.msg = res.msg;\n M.util.popup_tips(config_tips);\n }\n })\n }", "function getPage (pages) {\n var gameList = document.querySelector('.game_list');\n gameList.innerHTML = \"\";\n // appends each page to the list\n for (var index = 0; index < pages.length; index++) {\n var listElmt = document.createElement(\"li\");\n listElmt.innerHTML = pages[index];\n gameList.appendChild(listElmt);\n }\n\n }", "function showPage(list, page) {\r\n var starIndex = page * 9 - 9;\r\n var endIndex = page * 9;\r\n var studentList = document.querySelector(\".student-list\").innerHTML;\r\n studentList = \"\";\r\n\r\n for (let i = 0; i < list.length; i++) {\r\n if (starIndex <= i && i < endIndex) {\r\n studentList += `<li class=\"student-item cf\">\r\n <div class=\"student-details\"><img class=\"avatar\" src=\"${list[i].picture.medium}\"alt=\"Profile Picture\">\r\n <h3> ${list[i].name.first} </h3>\r\n <span class=\"email\"> ${list[i].email} </span>\r\n </div><div class=\"joined-details\">\r\n <span class=\"date\"> Joined: ${list[i].registered.date}</span></div></li>`;\r\n document.querySelector(\".student-list\").innerHTML = studentList;\r\n }\r\n }\r\n}", "function showTemplates() {\n\tvar templates = getTemplates();\n\tvar formHTML = \"<ul>\";\n\tfor (var i = 0; i < templates.length; i++)\n\t{\n\t\tformHTML = formHTML + '<li>' + templates[i].title + '</li>';\n\t}\n\tformHTML = formHTML + \"</ul>\";\n\t$( \"div#templatesList\" ).html(formHTML);\n}", "function ShowPage(list, page) {\n for (let i = 0; i < list.length; i++) {\n if (i >= (page-1)*maxEntriesPerPage && i < page*maxEntriesPerPage) {\n list[i].style.display = \"block\";\n }\n else {\n list[i].style.display = \"none\";\n }\n }\n}", "function showPage(list, page) {\n //shows 9 students on display\n const startIndex = (page * 9) - 9;\n const endIndex = page * 9;\n\n // this resets the list of students\n studentList.innerHTML = '';\n\n // the for loop iterates the list of student objects and creates a student list item and adds it to the studentList HTML\n for (let i = 0; i < list.length; i++) {\n if (i >= startIndex && i < endIndex) {\n const student = list[i];\n const studentLi = `\n <li class=\"student-item cf\">\n <div class\"student-details>\n <img class=\"avatar\" src=\"${student.picture.large}\" alt=\"Profile Picture\">\n <h3>${student.name.first} ${student.name.last}</h3>\n <span class=\"email\">${student.email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined: ${student.registered.date}</span>\n </div>\n </li>\n `;\n \n studentList.innerHTML += studentLi;\n }\n }\n}", "function djnInit() {\n\tcreateRegions();\n\t\n\t// this is the parent group that should show up in the title bar\n\tvar foundGroup = null;\n\t\n\t// create zones\n\t(function() {\n\t\t// find which zone we are in\n\t\tvar alreadyFound = false;\n\t\tfunction findMatch(zones,group) {\n\t\t\tvar found = false;\n\t\t\tfor( var i=0; i<zones.length; i++ ) {\n\t\t\t\t(function (z,group) {\n\t\t\t\t\tvar match=false;\n\t\t\t\t\t\n\t\t\t\t\t// look for a match in the children first\n\t\t\t\t\tif(z.zones!=null)\n\t\t\t\t\t\tmatch |= findMatch(z.zones, z.group?z:group );\n\t\t\t\t\t\n\t\t\t\t\t// otherwise try to match with the parent\n\t\t\t\t\tif(!alreadyFound) {\n\t\t\t\t\t\tvar matchFunction = z.match;\n\t\t\t\t\t\tif(matchFunction==null)\n\t\t\t\t\t\t\tmatchFunction = function() { return window.location.href.indexOf(z.href)==0; }\n\t\t\t\t\t\tif(matchFunction()) {\n\t\t\t\t\t\t\tz.current = true;\n\t\t\t\t\t\t\talreadyFound = true;\n\t\t\t\t\t\t\tfoundGroup = group;\n\t\t\t\t\t\t\tmatch = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tz.expanded = match;\n\t\t\t\t\tfound |= match;\n\t\t\t\t})(zones[i],group);\n\t\t\t}\n\t\t\treturn found;\n\t\t}\n\t\tfindMatch(zones,null);\n\t\t\n\t\t// create fragment to inject\n\t\tvar html = [];\n\t\tvar foundCurrent = false;\n\t\tvar currentDepth;\n\t\tfunction createZones(zones,depth) {\n\t\t\tfor( var i=0; i<zones.length; i++ ) {\n\t\t\t\tif(zones[i].current) {\n\t\t\t\t\thtml.push(\"<dt id=current-zone class='\");\n\t\t\t\t\tfoundCurrent = true;\n\t\t\t\t\tcurrentDepth = depth;\n\t\t\t\t} else\n\t\t\t\tif(!foundCurrent)\n\t\t\t\t\thtml.push(\"<dt class='before-current \");\n\t\t\t\telse\n\t\t\t\t\thtml.push(\"<dt class='after-current \");\n\t\t\t\thtml.push(\"depth\"+depth);\n\t\t\t\thtml.push(\"'><a href='\");\n\t\t\t\thtml.push(zones[i].href);\n\t\t\t\thtml.push(\"'>\");\n\t\t\t\thtml.push(zones[i].title);\n\t\t\t\thtml.push(\"</a></dt>\");\n\t\t\t\tif(zones[i].zones!=null && zones[i].expanded)\n\t\t\t\t\tcreateZones(zones[i].zones,depth+1);\n\t\t\t}\n\t\t}\n\t\tcreateZones(zones,0);\n\t\t\n\t\t// detach the menubar so that it will remain intact when we overwrite project tools\n\t\tvar menubar = document.getElementById(\"menubar\");\n\t\tif(menubar==null)\treturn;\t// huh?\n\t\tmenubar.className=\"depth\"+currentDepth;\n\t\tmenubar.parentNode.removeChild(menubar);\n\t\t\n\t\t// insert the zone list into the navigation bar\n\t\tvar projecttools = document.getElementById(\"projecttools\");\n\t\tprojecttools.innerHTML = html.join('');\n\t\t\n\t\t// insert the menubar\n\t\tvar curZone = document.getElementById(\"current-zone\");\n\t\tif(curZone!=null)\n\t\t\tprojecttools.insertBefore(menubar, curZone.nextSibling);\n\t\telse\n\t\t\tprojecttools.appendChild(menubar); // TODO: will come back to this later\n\t\t\n\t\t// kill all the boxes in front of the projecttools\n\t\twhile(projecttools.previousSibling!=null) {\n\t\t\tprojecttools.parentNode.removeChild(projecttools.previousSibling);\n\t\t}\n\t})();\n\n\n\n\n\n\t// update menubar by using the current location\n\t(function() {\n\t // adds a CSS class to the element\n\t function addClass(e,clazz) {\n\t if(e.className!=null)\n\t e.className += ' '+clazz;\n\t else\n\t e.className = clazz;\n\t }\n\t \n\t // check if element has a CSS class\n\t function hasClass(e,clazz) {\n\t if(e.className==null)\n\t return false;\n\t \n\t var list = e.className.split(/\\s+/);\n\t for( var i=0; i<list.length; i++ ) {\n\t if(list[i]==clazz) return true;\n\t }\n\t return false;\n\t }\n\t \n\t // remove a CSS class\n\t function removeClass(e,clazz) {\n\t if(e.className==null)\n\t return false;\n\t \n\t var list = e.className.split(/\\s+/);\n\t var r = [];\n\t for( var i=0; i<list.length; i++ ) {\n\t if(list[i]!=clazz) r.push(list[i]);\n\t }\n\t e.className = r.join(' ');\n\t }\n\t \n\t var menubar = document.getElementById(\"menubar\");\n\t if(menubar==null)\treturn;\t// huh?\n\t \n\t // LIs that have child ULs is 'parent'\n\t var items = menubar.getElementsByTagName(\"UL\");\n\t for (var i=0; i<items.length; i++ ) {\n\t var ul = items[i];\n\t addClass(ul.parentNode,\"parent\");\n\t }\n\t \n\t // LIs/ULs that are in the path of current page is 'active'\n\t var loc = window.location.href;\n\t function matches(a) {\n\t\tif(a.href==loc)\treturn true; // location match\n\t\tvar m = a.getAttribute(\"match\");\n\t\tif(m==null)\n\t\t\tm = defaultMatchPatterns[a.getAttribute(\"href\")];\n\t\t\n\t\treturn m!=null && loc.match(new RegExp(m));\n\t }\n\t var items = menubar.getElementsByTagName(\"a\");\n\t for( var i=0; i<items.length; i++ ) {\n\t var a = items[i];\n\t if(matches(a)) {\n\t // found match. mark ancestor nodes as active\n\t var e = a.parentNode;\n\t while(e!=menubar) {\n\t addClass(e,\"active\");\n\t e=e.parentNode;\n\t }\n\t break;\n\t }\n\t }\n\t \n\t // install expand/collapse handler for targetless intermediate A tags\n\t var items = menubar.getElementsByTagName(\"a\");\n\t for( var i=0; i<items.length; i++ ) {\n\t var a = items[i];\n\t var href = a.getAttribute(\"href\"); // IE returns fully absolutized href, so check for things that end with '#'\n\t if(href!=null && href!=\"\" && href.charAt(href.length-1)=='#') {// be defensive\n\t\t a.onclick = function() {\n\t\t var li = this.parentNode;\n\t\t if(hasClass(li,\"expanded\")) {\n\t\t removeClass(li,\"expanded\");\n\t\t } else {\n\t\t addClass(li,\"expanded\");\n\t\t }\n\t\t return false;\n\t\t };\n\t\t addClass(this.parent,\"collapsed\");\n\t }\n\t }\n\t \n\t \n\t // all non-'active' LIs are 'inactive'\n\t // all non-'parent' LIs are 'leaf'\n\t var items = menubar.getElementsByTagName(\"LI\");\n\t for( var i=0; i<items.length; i++ ) {\n\t var li = items[i];\n\t if(!hasClass(li,\"active\"))\n\t addClass(li,\"inactive\");\n\t if(!hasClass(li,\"parent\"))\n\t addClass(li,\"leaf\");\n\t }\n\t})();\n\n\t// update the top-left corner of the page from the current project information\n\t(function() {\n\t\tvar box = document.createElement(\"div\");\n\t\tbox.id = \"logo-box\";\n\t\t\n\t\tvar html = [];\n\t\tvar hadToken = false;\n\t\t\n\t\tfunction addLogo() {\n\t\t\tif(info.logo!=null && info.logo!=\"\") {\n\t\t\t\thtml.push(\"<a href=/><img src=\"+info.logo+\"></a>\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(info.noGF) {\n\t\t\taddLogo();\n\t\t}\n\t\t\n\t\tfunction append(url,title) {\n\t\t\tif(title==null)\t\treturn;\n\t\t\tif(hadToken) html.push(\" &#xBB; \");\n\t\t\thadToken=true;\n\t\t\thtml.push(\"<a href=\"+url+\">\");\n\t\t\thtml.push(title);\n\t\t\thtml.push(\"</a>\");\n\t\t}\n\t\t\n\t\tif(foundGroup!=null)\n\t\t\tappend(foundGroup.href, foundGroup.title);\n\t\tappend(\"/\", info.title);\n\t\t\n\t\tif(!info.noGF)\n\t\t\taddLogo();\n\t\t\n\t\tbox.innerHTML = html.join('');\n\t\t\n\t\t// insert after the login bar\n\t\tvar bar = document.getElementById(\"regions-box\");\n\t\tbar.parentNode.appendChild(box);\n\t})();\n\n\t// put the \"hosted on java.net link\"\n\t(function() {\n\t\tvar box = document.createElement(\"div\");\n\t\tvar pt = document.getElementById(\"projecttools\");\n\t\tif(pt==null)\treturn;\t// huh?\n\t\tpt.parentNode.insertBefore(box,pt.nextSibling);\n\t\t\n\t\tbox.id = \"hosted-on-javanet\";\n\t\tbox.innerHTML = \"A <a href='http://www.java.net/'>java.net</a> project\";\n\t})();\n\n\t(function() {\n\t\tvar brdcstmsg = document.getElementById(\"broadcastmsg\");\n if(brdcstmsg==null) return;\n \t//brdcstmsg.innerHTML = \"<p><strong>Alert: message</strong></p>\";\n\t})();\n\n\t// re-display everything\n\tdocument.body.style.display=\"block\";\n\tdocument.getElementById(\"banner\").style.display=\"block\";\n\n\t// jump to anchor if one is given\n\tif(window.location.hash!=null && window.location.hash!=\"\")\n\t\twindow.location.hash = window.location.hash;\n \n // if the user is logged in, looking at issue tracker, and\n // not seeing the update form, suggest him to get an observer role.\n (function() {\n if(window.location.pathname.indexOf(\"/issues/show_bug\")!=0)\n return; // not in the issue tracker\n var changeForm = document.getElementById(\"changeform\");\n if(changeForm==null || changeForm.elements.length>10)\n return; // already seeing the form. must be having the proper permission\n // TODO: check if the user is logged in.\n \n var mainSection = document.getElementById(\"issuezilla\");\n var msg = document.createElement(\"DIV\");\n msg.innerHTML = \"<img src='https://glassfish-theme.dev.java.net/warning.gif' style='vertical-align:middle; margin-left:2em'><strong><a href='/servlets/ProjectMembershipRequest'>Become an observer</a> to comment on this issue</strong>\";\n mainSection.parentNode.insertBefore(msg,mainSection);\n })();\n}", "function listContentType(req,res,template,block,next) {\n\n // Re-retrieve our object\n var ContentType = calipso.lib.mongoose.model('ContentType');\n\n res.menu.adminToolbar.addMenuItem({name:'New Type',path:'new',url:'/content/type/new',description:'Create content type ...',security:[]});\n\n var format = req.moduleParams.format ? req.moduleParams.format : 'html';\n\n var query = new Query();\n\n // Initialise the block based on our content\n ContentType.count(query, function (err, count) {\n\n var total = count;\n\n ContentType.find(query)\n .sort('contentType', 1)\n .find(function (err, contents) {\n\n // Render the item into the response\n if(format === 'html') {\n calipso.theme.renderItem(req,res,template,block,{items:contents},next);\n }\n\n if(format === 'json') {\n res.format = format;\n res.send(contents.map(function(u) {\n return u.toObject();\n }));\n next();\n }\n\n });\n\n\n });\n}", "function createWorldPageFrontView() {\n var countinents = initial_data.continent\n var countries = initial_data.country\n var result = \"<div id='MainContainer'>\";\n\n //List of visited countries splited per continents\n $.each( countinents, function( i, cont ){\n var countriesPerContinentNumber = 0;\n var listOfCountries = \"\";\n\n $.each( countries, function( j, country ){\n if (country.continent_id == cont.continent_id) {\n countriesPerContinentNumber += 1;\n\n listOfCountries += \"<a id='\" + country.short_name + \"' title='Перейти до інформації про країну' onclick='javascript:getCountryPage(this.id)' onmouseover='' style='cursor: pointer;'>\" +\n// \"<a href='index.html?country=\" + country.short_name + \"' onmouseover='' style='cursor: pointer;'>\" +\n \"<img src='IMG/icon/x.gif' title='\" + country.name_full + \"' class='countflag' style='background-position:\" + country.small_flag_img + \"' /></a>\"\n }\n });\n result += \"<div class='my_countries'><div><b>\" + cont.name_ru + \":</b> \" + setCountriesNumberWithCorrectEnd(countriesPerContinentNumber) + \"<span id='citiesNumberPerContinent\" + cont.continent_id + \"'></span>\" +\n \"</div>\" + listOfCountries + \"</div>\";\n });\n result += createWorldMap_HTML(countries);\n result += \"<div class='countryhead'>Усього: \" + setCountriesNumberWithCorrectEnd(countries.length) + \"<span id='totalCitiesNum'></span></div></div>\";\n return result;\n}", "function _drawLists() {\n store.saveState();\n let template = \"\";\n store.State.lists.forEach((list) => (template += list.Template));\n\n document.getElementById(\"list\").innerHTML = template;\n}", "function _drawLists() {\n let lists = store.State.lists;\n let template = '';\n lists.forEach(list => {\n template += list.Template;\n })\n \n document.getElementById('lists').innerHTML = template;\n}", "function allPages(req, res, template, block, next) {\n\n // All available parameters\n // NOTE: This only works here because this template is last:true (see exports).\n var params = res.params;\n\n // Get some data (e.g. this could be a call off to Mongo based on the params\n var item = {\n variable: \"Hello World\",\n params: params\n };\n\n // Now render the output\n calipso.theme.renderItem(req, res, template, block, {\n item: item\n },next);\n\n}", "function _initLayerList() {\n $('#layerspage').page();\n $('<li>', {\n \"data-role\": \"list-divider\",\n text: \"Base Layers\"\n })\n .appendTo('#layerslist');\n var baseLayers = map.getLayersBy(\"isBaseLayer\", true);\n $.each(baseLayers, function() {\n _addLayerToList(this);\n });\n $('<li>', {\n \"data-role\": \"list-divider\",\n text: \"Overlay Layers\"\n })\n .appendTo('#layerslist');\n var overlayLayers = map.getLayersBy(\"isBaseLayer\", false);\n $.each(overlayLayers, function() {\n _addLayerToList(this);\n });\n $('#layerslist').listview('refresh'); \n map.events.register(\"addlayer\", this, function(e) {\n _addLayerToList(e.layer);\n });\n}", "function sitesToPage(unesco){\r\n for (var i in sites) {\r\n var newElement = document.createElement('div');\r\n newElement.id = sites[i].ident; newElement.className = \"cardCase col-sm-12 col-md-6 col-lg-3 \"+sites[i].country;\r\n newElement.innerHTML=\"<div class='card fluid'><img class='section media' src='\"+sites[i].image+\r\n \"'><div class='section'><a href='\"+sites[i].whcSite+\r\n \"' target='_blank'>\"+sites[i].name+\"</a><br>\"+sites[i].city+\", \"+sites[i].country+\" - \"+sites[i].dateVisited+\"</div></div>\";\r\n document.getElementById(\"sitesList\").appendChild(newElement);\r\n }\r\n document.getElementById(\"siteCount\").innerHTML=sites.length;\r\n}", "function addSourcesToPage(sources) {\n const list = document.getElementById('WaterSources');\n\n for (let i = 0; i < sources.length; i++) {\n let li = createListItem(sources[i]);\n list.appendChild(li);\n }\n}", "function readPost_index(obj) {\n\t$.each(obj.post, function(index, value){\n var file = change_alias(value.title).toLowerCase().replace(/ /g, '-');\n var category = value.categories.toLowerCase().replace(/ /g, '-');\n var date = new Date(value.created);\n\t\tvar temp = `<a href=\"post.html?post=${file}\" class=\"card text-center\">\n <img src=\"${value.featureImage}\" class=\"card-img-top\" alt=\"${value.title}\">\n <div class=\"card-header\">\n <h5 class=\"card-title\">${value.title}</h5>\n </div>\n <div class=\"card-body\">\n <p class=\"card-text\"><small class=\"text-muted\">Last updated ${date.toDateString()}</small></p>\n </div>\n </a>`;\n $(`.list-${category}-js`).prepend(temp);\n\t})\t\n}", "static transformTpl(res, pageConfig) {\n res['url'] = res['url'].map((url) => {\n const up = UrlParser.parse(pageConfig.url, true)\n return [up.protocol+'//', up.host, url].join('')\n })\n\n let idx\n res['name'].some((name, i) => {\n if (name === 'Furniture') {\n idx = i\n console.log(Chalk.yellow('IGNORED --------> ', name, pageConfig.url))\n return true\n } else {\n return false\n }\n })\n\n if (idx !== undefined) {\n res['name'].splice(idx, 1)\n res['url'].splice(idx, 1)\n }\n\n return res\n }", "function showPage(list, section, perPage) {\n let startIndex = (section * perPage) - perPage;\n let endIndex = (section * perPage);\n let ul = document.querySelector(\".student-list\");\n ul.innerHTML = \"\";\n \n for (let i = 0; i < list.length; i += 1) {\n if (i >= startIndex && i < endIndex) {\n let obj = list[i];\n if (obj.error) {\n ul.insertAdjacentHTML(\"beforeend\", `<h1 id=\"error\">${obj.error}<h1>`);\n } else {\n ul.insertAdjacentHTML(\"beforeend\", \n `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=${obj.picture[\"large\"]} alt=\"Profile Picture\">\n <h3>${obj.name[\"first\"]} ${obj.name[\"last\"]}</h3>\n <span class=\"email\">${obj.email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\"> Join: ${obj.registered[\"date\"]}</span>\n </div>\n </li>` );\n } \n\n }\n }\n}", "function course_articles_page() {\n try {\n var content = {};\n content.welcome = {\n \tmarkup: '<p style=\"text-align: center;\">' +\n \tt('Select a course for more information') +\n \t'</p>'\n \t\t\t};\n content['course_list'] = {\n theme: 'view',\n format: 'unformatted_list',\n path: 'json-out/course', /* the path to the view in Drupal */\n row_callback: 'course_articles_list_row',\n empty_callback: 'course_articles_list_empty',\n attributes: {\n id: 'course_list_view'\n }\n };\n return content;\n }\n catch (error) { console.log('course_articles_page - ' + error); }\n}", "function template(){\n vm.docDefinition = {\n pageSize: 'A4',\n content: [\n {\n image: logo_garuda,\n width: 50,\n height: 50,\n alignment: 'center',\n margin: [0,0,0,5]\n },\n\n {\n text: '' + vm.item.pegawaiPembuat.jabatan.toUpperCase(), style: 'nama_judul'\n },\n\n {\n text: 'REPUBLIK INDONESIA', style: 'nama_judul', margin: [0,0,0,15]\n },\n\n 'LAMPIRAN',\n 'PERATURAN MENTERI',\n '' + vm.item.namaMenteri.toUpperCase(),\n 'REPUBLIK INDONESIA',\n 'NOMOR '+ vm.item.nomorSurat + ' TAHUN ' + ((new Date()).getYear() + 1900),\n 'TENTANG PEDOMAN ' + vm.item.ttgPedoman.toUpperCase(),\n\n {\n text: 'PEDOMAN', style: 'nama_judul', margin: [0,15,0,0]\n },\n {\n text: '' + vm.item.ttgPedoman.toUpperCase(), style: 'judul_nomor'\n }\n\n ],\n\n styles: {\n nama_judul: {\n alignment : 'center',\n bold: true,\n fontSize: 12\n },\n header1: {\n bold: true,\n fontSize: 15,\n alignment: 'center'\n },\n header2: {\n fontSize: 10,\n alignment: 'center'\n },\n judul_nomor: {\n alignment : 'center',\n bold: true,\n fontSize: 11\n },\n tandaTangan: {\n color: '#000',\n fontSize: 10,\n alignment:'right'\n }\n }\n };\n\n for(var i = 0; i < vm.isiPedoman.length; i++){\n var bab = {\n text: '' + vm.isiPedoman[i].bab, style: 'nama_judul', margin: [0,15,0,0]\n };\n var judulBab = {\n text: '' + vm.isiPedoman[i].judul.toUpperCase(), style: 'judul_nomor', margin: [0,0,0,5]\n };\n var isi = {\n type: 'upper-alpha', bold: true, margin:[0,0,0,15],\n ol: []\n };\n for(var j = 0; j < vm.isiPedoman[i].subab.length; j++)\n isi.ol.push({text:[''+ vm.isiPedoman[i].subab[j].judul +'\\n', {text:'' + vm.isiPedoman[i].subab[j].isi, bold:false}],margin:[0,0,0,10]});\n vm.docDefinition.content.push(bab);\n vm.docDefinition.content.push(judulBab);\n vm.docDefinition.content.push(isi);\n } \n vm.docDefinition.content.push({\n style: 'tandaTangan',\n table: {\n widths: [100],\n body: [\n [{text: ''+vm.item.pegawaiPembuat.jabatan+',', alignment : 'left', bold: true, border: [false, false, false, false]}],\n [{text: ' ',margin: [0,20], border: [false, false, false, false]}],\n [{text: '' + vm.item.pegawaiPembuat.nama, alignment : 'left', border: [false, false, false, false]}]\n ]\n }\n });\n if($state.current.name == \"pedomannonpejabat\"){\n vm.docDefinition.content[2] = {\n margin: [0, 10, 0, 15],\n table: {\n widths: ['*'],\n body: [\n [\n {\n }\n ]\n ]\n },\n layout: {\n fillColor: 'Black'\n }\n };\n\n vm.docDefinition.content[1] = {\n margin: [115, -5, 0, 0],\n table: {\n widths: [90, 90, 150],\n body: [\n [\n {\n border: [false, false, false, false],\n text: 'Telp. (021) 89970696',\n fontSize: 9,\n alignment: 'right'\n },{\n border: [false, false, false, false],\n text: 'Fax. (021) 89970064',\n fontSize: 9,\n alignment: 'center'\n },{\n border: [false, false, false, false],\n text: 'email : [email protected]',\n fontSize: 9,\n alignment: 'left'\n }\n ]\n ]\n }\n };\n\n vm.docDefinition.content[0] = {\n margin: [175, -5, 0, 0],\n table: {\n widths: [230],\n body: [\n [\n {\n border: [false, false, false, false],\n text: 'Komplek Perkantoran Pemerintah Kabupaten Bekasi Desa Sukamahi Kecamatan Cikarang Pusat',\n style: 'header2'\n }\n ]\n ]\n }\n };\n \n vm.docDefinition.content.unshift({\n margin: [90, -5, 0, 0],\n table: {\n widths: [400],\n body: [\n [\n {\n border: [false, false, false, false],\n text: 'DINAS KOMUNIKASI DAN INFORMATIKA PERSANDIAN DAN STATISTIK',\n style: 'header1'\n }\n ]\n ]\n }\n });\n\n vm.docDefinition.content.unshift({\n margin: [90, -96, 0, 0],\n table: {\n widths: [400],\n body: [\n [\n {\n border: [false, false, false, false],\n text: 'PEMERINTAHAN KABUPATEN BEKASI',\n style: 'header1'\n }\n ]\n ]\n }\n });\n\n vm.docDefinition.content.unshift({\n image: logo_bekasi,\n width: 90,\n height: 90\n });\n }\n }", "function makePage(){\n\n codeFellows.makeList();\n disneyLand.makeList();\n}", "function printList(arrayList){\r\n // Pulisce la lista, prima di stamparla\r\n $('.todo-list').text('');\r\n // Preparo template di Handelbars\r\n var source = $('#todo-template').html();\r\n var template = Handlebars.compile(source);\r\n for (var i = 0; i < arrayList.length; i++) {\r\n context = {\r\n listItem: arrayList[i].text,\r\n itemId: arrayList[i].id\r\n };\r\n var html = template(context);\r\n $('.todo-list').append(html);\r\n };\r\n }", "function SP_SetTabsFormat()\n{\n\tvar tabObject,valueExist,edFieldExist,pageObj;\n\tvar pageMC = 2; // value assign 2, to get mcPageId\n\tvar oFormStatus = document.getElementById(\"mastercontrol.hidden.event\");\n\tvar oPage = \"\";\n\tvar nPagesInTab = 0;\n\t\n\t// For tab having more than one page in it.\n\tvar pgCnData = new Array();\n\tpgCnData[0] = false; // Value Exist\n\tpgCnData[1] = false;// Editable Field Exist;\n\t\n\tif(SP_Trim(oFormStatus.value) != \"\")\n\t{\n\n\t\t$(\"ul.tabbernav li a\").each(function(anchorIndex){\n\t\n\t\t\t// get mcPages\n\t\t\tvar tabName = $(this).text()+\"\";\n\t\t\t\n\t\t\tif(tabName.indexOf('*') != -1)\n\t\t\t\ttabName = tabName.replace('*','');\n\t\t\t\t\n\t\t\tvar oAnchor = $(this);\n\t\t\tif($(this).attr(\"name\"))\n\t\t\t{tabName = SP_Trim($(this).attr(\"name\"));}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar tempTabName = tabName.split(\"(\");\n\t\t\t\ttabName = SP_Trim(tempTabName[0]);\t\t\t\t\t\t\t\t \n\t\t\t\ttabName\t= tabName.replace(/ /g,'_'); //replace space with underscore\n\t\t\t\ttabName\t= tabName.replace(/\\//g,'_'); //replace \"/\" with underscore Bug 34054\n\t\t\t\ttabName\t= tabName.replace(/&/g,'and'); // replace & sign with 'and'\n\t\t\t\ttabName\t= tabName.replace(/,/g,''); // remove \",\" from tab name Bug 35570\n\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t$(\"#\"+tabName+\" div.mcPageDiv\").each(function(){\n\t\t\t\tnPagesInTab = $(\"#\"+tabName+\" div.mcPageDiv\").size() * 1;\n\t\t\t\t\n\t\t\t\tif(SP_Trim(tabName) == \"Signatures\")\n\t\t\t\t{\n\t\t\t\t\tvalueExist = SP_IsDataExistInTextarea($(this));\n\t\t\t\t\tif(valueExist)\n\t\t\t\t\t{\n\t\t\t\t\t\toAnchor.css(\"color\",\"black\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\toAnchor.css(\"color\",\"gray\");\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\tvalueExist = SP_IsTabContainData($(this));\n\t\t\t\t\tedFieldExist = SP_EditableFields($(this));\n\t\t\t\t\t \n\t\t\t\t\tpgCnData[0] = (valueExist || pgCnData[0]) ? true : false;\n\t\t\t\t\tpgCnData[1] = (edFieldExist || pgCnData[1]) ? true : false;\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\tif(nPagesInTab > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tSP_FormatingTab(pgCnData[0],pgCnData[1],oAnchor);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSP_FormatingTab(valueExist,edFieldExist,oAnchor);\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tpgCnData[0] = false; // re initialize with default value\n\t\t\tpgCnData[1] = false; // re initialize with default value\t\t\t\t\t\n\n\t\n\t\t});\n\t}\t\n\t\n}", "function detailPage(ind){\n displayDetails(formatDetails('detail', json.list[ind]));\n // console.log(json.list[ind]);\n document.getElementById(\"homepage\").style.display = \"none\";\n document.getElementById(\"detailpage\").style.display = \"block\";\n }", "function lists() {\n\t$.post(\"listobject.hrd\", function(data) {\n\t\t$(\"#tblist\").html(listobjectdetails(data));\n\t});\n\n}", "function displayListings(data) {\n // Target the housing container already present in index.html\n var $housing = $('.js-housing');\n $housing.empty();\n var $container, i;\n // Loop through each listing\n for (i=0; i<data.length; i++) {\n var listing = data[i].properties;\n var coordinates = data[i].geometry.coordinates;\n // Creates a basic listing\n if (listing.sublease) {\n $container = displaySublease(listing, i, coordinates);\n //console.log(\"listing in displaysublease: \", listing);\n //console.log('sublease listing');\n } else {\n $container = displayPromo(listing, i, coordinates);\n //console.log('promo listing');\n }\n // Add the listing to the DOM\n $housing.append($container);\n }\n}", "function processContent(o, tabnr, back, listid, listplace) {\n if (o.listid) {\n // processing a List\n lists[o.listid] = [];\n o.pages.forEach(function(page,i) {\n lists[o.listid].push({\n navtextid: page.navtextid,\n pageid: page.pageid\n });\n processContent(page, tabnr, o.back, o.listid, i);\n });\n } else {\n // processing a Page\n pages[o.pageid] = {\n view: o.view,\n tabnr: tabnr,\n back: (o.back) || (back),\n listid: listid,\n\t\t\t\t\tlistplace: listplace\n };\n if (!tabs[tabnr].rootpageid) {\n tabs[tabnr].rootpageid = o.pageid;\n }\n if (o.sub) {\n processContent(o.sub, tabnr, back);\n }\n }\n }", "function getPantryList() {\n $.get(\"/api/inventories\", function(data) {\n var rowsToAdd = [];\n // var dataArray = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createPantryRow(data[i]));\n };\n renderPantryList(rowsToAdd);\n });\n }", "function printPageLabList(folder) {\n var html = '';\n var url = '/api/folders' + folder;\n var type = 'GET';\n FOLDER = folder;\n $.ajax({\n cache: false,\n timeout: TIMEOUT,\n type: type,\n url: encodeURI(url),\n dataType: 'json',\n success: function (data) {\n // Clear the message container\n $(\"#notification_container\").empty()\n if (data['status'] == 'success') {\n logger(1, 'DEBUG: folder \"' + folder + '\" found.');\n\n html = new EJS({url: '/themes/default/ejs/layout.ejs'}).render({\n \"MESSAGES\": MESSAGES,\n \"folder\": folder,\n \"username\": USERNAME,\n \"role\": ROLE\n })\n $(\"#alert_container\").remove();\n\n // Adding to the page\n $('#body').html(html);\n\n // Adding all folders\n $.each(data['data']['folders'], function (id, object) {\n $('#list-folders > ul').append('<li><a class=\"folder action-folderopen\" data-path=\"' + object['path'] + '\" href=\"javascript:void(0)\" title=\"Double click to open, single click to select.\">' + object['name'] + '</a></li>');\n });\n\n // Adding all labs\n $.each(data['data']['labs'], function (id, object) {\n $('#list-labs > ul').append('<li><a class=\"lab action-labpreview\" data-path=\"' + object['path'] + '\" href=\"javascript:void(0)\" title=\"Double click to open, single click to select.\">' + object['file'] + '</a></li>');\n });\n\n\n\n // Read privileges and set specific actions/elements\n if (ROLE == 'admin' || ROLE == 'editor') {\n // Adding actions\n $('#actions-menu').empty();\n $('#actions-menu').append('<li><a class=\"action-folderadd\" href=\"javascript:void(0)\"><i class=\"glyphicon glyphicon-folder-close\"></i> ' + MESSAGES[4] + '</a></li>');\n $('#actions-menu').append('<li><a class=\"action-labadd\" href=\"javascript:void(0)\"><i class=\"glyphicon glyphicon-file\"></i> ' + MESSAGES[5] + '</a></li>');\n $('#actions-menu').append('<li><a class=\"action-selectedclone\" href=\"javascript:void(0)\"><i class=\"glyphicon glyphicon-copy\"></i> ' + MESSAGES[6] + '</a></li>');\n $('#actions-menu').append('<li><a class=\"action-selectedexport\" href=\"javascript:void(0)\"><i class=\"glyphicon glyphicon-export\"></i> ' + MESSAGES[8] + '</a></li>');\n $('#actions-menu').append('<li><a class=\"action-import\" href=\"javascript:void(0)\"><i class=\"glyphicon glyphicon-import\"></i> ' + MESSAGES[9] + '</a></li>');\n $('#actions-menu').append('<li><a class=\"action-folderrename\" href=\"javascript:void(0)\"><i class=\"glyphicon glyphicon-pencil\"></i> ' + MESSAGES[10] + '</a></li>');\n $('#actions-menu').append('<li><a class=\"action-selecteddelete\" href=\"javascript:void(0)\"><i class=\"glyphicon glyphicon-trash\"></i> ' + MESSAGES[7] + '</a></li>');\n\n // Make labs draggable (to move inside folders)\n $('.lab').draggable({\n appendTo: '#body',\n helper: 'clone',\n revert: 'invalid',\n scroll: false,\n snap: '.folder',\n stack: '.folder'\n });\n\n // Make folders draggable (to move inside folders)\n $('.folder').draggable({\n appendTo: '#body',\n helper: 'clone',\n revert: 'invalid',\n scroll: false,\n snap: '.folder',\n stack: '.folder'\n });\n\n // Make folders draggable (to receive labs and folders)\n $('.folder').droppable({\n drop: function (e, o) {\n var object = o['draggable'].attr('data-path');\n var path = $(this).attr('data-path');\n logger(1, 'DEBUG: moving \"' + object + '\" to \"' + path + '\".');\n if (o['draggable'].hasClass('lab')) {\n $.when(moveLab(object, path)).done(function (data) {\n logger(1, 'DEBUG: \"' + object + '\" moved to \"' + path + '\".');\n o['draggable'].fadeOut(300, function () {\n o['draggable'].remove();\n })\n }).fail(function (data) {\n logger(1, 'DEBUG: failed to move \"' + object + '\" into \"' + path + '\".');\n addModal('ERROR', '<p>' + data + '</p>', '<button type=\"button\" class=\"btn btn-flat\" data-dismiss=\"modal\">Close</button>');\n });\n } else if (o['draggable'].hasClass('folder')) {\n $.when(moveFolder(object, path)).done(function (data) {\n logger(1, 'DEBUG: \"' + object + '\" moved to \"' + path + '\".');\n o['draggable'].fadeOut(300, function () {\n o['draggable'].remove();\n })\n }).fail(function (data) {\n logger(1, 'DEBUG: failed to move \"' + object + '\" into \"' + path + '\".');\n addModal('ERROR', '<p>' + data + '</p>', '<button type=\"button\" class=\"btn btn-flat\" data-dismiss=\"modal\">Close</button>');\n });\n } else {\n // Should not be here\n logger(1, 'DEBUG: cannot move unknown object.');\n }\n\n }\n });\n } else {\n $('#actions-menu').empty();\n $('#actions-menu').append('<li><a href=\"javascript:void()\">&lt;' + MESSAGES[3] + '&gt;</a></li>');\n }\n } else {\n // Application error\n logger(1, 'DEBUG: application error (' + data['status'] + ') on ' + type + ' ' + url + ' (' + data['message'] + ').');\n addModal('ERROR', '<p>' + data['message'] + '</p>', '<button type=\"button\" class=\"btn btn-flat\" data-dismiss=\"modal\">Close</button>');\n }\n\n bodyAddClass('folders');\n // Extend height to the bottom if shorter\n autoheight();\n\n },\n error: function (data) {\n // Server error\n var message = getJsonMessage(data['responseText']);\n logger(1, 'DEBUG: server error (' + data['status'] + ') on ' + type + ' ' + url + '.');\n logger(1, 'DEBUG: ' + message);\n addModal('ERROR', '<p>' + message + '</p>', '<button type=\"button\" class=\"btn btn-flat\" data-dismiss=\"modal\">Close</button>');\n }\n });\n}", "function addGarmentsOfSpecificPageNumber(pageNumber){\n\t\t// Se remueven las prendas anteriores (de clase posts)\n\t\t$(\".post\").remove();\n\t\t// Se actualiza el numero de pagina (variable global)\n\t\tcurrentPageNumber = pageNumber;\n\t\t// Se verifica si es que existen prendas para esa pagina\n\t\tif(pageNumber in favoriteGarmentsJson){\n\t\t\t// Se obtienen las prendas de la pagina seleccionada\n\t\t\t// garmentsJson se define en el template\n\t\t\tvar favoriteGarmentsPage = favoriteGarmentsJson[pageNumber];\n\t\t\t// Se itera sobre cada prenda\n\t\t\t// Se eliminan las prendas desde la variable postsList (del template)\n\t\t\t$scope.postsList = [];\n\t\t\tfor(var i=0;i<favoriteGarmentsPage.length;i++){\n\t\t\t\t// Se obtiene la prenda favorita\n\t\t\t\tvar favoriteGarment = favoriteGarmentsPage[i];\n\t\t\t\t// Se obtiene la prenda\n\t\t\t\tvar garment = garmentsJson[favoriteGarment.pk][0];\n\t\t\t\t// Se obtiene la marca de la prenda\n\t\t\t\tvar trademark = trademarksJson[garment.pk][0];\n\t\t\t\t// Se obtiene la empresa de la prenda\n\t\t\t\tvar company = companiesJson[garment.pk][0];\n\t\t\t\tvar urlForRedirectToCompanyProfile = urlCompanyProfile + company.pk;\n\t\t\t\t// Se crea objeto a agregar a postsList\n\t\t\t\tpostObject = {\"garment\":garment,\"trademark\":trademark,\"company\":company,\"urlForRedirectToCompanyProfile\":urlForRedirectToCompanyProfile};\n\t\t\t\t// Se agrega el posteo (y todo lo relacionado a este) a la lista postsList la cual se muestra en el temlpate\n\t\t\t\t// Si es que no esta definido aun\n\t\t\t\tif(typeof $scope.postsList == \"undefined\"){\n\t\t\t\t\t$scope.postsList = [postObject];\n\t\t\t\t// Si es que existia antes, se agrega el elemento a la lista\n\t\t\t\t}else{\n\t\t\t\t\t$scope.postsList.push(postObject);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t// Si es que no existen prendas\n\t\telse{\n\t\t\t// Se muestra un mensaje\n\t\t\tconsole.log(\"no hay prendas\");\n\t\t}\n\t}", "function showPage(list, page) {\n //store start and end index\n let startIndex = (page * 9) - 9;\n let endIndex = page * 9;\n\n //get student list element and empty it\n let studentList = document.querySelector('.student-list');\n studentList.innerHTML = '';\n\n //loop over list parameter length and store student data\n for (let i = 0; i < list.length; i++) {\n if (i >= startIndex && i < endIndex) {\n let studentItem = `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\n <h3>${list[i].name.title} ${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>\n </li>`;\n studentList.insertAdjacentHTML('beforeend', studentItem);\n }\n }\n}", "function showPage(page,list) {\r\n const startIndex = (page * itemsPerPage) - itemsPerPage;\r\n const endIndex = page * itemsPerPage;\r\n //loop over the student list, print 10 student according the index position\r\n for(let i = 0; i < list.length; i++){\r\n if( i >= startIndex && i < endIndex){\r\n list[i].style.display = 'block';\r\n } else {\r\n list[i].style.display = 'none';\r\n }\r\n }\r\n }", "function load_page(data){\n $(\".block-container\").empty();\n var infos = data.Infos;\n var page = \"<block class='block'>\";\n for (var i = 0; i < infos.length; i++) {\n page += infos[i].html;\n }\n page += \"</div>\";\n $(\".block-container\").append(page);\n}", "editDisplayOrder(rules, file) {\n if (!rules || !file)\n throw new Error('Invalid parameters');\n for (let rule of rules) {\n const index = this._docType.indexOf(rule['範本代碼']);\n if (index === -1)\n continue;\n file.Templates[index].TemplateType = String(rule['範本類別']);\n file.Templates[index].DisplayOrder = Number(rule['序號']);\n }\n return file;\n }", "function _drawLists() {\n let template = ''\n let lists = _store.State.lists\n let listId = ''\n\n\n lists.forEach(list => template += list.Template)\n\n document.getElementById(\"lists\").innerHTML = template\n}", "function getPages()\n{\n\t//add each page to view in app\n\t//Examples:\n\t//for adding a header:\n\t////\"header\":{\n\t////\t\"url\":\"pages/general/header.html\",\n\t////\t\"left\":\"<a></a>\",\n\t////\t\"center\":\"<a></a>\",\n\t////\t\"right\":\"<a></a>\"\n\t////}\n\t//for adding a panel:\n\t////\"leftPanel\":{\n\t////\t\"id\":\"nav-panel\",\n\t////\t\"url\":\"pages/general/left_panel.html\"\n\t////}\n\t//for adding dialogs, you can add more then one\n\t////\"popup\":[\n\t//// {\n\t//// \t \"url\":\"pages/general/popup.html\",\n\t//// \t \"id\":\"dialog\", \n\t//// \t \"header\":\"myHeader\", \n\t//// \t \"title\":\"Hi Dialog!\", \n\t//// \t \"content\":\"You have to insert your own content here\", \n\t//// \t \"okButton\":{\"action\":\"alert('ok button action');\",\"location\":\"#login\",\"text\":\"OK\"}, \n\t//// \t \"cancelButton\":{\"action\":\"alert('cancel button action');\",\"location\":\"\",\"text\":\"Cancel\"}\n\t//// }\n\t//// ]\n\treturn [\n\t\t\t{\"id\":\"profile\", \"url\":\"pages/profile/user.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aUser'>User</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='validateProfile(); setSGMMDataTransaction(); saveUserMedicalData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"profileNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"mechanic\", \"url\":\"pages/profile/mechanic.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aMechanical'>Mecanico</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='saveMechanicData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"mechanicNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"medical\", \"url\":\"pages/profile/medical.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aMedical'>Medicos</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='saveUserMedicalData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"medicalNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"policiesContent\", \"url\":\"pages/policy/policiesContent.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a tag='a' lng='vehicles' onClick='backPolicy();' class='ui-btn ui-corner-all ui-icon-arrow-l ui-btn-icon-left'>Vehicles</a>\",\n\t\t\t \t\"center\":\"<h2 lng='vehicle'>Vehicle</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onClick='validPolicy();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\" \n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"showPolicies\", \"url\":\"pages/policy/showPolicies.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='vehicles'>Vehicles</h2>\",\n\t\t\t \t\"right\":\"<a onClick='validNewPolicy();' tag='a' id='save' class='ui-btn ui-corner-all ui-icon-plus ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"policiesNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"contactsContent\", \"url\":\"pages/contacts/contactsContent.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#showContacts' tag='a' id='aContacts' class='ui-btn ui-corner-all ui-icon-arrow-l ui-btn-icon-left'>Contactos</a>\",\n\t\t\t \t\"center\":\"<h2 id='aContact'>Contacto</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='validateContact();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t }\n\t\t\t}, \n\t\t\t{\"id\":\"showContacts\", \"url\":\"pages/contacts/showContacts.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aContacts'>Contactos</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onClick='validNewContact();' class='ui-btn ui-corner-all ui-icon-plus ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"sContactsNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t}, \n\t\t\t{\"id\":\"showInsurance\", \"url\":\"pages/contacts/insurance.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aInsurances'>Aseguradoras</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"sInsuranceNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"initial\", \"url\":\"pages/initial.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='report'>Reportar</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelInitial\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"sinDetails\", \"url\":\"pages/sinisters/details.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a lng='report' href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>Reportar</a>\",\n\t\t\t \t\"center\":\"<h2 lng='pictures'>Fotos</h2>\",\n\t\t\t \t\"right\":\"<a href='#' onclick='enviarExtras();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-left ui-btn-icon-notext'></a>\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"sinisterList\", \"url\":\"pages/sinisters/sinisterList.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='sinisters'>Siniestros</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelSinList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"theftsList\", \"url\":\"pages/sinisters/theftsList.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='thefts'>Robos</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelTheftList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"consultSinister\", \"url\":\"pages/sinisters/consultSinister.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>List</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>Details</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"signup\", \"url\":\"pages/account/signup.html\"\n\t\t\t},\n\t\t\t{\"id\":\"login\", \"url\":\"pages/account/login.html\"\n\t\t\t},\n\t\t\t{\"id\":\"signin\", \"url\":\"pages/account/signin.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_a\", \"url\":\"pages/account/features_a.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_b\", \"url\":\"pages/account/features_b.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_c\", \"url\":\"pages/account/features_c.html\"\n\t\t\t},\n\t\t\t{\"id\":\"options\", \"url\":\"pages/options/options.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='options'>Options</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelTheftList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"about\", \"url\":\"pages/options/about.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>options</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>About</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t},\n\t\t\t{\"id\":\"map\", \"url\":\"pages/sinisters/map.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>report</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>Location</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t},\n\t\t\t{\"id\":\"report\", \"url\":\"pages/sinisters/report.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a lng='report' href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>report</a>\",\n\t\t\t \t\"center\":\"<h2 id='titleReport' lng='details'>R.Type</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t}\n\t ];\n\t\n}", "function showPage(list, page) {\r\n let startIndex = page * itemsPerPage - itemsPerPage;\r\n let endIndex = page * itemsPerPage;\r\n clearHtml(studentList);\r\n for (let i =0; i < list.length; i++) {\r\n if (i >= startIndex && i < endIndex) {\r\n let itemContents = \r\n `<li class=\"student-item cf\">\r\n <div class=\"student-details\">\r\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\r\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\r\n <span class=\"email\">${list[i].email}</span>\r\n </div>\r\n <div class=\"joined-details\">\r\n <span class=\"date\">J${list[i].registered.date}</span>\r\n </div>\r\n </li>`;\r\n studentList.insertAdjacentHTML('beforeend', itemContents);\r\n }\r\n }\r\n}", "function showPage(list, page) { \n const startIndex = (page * pageMax) - pageMax; //startIndex becomes 0 if the page is 1, 10 if page is 2, etc.\n const endIndex = (page * pageMax) - 1; //endIndex becomes 9 if page is 1, 19 if page is 2, etc.\n for (let i = 0; i < list.length; i++) //for loop will run through the entire number of list items before stopping\n if ( i >= startIndex && i <= endIndex) {\n list[i].style.display = ''; //displays all list items within the range of startIndex' value and endIndex' value\n } else {\n list[i].style.display = 'none'; //hides all list items not contained within the start and end Index values.\n }\n\n}", "function showPage(list, page) {\n const startIndex = (page * 9) - 9;\n const endIndex = page * 9;\n const studentUL = document.querySelector('.student-list');\n studentUL.innerHTML = '';\n\n if (list.length < 1) {\n const ul = document.querySelector('.student-list');\n ul.innerHTML = `<h1>No results found...</h1>`;\n } else {\n for ( let i = 0; i < list.length; i++ ) {\n if ( i >= startIndex && i < endIndex ) {\n const studentLI = `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=${list[i].picture.thumbnail}\n alt=\"Profile Picture\">\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined \n ${list[i].registered.date}</span>\n </div>\n </li>`;\n\n studentUL.insertAdjacentHTML('beforeend', studentLI);\n }\n }\n }\n}", "function loadListPageData() {\n $('#list > ul').html(setListPageSensors());\n}", "function getPage(manu) {\r\n var pageext =[];\r\n\r\n for(i=0;i<manuList.length;i++){\r\n if(manuList[i]==manu){\r\n pageext.push(pageList[i]);\r\n }\r\n }\r\n return pageext;\r\n}", "function viewsectiontree() {\n $.each(treesectionArray, function(i, data) {\n checkdraft = data[\"draft\"];\n if (!checkdraft) {\n if (treesectionArray.length) {\n /* var content = \"<a href='\" + data[\"url\"] + \"'>\" + data[\"name\"] + \"</a>\";\n var list = $('<li class=\"treeline\" id=\"treelist\"/>').html(content);\n */\n var hold = document.createElement(\"a\");\n hold.href = data[\"url\"];\n var temp = document.createTextNode(data[\"name\"]);\n hold.appendChild(temp);\n var list = document.createElement(\"li\");\n list.className = \"treeline\";\n list.appendChild(hold);\n showData.css('display', 'none').append(list);\n }\n }\n });\n }", "function add_listings_for_preset(evt, preset) {\n var $form = $( evt.target );\n var no_items = $form.find('.listing-row.inline-item').length;\n var desired_no = 0;\n var $template = $form.find('.listing-row-template:first');\n if ($template.length == 0) {\n log_inline.log('add_listings_for_preset: template not found');\n return;\n }\n for (var i = 0; i < preset.data.length; i++) {\n var o = preset.data[i];\n if (o.name == 'placement_set-0-listings') desired_no++;\n }\n // add listings if necessary\n for (var i = no_items; i < desired_no; i++) {\n add_inline($template, i+1);\n }\n // remove listings if necessary\n for (var i = no_items; i > desired_no; i--) {\n $('.listing-row.inline-item:last').remove();\n }\n }", "gerarDetalheListaPage(tabela) {\n const _super = Object.create(null, {\n gravarArquivo: { get: () => super.gravarArquivo }\n });\n return __awaiter(this, void 0, void 0, function* () {\n let modelJson = new flutter_aba_detalhe_lista_page_1.FlutterAbaDetalheListaPage(tabela, this.tabela, this.dataPacket);\n let modelTemplate = fs.readFileSync(this.arquivoTemplateAbaDetalheListaPage).toString();\n let modelGerado = Mustache.render(modelTemplate, modelJson);\n let nomeArquivo = tabela.toLowerCase() + '_lista_page';\n return _super.gravarArquivo.call(this, this.caminhoFontes + this.tabela + '/MestreDetalhe/' + nomeArquivo + '.dart', modelGerado);\n });\n }", "function showPage(list, page) {\n const startIndex = (page * numberOfItems) - numberOfItems;\n const endIndex = page * numberOfItems;\n for ( let i = 0; i < list.length; i++ ) {\n if ( i < startIndex || i >= endIndex ) { //condition to select 10 items per page. true if either of the conditions are true.\n list[i].style.display = 'none';\n } else {\n list[i].style.display = 'block';\n }\n }\n}", "function _getListBaseTemplate() {\n var listTemplate = -1;\n var spPageContextInfo = window['_spPageContextInfo'];\n if (spPageContextInfo !== undefined && spPageContextInfo !== null) {\n listTemplate = spPageContextInfo.listBaseTemplate;\n }\n return listTemplate;\n }", "function show_post_by_page(page, data){\n $.each(data, function(index, item){\n if (index >= page*4-4 && index < page*4){\n var href = item['link'];\n var title = item['title'];\n var content = item['content'];\n var describe = content.replace(/(<([^>]+)>)/ig,\"\").slice(0,121) + '...';\n var tags = item['categories'];\n //console.log(tags);\n $(\"#news\").append(construct_html(href, title, describe, tags))\n }\n })\n }", "function pageType(){\r\n\tlist_pages=['page-WiHome','page-WiAltGenre','page-WiSimilarsByViewType','page-Kids','page-KidsAltGenre']\r\n\tif ($.inArray($(\"body\").attr(\"id\"),list_pages) >= 0){\r\n\t\treturn \"LIST\";\r\n\t}\r\n\telse{\r\n\t\treturn \"DETAIL\";\r\n\t}\r\n}", "getAndDisplay(listDisplayName) {\n try {\n //Note - this is a fix for NZ timezone!!\n const currentDay = moment().subtract(18, \"h\"), isodate = currentDay.toISOString();\n $pnp.sp.web.lists.getByTitle(listDisplayName).items.select([\"Title\",\"AnnouncementLevel\",\"Body\"]).filter(\"Expires ge datetime'\" + isodate + \"'\").orderBy(\"AnnouncementLevel\", true).get().\n then((data) => {\n if (data && data.length > 0){\n console.log(JSON.stringify(data));\n let announcementsHtml = data.map((item) => {\n const className = this.deriveClass(item.AnnouncementLevel),\n icon = this.deriveIcon(item.AnnouncementLevel);\n return `<li class=\"${className}\">${icon}<div class=\"announcementBannerTitle\">${item.Title}</div><div class=\"announcementBannerBody\">${item.Body}</div></li>`\n });\n document.getElementById(\"customContent\").innerHTML = \"<ul>\" + [...announcementsHtml].join(\"\") + \"</ul>\"; \n }\n })\n .catch((error) => {\n this.logToConsole(`1 - Error attempting to get list items from '${listDisplayName}': ${error.message}`);\n });\n } catch (e) {\n $pnp.sp.web.lists.getByTitle(listDisplayName).get()\n .then((list) => {\n this.logToConsole(`2 - Error getting items from list '${list.Title}': ${e.message}`);\n })\n .catch((error) => {\n this.logToConsole(`3 - Could not find list named '${listDisplayName}': ${error.message}`);\n });\n } \n }", "_getListDialogContent(sortBy, sortAsc) {\n const operation = getSelectedOperation();\n const content = new Sortable();\n content.fields = [\n {\n name: wX(\"FROM_PORT\"),\n value: (blocker) => {\n return operation.getPortal(blocker.fromPortalId).name;\n },\n sort: (a, b) => a.localeCompare(b),\n format: (row, value, blocker) => {\n const p = operation.getPortal(blocker.fromPortalId);\n row.appendChild(p.displayFormat());\n },\n },\n {\n name: this._smallScreen ? \"#\" : wX(\"COUNT\"),\n value: (blocker) => {\n const c = operation.blockers.filter(\n (b) =>\n b.fromPortalId == blocker.fromPortalId ||\n b.toPortalID == blocker.fromPortalId\n );\n return c.length;\n },\n format: (row, value) => (row.textContent = value),\n },\n {\n name: wX(\"TO_PORT\"),\n value: (blocker) => {\n return operation.getPortal(blocker.toPortalId).name;\n },\n sort: (a, b) => a.localeCompare(b),\n format: (row, value, blocker) => {\n const p = operation.getPortal(blocker.toPortalId);\n row.appendChild(p.displayFormat());\n },\n },\n {\n name: this._smallScreen ? \"#\" : wX(\"COUNT\"),\n value: (blocker) => {\n const c = operation.blockers.filter(\n (b) =>\n b.fromPortalId == blocker.toPortalId ||\n b.toPortalId == blocker.toPortalId\n );\n return c.length;\n },\n format: (row, value) => (row.textContent = value),\n },\n ];\n content.sortBy = sortBy;\n content.sortAsc = sortAsc;\n content.items = operation.blockers;\n return content;\n }", "function showPage(list,page){ // 1- receives list of elements and page number as arguments\n\n// 2- calculate start/end index according to the page \nlet startIndex = (page * liPerPage) -liPerPage; //i.e. (2*10)-10 = 10.. start index is 10 on second page\nlet endIndex = page * liPerPage; // i.e. 2*10 = 20.. Gets items from 10 to 20 on second page\n\n// 4- iterare trough list and display items within the range of StartIndex-EndIndex \nfor (i = 0; i< list.length; i++) { \n\n if( (i >= startIndex) && (i<endIndex)) {\n\nlist[i].style.display = 'block';\n\n }\n// 5- Hide the remaining items 'none'\n else {\n \n list[i].style.display = 'none';\n \n }\n }\n\n\n}", "function createObjectListing(obj_title, obj_id, obj_class, obj_permalink, blog_id) {\n var $preview = jQuery('<span/>')\n .addClass('obj-title')\n .text(obj_title);\n // Edit link.\n var $edit = jQuery('<a/>')\n .attr('href', CMSScriptURI+'?__mode=view&_type='+obj_class+'&id='+obj_id+'&blog_id='+blog_id)\n .addClass('edit')\n .attr('target', '_blank')\n .attr('title', 'Edit in a new window')\n .html('<img src=\"'+StaticURI+'images/status_icons/draft.gif\" width=\"9\" height=\"9\" alt=\"Edit\" />');\n // View link.\n var $view;\n if (obj_permalink) {\n $view = jQuery('<a/>')\n .attr('href', obj_permalink)\n .addClass('view')\n .attr('target', '_blank')\n .attr('title', 'View in a new window')\n .html('<img src=\"'+StaticURI+'images/status_icons/view.gif\" width=\"13\" height=\"9\" alt=\"View\" />');\n }\n // Delete button.\n var $remove = jQuery('<img/>')\n .addClass('remove')\n .attr('title', 'Remove selected entry')\n .attr('alt', 'Remove selected entry')\n .attr('src', StaticURI+'images/status_icons/close.gif')\n .attr('width', 9)\n .attr('height', 9);\n\n // Insert all of the above into a list item.\n var $li = jQuery('<li/>')\n .attr('id', 'obj-'+obj_id)\n .append($preview)\n .append($edit)\n .append($view)\n .append($remove);\n\n return $li;\n}", "function listItems(){\r\n\t\tfullList.innerHTML = '';\r\n\t\tsortListsByDate().forEach((item, index) => {\r\n\t\t\tfullList.insertAdjacentHTML( 'beforeend', listHTMLString(item, index) );\r\n\t\t});\r\n\r\n\t}", "function formatDirContents(contents) {\n\tvar obj = JSON.parse(contents);\n\tvar dirs = obj.directories;\n\tvar dirList = \"\";\n\tif (dirs) {\n\t\tvar dirList = \"<ul id='dir-listing'>\";\n\t\tfor (i = 0; i < dirs.length; i++)\n\t\t\tdirList += \"<li class='clickable' draggable='true'>\" + dirs[i].name\n\t\t\t\t\t+ \"</li>\";\n\t\tdirList += \"</ul>\";\n\t}\n\tvar files = obj.files;\n\tvar textTypes = [ 'txt', 'csv', 'sh', 'csh' ];\n\tvar imgTypes = [ 'jpg', 'jpeg', 'bmp', 'gif', 'tif', 'svg' ];\n\tvar fileList = \"\";\n\tvar fileType;\n\tif (files) {\n\t\tvar fileList = \"<ul id='file-listing'>\";\n\t\tfor (i = 0; i < files.length; i++) {\n\t\t\tfileType = 'unknown';\n\t\t\tif (textTypes.indexOf(files[i].type) >= 0)\n\t\t\t\tfileType = 'text';\n\t\t\telse if (imgTypes.indexOf(files[i].type) >= 0)\n\t\t\t\tfileType = 'image';\n\t\t\telse if (files[i].type == 'pdf')\n\t\t\t\tfileType = 'pdf';\n\n\t\t\tvar link = '<a class=\"' + fileType + '\" target=\"_blank\" href=\"'\n\t\t\t\t\t+ properties.toLink() + '/' + files[i].name + '\">'\n\t\t\t\t\t+ files[i].name + '</a>';\n\t\t\tfileList += \"<li>\" + link + \"</li>\";\n\t\t}\n\n\t\tfileList += \"</ul>\";\n\t}\n\treturn dirList + fileList;\n}", "function node_page_pageshow() {\n try {\n // Grab some recent content and display it.\n views_datasource_get_view_result(\n 'drupalgap/views_datasource/drupalgap_content', {\n success: function(content) {\n // Extract the nodes into items, then drop them in the list.\n var items = [];\n for (var index in content.nodes) {\n if (!content.nodes.hasOwnProperty(index)) { continue; }\n var object = content.nodes[index];\n items.push(l(object.node.title, 'node/' + object.node.nid));\n }\n drupalgap_item_list_populate('#node_listing_items', items);\n }\n }\n );\n }\n catch (error) { console.log('node_page_pageshow - ' + error); }\n}", "function exportList() {\n\t\tvar string;\n\n\t\t//save stuff to string\n\t\t//the title\n\t\tstring = '<p>' + $('#list-title').text() + '</p>';\n\t\tstring += '<p>' +$('#list-desc').text() + '</p>';\n\n\t\t//the list items\n\t\tfor (var i = 0; i < $('.item').length; i++) {\n\t\t\tstring += '<p>' + (i + 1) + '. ' + $('.item').eq(i).find('.title-individual').text() + '<br>';\n\t\t\tstring += $('.item').eq(i).find('.notes').text() + '<br>';\n\t\t\tstring += ' [ ';\n\t\t\tvar classes = $('.item').eq(i).attr('class');\n\t\t\tif (classes.indexOf(\"deleted\") != -1) {\n\t\t\t\tstring += 'archived ';\n\t\t\t}\n\t\t\tif (classes.indexOf(\"completed\") != -1) {\n\t\t\t\tstring += 'completed ';\n\t\t\t}\n\t\t\tif (classes.indexOf(\"not-completed\") != -1) {\n\t\t\t\tstring += 'not completed ';\n\t\t\t}\n\t\t\tstring += ']';\n\t\t\tstring += '</p>';\n\t\t}\n\n\t\t//now show the entire list in a popup for someone to copy and paste\n\t\t$('#export-data').html(string);\n\t\t$('.export').fadeIn(300);\n\t}", "function createPage () {\n\t$(\"ul li\").each(function(index) {\n\t\tobj = $(this)\n\t\tdivCount += 1\n\t\t\tif (divCount < 10) {\n\t\t\t\tobj.show()\n\t\t\t} else {\n\t\t\t\tobj.hide()\n\t\t\t}\n\t\t\tif (index % 10 === 0) {\n\t\t\t\tnewTag += \"<li id=\\\"page\\\"><a href=\\\"#\\\">\" + countCreate + \"</a></li>\"\n\t\t\t\tcountCreate++;\n\t\t\t}\n\t});\n\tif (newTag !== null) {\n\t\t$(\"ul\").append(\"<nav aria-label=\\\"Page navigation\\\"><ul class=\\\"pagination\\\">\" + newTag + \"</ul></nav>\");\n\t}\n\n}", "function PagesContent() {\n\n}", "static displayEntries() {\n let posts = Store.getEntries();\n\n posts.forEach((entry) => UI.addEntryToList(entry));\n\n }", "function createTemplates(ul) {\n for (firstI=0; firstI<numberOfPages; firstI++) {\n for (secondI=0; secondI<10; secondI++){\n if (aNumber == numberOfStudents) {break;}\n newArray += ul[loopAll(aNumber,addToANumber())].outerHTML;\n }\n secondArray[firstI] = newArray;\n newArray = [];\n }\n}", "function show_settings() {\n var list = {};\n list.start = \"<li><div class='ui-field-contain'><fieldset>\";\n\n $.each(window.controller.options,function(key,data) {\n switch (key) {\n case \"tz\":\n var timezones = [\"-12:00\",\"-11:30\",\"-11:00\",\"-10:00\",\"-09:30\",\"-09:00\",\"-08:30\",\"-08:00\",\"-07:00\",\"-06:00\",\"-05:00\",\"-04:30\",\"-04:00\",\"-03:30\",\"-03:00\",\"-02:30\",\"-02:00\",\"+00:00\",\"+01:00\",\"+02:00\",\"+03:00\",\"+03:30\",\"+04:00\",\"+04:30\",\"+05:00\",\"+05:30\",\"+05:45\",\"+06:00\",\"+06:30\",\"+07:00\",\"+08:00\",\"+08:45\",\"+09:00\",\"+09:30\",\"+10:00\",\"+10:30\",\"+11:00\",\"+11:30\",\"+12:00\",\"+12:45\",\"+13:00\",\"+13:45\",\"+14:00\"];\n var tz = data-48;\n tz = ((tz>=0)?\"+\":\"-\")+pad((Math.abs(tz)/4>>0))+\":\"+((Math.abs(tz)%4)*15/10>>0)+((Math.abs(tz)%4)*15%10);\n list.tz = \"<label for='o1' class='select'>\"+_(\"Timezone\")+\"</label><select data-mini='true' id='o1'>\";\n $.each(timezones, function(i, timezone) {\n list.tz += \"<option \"+((timezone == tz) ? \"selected\" : \"\")+\" value='\"+timezone+\"'>\"+timezone+\"</option>\";\n });\n list.tz += \"</select>\";\n return true;\n case \"ntp\":\n list.ntp = \"<input data-mini='true' id='o2' type='checkbox' \"+((data == \"1\") ? \"checked='checked'\" : \"\")+\" /><label for='o2'>\"+_(\"NTP Sync\")+\"</label>\";\n return true;\n case \"hp0\":\n var http = window.controller.options.hp1*256+data;\n list.http = \"<label for='o12'>\"+_(\"HTTP Port (restart required)\")+\"</label><input data-mini='true' type='number' pattern='[0-9]*' id='o12' value='\"+http+\"' />\";\n return true;\n case \"devid\":\n list.devid = \"<label for='o26'>\"+_(\"Device ID (restart required)\")+\"</label><input data-mini='true' type='number' pattern='[0-9]*' max='255' id='o26' value='\"+data+\"' />\";\n return true;\n case \"ar\":\n list.ar = \"<input data-mini='true' id='o14' type='checkbox' \"+((data == \"1\") ? \"checked='checked'\" : \"\")+\" /><label for='o14'>\"+_(\"Auto Reconnect\")+\"</label>\";\n return true;\n case \"ext\":\n list.ext = \"<label for='o15'>\"+_(\"Extension Boards\")+\"</label><input data-highlight='true' data-mini='true' type='number' pattern='[0-9]*' data-type='range' min='0' max='5' id='o15' value='\"+data+\"' />\";\n return true;\n case \"seq\":\n list.seq = \"<input data-mini='true' id='o16' type='checkbox' \"+((data == \"1\") ? \"checked='checked'\" : \"\")+\" /><label for='o16'>\"+_(\"Sequential\")+\"</label>\";\n return true;\n case \"sdt\":\n list.sdt = \"<label for='o17'>\"+_(\"Station Delay (seconds)\")+\"</label><input data-highlight='true' data-mini='true' type='number' pattern='[0-9]*' data-type='range' min='0' max='240' id='o17' value='\"+data+\"' />\";\n return true;\n case \"mas\":\n list.mas = \"<label for='o18' class='select'>\"+_(\"Master Station\")+\"</label><select data-mini='true' id='o18'><option value='0'>None</option>\";\n var i = 1;\n $.each(window.controller.stations.snames,function(z, station) {\n list.mas += \"<option \"+((i == data) ? \"selected\" : \"\")+\" value='\"+i+\"'>\"+station+\"</option>\";\n if (i == 8) return false;\n i++;\n });\n list.mas += \"</select>\";\n return true;\n case \"mton\":\n list.mton = \"<label for='o19'>\"+_(\"Master On Delay\")+\"</label><input data-highlight='true' data-mini='true' type='number' pattern='[0-9]*' data-type='range' min='0' max='60' id='o19' value='\"+data+\"' />\";\n return true;\n case \"mtof\":\n list.mtof = \"<label for='o20'>\"+_(\"Master Off Delay\")+\"</label><input data-highlight='true' data-mini='true' type='number' pattern='[0-9]*' data-type='range' min='-60' max='60' id='o20' value='\"+data+\"' />\";\n return true;\n case \"urs\":\n list.urs = \"<input data-mini='true' id='o21' type='checkbox' \"+((data == \"1\") ? \"checked='checked'\" : \"\")+\" /><label for='o21'>\"+_(\"Use Rain Sensor\")+\"</label>\";\n return true;\n case \"rso\":\n list.rso = \"<input data-mini='true' id='o22' type='checkbox' \"+((data == \"1\") ? \"checked='checked'\" : \"\")+\" /><label for='o22'>\"+_(\"Normally Open (Rain Sensor)\")+\"</label>\";\n return true;\n case \"wl\":\n list.wl = \"<label for='o23'>\"+_(\"% Watering\")+\"</label><input data-highlight='true' data-mini='true' type='number' pattern='[0-9]*' data-type='range' min='0' max='250' id='o23' value='\"+data+\"' />\";\n return true;\n case \"ipas\":\n list.ipas = \"<input data-mini='true' id='o25' type='checkbox' \"+((data == \"1\") ? \"checked='checked'\" : \"\")+\" /><label for='o25'>\"+_(\"Ignore Password\")+\"</label>\";\n return true;\n }\n });\n list.loc = \"<label for='loc'>Location</label><input data-mini='true' type='text' id='loc' value='\"+window.controller.settings.loc+\"' />\";\n list.end = \"</fieldset></div></li>\";\n\n var str = list.start + list.tz + list.mas + list.http + list.devid + list.loc + list.ext + list.sdt + list.mton + list.mtof + list.wl + list.ntp + list.ar + list.seq + list.urs + list.rso + list.ipas + list.end;\n var settings = $(\"#os-settings-list\");\n settings.html(str).enhanceWithin();\n if (settings.hasClass(\"ui-listview\")) settings.listview(\"refresh\");\n changePage(\"#os-settings\");\n}", "function showPage(list, page) {\r\n // Calculate the index for first and last student to display\r\n let startIndex = page * 9 - 9;\r\n let endIndex = page * 9;\r\n\r\n // Select the ul for the student list\r\n const studentList = document.querySelector('.student-list');\r\n // Set ul to an empty string to clear it\r\n studentList.innerHTML = '';\r\n\r\n // Set the variable used to construct/append DOM elements\r\n let studentItem = '';\r\n\r\n for (let i = 0; i < list.length; i++) {\r\n let student = list[i];\r\n if (i >= startIndex && i < endIndex) {\r\n // Create the DOM elements\r\n studentItem = `\r\n <li class=\"student-item cf\">\r\n <div class=\"student-details\">\r\n <img class=\"avatar\" src=\"${student.picture.thumbnail}\" alt=\"Profile Picture\">\r\n <h3>${student.name.first} ${student.name.last}</h3>\r\n <span class=\"email\">${student.email}</span>\r\n </div>\r\n <div class=\"joined-details\">\r\n <span class=\"date\">${student.registered.date}</span>\r\n </div>\r\n </li>`;\r\n\r\n // Insert the created elements to the page\r\n studentList.insertAdjacentHTML('beforeend', studentItem);\r\n }\r\n }\r\n}", "function addWeatherToPage(data){\n\t\tdata.list.forEach(function(weather){\n\t\t\tweatherFormat(weather);\n\t\t});\n\t}", "preparePaginationList(){\n let begin = (this.pageNo - 1) * parseInt(this.recordsPerPage);\n let end = parseInt(begin) + parseInt(this.recordsPerPage);\n this.recordToDisplay = this.recordList.slice(begin,end).map(item=>{\n return {...item, \n \"iconName\":showIcons({itemName:item.name,itemURL :item.downloadURL})\n }\n });\n this.searchBar = this.recordList;\n window.clearTimeout(this.delayTimeout);\n this.delayTimeout = setTimeout(()=>{\n this.disableEnableActions();\n },DELAY);\n }", "function processLandingPage(cloudPointHostId,lpi,callback){\n\tWebAPI.getDefinition(lpi,function(landingTemplate){\n\t\tconsole.log('Got landing Template');\n\t\tDefinitionStore.receiveDefinition(landingTemplate);\n\t\tvar summariesToFetch=[];\n\t\tif(landingTemplate &&\n\t\t\t\tlandingTemplate.structure &&\n\t\t\t\tlandingTemplate.structure.root){\n\t\t\t//scanning dynamic content to fetch\n\t\t\tfunction readElement(tree){\n\t\t\t if(!tree.content){\n\t\t\t for(var key in tree){\n\t\t\t readElement(tree[key]);\n\t\t\t }\n\t\t\t }else{\n\t\t\t if(tree.content.type){\n\t\t\t if(tree.content.type==\"summary\" ||\n\t\t\t tree.content.type==\"carousel\" ||\n\t\t\t tree.content.type==\"cardCarousel\" ||\n\t\t\t tree.content.type==\"iconView\" ||\n\t\t\t tree.content.type==\"landingPage\")\n\t\t\t summariesToFetch.push(tree.content);\n\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t\treadElement(landingTemplate.structure.root)\n\t\t\t//processing dynamic content one at a time\n\t\t\tprocessFetchContent(0);\n\t\t\tfunction processFetchContent(index){\n\t\t\t\tif(index<summariesToFetch.length){\n\t\t\t\t\tvar content=JSON.parse(JSON.stringify(summariesToFetch[index]));\n\t\t\t\t\tvar pre=new Date();\n\n\t\t\t\t\tif(content.type==\"landingPage\"){\n\t\t\t\t\t\tconsole.log(\"Getting \"+content.lpi+\" \"+content.type +\" \"+ pre);\n\t\t\t\t\t\tWebAPI.getDefinition(content.lpi,function(clpi){\n\t\t\t\t\t\t\tconsole.log(\"Got \"+content.lpi+\" \"+content.type +\" \"+ ((new Date()-pre)/1000));\n\t\t\t\t\t\t\tDefinitionStore.receiveDefinition(clpi);\n\t\t\t\t\t\t\tprocessFetchContent(index+1);\n\t\t\t\t\t\t});\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(content.schema){\n\t\t\t\t\t\t\tconsole.log(\"Getting \"+content.schema+\" \"+content.type +\" \"+ pre);\n\t\t\t\t\t\t\tWebAPI.getSchemaRecords({\n\t\t\t\t\t\t\t\tcloudPointHostId:cloudPointHostId,\n\t\t\t\t\t\t\t\tschema:content.schema,\n\t\t\t\t\t\t\t\tdependentSchema:content.dependentSchema,\n\t\t\t\t\t\t\t\tfilters:content.filters,\n\t\t\t\t\t\t\t\tsortBy:content.sortBy,\n\t\t\t\t\t\t\t\tsortOrder:content.sortOrder,\n\t\t\t\t\t\t\t\torg:\"public\",\n\t\t\t\t\t\t\t\tuserId:\"CommonUser\",\n\t\t\t\t\t\t\t\tskip:0\n\t\t\t\t\t\t\t},function(result){\n\t\t\t\t\t\t\t\tif(result.error){\n\t\t\t\t\t\t\t\t\tconsole.log(result.error);\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tresult.org=\"public\";\n\t\t\t\t\t\t\t\t\tresult.dependentSchema=content.dependentSchema;\n\t\t\t\t\t\t\t\t\tresult.filters=content.filters;\n\t\t\t\t\t\t\t\t\tresult.skip=0;\n\t\t\t\t\t\t\t\t\tresult.landing=\"landing\";\n\t\t\t\t\t\t\t\t\tresult.cloudPointHostId=cloudPointHostId;\n\t\t\t\t\t\t\t\t\tRecordSummaryStore.receiveSchemaRecords(result);\n\t\t\t\t\t\t\t\t\tconsole.log(\"Got \"+content.schema+\" \"+content.type +\" \"+ ((new Date()-pre)/1000));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tprocessFetchContent(index+1);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tprocessFetchContent(index+1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log(\"processing landing page done\");\n\t\t\t\t\tif(typeof callback==\"function\"){\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}else{\n\t\t\tif(typeof callback==\"function\"){\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\t});\n}", "function showAll(req, res) {\n // On récupère la date demandée.\n const date = req.params.date;\n\n retrieveAll(date, (jsonRes) => {\n var templateParameters = {\n flights: jsonRes,\n date: date\n };\n res.render(__dirname + '/templates/flight_list.ejs', templateParameters);\n });\n}", "function allPostsView(targetname){\n\n let posts = Model.getPosts();\n let count = 0;\n\n for (let i =0; i<posts.length;i++){\n\n count++\n\n }\n\n let target = document.getElementById(targetname);\n let template = Handlebars.compile(\n document.getElementById(\"display-list-template\").textContent\n ) \n target.innerHTML = template({'display': Model.getRecentPosts(count)})\n\n}", "function NCList() {\n}", "function formatPageName() {\n customValues.pageName = customValues.sectionLevel1;\n customValues.hierarchy1 = customValues.pageName;\n if (subSections.length > 0) {\n customValues.parentSection = customValues.parentSection + \":\" + subSections[0];\n customValues.sectionLevel1 = customValues.sectionLevel1 + \":\" + subSections[0];\n\n for (var j = 0; j < subSections.length; j++) {\n customValues.pageName = customValues.pageName + \":\" + subSections[j];\n customValues.hierarchy1 = customValues.hierarchy1 + \"|\" + customValues.pageName;\n if (j + 1 == subSections.length) {\n customValues.pageName = pageTitleExists(customValues.pageName);\n customValues.hierarchy1 = customValues.hierarchy1 + \"|\" + customValues.pageName;\n if (j >= 1) {\n customValues.sectionLevel2 = customValues.sectionLevel1 + \":\" + subSections[1];\n if (siteData.bcLevel2 != \"\") {\n customValues.pageNameBreadCrumbs = customValues.pageNameBreadCrumbs + \":\" + siteData.bcLevel2;\n }\n if (j >= 2) {\n if (siteData.bcLevel3 != \"\") {\n customValues.pageNameBreadCrumbs = customValues.pageNameBreadCrumbs + \":\" + siteData.bcLevel3;\n }\n customValues.sectionLevel3 = customValues.sectionLevel2 + \":\" + subSections[2];\n if (j >= 3) {\n customValues.sectionLevel4 = customValues.sectionLevel3 + \":\" + subSections[3];\n if (j >= 4) {\n customValues.sectionLevel5 = customValues.sectionLevel4 + \":\" + subSections[4];\n }\n }\n }\n }\n }\n }\n } else {\n customValues.pageName = pageTitleExists(customValues.pageName);\n customValues.hierarchy1 = customValues.pageName;\n }\n }" ]
[ "0.5775443", "0.5446374", "0.53642035", "0.5326982", "0.53079766", "0.5255189", "0.52353305", "0.52117807", "0.5188642", "0.5186896", "0.51785135", "0.51746905", "0.51744676", "0.5137783", "0.51350546", "0.5133172", "0.5131016", "0.51281786", "0.5119937", "0.5109162", "0.5107533", "0.5106284", "0.5105384", "0.50985646", "0.50961506", "0.5095336", "0.50702816", "0.50694984", "0.5059712", "0.50582784", "0.5048026", "0.5044489", "0.50438166", "0.50411946", "0.5033904", "0.50204796", "0.501558", "0.5013807", "0.501081", "0.50083405", "0.4995927", "0.49943167", "0.4990608", "0.49885803", "0.49839213", "0.49750975", "0.49742118", "0.4967968", "0.49665233", "0.4955858", "0.4950252", "0.49493262", "0.49472868", "0.49317446", "0.49290007", "0.49255672", "0.4923646", "0.49109825", "0.49095333", "0.4902809", "0.48988187", "0.4897088", "0.48921472", "0.48869744", "0.48863587", "0.488353", "0.4876381", "0.48753273", "0.48614308", "0.48601925", "0.4851705", "0.48476282", "0.4841758", "0.4841691", "0.48413733", "0.48386595", "0.48302484", "0.482996", "0.4827338", "0.48264563", "0.48260704", "0.48260328", "0.48245648", "0.48216325", "0.48208877", "0.48184115", "0.48182175", "0.48165387", "0.48158276", "0.4807757", "0.4801663", "0.48015028", "0.47971871", "0.47916582", "0.47910756", "0.478997", "0.47893482", "0.47887042", "0.47875127", "0.47838843", "0.47789136" ]
0.0
-1
14/11/2018: Aula 7 Marcio Justo: JavaScript
function subtracao() { var numeroUm = document.getElementById("valor-um").value; var numeroDois= document.getElementById("valor-dois").value; if (isNaN(numeroUm)) { alert('Número Um inválido!'); } if (isNaN(numeroDois)) { alert('Número Dois inválido!'); } alert(parseInt(numeroUm) - parseInt(numeroDois)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcola_jdUT0(){\n\n // funzione per il calcolo del giorno giuliano per l'ora 0 di oggi in T.U.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) giugno 2010.\n // restituisce il valore numerico dataGiuliana.\n \n \n var data=new Date();\n\n var anno = data.getYear(); // anno\n var mese = data.getMonth(); // mese 0 a 11 \n var giorno= data.getDate(); // numero del giorno da 1 a 31\n var ora = 0; // ora del giorno da 0 a 23 in T.U.\n var minuti= 0; // minuti da 0 a 59\n var secondi=0; // secondi da 0 a 59\n \n mese =mese+1;\n\nif (anno<1900) {anno=anno+1900;} // correzione anno per il browser.\n\nvar dataGiuliana=costanti_jd(giorno,mese,anno,ora,minuti,secondi);\n\n dataGiuliana=dataGiuliana*1 // definire come valore numerico.\n\nreturn dataGiuliana; // restituisce il giorno giuliano\n\n}", "function calculateArmandoAge() {\n // Calculate age, Armando was born on May 13, 2000.\n const diffMs = new Date() - new Date(2000, 5, 13);\n const ageDt = new Date(diffMs);\n\n // Add it to the page.\n const ageContainer = document.getElementById('armando-age-container');\n ageContainer.innerText = Math.abs(ageDt.getUTCFullYear() - 1970);\n\n}", "function calcola_jda(){\n\n // funzione per il calcolo del giorno giuliano per il 0.0 gennaio dell'anno corrente.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009\n // restituisce dataGiuliana, giorno giuliano inizio anno.\n // recupera automaticamente l'anno.\n // il giorno giuliano è calcolato per il tempo 0 T.U. di Greenwich.\n \n var data=new Date(); \n\n var anno =data.getYear(); // anno\n var mese =1; // mese \n var giorno=0.0; // giorno=0.0\n \nif (anno<1900) {anno=anno+1900;} // correzione anno per il browser.\n\nvar dataGiuliana=costanti_jd(giorno,mese,anno,0,0,0); // valore del giorno giuliano per lo 0.0 gennaio dell'anno corrente.\n\n dataGiuliana=dataGiuliana*1 // definire come valore numerico.\n // \nreturn dataGiuliana;\n\n}", "function calcPersiana()\n {\n setJulian(persiana_to_jd((new Number(document.persiana.year.value)),\n\t\t\t document.persiana.month.selectedIndex + 1,\n\t\t\t (new Number(document.persiana.day.value))) + 0.5);\n }", "function showHoroscope(){\n let month = document.querySelector('#month').value;\n // console.log(typeof month);\n let day = parseInt(document.querySelector('#day').value);\n // console.log(typeof day);\n\n if (month === 'March' && day >= 21){\n console.log('Aries')\n document.querySelector('#quote').innerText = 'Resists the urge to flip over the table when the wrong dish arrives'\n document.querySelector('#sign-signature').innerText = '- ARIES'\n } else if (month === 'April' && day <= 19){\n console.log('Aries')\n document.querySelector('#quote').innerText = 'Resists the urge to flip over the table when the wrong dish arrives'\n document.querySelector('#sign-signature').innerText = '- ARIES'\n\n } else if (month === 'April' && day >= 20){\n console.log('Taurus')\n document.querySelector('#quote').innerText = '\"I\\'ll have my usual\"'\n document.querySelector('#sign-signature').innerText = '- TAURUS'\n } else if (month === 'May' && day <= 20){\n console.log('Taurus')\n document.querySelector('#quote').innerText = '\"I\\'ll have my usual\"'\n document.querySelector('#sign-signature').innerText = '- TAURUS'\n\n } else if (month === 'May' && day >= 21){\n console.log('Gemini')\n document.querySelector('#quote').innerText = 'Can\\'t decide what to order so asks the waiter to \"surprise me!\"'\n document.querySelector('#sign-signature').innerText = '- GEMINI'\n } else if (month === 'June' && day <= 20){\n console.log('Gemini')\n document.querySelector('#quote').innerText = 'Can\\'t decide what to order so asks the waiter to \"surprise me!\"'\n document.querySelector('#sign-signature').innerText = '- GEMINI'\n\n } else if (month === 'June' && day >= 21){\n console.log('Cancer')\n document.querySelector('#quote').innerText = 'Gathers up everyone\\'s dirty plates and silverware for the waiter'\n document.querySelector('#sign-signature').innerText = '- CANCER'\n } else if (month === 'July' && day <= 22){\n console.log('Cancer')\n document.querySelector('#quote').innerText = 'Gathers up everyone\\'s dirty plates and silverware for the waiter'\n document.querySelector('#sign-signature').innerText = '- CANCER'\n\n } else if (month === 'July' && day >= 23){\n console.log('Leo')\n document.querySelector('#quote').innerText = 'Tries to sit at the head of a circular table'\n document.querySelector('#sign-signature').innerText = '- LEO'\n } else if (month === 'August' && day <= 22 ){\n console.log('Leo')\n document.querySelector('#quote').innerText = 'Tries to sit at the head of a circular table'\n document.querySelector('#sign-signature').innerText = '- LEO'\n \n } else if (month === 'August' && day >= 23){\n console.log('Virgo')\n document.querySelector('#quote').innerText = '\"Could\\'ve done with a tad less rosemary.\"'\n document.querySelector('#sign-signature').innerText = '- VIRGO'\n } else if (month === 'September' && day <= 22){\n console.log('Virgo')\n document.querySelector('#quote').innerText = '\"Could\\'ve done with a tad less rosemary.\"'\n document.querySelector('#sign-signature').innerText = '- VIRGO'\n\n } else if (month === 'September' && day >= 23 ){\n console.log('Libra')\n document.querySelector('#quote').innerText = '*waiter introduces himself* \"Guys, I think the waiter is flirting with me.\"'\n document.querySelector('#sign-signature').innerText = '- LIBRA'\n } else if (month === 'October' && day <= 22){\n console.log('Libra')\n document.querySelector('#quote').innerText = '*waiter introduces himself* \"Guys, I think the waiter is flirting with me.\"'\n document.querySelector('#sign-signature').innerText = '- LIBRA'\n\n } else if (month === 'October' && day >= 23 ){\n console.log('Scorpio')\n document.querySelector('#quote').innerText = '*gazes into the romantic candlelight and imagines who they\\'d burn*'\n document.querySelector('#sign-signature').innerText = '- SCORPIO'\n } else if (month === 'November' && day <= 21){\n console.log('Scorpio')\n document.querySelector('#quote').innerText = '*gazes into the romantic candlelight and imagines who they\\'d burn*'\n document.querySelector('#sign-signature').innerText = '- SCORPIO'\n\n } else if (month === 'November' && day >= 22 ){\n console.log('Sagittarius')\n document.querySelector('#quote').innerText = '\"I had cacio e pepe like this when I lived in Rome for 3 weeks\"'\n document.querySelector('#sign-signature').innerText = '- SAGITTARIUS'\n } else if (month === 'December' && day <= 21){\n console.log('Sagittarius')\n document.querySelector('#quote').innerText = '\"I had cacio e pepe like this when I lived in Rome for 3 weeks\"'\n document.querySelector('#sign-signature').innerText = '- SAGITTARIUS'\n\n } else if (month === 'December' && day >= 22 ){\n console.log('Capricorn')\n document.querySelector('#quote').innerText = 'Configures a way to split the bill 14 ways'\n document.querySelector('#sign-signature').innerText = '- CAPRICORN'\n } else if (month === 'January' && day <= 19){\n console.log('Capricorn')\n document.querySelector('#quote').innerText = 'Configures a way to split the bill 14 ways'\n document.querySelector('#sign-signature').innerText = '- CAPRICORN'\n\n } else if (month === 'January' && day >= 20){\n console.log('Aquarius')\n document.querySelector('#quote').innerText = 'Overhears waiter being mistreated by another table and leaps to their defense'\n document.querySelector('#sign-signature').innerText = '- AQUARIUS'\n } else if (month === 'February' && day <= 18){\n console.log('Aquarius')\n document.querySelector('#quote').innerText = 'Overhears waiter being mistreated by another table and leaps to their defense'\n document.querySelector('#sign-signature').innerText = '- AQUARIUS'\n\n } else if (month === 'February' && day >= 19){\n console.log('Pisces')\n document.querySelector('#quote').innerText = '\"I looove the vibes in here\" *forgets to look at the menu*'\n document.querySelector('#sign-signature').innerText = '- PISCES'\n } else if (month === 'March' && day <= 20 ){\n console.log('Pisces')\n document.querySelector('#quote').innerText = '\"I looove the vibes in here\" *forgets to look at the menu*'\n document.querySelector('#sign-signature').innerText = '- PISCES'\n }\n}", "function Exo_4_8_jsform()\r\n //Début\r\n {\r\n var iJour, iMois, iAnnee, bBis, bTrente;\r\n\r\n //Ecrire \"Entrez le jour\"\r\n // Lire iJour\r\n iJour=document.getElementById(\"iJour\").value;\r\n // Ecrire \"Entre le mois\"\r\n // Lire iMois\r\n iMois=document.getElementById(\"iMois\").value;\r\n // Ecrire \"Entrez l'année\"\r\n // Lire iAnnee\r\n iAnnee=document.getElementById(\"iAnnee\").value;\r\n\r\n bBis= iAnnee%4===0 && iAnnee%100!=0 || iAnnee%400===0; \r\n bTrente=(iMois===\"avr\") || (iMois===\"jui\") || (iMois===\"sep\") || (iMois===\"nov\");\r\n\r\n\r\n\r\n if ((iMois===\"fev\" && ((iJour>\"28\" && !bBis) || iJour>\"29\")) || (iJour>\"30\" && bTrente) || (iJour>\"31\"))\r\n {\r\n document.getElementById(\"sp_resultat_code\").innerHTML=\"votre date est incorrect\";\r\n }\r\n else \r\n {\r\n document.getElementById(\"sp_resultat_code\").innerHTML=\"votre date est valide\";\r\n }\r\n\r\n }", "function _diaHoy(opcion)\r\n{\r\n var Hoy= new Array(2);\r\n var fecha=new Date();\r\n Hoy[1]= fecha.getFullYear();\r\n Hoy[0]=(fecha.getDate()<10)? '0'+fecha.getDate(): fecha.getDate();\r\n Hoy[0]+=((fecha.getMonth()+1)<10)? '/0'+(fecha.getMonth()+1):'/'+(fecha.getMonth()+1);\r\n Hoy[0]+= '/'+Hoy[1];\r\n if (opcion==1){return Hoy[1];}\r\n else {return Hoy[0];}\r\n}", "function calcIslamic()\n {\n setJulian(islamic_to_jd((new Number(document.islamic.year.value)),\n\t\t\t document.islamic.month.selectedIndex + 1,\n\t\t\t (new Number(document.islamic.day.value))));\n }", "function renderDate() {\n // The class name \"content\" does not have any relevance for our js file, and is only used for creating overview of the div section.\n\n dt.setDate(1);\n// set.Date is a javascript function we use so the date is equal to the weekday. We use the parameter (1) because (0) is equal to the first day of the last month, and we want to get the first day of this month.\n// (\"JavaScript setDate\" s.d)\n var day = dt.getDay();\n\n // this is consoled log, so we can see how many dates from last month we have.\n console.log(dt.getDay());\n\n var endDate = new Date(\n dt.getFullYear(),\n dt.getMonth()+1,0\n ).getDate();\n\n // Test, where we should get the last day of the month. That happens because we in getMonth use +1 besides the parameter, and furthermore use 0 which represents the last day of the last month.\n // This object constructor will also be relevant in a later for loop.\n console.log(endDate);\n\n var prevDate = new Date(\n dt.getFullYear(),\n dt.getMonth(),0).getDate();\n// This variable refers to the HTML arrow symbol and the function executes with an onClick. We use date:0; because that is the last month\n var today = new Date();\n console.log(today);\n // This console log consoles the date of today via a javascript method\n // We declare this variable because we want to use it in or for loop, that via HTML should print all the dates of the month.\n console.log(prevDate);\n // Here we test that the prevDate we just created is the last day of the last month.\n\n// But firstly an array of all the months.\n var months = [\"January\",\"February\",\"March\",\"April\",\"May\", \"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"];\n\n// We here use a object constructor function, which prints the date to our paragraph in html.\n// \"\"JaveScript | date.toDateString\" s.d)/\n document.getElementById(\"date_str\").innerHTML = 1 + \"/\" + (dt.getMonth() + 1) + \"/\" + dt.getFullYear();\n\n// We use our dt variable new date to get the month.\n document.getElementById(\"month\").innerHTML = months[dt.getMonth()];\n\n cells = \"\";\n\n for(x = day; x > 0; x--){\n cells += \"<div class='prev_date'>\" + (prevDate - x + 1) + \"</div>\";\n }\n\n// This for loop connects with our div class \"'prev_date\" it starts out by saying our previous date, which is the last day of the last month=30. Then it says - x = the days that is represented from last month. It then plus with 1 so we get 29, and the loop repeats.\n\n// This for loop is for all the days of the relevant month. We again use a for loop, ad break out of the loop when i is less than our equal to the last day of the month\n\n for (i = 1; i <= endDate; i++){\n if(i == today.getDate() && dt.getMonth() == today.getMonth()){\n //var newDate = \"day\" + i;\n cells += \"<div class='day' id ='\" + i + \"' value ='\" + i + \"'>\" + i + \"</div>\";\n\n } else{\n\n cells += \"<div class='day' id ='\" + i + \"' value ='\" + i + \"'>\" + i + \"</div>\";\n\n// If the date is not equal to today's date, we use the conditional else statement, until we hit todays date. Then the if statement will be used. The break happens at the endDate\n\n }\n }\n\n // Here we use innerHTML to print the cells we have declared above, in the user interface.\n document.getElementsByClassName(\"days\")[0].innerHTML = cells;\n one++;\n console.log( \"første tæller\" + one)\n // add onclick functions to every day with addDateChecker();\n addDateChecker();\n}", "function JtoG($, _, n, y) { function a($, _) { return Math.floor($ / _) } for ($g_days_in_month = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31), $j_days_in_month = new Array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29), $jy = $ - 979, $jm = _ - 1, $jd = n - 1, $j_day_no = 365 * $jy + 8 * a($jy, 33) + a($jy % 33 + 3, 4), $i = 0; $i < $jm; ++$i)$j_day_no += $j_days_in_month[$i]; for ($j_day_no += $jd, $g_day_no = $j_day_no + 79, $gy = 1600 + 400 * a($g_day_no, 146097), $g_day_no %= 146097, $leap = !0, 36525 <= $g_day_no && ($g_day_no-- , $gy += 100 * a($g_day_no, 36524), $g_day_no %= 36524, 365 <= $g_day_no ? $g_day_no++ : $leap = !1), $gy += 4 * a($g_day_no, 1461), $g_day_no %= 1461, 366 <= $g_day_no && ($leap = !1, $g_day_no-- , $gy += a($g_day_no, 365), $g_day_no %= 365), $i = 0; $g_day_no >= $g_days_in_month[$i] + (1 == $i && $leap); $i++)$g_day_no -= $g_days_in_month[$i] + (1 == $i && $leap); return $gm = $i + 1, $gd = $g_day_no + 1, y && null != y ? $gy + \"/\" + $gm + \"/\" + $gd : { y: $gy, m: $gm, d: $gd } }", "function calcola_jd(){\n\n // funzione per il calcolo del giorno giuliano utilizzando la data indicata dal pc.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) giugno 2010.\n // restituisce il valore numerico dataGiuliana_dec.\n // il giorno giuliano è calcolato per il T.U. di Greenwich.\n // la funzione [fuso_loc()], recupera il fuso orario della località (-est) (+ovest).\n // la funzione ritorna la variabile numerica dataGiuliana_dec;\n \n \n var data=new Date();\n\n var anno = data.getYear(); // anno\n var mese = data.getMonth(); // mese 0 a 11 \n var giorno= data.getDate(); // numero del giorno da 1 a 31\n var ora = data.getHours(); // ora del giorno da 0 a 23 recuperata dal pc.\n var minuti= data.getMinutes(); // minuti da 0 a 59\n var secondi=data.getSeconds(); // secondi da 0 a 59\n \n mese =mese+1;\n\nif (anno<1900) {anno=anno+1900;} // correzione anno per il browser.\n\n ora=ora+fuso_loc(); // recupera il fuso orario della località (compresa l'ora legale) e riporta l'ora del pc. come T.U.\n\nvar dataGiuliana=costanti_jd(giorno,mese,anno,ora,minuti,secondi);\n\n dataGiuliana=dataGiuliana*1 // definire come valore numerico.\n \nreturn dataGiuliana; // restituisce il giorno giuliano\n\n}", "function calculateDate(el) {\r\n\treturn 2019 - el; \r\n}", "function calcBahai()\n {\n setJulian(bahai_to_jd((new Number(document.bahai.kull_i_shay.value)),\n\t\t\t (new Number(document.bahai.vahid.value)),\n\t\t\t document.bahai.year.selectedIndex + 1,\n\t\t\t document.bahai.month.selectedIndex + 1,\n\t\t\t document.bahai.day.selectedIndex + 1));\n }", "function j(e,t,a){var s=e+\" \";switch(a){case\"ss\":return s+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return s+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return s+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return s+=1===e?\"dan\":\"dana\";case\"MM\":return s+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return s+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "function a(e,a,t,n){var i=e+\" \";switch(t){case\"s\":return a||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===e?a?\"sekundo\":\"sekundi\":2===e?a||n?\"sekundi\":\"sekundah\":e<5?a||n?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return a?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===e?a?\"minuta\":\"minuto\":2===e?a||n?\"minuti\":\"minutama\":e<5?a||n?\"minute\":\"minutami\":a||n?\"minut\":\"minutami\";case\"h\":return a?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===e?a?\"ura\":\"uro\":2===e?a||n?\"uri\":\"urama\":e<5?a||n?\"ure\":\"urami\":a||n?\"ur\":\"urami\";case\"d\":return a||n?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===e?a||n?\"dan\":\"dnem\":2===e?a||n?\"dni\":\"dnevoma\":a||n?\"dni\":\"dnevi\";case\"M\":return a||n?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===e?a||n?\"mesec\":\"mesecem\":2===e?a||n?\"meseca\":\"mesecema\":e<5?a||n?\"mesece\":\"meseci\":a||n?\"mesecev\":\"meseci\";case\"y\":return a||n?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===e?a||n?\"leto\":\"letom\":2===e?a||n?\"leti\":\"letoma\":e<5?a||n?\"leta\":\"leti\":a||n?\"let\":\"leti\"}}", "function a(e,a,c,n){var t=e+\" \";switch(c){case\"s\":return a||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return t+=1===e?a?\"sekundo\":\"sekundi\":2===e?a||n?\"sekundi\":\"sekundah\":e<5?a||n?\"sekunde\":\"sekundah\":\"sekund\",t;case\"m\":return a?\"ena minuta\":\"eno minuto\";case\"mm\":return t+=1===e?a?\"minuta\":\"minuto\":2===e?a||n?\"minuti\":\"minutama\":e<5?a||n?\"minute\":\"minutami\":a||n?\"minut\":\"minutami\",t;case\"h\":return a?\"ena ura\":\"eno uro\";case\"hh\":return t+=1===e?a?\"ura\":\"uro\":2===e?a||n?\"uri\":\"urama\":e<5?a||n?\"ure\":\"urami\":a||n?\"ur\":\"urami\",t;case\"d\":return a||n?\"en dan\":\"enim dnem\";case\"dd\":return t+=1===e?a||n?\"dan\":\"dnem\":2===e?a||n?\"dni\":\"dnevoma\":a||n?\"dni\":\"dnevi\",t;case\"M\":return a||n?\"en mesec\":\"enim mesecem\";case\"MM\":return t+=1===e?a||n?\"mesec\":\"mesecem\":2===e?a||n?\"meseca\":\"mesecema\":e<5?a||n?\"mesece\":\"meseci\":a||n?\"mesecev\":\"meseci\",t;case\"y\":return a||n?\"eno leto\":\"enim letom\";case\"yy\":return t+=1===e?a||n?\"leto\":\"letom\":2===e?a||n?\"leti\":\"letoma\":e<5?a||n?\"leta\":\"leti\":a||n?\"let\":\"leti\",t}}", "function e(A,e,t,r){var n=A+\" \";switch(t){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return n+=1===A?e?\"sekundo\":\"sekundi\":2===A?e||r?\"sekundi\":\"sekundah\":A<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",n;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return n+=1===A?e?\"minuta\":\"minuto\":2===A?e||r?\"minuti\":\"minutama\":A<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",n;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return n+=1===A?e?\"ura\":\"uro\":2===A?e||r?\"uri\":\"urama\":A<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",n;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return n+=1===A?e||r?\"dan\":\"dnem\":2===A?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",n;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return n+=1===A?e||r?\"mesec\":\"mesecem\":2===A?e||r?\"meseca\":\"mesecema\":A<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",n;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return n+=1===A?e||r?\"leto\":\"letom\":2===A?e||r?\"leti\":\"letoma\":A<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",n}}", "function e(e,t,n,a){var r=e+\" \";switch(n){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||a?\"sekundi\":\"sekundah\":e<5?t||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||a?\"minuti\":\"minutama\":e<5?t||a?\"minute\":\"minutami\":t||a?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||a?\"uri\":\"urama\":e<5?t||a?\"ure\":\"urami\":t||a?\"ur\":\"urami\";case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||a?\"dan\":\"dnem\":2===e?t||a?\"dni\":\"dnevoma\":t||a?\"dni\":\"dnevi\";case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||a?\"mesec\":\"mesecem\":2===e?t||a?\"meseca\":\"mesecema\":e<5?t||a?\"mesece\":\"meseci\":t||a?\"mesecev\":\"meseci\";case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||a?\"leto\":\"letom\":2===e?t||a?\"leti\":\"letoma\":e<5?t||a?\"leta\":\"leti\":t||a?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":if(e===1){a+=t?\"sekundo\":\"sekundi\"}else if(e===2){a+=t||r?\"sekundi\":\"sekundah\"}else if(e<5){a+=t||r?\"sekunde\":\"sekundah\"}else{a+=\"sekund\"}return a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":if(e===1){a+=t?\"minuta\":\"minuto\"}else if(e===2){a+=t||r?\"minuti\":\"minutama\"}else if(e<5){a+=t||r?\"minute\":\"minutami\"}else{a+=t||r?\"minut\":\"minutami\"}return a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":if(e===1){a+=t?\"ura\":\"uro\"}else if(e===2){a+=t||r?\"uri\":\"urama\"}else if(e<5){a+=t||r?\"ure\":\"urami\"}else{a+=t||r?\"ur\":\"urami\"}return a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":if(e===1){a+=t||r?\"dan\":\"dnem\"}else if(e===2){a+=t||r?\"dni\":\"dnevoma\"}else{a+=t||r?\"dni\":\"dnevi\"}return a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":if(e===1){a+=t||r?\"mesec\":\"mesecem\"}else if(e===2){a+=t||r?\"meseca\":\"mesecema\"}else if(e<5){a+=t||r?\"mesece\":\"meseci\"}else{a+=t||r?\"mesecev\":\"meseci\"}return a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":if(e===1){a+=t||r?\"leto\":\"letom\"}else if(e===2){a+=t||r?\"leti\":\"letoma\"}else if(e<5){a+=t||r?\"leta\":\"leti\"}else{a+=t||r?\"let\":\"leti\"}return a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":if(e===1){a+=t?\"sekundo\":\"sekundi\"}else if(e===2){a+=t||r?\"sekundi\":\"sekundah\"}else if(e<5){a+=t||r?\"sekunde\":\"sekundah\"}else{a+=\"sekund\"}return a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":if(e===1){a+=t?\"minuta\":\"minuto\"}else if(e===2){a+=t||r?\"minuti\":\"minutama\"}else if(e<5){a+=t||r?\"minute\":\"minutami\"}else{a+=t||r?\"minut\":\"minutami\"}return a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":if(e===1){a+=t?\"ura\":\"uro\"}else if(e===2){a+=t||r?\"uri\":\"urama\"}else if(e<5){a+=t||r?\"ure\":\"urami\"}else{a+=t||r?\"ur\":\"urami\"}return a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":if(e===1){a+=t||r?\"dan\":\"dnem\"}else if(e===2){a+=t||r?\"dni\":\"dnevoma\"}else{a+=t||r?\"dni\":\"dnevi\"}return a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":if(e===1){a+=t||r?\"mesec\":\"mesecem\"}else if(e===2){a+=t||r?\"meseca\":\"mesecema\"}else if(e<5){a+=t||r?\"mesece\":\"meseci\"}else{a+=t||r?\"mesecev\":\"meseci\"}return a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":if(e===1){a+=t||r?\"leto\":\"letom\"}else if(e===2){a+=t||r?\"leti\":\"letoma\"}else if(e<5){a+=t||r?\"leta\":\"leti\"}else{a+=t||r?\"let\":\"leti\"}return a}}", "function masqueSaisieDate(obj) {\n\n var ch = obj.value;\n var ch_gauche, ch_droite;\n obj.value = ch.slice(0, 10);\n ch.toString();\n if (((ch.slice(2, 3)) !== (\"/\")) && (ch.length >= 3)) {\n if (ch.slice(0, 2) > 31) {\n ch_gauche = '31';\n } else {\n ch_gauche = ch.slice(0, 2);\n }\n ch_droite = ch.slice(2);\n obj.value = ch_gauche + \"/\" + ch_droite;\n }\n if (((ch.slice(5, 6)) !== (\"/\")) && (ch.length >= 6)) {\n if (ch.slice(3, 5) > 12) {\n ch_gauche = ch.slice(0, 3) + '12';\n } else {\n ch_gauche = ch.slice(0, 5);\n }\n ch_droite = ch.slice(5);\n obj.value = ch_gauche + \"/\" + ch_droite;\n }\n return;\n}", "function swieta_ruchome(year) \n{\n //wielkanoc\n var poniedzialek_wielkanocny_dzien, poniedzialek_wielkanocny_miesiac, boze_cialo_dzien, boze_cialo_miesiac,\n luty = l_dni(1, year), \n dzien_roku = 31 + luty, \n f = Math.floor,\n\t\tG = year % 19,\n\t\tC = f(year / 100),\n\t\tH = (C - f(C / 4) - f((8 * C + 13)/25) + 19 * G + 15) % 30,\n\t\tI = H - f(H/28) * (1 - f(29/(H + 1)) * f((21-G)/11)),\n\t\tJ = (year + f(year / 4) + I + 2 - C + f(C / 4)) % 7,\n\t\tL = I - J,\n\t\tmonth = 3 + f((L + 40)/44),\n day = L + 28 - 31 * f(month / 4);\n\n if( day==31 && month==3 )\n {\n poniedzialek_wielkanocny_dzien = 1;\n poniedzialek_wielkanocny_miesiac = 3;\n }\n else\n {\n poniedzialek_wielkanocny_dzien = day + 1;\n poniedzialek_wielkanocny_miesiac = month - 1;\n }\n\n if( month==3 )\n {\n dzien_roku += day;\n }\n else\n {\n dzien_roku = dzien_roku + 31 + day;\n }\n\n dzien_roku += 60;\n\n if( luty==28 && dzien_roku<=151)\n {\n boze_cialo_dzien = dzien_roku - 120;\n boze_cialo_miesiac = 4;\n }\n else if( luty==29 && dzien_roku<=152 )\n {\n boze_cialo_dzien = dzien_roku - 121;\n boze_cialo_miesiac = 4;\n }\n else if( luty==29 )\n {\n boze_cialo_dzien = dzien_roku - 152;\n boze_cialo_miesiac = 5;\n }\n else\n {\n boze_cialo_dzien = dzien_roku - 151;\n boze_cialo_miesiac = 5;\n }\n\n return [poniedzialek_wielkanocny_dzien, poniedzialek_wielkanocny_miesiac, boze_cialo_dzien, boze_cialo_miesiac];\n}", "function moon_facts()\n{\n with (Math) {\n\n var dt_as_str, mm, yy, i, tmp, k, t;\n var M, M1, F, NM_FM, FQ_LQ, RAD = 180 / PI;\n var jd_temp, d_of_w, dow_str, zz, ff, alpha;\n var aa, bb, cc, dd, ee, calendar_day, month;\n var calendar_month, int_day, hours, minutes;\n\n moon_data = \"\";\n phase[0] = \"New Moon \";\n phase[1] = \"Moon at first quarter \";\n phase[2] = \"Full Moon \";\n phase[3] = \"Moon at last quarter \";\n\n dt_as_str = document.planets.date_txt.value;\n yy = eval(dt_as_str.substring(6,10));\n mm = eval(dt_as_str.substring(0,2));\n dd = eval(dt_as_str.substring(3,5));\n\n tmp = floor(((yy + (mm - 1) / 12 + dd / 365.25) - 1900.0) * 12.3685);\n\n for (i=0; i<4; i++)\n {\n k = tmp + i * 0.25;\n t = k / 1236.85;\n M = proper_ang(359.2242 + 29.10535608 * k - 0.0000333 * pow(t,2) - 0.00000347 * pow(t,3)) / RAD;\n M1 = proper_ang(306.0253 + 385.81691806 * k + 0.0107306 * pow(t,2) + 0.00001236 * pow(t,3)) / RAD;\n F = proper_ang(21.2964 + 390.67050646 * k - 0.0016528 * pow(t,2) - 0.00000239 * pow(t,3)) / RAD;\n NM_FM = (0.1734 - 0.000393 * t) * sin(M) + 0.0021 * sin(2 * M) - 0.4068 * sin(M1) + 0.0161 * sin(2 * M1) - 0.0004 * sin(3 * M1) + 0.0104 * sin(2 * F) - 0.0051 * sin(M + M1) - 0.0074 * sin(M - M1) + 0.0004 * sin(2 * F + M) - 0.0004 * sin(2 * F - M) - 0.0006 * sin(2 * F + M1) + 0.0010 * sin(2 * F - M1) + 0.0005 * sin(M + 2 * M1);\n FQ_LQ = (0.1721 - 0.0004 * t) * sin(M) + 0.0021 * sin(2 * M) - 0.628 * sin(M1) + 0.0089 * sin(2 * M1) - 0.0004 * sin(3 * M1) + 0.0079 * sin(2 * F) - 0.0119 * sin(M + M1) - 0.0047 * sin(M - M1) + 0.0003 * sin(2 * F + M) - 0.0004 * sin(2 * F - M) - 0.0006 * sin(2 * F + M1) + 0.0021 * sin(2 * F - M1) + 0.0003 * sin(M + 2 * M1) + 0.0004 * sin(M - 2 * M1) - 0.0003 * sin(2 * M + M1);\n phases[i] = 2415020.75933 + 29.53058868 * k + 0.0001178 * pow(t,2) - 0.000000155 * pow(t,3) + 0.00033 * sin(2.907 + 2.319 * t - 1.6e-4 * pow(t,2));\n if (i == 0 || i == 2) phases[i] += NM_FM;\n if (i == 1) phases[i] = phases[i] + FQ_LQ + 0.0028 - 0.0004 * cos(M) + 0.0003 * cos(M1);\n if (i == 3) phases[i] = phases[i] + FQ_LQ - 0.0028 + 0.0004 * cos(M) - 0.0003 * cos(M1);\n }\n new_moon = phases[0];\n\n for (i=0; i<4; i++)\n {\n jd_temp = phases[i] + 0.5;\n\n d_of_w = floor(jd_temp + 1.0) % 7;\n if (d_of_w == 0) dow_str = \"Sun.\";\n if (d_of_w == 1) dow_str = \"Mon.\";\n if (d_of_w == 2) dow_str = \"Tue.\";\n if (d_of_w == 3) dow_str = \"Wed.\";\n if (d_of_w == 4) dow_str = \"Thu.\";\n if (d_of_w == 5) dow_str = \"Fri.\";\n if (d_of_w == 6) dow_str = \"Sat.\";\n\n zz = floor(jd_temp);\n ff = jd_temp - zz;\n alpha = floor((zz - 1867216.25) / 36524.25);\n aa = zz + 1 + alpha - floor(alpha / 4);\n bb = aa + 1524;\n cc = floor((bb - 122.1) / 365.25);\n dd = floor(365.25 * cc);\n ee = floor((bb - dd) / 30.6001);\n calendar_day = bb - dd - floor(30.6001 * ee) + ff;\n calendar_month = ee;\n if (ee < 13.5) calendar_month = ee - 1;\n if (ee > 13.5) calendar_month = ee - 13;\n calendar_year = cc;\n if (calendar_month > 2.5) calendar_year = cc - 4716;\n if (calendar_month < 2.5) calendar_year = cc - 4715;\n int_day = floor(calendar_day);\n hours = (calendar_day - int_day) * 24;\n minutes = floor((hours - floor(hours)) * 60 + 0.5);\n hours = floor(hours);\n if (minutes > 59)\n {minutes = 0; hours = hours + 1;}\n if (hours < 10) hours = \"0\" + hours;\n if (minutes < 10) minutes = \"0\" + minutes;\n if (int_day < 10) int_day = \"0\" + int_day;\n\n if (calendar_month == 1) month = \"Jan.\";\n if (calendar_month == 2) month = \"Feb.\";\n if (calendar_month == 3) month = \"Mar.\";\n if (calendar_month == 4) month = \"Apr.\";\n if (calendar_month == 5) month = \"May \";\n if (calendar_month == 6) month = \"Jun.\";\n if (calendar_month == 7) month = \"Jul.\";\n if (calendar_month == 8) month = \"Aug.\";\n if (calendar_month == 9) month = \"Sep.\";\n if (calendar_month == 10) month = \"Oct.\";\n if (calendar_month == 11) month = \"Nov.\";\n if (calendar_month == 12) month = \"Dec.\";\n\n moon_data += dow_str + \" \" + month + \" \" + int_day + \", \" + calendar_year + \" \" + phase[i] + \"(\" + hours + \":\" + minutes + \" UT)\";\n\n if (i == 1 || i == 3)\n {\n moon_data += \"\\n\"\n }\n else\n {\n moon_data += \" \";\n }\n\n }\n\n }\n}", "function controlaAnho(){\r\n\tvar fiscalYear = getValueFormatless('fiscalPeriodYear');\r\n\tvar declaType = document.getElementById('declarationType').value;\r\n\tvar fecha = new Date();\r\n\tvar anhoActual = getActualYear();\r\n\t\r\n\tif(fiscalYear != 0){\r\n\t\t//Si es clausura tiene que ser menor o igual q el a?o actual\r\n\t\tif(declaType == '| 5 | CLAUSURA'){\r\n\t\t\tif(fiscalYear > anhoActual){//Mayor o igual? O solo igual se permite\r\n\t\t\t\talert('Para las ddjj de tipo CLAUSURA, el año debe ser el menor o igual al año actual.');\r\n\t\t\t\tdocument.getElementById('fiscalPeriodYear').value = \"\";\r\n\t\t\t\tdocument.getElementById('fiscalPeriodYear').focus();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}else{//Si no es clausura, el a?o tiene que ser menor al actual\r\n\t\t\tif(fiscalYear >= anhoActual){\r\n\t\t\t\talert('Para las ddjj ORIGINALES y RECTIFICATIVAS, el año debe ser menor al año actual.');\r\n\t\t\t\tdocument.getElementById('fiscalPeriodYear').value = \"\";\r\n\t\t\t\tdocument.getElementById('fiscalPeriodYear').focus();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\t//getPorcentajeMoras(document.getElementById('fiscalPeriodYear')); \t\t \r\n}", "function e(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+(1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\");case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+(1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\");case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+(1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\");case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+(1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\");case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+(1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\");case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+(1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\")}}", "function MarchEquinox(year)\n{\n // range is between -1000 and +3000 , else return nothing\n if(year*1000 < -1000 || year*1000 > 3000)\n {\n return \"\";\n }\n // initial seed value\n let initialJulianFormatDay = 0;\n // for years between -1000 and +999 set the seed to...\n if(year*1000 >=-1000 && year*1000 < 1000)\n {\n initialJulianFormatDay = 1721139.29189 + 365242.13740*(year) + 0.06134*(year**2) + 0.00111*(year**3) - 0.00071*(year**4);\n }\n // for years between +1000 and +3000 set the seed to...\n if(year*1000 >=1000 && year*1000<= 3000)\n {\n initialJulianFormatDay = 2451623.80984 + 365242.13740*((year*1000-2000)/1000) + 0.05169*(((year*1000-2000)/1000)**2) - 0.00411*(((year*1000-2000)/1000)**3) - 0.00057*(((year*1000-2000)/1000)**4);\n }\n // set the years and month\n const JulianFormatDay = (initialJulianFormatDay - 2451545)/36525;\n // delta is used to calculate the day offset\n const delta = 1 + 0.0334*Math.cos((35999.373*(((JulianFormatDay -2451545)/36525) -2.47))* Math.PI / 180) + 0.0007*Math.cos((2*(35999.373*((JulianFormatDay -2451545)/36525) -2.47))* Math.PI / 180);\n // sum also used to calculate the day offset\n const sum = 485*Math.cos((324.96+1934.136*JulianFormatDay)* Math.PI / 180) + 203*Math.cos((337.23+32964.467*JulianFormatDay)* Math.PI / 180) + 199*Math.cos((324.08+20.186*JulianFormatDay)* Math.PI / 180) + 182*Math.cos((27.85+445267.112*JulianFormatDay)* Math.PI / 180)+ 156*Math.cos((73.14+45036.886*JulianFormatDay)* Math.PI / 180)+ 136*Math.cos((171.52+22518.443*JulianFormatDay)* Math.PI / 180)+ 77*Math.cos((222.54+65928.934*JulianFormatDay)* Math.PI / 180)+ 74*Math.cos((296.72+3034.906*JulianFormatDay)* Math.PI / 180)+ 70*Math.cos((243.58+9037.513*JulianFormatDay)* Math.PI / 180)+ 58*Math.cos((119.81+33718.147*JulianFormatDay)* Math.PI / 180)+ 52*Math.cos((297.17+150.678*JulianFormatDay)* Math.PI / 180)+ 50*Math.cos((21.02+2281.226*JulianFormatDay)* Math.PI / 180)+ 45*Math.cos((247.54+29929.562*JulianFormatDay)* Math.PI / 180)+ 44*Math.cos((325.15+31555.956*JulianFormatDay)* Math.PI / 180)+ 29*Math.cos((60.93+4443.417*JulianFormatDay)* Math.PI / 180)+ 18*Math.cos((155.12+67555.328*JulianFormatDay)* Math.PI / 180)+ 17*Math.cos((288.79+4562.452*JulianFormatDay)* Math.PI / 180)+ 16*Math.cos((198.04+62894.029*JulianFormatDay)* Math.PI / 180)+ 14*Math.cos((199.76+31436.921*JulianFormatDay)* Math.PI / 180)+ 12*Math.cos((95.39+14577.848*JulianFormatDay)* Math.PI / 180)+ 12*Math.cos((287.11+31931.756*JulianFormatDay)* Math.PI / 180)+ 12*Math.cos((320.81+34777.259*JulianFormatDay)* Math.PI / 180)+ 9*Math.cos((227.73+1222.114*JulianFormatDay)* Math.PI / 180)+ 8*Math.cos((15.45+16859.074*JulianFormatDay)* Math.PI / 180);\n // answer = years and month + days\n const finalJulianFormatDay = initialJulianFormatDay + 0.00001*sum/delta;\n // the answer is now in Julian day format we need to convert it to the gregorian date format\n\n // if answer + 0.5 > 2299161\n if(Math.trunc(finalJulianFormatDay+0.5) >= 2299161)\n {\n const alpha = Math.trunc(((Math.trunc(finalJulianFormatDay+0.5) - 1867216.25))/36524.25);\n const offsetFinalJulianFormatDay = Math.trunc(finalJulianFormatDay+0.5) + 1 + alpha - Math.trunc(alpha/4) + 1524;\n // the year in the gregorian date format\n const theYear = Math.trunc((offsetFinalJulianFormatDay - 122.1)/365.25);\n // the month in the gregorian date format\n const theMonth = Math.trunc((offsetFinalJulianFormatDay - Math.trunc(365.25*theYear))/30.6001);\n // the day in the gregorian date format\n const theDay = offsetFinalJulianFormatDay - Math.trunc(365.25*theYear) - Math.trunc(30.6001*theMonth) + finalJulianFormatDay+0.5 - Math.trunc(finalJulianFormatDay+0.5);\n let theFinalMonth = 0;\n let theFinalYear = 0;\n // formating it correctly \n if(theMonth < 14)\n {\n theFinalMonth = theMonth - 1;\n }\n if(theMonth == 14 || theMonth == 15)\n {\n theFinalMonth = theMonth - 13;\n }\n if(theYear > 2)\n {\n theFinalYear = theYear -4716;\n }\n if(theYear == 1 || theYear == 2)\n {\n theFinalYear = theYear -4715\n }\n // final answers formated properly \n const theHour = Math.trunc((theDay - Math.trunc(theDay))*24);\n const theMinute = Math.trunc(((theDay - Math.trunc(theDay))*24 - theHour)*60);\n const theSecond = Math.trunc((((theDay - Math.trunc(theDay))*24 - theHour)*60 - theMinute)*60);\n if(theMinute > 9 && theSecond > 9)\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":\"+theMinute+\":\"+theSecond+\" \"+\"GMT\";\n }\n if(theMinute> 9 && !(theSecond > 9))\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":\"+theMinute+\":0\"+theSecond+\" \"+\"GMT\";\n }\n if(!(theMinute > 9) && theSecond > 9)\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":0\"+theMinute+\":\"+theSecond+\" \"+\"GMT\";\n }\n if(!(theMinute > 9) && !(theSecond > 9))\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":0\"+theMinute+\":0\"+theSecond+\" \"+\"GMT\";\n }\n }else\n {\n const offsetFinalJulianFormatDay = Math.trunc(finalJulianFormatDay+0.5) + 1524;\n // the year in the gregorian date format\n const theYear = Math.trunc((offsetFinalJulianFormatDay - 122.1)/365.25);\n // the month in the gregorian date format\n const theMonth = Math.trunc((offsetFinalJulianFormatDay - Math.trunc(365.25*theYear))/30.6001);\n // the day in the gregorian date format\n const theDay = offsetFinalJulianFormatDay - Math.trunc(365.25*theYear) - Math.trunc(30.6001*theMonth) + finalJulianFormatDay+0.5 - Math.trunc(finalJulianFormatDay+0.5);\n let theFinalMonth = 0;\n let theFinalYear = 0;\n // formating it correctly \n if(theMonth < 14)\n {\n theFinalMonth = theMonth - 1;\n }\n if(theMonth == 14 || theMonth == 15)\n {\n theFinalMonth = theMonth - 13;\n }\n if(theYear > 2)\n {\n theFinalYear = theYear -4716;\n }\n if(theYear == 1 || theYear == 2)\n {\n theFinalYear = theYear -4715;\n }\n // final answers formated properly \n const theHour = Math.trunc((theDay - Math.trunc(theDay))*24);\n const theMinute = Math.trunc(((theDay - Math.trunc(theDay))*24 - theHour)*60);\n const theSecond = Math.trunc((((theDay - Math.trunc(theDay))*24 - theHour)*60 - theMinute)*60);\n if(theMinute > 9 && theSecond > 9)\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":\"+theMinute+\":\"+theSecond+\" \"+\"GMT\";\n }\n if(theMinute> 9 && !(theSecond > 9))\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":\"+theMinute+\":0\"+theSecond+\" \"+\"GMT\";\n }\n if(!(theMinute > 9) && theSecond > 9)\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":0\"+theMinute+\":\"+theSecond+\" \"+\"GMT\";\n }\n if(!(theMinute > 9) && !(theSecond > 9))\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":0\"+theMinute+\":0\"+theSecond+\" \"+\"GMT\";\n }\n }\n}", "function e(t,e,n,r){var a=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":if(t===1){a+=e?\"sekundo\":\"sekundi\"}else if(t===2){a+=e||r?\"sekundi\":\"sekundah\"}else if(t<5){a+=e||r?\"sekunde\":\"sekundah\"}else{a+=\"sekund\"}return a;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":if(t===1){a+=e?\"minuta\":\"minuto\"}else if(t===2){a+=e||r?\"minuti\":\"minutama\"}else if(t<5){a+=e||r?\"minute\":\"minutami\"}else{a+=e||r?\"minut\":\"minutami\"}return a;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":if(t===1){a+=e?\"ura\":\"uro\"}else if(t===2){a+=e||r?\"uri\":\"urama\"}else if(t<5){a+=e||r?\"ure\":\"urami\"}else{a+=e||r?\"ur\":\"urami\"}return a;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":if(t===1){a+=e||r?\"dan\":\"dnem\"}else if(t===2){a+=e||r?\"dni\":\"dnevoma\"}else{a+=e||r?\"dni\":\"dnevi\"}return a;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":if(t===1){a+=e||r?\"mesec\":\"mesecem\"}else if(t===2){a+=e||r?\"meseca\":\"mesecema\"}else if(t<5){a+=e||r?\"mesece\":\"meseci\"}else{a+=e||r?\"mesecev\":\"meseci\"}return a;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":if(t===1){a+=e||r?\"leto\":\"letom\"}else if(t===2){a+=e||r?\"leti\":\"letoma\"}else if(t<5){a+=e||r?\"leta\":\"leti\"}else{a+=e||r?\"let\":\"leti\"}return a}}", "function t(e,t,n,r){var o=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":if(e===1){o+=t?\"sekundo\":\"sekundi\"}else if(e===2){o+=t||r?\"sekundi\":\"sekundah\"}else if(e<5){o+=t||r?\"sekunde\":\"sekundah\"}else{o+=\"sekund\"}return o;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":if(e===1){o+=t?\"minuta\":\"minuto\"}else if(e===2){o+=t||r?\"minuti\":\"minutama\"}else if(e<5){o+=t||r?\"minute\":\"minutami\"}else{o+=t||r?\"minut\":\"minutami\"}return o;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":if(e===1){o+=t?\"ura\":\"uro\"}else if(e===2){o+=t||r?\"uri\":\"urama\"}else if(e<5){o+=t||r?\"ure\":\"urami\"}else{o+=t||r?\"ur\":\"urami\"}return o;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":if(e===1){o+=t||r?\"dan\":\"dnem\"}else if(e===2){o+=t||r?\"dni\":\"dnevoma\"}else{o+=t||r?\"dni\":\"dnevi\"}return o;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":if(e===1){o+=t||r?\"mesec\":\"mesecem\"}else if(e===2){o+=t||r?\"meseca\":\"mesecema\"}else if(e<5){o+=t||r?\"mesece\":\"meseci\"}else{o+=t||r?\"mesecev\":\"meseci\"}return o;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":if(e===1){o+=t||r?\"leto\":\"letom\"}else if(e===2){o+=t||r?\"leti\":\"letoma\"}else if(e<5){o+=t||r?\"leta\":\"leti\"}else{o+=t||r?\"let\":\"leti\"}return o}}", "function t(e,t,n,i){var r=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":if(e===1){r+=t?\"sekundo\":\"sekundi\"}else if(e===2){r+=t||i?\"sekundi\":\"sekundah\"}else if(e<5){r+=t||i?\"sekunde\":\"sekundah\"}else{r+=\"sekund\"}return r;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":if(e===1){r+=t?\"minuta\":\"minuto\"}else if(e===2){r+=t||i?\"minuti\":\"minutama\"}else if(e<5){r+=t||i?\"minute\":\"minutami\"}else{r+=t||i?\"minut\":\"minutami\"}return r;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":if(e===1){r+=t?\"ura\":\"uro\"}else if(e===2){r+=t||i?\"uri\":\"urama\"}else if(e<5){r+=t||i?\"ure\":\"urami\"}else{r+=t||i?\"ur\":\"urami\"}return r;case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":if(e===1){r+=t||i?\"dan\":\"dnem\"}else if(e===2){r+=t||i?\"dni\":\"dnevoma\"}else{r+=t||i?\"dni\":\"dnevi\"}return r;case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":if(e===1){r+=t||i?\"mesec\":\"mesecem\"}else if(e===2){r+=t||i?\"meseca\":\"mesecema\"}else if(e<5){r+=t||i?\"mesece\":\"meseci\"}else{r+=t||i?\"mesecev\":\"meseci\"}return r;case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":if(e===1){r+=t||i?\"leto\":\"letom\"}else if(e===2){r+=t||i?\"leti\":\"letoma\"}else if(e<5){r+=t||i?\"leta\":\"leti\"}else{r+=t||i?\"let\":\"leti\"}return r}}", "function t(e,t,n,g){var I=e+\" \";switch(n){case\"s\":return t||g?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return I+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||g?\"sekundi\":\"sekundah\":e<5?t||g?\"sekunde\":\"sekundah\":\"sekund\",I;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return I+=1===e?t?\"minuta\":\"minuto\":2===e?t||g?\"minuti\":\"minutama\":e<5?t||g?\"minute\":\"minutami\":t||g?\"minut\":\"minutami\",I;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return I+=1===e?t?\"ura\":\"uro\":2===e?t||g?\"uri\":\"urama\":e<5?t||g?\"ure\":\"urami\":t||g?\"ur\":\"urami\",I;case\"d\":return t||g?\"en dan\":\"enim dnem\";case\"dd\":return I+=1===e?t||g?\"dan\":\"dnem\":2===e?t||g?\"dni\":\"dnevoma\":t||g?\"dni\":\"dnevi\",I;case\"M\":return t||g?\"en mesec\":\"enim mesecem\";case\"MM\":return I+=1===e?t||g?\"mesec\":\"mesecem\":2===e?t||g?\"meseca\":\"mesecema\":e<5?t||g?\"mesece\":\"meseci\":t||g?\"mesecev\":\"meseci\",I;case\"y\":return t||g?\"eno leto\":\"enim letom\";case\"yy\":return I+=1===e?t||g?\"leto\":\"letom\":2===e?t||g?\"leti\":\"letoma\":e<5?t||g?\"leta\":\"leti\":t||g?\"let\":\"leti\",I}}", "function t(e,t,r,a){var n=e+\" \";switch(r){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":if(e===1)n+=t?\"sekundo\":\"sekundi\";else if(e===2)n+=t||a?\"sekundi\":\"sekundah\";else if(e<5)n+=t||a?\"sekunde\":\"sekundah\";else n+=\"sekund\";return n;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":if(e===1)n+=t?\"minuta\":\"minuto\";else if(e===2)n+=t||a?\"minuti\":\"minutama\";else if(e<5)n+=t||a?\"minute\":\"minutami\";else n+=t||a?\"minut\":\"minutami\";return n;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":if(e===1)n+=t?\"ura\":\"uro\";else if(e===2)n+=t||a?\"uri\":\"urama\";else if(e<5)n+=t||a?\"ure\":\"urami\";else n+=t||a?\"ur\":\"urami\";return n;case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":if(e===1)n+=t||a?\"dan\":\"dnem\";else if(e===2)n+=t||a?\"dni\":\"dnevoma\";else n+=t||a?\"dni\":\"dnevi\";return n;case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":if(e===1)n+=t||a?\"mesec\":\"mesecem\";else if(e===2)n+=t||a?\"meseca\":\"mesecema\";else if(e<5)n+=t||a?\"mesece\":\"meseci\";else n+=t||a?\"mesecev\":\"meseci\";return n;case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":if(e===1)n+=t||a?\"leto\":\"letom\";else if(e===2)n+=t||a?\"leti\":\"letoma\";else if(e<5)n+=t||a?\"leta\":\"leti\";else n+=t||a?\"let\":\"leti\";return n}}", "function calcularEdad(anio_nac){\r\n let edad = 2021 - anio_nac;\r\n alert(edad);\r\n}", "function calcHebrew()\n {\n setJulian(hebrew_to_jd((new Number(document.hebrew.year.value)),\n\t\t\t document.hebrew.month.selectedIndex + 1,\n\t\t\t (new Number(document.hebrew.day.value))));\n }", "function date(){\n return ;\n }", "function c(e,c,t,n){var o=e+\" \";switch(t){case\"s\":return c||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return o+=1===e?c?\"sekundo\":\"sekundi\":2===e?c||n?\"sekundi\":\"sekundah\":e<5?c||n?\"sekunde\":\"sekundah\":\"sekund\",o;case\"m\":return c?\"ena minuta\":\"eno minuto\";case\"mm\":return o+=1===e?c?\"minuta\":\"minuto\":2===e?c||n?\"minuti\":\"minutama\":e<5?c||n?\"minute\":\"minutami\":c||n?\"minut\":\"minutami\",o;case\"h\":return c?\"ena ura\":\"eno uro\";case\"hh\":return o+=1===e?c?\"ura\":\"uro\":2===e?c||n?\"uri\":\"urama\":e<5?c||n?\"ure\":\"urami\":c||n?\"ur\":\"urami\",o;case\"d\":return c||n?\"en dan\":\"enim dnem\";case\"dd\":return o+=1===e?c||n?\"dan\":\"dnem\":2===e?c||n?\"dni\":\"dnevoma\":c||n?\"dni\":\"dnevi\",o;case\"M\":return c||n?\"en mesec\":\"enim mesecem\";case\"MM\":return o+=1===e?c||n?\"mesec\":\"mesecem\":2===e?c||n?\"meseca\":\"mesecema\":e<5?c||n?\"mesece\":\"meseci\":c||n?\"mesecev\":\"meseci\",o;case\"y\":return c||n?\"eno leto\":\"enim letom\";case\"yy\":return o+=1===e?c||n?\"leto\":\"letom\":2===e?c||n?\"leti\":\"letoma\":e<5?c||n?\"leta\":\"leti\":c||n?\"let\":\"leti\",o}}", "function t(e,t,n,a){var i=e+\" \";switch(n){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||a?\"sekundi\":\"sekundah\":e<5?t||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===e?t?\"minuta\":\"minuto\":2===e?t||a?\"minuti\":\"minutama\":e<5?t||a?\"minute\":\"minutami\":t||a?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===e?t?\"ura\":\"uro\":2===e?t||a?\"uri\":\"urama\":e<5?t||a?\"ure\":\"urami\":t||a?\"ur\":\"urami\";case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===e?t||a?\"dan\":\"dnem\":2===e?t||a?\"dni\":\"dnevoma\":t||a?\"dni\":\"dnevi\";case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===e?t||a?\"mesec\":\"mesecem\":2===e?t||a?\"meseca\":\"mesecema\":e<5?t||a?\"mesece\":\"meseci\":t||a?\"mesecev\":\"meseci\";case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===e?t||a?\"leto\":\"letom\":2===e?t||a?\"leti\":\"letoma\":e<5?t||a?\"leta\":\"leti\":t||a?\"let\":\"leti\"}}", "function t(e,t,n,a){var i=e+\" \";switch(n){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||a?\"sekundi\":\"sekundah\":e<5?t||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===e?t?\"minuta\":\"minuto\":2===e?t||a?\"minuti\":\"minutama\":e<5?t||a?\"minute\":\"minutami\":t||a?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===e?t?\"ura\":\"uro\":2===e?t||a?\"uri\":\"urama\":e<5?t||a?\"ure\":\"urami\":t||a?\"ur\":\"urami\";case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===e?t||a?\"dan\":\"dnem\":2===e?t||a?\"dni\":\"dnevoma\":t||a?\"dni\":\"dnevi\";case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===e?t||a?\"mesec\":\"mesecem\":2===e?t||a?\"meseca\":\"mesecema\":e<5?t||a?\"mesece\":\"meseci\":t||a?\"mesecev\":\"meseci\";case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===e?t||a?\"leto\":\"letom\":2===e?t||a?\"leti\":\"letoma\":e<5?t||a?\"leta\":\"leti\":t||a?\"let\":\"leti\"}}", "function bl(e,t,n,i){var o=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return o+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return o+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return o+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return o+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return o+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return o+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "function jour(){\n let date_actuelle = date.getDate();\n let mois = date.getMonth()+1;\n let annee = date.getFullYear();\n mois < 10 ? mois = `0${mois}` : mois\n document.getElementById(\"date\").innerHTML=\"\"+date_actuelle+\"/\"+mois+\"/\"+annee;\n console.log(date);\n}", "function e(t,e,n,i){var a=t+\" \";switch(n){case\"s\":return e||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||i?\"sekundi\":\"sekundah\":t<5?e||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===t?e?\"minuta\":\"minuto\":2===t?e||i?\"minuti\":\"minutama\":t<5?e||i?\"minute\":\"minutami\":e||i?\"minut\":\"minutami\";case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===t?e?\"ura\":\"uro\":2===t?e||i?\"uri\":\"urama\":t<5?e||i?\"ure\":\"urami\":e||i?\"ur\":\"urami\";case\"d\":return e||i?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===t?e||i?\"dan\":\"dnem\":2===t?e||i?\"dni\":\"dnevoma\":e||i?\"dni\":\"dnevi\";case\"M\":return e||i?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===t?e||i?\"mesec\":\"mesecem\":2===t?e||i?\"meseca\":\"mesecema\":t<5?e||i?\"mesece\":\"meseci\":e||i?\"mesecev\":\"meseci\";case\"y\":return e||i?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===t?e||i?\"leto\":\"letom\":2===t?e||i?\"leti\":\"letoma\":t<5?e||i?\"leta\":\"leti\":e||i?\"let\":\"leti\"}}", "function dayOfProgrammer(year) {\n\n let dt = 0;\n//year where julian calender changed to gregorian calender \n if (year == 1918) {\n dt = 256-230;\n }\n\n//julian calender\n if (year >= 1700 && year < 1918) {\n if (year % 4 == 0) //its leap\n dt = 256 - 244;\n else\n dt = 256 - 243;\n }\n\n//for gregorian calender\n else if (year > 1918 && year <= 2700) {\n\n if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n //leap year\n dt = 256 - 244;\n }\n else {\n //not leap year\n dt = 256 - 243;\n }\n }\n else {\n return \"year should be between 1700 - 2700 \";\n }\n\n//256th day always falls in september -09\n\n let ans = dt + \".09\" + \".\" + year;\n return ans;\n \n}", "function t(e,t,n,a){var s=e+\" \";switch(n){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return s+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||a?\"sekundi\":\"sekundah\":e<5?t||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return s+=1===e?t?\"minuta\":\"minuto\":2===e?t||a?\"minuti\":\"minutama\":e<5?t||a?\"minute\":\"minutami\":t||a?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return s+=1===e?t?\"ura\":\"uro\":2===e?t||a?\"uri\":\"urama\":e<5?t||a?\"ure\":\"urami\":t||a?\"ur\":\"urami\";case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":return s+=1===e?t||a?\"dan\":\"dnem\":2===e?t||a?\"dni\":\"dnevoma\":t||a?\"dni\":\"dnevi\";case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":return s+=1===e?t||a?\"mesec\":\"mesecem\":2===e?t||a?\"meseca\":\"mesecema\":e<5?t||a?\"mesece\":\"meseci\":t||a?\"mesecev\":\"meseci\";case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":return s+=1===e?t||a?\"leto\":\"letom\":2===e?t||a?\"leti\":\"letoma\":e<5?t||a?\"leta\":\"leti\":t||a?\"let\":\"leti\"}}", "function t(e,t,a,i){var s=e+\" \";switch(a){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return s+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return s+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return s+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return s+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return s+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return s+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "function calcHebrew() { \n if (document.hebrew.day.value>=31) {alert(\"Hebrew day number too high\");return;}\n setJulian(hebrew_to_jd((new Number(document.hebrew.year.value)),\n document.hebrew.month.selectedIndex + 1,\n (new Number(document.hebrew.day.value))));\n}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "function t(e,t,a){return e+\" \"+function(e,t){return 2===t?function(e){var t={m:\"v\",b:\"v\",d:\"z\"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[a],e)}", "function t(e,t,a){return e+\" \"+function(e,t){return 2===t?function(e){var t={m:\"v\",b:\"v\",d:\"z\"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[a],e)}", "function t(e,t,n,i){var a=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "function t(e,t,n,i){var r=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":if(e===1)r+=t?\"sekundo\":\"sekundi\";else if(e===2)r+=t||i?\"sekundi\":\"sekundah\";else if(e<5)r+=t||i?\"sekunde\":\"sekundah\";else r+=\"sekund\";return r;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":if(e===1)r+=t?\"minuta\":\"minuto\";else if(e===2)r+=t||i?\"minuti\":\"minutama\";else if(e<5)r+=t||i?\"minute\":\"minutami\";else r+=t||i?\"minut\":\"minutami\";return r;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":if(e===1)r+=t?\"ura\":\"uro\";else if(e===2)r+=t||i?\"uri\":\"urama\";else if(e<5)r+=t||i?\"ure\":\"urami\";else r+=t||i?\"ur\":\"urami\";return r;case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":if(e===1)r+=t||i?\"dan\":\"dnem\";else if(e===2)r+=t||i?\"dni\":\"dnevoma\";else r+=t||i?\"dni\":\"dnevi\";return r;case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":if(e===1)r+=t||i?\"mesec\":\"mesecem\";else if(e===2)r+=t||i?\"meseca\":\"mesecema\";else if(e<5)r+=t||i?\"mesece\":\"meseci\";else r+=t||i?\"mesecev\":\"meseci\";return r;case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":if(e===1)r+=t||i?\"leto\":\"letom\";else if(e===2)r+=t||i?\"leti\":\"letoma\";else if(e<5)r+=t||i?\"leta\":\"leti\";else r+=t||i?\"let\":\"leti\";return r}}", "function nbJoursParAn() {\r\n var typeannee = document.getElementById(\"typeannee\").value;\r\n switch (typeannee) {\r\n case 'Sidérale':\r\n return 365.256363051;\r\n case 'Julienne':\r\n return 365.25;\r\n case 'Tropique (2000)':\r\n return 365.242190517;\r\n default:\r\n return 365.2425;\r\n }\r\n}", "function getVerseOfTheDay() {\n \n let today = new Date();\n let year = today.getFullYear();\n var janFirst = new Date(year, 0, 1, 1, 1, 1, 1);\n var days = daydiff(janFirst,today);\n\n var dailyVerseToGet = Math.ceil((((days / text3.Verse.length) - Math.floor((days / text3.Verse.length)))) * text3.Verse.length);\n \n console.log(dailyVerseToGet);\n \n return text3.Verse[dailyVerseToGet];\n}", "function t(a,r,_,l){var h=a+\" \";switch(_){case\"s\":return r||l?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a===1?h+=r?\"sekundo\":\"sekundi\":a===2?h+=r||l?\"sekundi\":\"sekundah\":a<5?h+=r||l?\"sekunde\":\"sekundah\":h+=\"sekund\",h;case\"m\":return r?\"ena minuta\":\"eno minuto\";case\"mm\":return a===1?h+=r?\"minuta\":\"minuto\":a===2?h+=r||l?\"minuti\":\"minutama\":a<5?h+=r||l?\"minute\":\"minutami\":h+=r||l?\"minut\":\"minutami\",h;case\"h\":return r?\"ena ura\":\"eno uro\";case\"hh\":return a===1?h+=r?\"ura\":\"uro\":a===2?h+=r||l?\"uri\":\"urama\":a<5?h+=r||l?\"ure\":\"urami\":h+=r||l?\"ur\":\"urami\",h;case\"d\":return r||l?\"en dan\":\"enim dnem\";case\"dd\":return a===1?h+=r||l?\"dan\":\"dnem\":a===2?h+=r||l?\"dni\":\"dnevoma\":h+=r||l?\"dni\":\"dnevi\",h;case\"M\":return r||l?\"en mesec\":\"enim mesecem\";case\"MM\":return a===1?h+=r||l?\"mesec\":\"mesecem\":a===2?h+=r||l?\"meseca\":\"mesecema\":a<5?h+=r||l?\"mesece\":\"meseci\":h+=r||l?\"mesecev\":\"meseci\",h;case\"y\":return r||l?\"eno leto\":\"enim letom\";case\"yy\":return a===1?h+=r||l?\"leto\":\"letom\":a===2?h+=r||l?\"leti\":\"letoma\":a<5?h+=r||l?\"leta\":\"leti\":h+=r||l?\"let\":\"leti\",h}}", "dayToJalali(julianDayNumber) {\r\n let gy = this.dayToGregorion(julianDayNumber).getFullYear(), // Calculate Gregorian year (gy).\r\n jalaliYear = gy - 621,\r\n r = this.jalCal(jalaliYear),\r\n gregorianDay = this.gregorianToDay(gy, 3, r.march),\r\n jalaliDay,\r\n jalaliMonth,\r\n numberOfDays;\r\n // Find number of days that passed since 1 Farvardin.\r\n numberOfDays = julianDayNumber - gregorianDay;\r\n if (numberOfDays >= 0) {\r\n if (numberOfDays <= 185) {\r\n // The first 6 months.\r\n jalaliMonth = 1 + div(numberOfDays, 31);\r\n jalaliDay = mod(numberOfDays, 31) + 1;\r\n return { year: jalaliYear, month: jalaliMonth, day: jalaliDay };\r\n } else {\r\n // The remaining months.\r\n numberOfDays -= 186;\r\n }\r\n } else {\r\n // Previous Jalali year.\r\n jalaliYear -= 1;\r\n numberOfDays += 179;\r\n if (r.leap === 1) {\r\n numberOfDays += 1;\r\n }\r\n }\r\n jalaliMonth = 7 + div(numberOfDays, 30);\r\n jalaliDay = mod(numberOfDays, 30) + 1;\r\n return { year: jalaliYear, month: jalaliMonth, day: jalaliDay };\r\n }", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\",a;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\",a;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\",a;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\",a}}", "function e(t,e,n,i){var a=t+\" \";switch(n){case\"s\":return e||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||i?\"sekundi\":\"sekundah\":t<5?e||i?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===t?e?\"minuta\":\"minuto\":2===t?e||i?\"minuti\":\"minutama\":t<5?e||i?\"minute\":\"minutami\":e||i?\"minut\":\"minutami\",a;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===t?e?\"ura\":\"uro\":2===t?e||i?\"uri\":\"urama\":t<5?e||i?\"ure\":\"urami\":e||i?\"ur\":\"urami\",a;case\"d\":return e||i?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===t?e||i?\"dan\":\"dnem\":2===t?e||i?\"dni\":\"dnevoma\":e||i?\"dni\":\"dnevi\",a;case\"M\":return e||i?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===t?e||i?\"mesec\":\"mesecem\":2===t?e||i?\"meseca\":\"mesecema\":t<5?e||i?\"mesece\":\"meseci\":e||i?\"mesecev\":\"meseci\",a;case\"y\":return e||i?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===t?e||i?\"leto\":\"letom\":2===t?e||i?\"leti\":\"letoma\":t<5?e||i?\"leta\":\"leti\":e||i?\"let\":\"leti\",a}}", "function t(e,t,a,n){var r=e+\" \";switch(a){case\"s\":return t||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||n?\"sekundi\":\"sekundah\":e<5?t||n?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||n?\"minuti\":\"minutama\":e<5?t||n?\"minute\":\"minutami\":t||n?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||n?\"uri\":\"urama\":e<5?t||n?\"ure\":\"urami\":t||n?\"ur\":\"urami\";case\"d\":return t||n?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||n?\"dan\":\"dnem\":2===e?t||n?\"dni\":\"dnevoma\":t||n?\"dni\":\"dnevi\";case\"M\":return t||n?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||n?\"mesec\":\"mesecem\":2===e?t||n?\"meseca\":\"mesecema\":e<5?t||n?\"mesece\":\"meseci\":t||n?\"mesecev\":\"meseci\";case\"y\":return t||n?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||n?\"leto\":\"letom\":2===e?t||n?\"leti\":\"letoma\":e<5?t||n?\"leta\":\"leti\":t||n?\"let\":\"leti\"}}", "function t(e,t,n,i){var a=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\",a;case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\",a;case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\",a;case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\",a}}", "function t(e,t,n,i){var a=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\",a;case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\",a;case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\",a;case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\",a}}", "function t(e,t,n,i){var a=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\",a;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\",a;case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\",a;case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\",a;case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\",a}}", "function t(e,t,n,o){var i=e+\" \";switch(n){case\"s\":return t||o?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||o?\"sekundi\":\"sekundah\":e<5?t||o?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===e?t?\"minuta\":\"minuto\":2===e?t||o?\"minuti\":\"minutama\":e<5?t||o?\"minute\":\"minutami\":t||o?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===e?t?\"ura\":\"uro\":2===e?t||o?\"uri\":\"urama\":e<5?t||o?\"ure\":\"urami\":t||o?\"ur\":\"urami\";case\"d\":return t||o?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===e?t||o?\"dan\":\"dnem\":2===e?t||o?\"dni\":\"dnevoma\":t||o?\"dni\":\"dnevi\";case\"M\":return t||o?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===e?t||o?\"mesec\":\"mesecem\":2===e?t||o?\"meseca\":\"mesecema\":e<5?t||o?\"mesece\":\"meseci\":t||o?\"mesecev\":\"meseci\";case\"y\":return t||o?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===e?t||o?\"leto\":\"letom\":2===e?t||o?\"leti\":\"letoma\":e<5?t||o?\"leta\":\"leti\":t||o?\"let\":\"leti\"}}", "function t(e,t,n,a){var r=e+\" \";switch(n){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||a?\"sekundi\":\"sekundah\":e<5?t||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||a?\"minuti\":\"minutama\":e<5?t||a?\"minute\":\"minutami\":t||a?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||a?\"uri\":\"urama\":e<5?t||a?\"ure\":\"urami\":t||a?\"ur\":\"urami\";case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||a?\"dan\":\"dnem\":2===e?t||a?\"dni\":\"dnevoma\":t||a?\"dni\":\"dnevi\";case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||a?\"mesec\":\"mesecem\":2===e?t||a?\"meseca\":\"mesecema\":e<5?t||a?\"mesece\":\"meseci\":t||a?\"mesecev\":\"meseci\";case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||a?\"leto\":\"letom\":2===e?t||a?\"leti\":\"letoma\":e<5?t||a?\"leta\":\"leti\":t||a?\"let\":\"leti\"}}", "function t(e,t,n,a){var r=e+\" \";switch(n){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||a?\"sekundi\":\"sekundah\":e<5?t||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||a?\"minuti\":\"minutama\":e<5?t||a?\"minute\":\"minutami\":t||a?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||a?\"uri\":\"urama\":e<5?t||a?\"ure\":\"urami\":t||a?\"ur\":\"urami\";case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||a?\"dan\":\"dnem\":2===e?t||a?\"dni\":\"dnevoma\":t||a?\"dni\":\"dnevi\";case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||a?\"mesec\":\"mesecem\":2===e?t||a?\"meseca\":\"mesecema\":e<5?t||a?\"mesece\":\"meseci\":t||a?\"mesecev\":\"meseci\";case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||a?\"leto\":\"letom\":2===e?t||a?\"leti\":\"letoma\":e<5?t||a?\"leta\":\"leti\":t||a?\"let\":\"leti\"}}", "function t(e,t,n,a){var r=e+\" \";switch(n){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||a?\"sekundi\":\"sekundah\":e<5?t||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||a?\"minuti\":\"minutama\":e<5?t||a?\"minute\":\"minutami\":t||a?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||a?\"uri\":\"urama\":e<5?t||a?\"ure\":\"urami\":t||a?\"ur\":\"urami\";case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||a?\"dan\":\"dnem\":2===e?t||a?\"dni\":\"dnevoma\":t||a?\"dni\":\"dnevi\";case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||a?\"mesec\":\"mesecem\":2===e?t||a?\"meseca\":\"mesecema\":e<5?t||a?\"mesece\":\"meseci\":t||a?\"mesecev\":\"meseci\";case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||a?\"leto\":\"letom\":2===e?t||a?\"leti\":\"letoma\":e<5?t||a?\"leta\":\"leti\":t||a?\"let\":\"leti\"}}", "function t(e,t,n,a){var r=e+\" \";switch(n){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||a?\"sekundi\":\"sekundah\":e<5?t||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||a?\"minuti\":\"minutama\":e<5?t||a?\"minute\":\"minutami\":t||a?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||a?\"uri\":\"urama\":e<5?t||a?\"ure\":\"urami\":t||a?\"ur\":\"urami\";case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||a?\"dan\":\"dnem\":2===e?t||a?\"dni\":\"dnevoma\":t||a?\"dni\":\"dnevi\";case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||a?\"mesec\":\"mesecem\":2===e?t||a?\"meseca\":\"mesecema\":e<5?t||a?\"mesece\":\"meseci\":t||a?\"mesecev\":\"meseci\";case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||a?\"leto\":\"letom\":2===e?t||a?\"leti\":\"letoma\":e<5?t||a?\"leta\":\"leti\":t||a?\"let\":\"leti\"}}", "function t(e,t,n,a){var r=e+\" \";switch(n){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||a?\"sekundi\":\"sekundah\":e<5?t||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||a?\"minuti\":\"minutama\":e<5?t||a?\"minute\":\"minutami\":t||a?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||a?\"uri\":\"urama\":e<5?t||a?\"ure\":\"urami\":t||a?\"ur\":\"urami\";case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||a?\"dan\":\"dnem\":2===e?t||a?\"dni\":\"dnevoma\":t||a?\"dni\":\"dnevi\";case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||a?\"mesec\":\"mesecem\":2===e?t||a?\"meseca\":\"mesecema\":e<5?t||a?\"mesece\":\"meseci\":t||a?\"mesecev\":\"meseci\";case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||a?\"leto\":\"letom\":2===e?t||a?\"leti\":\"letoma\":e<5?t||a?\"leta\":\"leti\":t||a?\"let\":\"leti\"}}", "function dates() {\n var m = d.getMonth()+1;\n if(m<10) \n{\n m='0'+m;\n}\n var date = d.getDate();\n if(date<10) \n{\n date='0'+date;\n}\n var fy = d.getFullYear();\ndocument.getElementById(\"answer2\").innerHTML = m+\"-\"+date+\"-\"+fy;\nvar node = document.createElement(\"p\");\nnode.appendChild(document.createTextNode(m+\"/\"+date+\"/\"+fy));\ndocument.getElementById(\"answer2\").appendChild(node); \n\nvar node2 = document.createElement(\"p\");\nnode2.appendChild(document.createTextNode(date+\"/\"+m+\"/\"+fy));\ndocument.getElementById(\"answer2\").appendChild(node2); \n}", "function t(e,t,a,n){var r=e+\" \";switch(a){case\"s\":return t||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||n?\"sekundi\":\"sekundah\":e<5?t||n?\"sekunde\":\"sekundah\":\"sekund\",r;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||n?\"minuti\":\"minutama\":e<5?t||n?\"minute\":\"minutami\":t||n?\"minut\":\"minutami\",r;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||n?\"uri\":\"urama\":e<5?t||n?\"ure\":\"urami\":t||n?\"ur\":\"urami\",r;case\"d\":return t||n?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||n?\"dan\":\"dnem\":2===e?t||n?\"dni\":\"dnevoma\":t||n?\"dni\":\"dnevi\",r;case\"M\":return t||n?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||n?\"mesec\":\"mesecem\":2===e?t||n?\"meseca\":\"mesecema\":e<5?t||n?\"mesece\":\"meseci\":t||n?\"mesecev\":\"meseci\",r;case\"y\":return t||n?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||n?\"leto\":\"letom\":2===e?t||n?\"leti\":\"letoma\":e<5?t||n?\"leta\":\"leti\":t||n?\"let\":\"leti\",r}}" ]
[ "0.6087893", "0.59904623", "0.5989278", "0.5923899", "0.5849531", "0.584033", "0.5806088", "0.5794761", "0.57887447", "0.5749848", "0.5729964", "0.5703972", "0.56496435", "0.5645243", "0.56417555", "0.5634543", "0.5623934", "0.5607767", "0.5607352", "0.5607352", "0.56040776", "0.56027204", "0.56018084", "0.5597853", "0.55914044", "0.55833304", "0.55831474", "0.55754644", "0.5573534", "0.5573417", "0.5569128", "0.5568236", "0.5566519", "0.5564456", "0.55623096", "0.5560282", "0.5560282", "0.55525106", "0.5551949", "0.55485505", "0.55477273", "0.5544238", "0.55442077", "0.55429935", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5541097", "0.5539171", "0.5539171", "0.55386233", "0.5536894", "0.5535311", "0.553449", "0.55341524", "0.5531854", "0.5530606", "0.5530606", "0.5530606", "0.5530606", "0.5530606", "0.5530606", "0.5530606", "0.5530606", "0.5530606", "0.5530606", "0.5530606", "0.5530606", "0.5530606", "0.5530606", "0.55254376", "0.55221844", "0.55190575", "0.55190575", "0.55190575", "0.5518589", "0.55142474", "0.55142474", "0.55142474", "0.55142474", "0.55142474", "0.5513547", "0.55130434" ]
0.0
-1
Verifica Campo da Cidade/Pais
function verificaCampoPreenchido(cidade) { var preenchido; if(cidade != ""){ preenchido = true; } return preenchido; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function esCampo(campo)\n{\n\tif (campo==null) return false;\n\tif (campo.name==null) return false;\n\treturn true;\n}", "function check_ciudad() {\n\n\t\tif($(\"#Ciudad option:selected\").val() == 0) {\n \t\t$(\"#errorciudad\").html(\"Seleccione una ciudad\");\n\t\t\t$(\"#rrorciudad\").show();\n\t\t\terror_vivienda = true;\n\t\t} else {\n\t\t\t$(\"#errorciudad\").hide();\n\t\t}\n\t}", "function buscarCiudad() {\n // obtener valor ingresado\n let ciudadBuscada = document.getElementById('nombreCiudad').value;\n console.log(ciudadBuscada);\n // comprobar que se haya ingresado un valor\n if (ciudadBuscada === \"\") {\n alert(\"Ingrese una ciudad\");\n } else {\n // armar url para hacer el fetch de openweather con nombre\n let fetchNombre = tempactual + q + ciudadBuscada +idioma + grados + apiKey;\n // llamo funcion que ubica en mapa y vuelca datos de clima\n temperaturaCiudad(fetchNombre);\n }\n }", "verificaDados(){\n this.verificaEndereco();\n if(!this.verificaVazio()) this.criaMensagem('Campo vazio detectado', true);\n if(!this.verificaIdade()) this.criaMensagem('Proibido cadastro de menores de idade', true);\n if(!this.verificaCpf()) this.criaMensagem('Cpf deve ser válido', true);\n if(!this.verificaUsuario()) this.criaMensagem('Nome de usuario deve respeitar regras acima', true);\n if(!this.verificaSenhas()) this.criaMensagem('Senha deve ter os critérios acima', true)\n else{\n this.criaMensagem();\n // this.formulario.submit();\n }\n }", "function QualidadeCheck(){\n\tconsole.log(\"Avaliando pessoas!\");\n\tvar palavra1,\n\t\tpalavra2,\n\t\tpalavrafinal,\n\t\tresultado,\n\t\tcaracter;\n\tfor(var cont=0; cont < Cidade.length; cont++){\n\t\tpalavra1=Sun1;\n\t\tpalavra2=Sun2;\n\t\tpalavrafinal = Result;\n\t\tif(Cidade[cont].soma == null){\n\t\t\tfor(var cont2=0; cont2<Sun1.length; cont2++){\n\t\t\t\tcaracter = Sun1[cont2];\n\t\t\t\tpalavra1 = palavra1.replace(Sun1[cont2], Cidade[cont][caracter]);\n\t\t\t}\n\t\t\tfor(var cont2=0; cont2<Sun2.length; cont2++){\n\t\t\t\tcaracter = Sun2[cont2];\n\t\t\t\tpalavra2 = palavra2.replace(Sun2[cont2], Cidade[cont][caracter]);\n\t\t\t}\n\t\t\t\n\t\t\t//Soma das palavras, e preciso converte para inteiro.\n\t\t\tpalavra1 = parseInt(palavra1, 10);\n\t\t\tpalavra2 = parseInt(palavra2, 10);\n\t\t\tresultado = palavra1+palavra2;\n\t\t\tCidade[cont].soma = resultado;\n\n\t\t\t//Para que o .length funcione e consiga navegar pelos caracteres da soma, e necessario converte para String.\n\t\t\tresultado = String(resultado);\n\n\t\t\t//Caminhar por todos caracteres da soma.\n\t\t\tfor(var cont2=0; cont2<resultado.length; cont2++){\n\t\t\t\t//Caminha por todos caracteres do texto (Ex: 15263 ira se torna 'dlsjqi')\n\t\t\t\tfor(var cont3=0;cont3<Texto.length;cont3++){\n\t\t\t\t\t// Pelo o caractere vejo qual numero o representa, caso o numero seja o mesmo que eu esteja procurando, troco o numero pelo caractere.\n\t\t\t\t\tif(Cidade[cont][Texto[cont3]]==resultado[cont2]){\n\t\t\t\t\t\tresultado = resultado.replace(resultado[cont2], Texto[cont3]);\n\t\t\t\t\t}\n\t\t\t\t}\n }\n \n Cidade[cont].stexto = resultado;\n \n\t\t\t//saber % de acerto de cada palavra\t+ Aptidão\n\t\t\tCidade[cont] = new Object(AvaliacaoMetodo(Cidade[cont]));\n\t\t\tif(Cidade[cont].aptidao==0){\n\t\t\t\tKillError(\"RESULTADO ENCONTRADO\");\n\t\t\t}\n\t\t}\n\t}\n\n\n\tfunction AvaliacaoMetodo(obj){\n\t\tvar taxa_acerto=0,temp;\n\t\tswitch(MetodoAvalicao){\n\t\t\tcase 1:\n\t\t\t\t//(SEND+MORE)-MONEY\n\t\t\t\t//Pego a soma do alfabeto e subtraio menos a palavra MONEY gerada pelo alfabeto, verificar se ocorre a igualdade.\n\t\t\t\t//Caso taxa == 0, então encontramos o resultado!\n\t\t\t\tvar letra,\n\t\t\t\t\tfrase=Result;\n\t\t\t\t//Converte frase MONEY para 12546 usando o alfabeto da cidade.\n\t\t\t\tfor (var cont=0; cont < frase.length; cont++){\n\t\t\t\t\tletra = frase.substring(cont, cont+1);\n\t\t\t\t\tif(obj[letra] != null){\n\t\t\t\t\t\tfrase = frase.replace(letra,obj[letra]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfrase = parseInt(frase, 10);\n\t\t\t\tobj.aptidao = frase - obj.soma;\n\t\t\t\tif(obj.aptidao<0){\n\t\t\t\t\tobj.aptidao = obj.aptidao*-1;\n\t\t\t\t}\n\n\t\t\t\t//Vamos força a finalização do programa, pois encontramos o resultado.\n\t\t\t\tobj.qualidade = parseInt((1/obj.aptidao)*10000);\n\t\t\t\treturn obj;\n\t\t\t\tbreak;\n case 2:\n KillError(\" -a [1,2:Não corrigido,3,4]\");\n\t\t\t\t// SOMA DE BIT A BIT E SUBTRAÇÃO\n\t\t\t\t//Pego a soma do alfabeto e subtraio menos a palavra MONEY gerada pelo alfabeto, verificar se ocorre a igualdade.\n\t\t\t\t//Caso taxa == 0, então encontramos o resultado!\n\t\t\t\tvar letra, frase=Result;\n\t\t\t\t//Converte frase MONEY para EX: 17892 usando o alfabeto da cidade.\n\t\t\t\tfor (var cont=0; cont < frase.length; cont++){\n\t\t\t\t\tletra = frase.substring(cont, cont+1);\n\t\t\t\t\tfrase = frase.replace(letra,Cidade[letra]);\n\t\t\t\t}\n\t\t\t\t//Somar bit a bit resultado da palavra MONEY.\n\t\t\t\tfor (cont=0; cont < frase.length; cont++){\n\t\t\t\t\ttaxa_acerto += parseInt(frase.substring(cont, cont+1), 10);\n\t\t\t\t}\n\n\t\t\t\t//Soma Cidade.soma BIT a BIT\n\t\t\t\ttemp=0;\n\t\t\t\tvar cidade_soma = String(Cidade.soma);\n\t\t\t\tfor (cont=0; cont < cidade_soma.length; cont++){\n\t\t\t\t\ttemp += parseInt(cidade_soma.substring(cont, cont+1), 10);\n\t\t\t\t}\n\n\t\t\t\t//Obter diferença do desejado e do numero gerado.\n\t\t\t\ttaxa_acerto = taxa_acerto - temp;\n\t\t\t\tif(taxa_acerto<0){\n\t\t\t\t\ttaxa_acerto = taxa_acerto*-1;\n\t\t\t\t}\n\n\t\t\t\t//Verificar se este foi o melhor obtido!\n\t\t\t\tif(CidadeTOP.qualidade>taxa_acerto || CidadeTOP.qualidade==null){\n\t\t\t\t\tCidade.qualidade = taxa_acerto;\n\t\t\t\t\tCidadeTOP = Cidade;\n\t\t\t\t}\n\t\t\t\treturn Cidade;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t//METODO NÃO ENTENDIDO\n\t\t\t\tKillError(\" -a [1,2,3:Não definido,4]\");\n\t\t\t\tbreak;\n case 4:\n KillError(\" -a [1,2,3,4:Não corrigido]\");\n\t\t\t\t//METODO DE % DE IGUALDADE ENTRE O QUE ESPERAVA \n\t\t\t\t//Comparar caractere por caractere e vejo a % de igualdade.\n\t\t\t\t//Caso chege a 100, encontramos nosso resultado.\n\t\t\t\tvar resultado = Cidade.stexto;\n\t\t\t\tCidade.aptidao = 0;\n\t\t\t\tfor(var cont2=0; cont2<resultado.length; cont2++){\n\t\t\t\t\tif(resultado[cont2]==Result[cont2]){\n\t\t\t\t\t\tCidade.aptidao = Cidade.aptidao+(1/Result.length)*100;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Verificar se este foi o melhor obtido!\n\t\t\t\tif(CidadeTOP.aptidao<Cidade.aptidao || CidadeTOP.aptidao==null){\n\t\t\t\t\tCidadeTOP = Cidade;\n\t\t\t\t}\n\t\t\t\t//Vamos força a finalização do programa, pois encontramos o resultado.\n\t\t\t\tif(Cidade.aptidao==100){\n\t\t\t\t\tKillError(\"RESULTADO ENCONTRADO\");\n\t\t\t\t}else{\n\t\t\t\t\tCidade.qualidade = Cidade.aptidao;\n\t\t\t\t}\n\t\t\t\treturn Cidade;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tKillError(\" -a [1,2,3:Não definido,4]\");\n\t\t}\n\t}\n}", "validarDadosC() {\n for (let i in this) {\n if (this[i] == undefined || this[i] == '' || this[i] == null) {\n return false;\n }\n }\n\n if (this.vencimento == 'e' || this.limite == 'e') {\n return false\n }\n else if (this.vecimento < 1 || this.limite < 1) {\n return false\n }\n else if (this.vencimento > 31) {\n return false\n }\n\n return true;\n }", "verificarDadosMinhaConta() {\n cy.visit('https://www.panvel.com/panvel/meusDados.do')\n cy.get(elementsMinhaConta.cardEndereco()).should('include.text', 'ESTR: 15, 865, eldorado, PARQUE GUAIBA, ELDORADO DO SUL, RS')\n cy.get(elementsMinhaConta.cardTelefone()).should('include.text', '985743758')\n cy.get(elementsMinhaConta.cardNome()).should('include.text', 'JOAO GUILHERME GROSS MARTINS')\n waitLoader()\n }", "function verificarCampos(){\n let añoS=parseInt(fechafinal.value.substr(0,4));\n let mesS=parseInt(fechafinal.value.substr(5,7));\n let diaS=parseInt(fechafinal.value.substr(8,10));\n \n\n if(idC.value==''|| producto.value=='' || estanteria.value==''|| precio.value==''||\n descripcion.value==''|| ubicacion.value=='' ||fechafinal.value=='' ){\n mensaje.innerHTML = `\n <div class=\"alert alert-danger\" role=\"alert\">\n LLene todo los Campos\n </div>\n `;\n mensaje.style.display='block';\n }else if((añoS<anoActual || mesS<mesActual) || diaS<=dia ){\n mensaje.style.display='block';\n mensaje.innerHTML = `\n <div class=\"alert alert-danger\" role=\"alert\">\n La fecha escojida debe ser superior a la actual \n </div>\n `;\n \n }else{\n insertarDatosEmpeno();\n }\n }", "function verificaCampos() {\n var vetor = [$('#cn'), $('#sn'), $('#employeeNumber'), $('#uid'), $('#givenName'), $('#mail'), $('#telephoneNumber'), $('#cellphoneNumber'), $('#userPassword'), $('#confirmar_senha')];\n\n if ($('#cn').val() && $('#sn').val() && $('#employeeNumber').val() && $('#uid').val() && $('#givenName').val() && $('#mail').val() && $('#telephoneNumber').val() && $('#cellphoneNumber').val() && $('#userPassword').val() && $('#confirmar_senha').val()) {\n dados = true;\n }\n else {\n for (var a = 0; a < 10; ++a) {\n if (!vetor[a].val()) {\n vetor[a].addClass('error');\n }\n }\n dados = false;\n }\n}", "function validarCampos () {\n\tif (!vacio($(\"#titulo\").val(), $(\"#titulo\").attr(\"placeholder\"))) {\n\t\tsave();\n\t}\n}", "function campo_vacio(campo) {\n\tif (campo.value == \"\") {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "validarCadena(propiedad, valor) {\n //Estas validaciones dentro de este metodo las invoco donde necesite validar que un valor es de tipo cadena\n if (!valor) return console.warn(`${propiedad} \"${valor}\" esta vacío`);\n if (!valor) return console.warn(`${propiedad} \"${valor}\" ingresado, NO es una cadena de texto`);\n return true;\n }", "function validarCP1(cPostal){\n\n let provincias = {\n 1: \"Álava\", 2: \"Albacete\", 3: \"Alicante\", 4: \"Almería\", 5: \"Ávila\",\n 6: \"Badajoz\", 7: \"Islas Baleares\", 08: \"Barcelona\", 09: \"Burgos\", 10: \"Cáceres\",\n 11: \"Cádiz\", 12: \"Castellón\", 13: \"Ciudad Real\", 14: \"Córdoba\", 15: \"La Coruña\",\n 16: \"Cuenca\", 17: \"Gerona\", 18: \"Granada\", 19: \"Guadalajara\", 20: \"Guipúzcoa\",\n 21: \"Huelva\", 22: \"Huesca\", 23: \"Jaén\", 24: \"León\", 25: \"Lérida\",\n 26: \"La Rioja\", 27: \"Lugo\", 28: \"Madrid\", 29: \"Málaga\", 30: \"Murcia\",\n 31: \"Navarra\", 32: \"Orense\", 33: \"Asturias\", 34: \"Palencia\", 35: \"Las Palmas de Gran Canaria\",\n 36: \"Pontevedra\", 37: \"Salamanca\", 38: \"Santa Cruz de Tenerife\", 39: \"Cantabria\", 40: \"Segovia\",\n 41: \"Sevilla\", 42: \"Soria\", 43: \"Tarragona\", 44: \"Teruel\", 45: \"Toledo\",\n 46: \"Valencia\", 47: \"Valladolid\", 48: \"Vizcaya\", 49: \"Zamora\", 50: \"Zaragoza\",\n 51: \"Ceuta\", 52: \"Melilla\"\n };\n if(cPostal.length == 5 && cPostal <= 52999 && cPostal >= 1000){\n \n return provincias[parseInt(cPostal.substring(0, 2))];\n }\n if(patrones.patronCP.test(cp.value)){\n\n cp.className=\"form-control is-valid\";\n errorCP.classList.remove('mensajeError-activo');\n errorCP.classList.add('mensajeError-oculto');\n \n \treturn true;\n }\n else{\n cp.className=\"form-control is-invalid\";\n errorCP.classList.remove('mensajeError-oculto');\n errorCP.classList.add('mensajeError-activo');\n \t\treturn false;\n }\n}", "validarCpf() {\r\n if(this.cpf.lenght === 11) {\r\n return true;\r\n }\r\n return false;\r\n }", "function validarCP2(cPostal){\n\n let comunidades = {\n 1: \"País Vasco\", 2: \"Castilla-La Mancha\", 3: \"Comunidad Valenciana\", 4: \"Andalucía\", 5: \"Castilla y León\",\n 6: \"Extremadura\", 7: \"Islas Baleares\", 08: \"Cataluña\", 09: \"Castilla y León\", 10: \"Extremadura\",\n 11: \"Andalucía\", 12: \"Comunidad Valenciana\", 13: \"Castilla-La Mancha\", 14: \"Andalucía\", 15: \"Galicia\",\n 16: \"Castilla-La Mancha\", 17: \"Cataluña\", 18: \"Andalucía\", 19: \"Castilla-La Mancha\", 20: \"País Vasco\",\n 21: \"Andalucía\", 22: \"Aragón\", 23: \"Andalucía\", 24: \"Castilla y León\", 25: \"Cataluña\",\n 26: \"La Rioja\", 27: \"Galicia\", 28: \"Madrid\", 29: \"Andalucía\", 30: \"Murcia\",\n 31: \"Navarra\", 32: \"Galicia\", 33: \"Asturias\", 34: \"Castilla y León\", 35: \"Islas Canarias\",\n 36: \"Galicia\", 37: \"Castilla y León\", 38: \"Islas Canarias\", 39: \"Cantabria\", 40: \"Castilla y León\",\n 41: \"Andalucía\", 42: \"Castilla y León\", 43: \"Cataluña\", 44: \"Aragón\", 45: \"Castilla-La Mancha\",\n 46: \"Comunidad Valenciana\", 47: \"Castilla y León\", 48: \"País Vasco\", 49: \"Castilla y León\", 50: \"Aragón\",\n 51: \"Ceuta\", 52: \"Melilla\"\n };\n if(cPostal.length == 5 && cPostal <= 52999 && cPostal >= 1000){\n\n return comunidades[parseInt(cPostal.substring(0, 2))];\n }\n if(patrones.patronCP.test(cp.value)){\n\n cp.className=\"form-control is-valid\";\n errorCP.classList.remove('mensajeError-activo');\n errorCP.classList.add('mensajeError-oculto');\n \treturn true;\n }\n else{\n cp.className=\"form-control is-invalid\";\n errorCP.classList.remove('mensajeError-oculto');\n errorCP.classList.add('mensajeError-activo');\n \treturn false;\n }\n}", "function dadosForamPreenchidos(form) {\n\tif(form.nome.value != \"\" && form.peso.value != \"\" && form.altura.value != \"\" && form.gordura.value != \"\"){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function aviso_CEP(campo, escolha){\r\r\n\r\r\n //TEXTO SIMPLES\r\r\n var label = document.createElement(\"label\")\r\r\n\r\r\n //ESCOLHENDO O TIPO DE AVISO\r\r\n if (escolha == 1 ){ \r\r\n\r\r\n //TEXTO DE AVISO DE OBRIGATORIO\r\r\n var text = document.createTextNode(\"Preenchimento Obrigatório\")\r\r\n\r\r\n //COLOCANDO O ID NA LABEL E BR CRIADAS\r\r\n label.id = \"aviso_cep\"\r\r\n\r\r\n //INSERINDO O TEXTO DE AVISO NO CAMPO QUE SERA COLOCADO\r\r\n label.appendChild(text)\r\r\n }\r\r\n else if (escolha == 2){ \r\r\n\r\r\n //COLOCANDO O ID NA LABEL E BR CRIADAS\r\r\n label.id = \"aviso_cep1\"\r\r\n\r\r\n //TEXTO DE AVISO DE INVÁLIDO\r\r\n var text = document.createTextNode(\"CEP inválido!\")\r\r\n\r\r\n //INSERINDO O TEXTO DE AVISO NO CAMPO QUE SERA COLOCADO\r\r\n label.appendChild(text)\r\r\n }\r\r\n\r\r\n //REFERENCIA DE ONDE SERA COLOCADO O ITEM\r\r\n var lista = document.getElementsByTagName(\"p\")[5]\r\r\n var itens = document.getElementsByTagName(\"/p\") \r\r\n\r\r\n //INSERINDO O AVISO EM VERMELHO\r\r\n lista.insertBefore( label, itens[0]);\r\r\n label.style.color = \"red\";\r\r\n\r\r\n //MUDANDO O BACKGROUND\r\r\n erro(campo)\r\r\n}", "validarEndereco() {\r\n console.log(this.endereco);\r\n }", "function select_cambio(){\n\n \tvar select = document.getElementById('pais').value;\n\n \tvar seleccion_departamento = document.getElementById('seleccion_departamento');\n \tvar escribir_departamento = document.getElementById('escribir_departamento');\n \tvar contenedor = document.getElementById('escribir_departamento');\n \tif(select == \"Colombia\"){\n \t\tseleccion_departamento.className = 'select-visible';\n \t\tseleccion_departamento.name = 'departamento';\n \t\tescribir_departamento.className = 'select-invisible';\n \t\tescribir_departamento.name = 'nada';\n \t}\n \telse{\n \t\tseleccion_departamento.className = 'select-invisible';\n \t\tseleccion_departamento.name = 'nada';\n\n \t\tescribir_departamento.className = 'select-visible';\n \t\tescribir_departamento.name = 'departamento';\n\n \t}\n }", "validarCadena(propiedad, valor){\n if(!valor) return console.warn(`${propiedad} ${valor} está vacío`);\n\n if(typeof valor !== \"string\") return console.error(`${propiedad} ${valor} ingresado, NO es una cadena de texto`);\n\n return true;\n }", "function validaCampoVacio(Nombre, _G_ID_) {\n /* Es de tipo select */\n if ($(_G_ID_ + '_txt_' + Nombre).is('select')) {\n if ($(_G_ID_ + '_txt_' + Nombre).val() == -1) {\n redLabel_Space(Nombre, 'Este campo es obligatorio', _G_ID_);\n ShowAlertM(_G_ID_, null, null, true);\n return false;\n } else {\n return true;\n }\n } else /* de tipo input*/\n if ($(_G_ID_ + '_txt_' + Nombre).is('input')) {\n if ($(_G_ID_ + '_txt_' + Nombre).val() == '') {\n redLabel_Space(Nombre, 'Este campo es obligatorio', _G_ID_);\n ShowAlertM(_G_ID_, null, null, true);\n return false;\n } else {\n return true;\n }\n }\n}", "function ValidarRegistro()\n{\n\n var porId = document.getElementById(\"estado\").value;\n var porId2 = document.getElementById(\"nombre\").value;\n var porId3 = document.getElementById(\"codigo\").value;\n \n\n $(\".municipio\").each(function(index,value){\n\n \n \n nombre_municipioViejo= $(value).children(\".nombre_municipio\").text();\n codigoViejo= $(value).children(\".codigo\").text();\n\n });\n var id_estadotabla = $(\".id_estado\").val();\n if((id_estadotabla==porId )&&(nombre_municipioViejo==porId2) &&(codigoViejo==porId3))\n { \n MensajeModificarNone();\n return false;\n }else\n {\n return true;\n }\n\n}", "validate_company(value) {\n if (!this.cleanStringField(value)) return t(\"Организация не указана\");\n return \"\";\n }", "validarCadena(propiedad, valor){ //validación para strings \n //recibirá la propiedad a evaluar (id, titulo...) y el valor\n if(!valor) return console.warn(`${propiedad} \"${valor}\" está vacío`)\n if(typeof valor !== \"string\") return console.error(`${propiedad} \"${valor}\" NO es un texto`)\n \n return true //si ninguna validación se ha activado, devulve un true\n }", "function citycompusory()\n{\t\n\tvar cityop='';\n\tvar nm='';\n\tcityop = $('city').getValue();\n\tnm = $('q').getValue();\n\tif(cityop == \"\"){\n\t\talert(\"Please select a city\");\n\t\treturn false;\t\n\t}\n\telse if(nm == \"\"){\n\t\talert(\"Company/Category name cannot be blank\");\n\t\treturn false;\t\n\t}\n\telse{\n\t\treturn true;\n\t}\n}", "function regExpCity() {\n // Récupération des données saisies\n const cityValid = contact.city;\n // Injection du HTML\n const checkCity = document.querySelector(\"#cityErrorMsg\");\n\n // Indication de la bonne saisie ou l'erreur dans le HTML\n if (/^([A-Za-z]{3,20})?([-]{0,1})?([A-Za-z]{3,20})$/.test(cityValid)) {\n checkCity.innerHTML = \"<i class='fas fa-check-circle form'></i>\";\n return true;\n } else {\n checkCity.innerHTML = \"<i class='fas fa-times-circle form'></i> format incorrect\";\n }\n }", "function controllo(nome,cognome){\n var nome_pul = nome.replace(/[^A-Za-z0-9]/g, \"\"); \n var cognome_pul = cognome.replace(/[^A-Za-z0-9]/g, \"\");\n if(nome==nome_pul && cognome==cognome_pul)\n return true;\n else return false;\n}", "function verificarCamposForm(id){\n // se verifican cuantos campos tiene el formulario\n // la ultima posicion corresonde al boton de envío\n for (let i = 0; i < $(id)[0].length - 1; i++) {\n let campo = $(id)[0][i];\n let value = $(campo).val();\n let select = $(campo).attr('id');\n select = '#'+select;\n\n if(value == \"\" || value == null || $(select).hasClass('is-invalid')) {\n return false;\n }\n }\n return true;\n}", "function validar_campos(){\n var nome = formulario.nome.value;\n var email = formulario.email.value;\n var msg = formulario.msg.value;\n var bool = true; //variável booleana que confere se o formulario foi preenchido corretamente\n \n if(!valida_campo(nome,'nome','erro_nome')) bool = false;\n if(!valida_email(email)) bool = false;\n if(!valida_campo(msg,'msg','erro_msg')) bool = false;\n return bool;\n}", "function formato_nombre_apellido(campo,span){\n\tformato_aceptado= /^[a-zA-ZñÑáéíóú\\s]+$/;\n\t\n\tif(campo.value == ''){\n\t\tval = false;\n\t\tspan.style.color = 'red';\n\t\tspan.innerHTML = 'campo vacio';\n\t\t}else if(! campo.value.match(formato_aceptado) && campo.value != ''){\n\t\t\tval = false;\n\t\t\tspan.style.color ='blue';\n\t\t\tspan.innerHTML = 'Solo son validas letras';\n\t\t\t}else{\n\t\t\tspan.innerHTML = '';\n\t\t\t}\n}", "function setVendaPadraoCidadeRelatorioPesquisarNome() {\n var pesquisa = $('#cardVendaPadraoCidadeRelatorioPesquisa').val().toUpperCase();\n $('#cardVendaPadraoCidadeRelatorioTabela').children().each(function () {\n if ($(this).hasClass('div-registro')) {\n var nome = $(this).find('.nome').val().toUpperCase();\n if (nome.includes(pesquisa)) {\n $(this).removeClass('d-none');\n $(this).addClass('d-flex');\n } else {\n $(this).removeClass('d-flex');\n $(this).addClass('d-none');\n }\n }\n });\n}", "function checkTypeContinue() {\n\t\tif (document.frmCadCliente.txtNumero.value == \"\") {\n\t\t\talert(\"Preencha o número da Localização da Empresa\");\n\t\t\tdocument.frmCadCliente.txtNumero.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (document.frmCadCliente.txtCep.value == \"\") {\n\t\t\talert(\"Preencha o campo Cep para Busca do Endereço de Coleta!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (isNaN(document.frmCadCliente.txtCep.value)) {\n\t\t\talert(\"Preencha o Cep somente com números!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (document.frmCadCliente.txtCep.value.length < 8) {\n\t\t\talert(\"Preencha corretamente o Campo Cep!\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\tdocument.getElementById(\"tableCadClienteEndereco\").style.display = 'none';\n\t\t\tif (!checkTypeColeta()) {\n\t\t\t\tdocument.getElementById(\"tableCadClienteContato\").style.display = 'block';\n\t\t\t} else {\n\t\t\t\tdocument.getElementById(\"tableCadClienteEnderecoColeta\").style.display = 'block';\n\t\t\t}\n\t\t}\n\t}", "function ValidarCamposVacios(texto) {\n var retorno = false;\n if (texto.length > 0) {\n if (texto != \"\") {\n retorno = true;\n }\n }\n return retorno;\n}", "function vacio(){\n\t var c_na = /^([a-z]|[A-Z]|├í|├ę|├*|├│|├║|├▒|├╝|\\s)+$/\n if(!c_na.test(solicitar.nombre.value)){\n alert('Escriba su nombre y apellido respetando may˙sculas, min˙sculas y acentos.');\n\t\t solicitar.nombre.focus();\n return false;\n }\n return true;\n }", "function longitudNombre(field, minLength, maxLength) {\n if (field.value.length >= minLength && field.value.length < maxLength) {\n setValido(field);\n return true;\n } else if (field.value.length < minLength) {\n setInvalido(\n field,\n `${field.name} debe tener al menos ${minLength} caracteres`\n );\n return false;\n } else {\n setInvalido(\n field,\n `${field.name} debe tener menos de ${maxLength} caracteres`\n );\n return false;\n }\n }", "function MascaraCep(cep) {\n if (mascaraInteiro(cep) == false) {\n event.returnValue = false;\n }\n return formataCampo(cep, '00000-000', event);\n}", "function controlAddress () {\n const Adresse = formValues.Adresse;\n\n if(regexAddress(Adresse)){\n \n document.querySelector(\"#Address_manque\").textContent = \"\";\n return true;\n }else{\n document.querySelector(\"#Address_manque\").textContent = \"Address: non valide\";\n alert(\"Address: non valide\");\n return false;\n }\n \n }", "function getCuponesPorIndustria(idIndustria){\n\t\n}", "function valida_cnpj ( valor ) {\n\n // Garante que o valor é uma string\n valor = valor.toString();\n\n // Remove caracteres inválidos do valor\n valor = valor.replace(/[^0-9]/g, '');\n\n\n // O valor original\n var cnpj_original = valor;\n\n // Captura os primeiros 12 números do CNPJ\n var primeiros_numeros_cnpj = valor.substr( 0, 12 );\n\n // Faz o primeiro cálculo\n var primeiro_calculo = calc_digitos_posicoes( primeiros_numeros_cnpj, 5 );\n\n // O segundo cálculo é a mesma coisa do primeiro, porém, começa na posição 6\n var segundo_calculo = calc_digitos_posicoes( primeiro_calculo, 6 );\n\n // Concatena o segundo dígito ao CNPJ\n var cnpj = segundo_calculo;\n\n // Verifica se o CNPJ gerado é idêntico ao enviado\n if ( cnpj === cnpj_original ) {\n return true;\n }\n\n // Retorna falso por padrão\n return false;\n\n }", "function validateCity() {\n \n var x = document.getElementById(\"city\");\n var possibleCities = []; //initialize an empty array of possible cities\n\t\n\tx.value = capitalize(x.value);\n \n for (var i = 0; i < cities.length; i++) {\n if (cities[i].startsWith(x.value)) {\t\t//if an index has properly matched prefix, add to array\n possibleCities.push(cities[i]);\n }\n }\n \n if (possibleCities.length == 0) { //if no possible cities, invalid name\n x.value = \"\";\n alert(\"Error! City does not exist.\");\n }\n \n}", "function canPaciente(paciente){\n var sucess = 0;\n sucess += checkForm(canAltura(paciente.altura) , \"altura\");\n sucess += checkForm(canPeso(paciente.peso) , \"peso\");\n sucess += checkForm(canNome(paciente.nome) , \"nome\");\n sucess += checkForm(canGordura(paciente.gordura) , \"gordura\");\n \n if(sucess == 4){\n return true;\n }else{\n return false;\n }\n}", "function setVendaPadraoTopVendedorPesquisarNome() {\n var pesquisa = $('#cardVendaPadraoTopVendedorPesquisa').val().toUpperCase();\n $('#cardVendaPadraoTopVendedorTabela').children().each(function () {\n if ($(this).hasClass('div-registro')) {\n var nome = $(this).find('.nome').val().toUpperCase();\n if (nome.includes(pesquisa)) {\n $(this).removeClass('d-none');\n $(this).addClass('d-flex');\n } else {\n $(this).removeClass('d-flex');\n $(this).addClass('d-none');\n }\n }\n });\n}", "function checkProvince(pDiv, check) {\n\tvar region = REGIONS[pDiv.textContent];\n\tif (typeof check == \"undefined\") check = !region.selected;\n\t// Marca/desmarca una provincia\n\tpDiv.className = check ? \"on\" : \"\";\n\tif (check && !region.color) {\t\t// creación del selector de color\n\t\tvar pickerOptions = {pickerPosition: 'right',pickerClosable: true};\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.className=\"config\";\n\t\tvar col = document.createElement(\"input\");\n\t\tcol.value = Raphael.getColor().slice(1);\t// nuevo color\n\t\tcol.className = \"color\";\n\t\tregion.color = new jscolor.color(col, pickerOptions);\n\t\taddEvent(col, \"change\", function() {updateAll(false);});\n\t\tdiv.appendChild(col);\n\t\tpDiv.appendChild(div);\n\t}\n\tregion.selected = check;\n}", "function showCadClienteContato() {\n\t\tvar form = document.frmCadCliente;\n\t\tif (form.txtCepColeta.value == \"\") {\n\t\t\talert(\"Preencha o campo de Cep do Endereço de Coleta!\");\n\t\t\tform.txtCepColeta.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (form.txtNumeroColeta.value == \"\") {\n\t\t\talert(\"Preecha o campo número do Endereço de Coleta!\");\n\t\t\tform.txtNumeroColeta.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (form.txtContatoRespColeta.value == \"\") {\n\t\t\talert(\"Preencha o campo do Contato responsável pela Coleta!\");\n\t\t\tform.txtContatoRespColeta.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (form.txtDDDContatoRespColeta.value == \"\") {\n\t\t\t\talert(\"Preencha o campo do DDD do responsável pela Coleta!\");\n\t\t\t\tform.txtDDDContatoRespColeta.focus();\n\t\t\t\treturn false;\n\t\t}\n\t\tif (isNaN(form.txtDDDContatoRespColeta.value)) {\n\t\t\talert(\"Preencha o campo DDD do Contato somente com dados numéricos!\");\n\t\t\tform.txtDDDContatoRespColeta.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (form.txtDDDContatoRespColeta.value.length < 2) {\n\t\t\talert(\"Preencha o campo do DDD do Contato com no mínimo 2 caracteres válidos!\");\n\t\t\tform.txtDDDContatoRespColeta.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (form.txtTelefoneContatoRespColeta.value == \"\") {\n\t\t\t\talert(\"Preencha o campo do Telefone do responsável pela Coleta!\");\n\t\t\t\tform.txtTelefoneContatoRespColeta.focus();\n\t\t\t\treturn false;\n\t\t}\n\t\tif (isNaN(form.txtTelefoneContatoRespColeta.value)) {\n\t\t\talert(\"Preencha o campo Telefone do Contato somente com dados numéricos!\");\n\t\t\tform.txtTelefoneContatoRespColeta.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (form.txtTelefoneContatoRespColeta.value.length < 8) {\n\t\t\talert(\"Preencha o campo do Telefone do Contato com 8 caracteres válidos!\");\n\t\t\tform.txtTelefoneContatoRespColeta.focus();\n\t\t\treturn false;\n\t\t}\n\t\tdocument.getElementById(\"tableCadClienteEnderecoColeta\").style.display = 'none';\n\t\tdocument.getElementById(\"tableCadClienteContato\").style.display = 'block';\n\t}", "function limparUltimosCampos(tipo){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\t//if(form.idMunicipio.value == \"\")\r\n\t\t//limparUltimosCampos(1);\r\n\t\r\n\tswitch(tipo){\r\n\t\tcase 1: //municipio\r\n\t\t\tform.nomeMunicipio.value = \"\";\r\n\t\t\tform.idBairro.value = \"\";\r\n\t\tcase 2: //bairro\r\n\t\t\tform.nomeBairro.value = \"\";\r\n\t\t\tform.idLogradouro.value =\"\";\t\t\t\r\n\t\tcase 3://logradouro\r\n\t\t\tform.nomeLogradouro.value = \"\";\r\n\t\t\tform.CEP.value = \"\";\r\n\t\tcase 4://cep\r\n\t\t\tform.descricaoCep.value = \"\";\r\n\t}\r\n}", "function limpiarCamposAdicional(){\n $cedula.val(\"\");\n $primerNombre.val(\"\");\n $segundoNombre.val(\"\");\n $primerApellido.val(\"\");\n $segundoApellido.val(\"\");\n $nombreTarjeta.val(\"\");\n $cupoOtorgado.val(\"\");\n $sexo.val($(\"#sexo option:first\").val());\n $estadoCivil.val($(\"#estadoCivil option:first\").val());\n $parentesco.val($(\"#parentesco option:first\").val());\n $fechaNacimiento.val(\"\");\n $nacionalidadSelect.val($(\"#nacionalidadSelect option:first\").val());\n $nacionalidad.val(\"ECUATORIANA\");\n $nacionalidadDiv.hide();\n $observaciones.val(\"\");\n}", "function gps_vehiculoSeleccionado() {\n var placa = document.getElementById(\"splaca\").value;\n var pruebaPlaca = document.getElementById(\"pruebaPlaca\");\n\n if (placa != \"\" && pruebaPlaca != null && pruebaPlaca.value == 1)\n return true;\n return false;\n}", "function validaPreenchimentoCamposFaixa(){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.localidadeOrigemID.value != \"\" && form.localidadeDestinoID.value == \"\"){\r\n\t\talert(\"Informe Localidade Final.\");\r\n\t\tform.localidadeDestinoID.focus();\r\n\t\tretorno = false;\r\n\t}else if(form.localidadeDestinoID.value != \"\" && form.localidadeOrigemID.value == \"\"){\r\n\t\talert(\"Informe Localidade Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.setorComercialOrigemCD.value != \"\" && form.setorComercialDestinoCD.value == \"\"){\r\n\t\talert(\"Informe Setor Comercial Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.setorComercialDestinoCD.value != \"\" && form.setorComercialOrigemCD.value == \"\"){\r\n\t\talert(\"Informe Setor Comercial Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.quadraOrigemID.value != \"\" && form.quadraDestinoID.value == \"\"){\r\n\t\talert(\"Informe Quadra Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.quadraDestinoID.value != \"\" && form.quadraOrigemID.value == \"\"){\r\n\t\talert(\"Informa Quadra Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.loteOrigem.value != \"\" && form.loteDestino.value == \"\"){\r\n\t\talert(\"Informe Lote Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.loteDestino.value != \"\" && form.loteOrigem.value == \"\"){\r\n\t\talert(\"Informe Lote Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\treturn retorno;\r\n}", "function validarDados() {\n var mensagem = \"Preencha corretamente os seguintes campos:\";\n\n if (trim(document.formPaciente.nome.value) == \"\") {\n mensagem = mensagem + \"\\n- Nome\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.nome.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nome.value)).toLowerCase());\n document.formPaciente.nome.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nome.value).toLowerCase());\n }\n\n if (!document.formPaciente.sexo[0].checked && !document.formPaciente.sexo[1].checked) {\n mensagem = mensagem + \"\\n- Sexo\";\n }\n\n if (trim(document.formPaciente.dataNascimento.value) == \"\") {\n mensagem = mensagem + \"\\n- Data de Nascimento\";\n }\n\n // Nome do pai sem acentos e/ou cedilhas\n if (trim(document.formPaciente.nomePai.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.nomePai.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nomePai.value)).toLowerCase());\n document.formPaciente.nomePai.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nomePai.value).toLowerCase());\n }\n\n // Nome da mae sem acentos e/ou cedilhas\n if (trim(document.formPaciente.nomeMae.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.nomeMae.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nomeMae.value)).toLowerCase());\n document.formPaciente.nomeMae.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nomeMae.value).toLowerCase());\n }\n\n if (trim(document.formPaciente.logradouro.value) == \"\") {\n mensagem = mensagem + \"\\n- Logradouro\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.logradouro.value)).toLowerCase());\n document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(trim(document.formPaciente.logradouro.value).toLowerCase());\n }\n\n // Numero sem acentos e/ou cedilhas\n if (trim(document.formPaciente.numero.value) != \"\") {\n document.formPaciente.numero.value = retirarAcentos(trim(document.formPaciente.numero.value)).toUpperCase();\n }\n\n /* Numero deixa de ser obrigatorio\n if (trim(document.formPaciente.numero.value) == \"\") {\n mensagem = mensagem + \"\\n- Numero\";\n }\n */\n\n if (trim(document.formPaciente.bairro.value) == \"\") {\n mensagem = mensagem + \"\\n- Bairro\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.bairro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.bairro.value)).toLowerCase());\n document.formPaciente.bairro.value = primeirasLetrasMaiusculas(trim(document.formPaciente.bairro.value).toLowerCase());\n }\n \n // Complemento sem acentos e/ou cedilhas\n if (trim(document.formPaciente.complemento.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.complemento.value = retirarAcentos(trim(document.formPaciente.complemento.value)).toUpperCase();\n document.formPaciente.complemento.value = trim(document.formPaciente.complemento.value).toUpperCase();\n }\n\n if (trim(document.formPaciente.cidade.value) == \"\") {\n mensagem = mensagem + \"\\n- Cidade\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.cidade.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.cidade.value)).toLowerCase());\n document.formPaciente.cidade.value = primeirasLetrasMaiusculas(trim(document.formPaciente.cidade.value).toLowerCase());\n }\n\n if (trim(document.formPaciente.estado.value) == \"\") {\n mensagem = mensagem + \"\\n- Estado\";\n }\n\n if (trim(document.formPaciente.indicacao.value) == \"\") {\n mensagem = mensagem + \"\\n- Indicacao\";\n }\n\n if (document.formPaciente.indicacao.value == \"selected\") {\n if (trim(document.formPaciente.indicacaoOutra.value) == \"\") {\n mensagem = mensagem + \"\\n- Indicacao - Outra\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.indicacaoOutra.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.indicacaoOutra.value)).toLowerCase());\n document.formPaciente.indicacaoOutra.value = primeirasLetrasMaiusculas(trim(document.formPaciente.indicacaoOutra.value).toLowerCase());\n }\n }\n\n if (mensagem == \"Preencha corretamente os seguintes campos:\") {\n return true;\n }\n else {\n alert(mensagem);\n goFocus('nome');\n return false;\n }\n}", "function mascaraCNPJ(cnpj){\n if(mascaraInteiro(cnpj)==false){\n event.returnValue = false;\n } \n return formataCampo(cnpj, '00.000.000/0000-00', event);\n}", "function checkContrasena(valor) {\n\t// if (valor == \"\") return false;\n\treturn regex.clave.test(valor);\n}", "function showCadCliente() {\n\t\tif (document.frmCadCliente.txtCepConsultaPonto.value == \"\") {\n\t\t\talert(\"Por favor preencha o campo de Cep para Busca dos Pontos de Coleta!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (checkChangePontoColeta()) {\n\t\t\tdocument.getElementById('tableCadClientePontoColeta').style.display = 'none';\n\t\t\tdocument.getElementById('tableCadCliente').style.display = 'block';\n\t\t} else {\n\t\t\talert(\"Escolha um Ponto de Coleta para que seja feita a Solicitação!\");\n\t\t}\n\t}", "function validateCanadaPostalCode(field) {\n // empty fields pass validation\n if (field === undefined || field === null) {\n return true;\n }\n var regex = new RegExp(/(^[A-Za-z0-9]{6}$)|(^[A-Za-z0-9]{3}\\s[A-Za-z0-9]{3}$)/);\n return regex.test(field);\n}", "function jeu_attaquerCA(me,cattaquante){\n\t\tmy_logger((me?PROMPT_ME:PROMPT_IA)+cattaquante.nom+ \" inflige dégat CA\");\n\t\tif (me){\n\t\t\t//infliger les dégats à l'adversaire\t\t\t\n\t\t\tpv_adv = pv_adv-cattaquante.ATT;\n\t\t\t$(\"#vieadv\").html(pv_adv);\t\t\n\t\t}else{\n\t\t\t//infliger les dégats à ME\t\t\t\n\t\t\tpv_me = pv_me-cattaquante.ATT;\n\t\t\t$(\"#vieme\").html(pv_me);\t\t\t\t\n\t\t}\n\t }", "function validarCamposOrden(){\r\n /*if(document.getElementById(\"codigoOrden\").value == \"\"){\r\n alert(\"Falta el codigo de la orden de compra\");\r\n return false;\r\n }*/\r\n if(document.getElementById(\"Proveedor\").value == null){\r\n alert(\"Falta el proveedor\")\r\n return false;\r\n }\r\n if(document.getElementById(\"FechaPedido\").value == \"\"){\r\n alert(\"Falta le fecha de pedido\");\r\n return false;\r\n }\r\n if(document.getElementById(\"FechaEntrega\").value == \"\"){\r\n alert(\"Falta la fecha de entrega\");\r\n return false;\r\n }\r\n return true;\r\n}", "function validarCro(entrada) {\n var saida = entrada;\n if (trim(entrada.value) != '') {\n saida = retirarAcentos(trim(entrada.value)).toUpperCase();\n return saida;\n }\n else {\n return '';\n }\n}", "function nombreMunicipio(estado) {\n if (estado == '') {\n return ''\n } else {\n return estado + ', '\n }\n}", "function CoordNombreCompletoNI() {\n if (NuevoIngresoCoordGLOBAL === 'CM') {\n return 'Coordinación Médica';\n } else if (NuevoIngresoCoordGLOBAL === 'CP') {\n return 'Coordinación Psicológica';\n } else if (NuevoIngresoCoordGLOBAL === 'CC') {\n return 'Coordinación Consejería';\n } else {\n return '';\n }\n}", "function validaPesquisaFaixaSetor(){\r\n\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.setorComercialOrigemCD.value != form.setorComercialDestinoCD.value){\r\n\t\tif(form.localidadeOrigemID.value != form.localidadeDestinoID.value){\r\n\t\t\r\n\t\t\talert(\"Para realizar a pesquisa por faixa de Setor Comercial as Localidade inicial e final devem ser iguais.\");\r\n\t\t\tform.setorComercialDestinoID.focus();\r\n\t\t\tretorno = false;\r\n\t\t}\t\t\r\n\t}\r\n\t\r\n\tif((form.setorComercialOrigemCD.value != \"\" )\r\n\t\t&& (form.setorComercialOrigemCD.value > form.setorComercialDestinoCD.value)){\r\n\t\talert(\"O c?digo do Setor Comercial Final deve ser maior ou igual ao Inicial.\");\r\n\t\t\tform.setorComercialDestinoID.focus();\r\n\t\t\tretorno = false;\r\n\t}\r\n\t\r\n\treturn retorno;\r\n\r\n}", "function validaClave() { /*Valida la clave*/\n var valor = document.getElementById(\"clave\").value;\n\n if (!(/^\\d{1}[a-zA-Z]{3}\\W{1}\\d{1}$/.test(valor))) {\n alert(\"La clave no es correcta. Ejemplo:7aHf$8\");\n document.getElementById(\"clave\").value = \"\"; /*Deja el Campo vacio*/\n document.getElementById(\"envio\").disabled = true; /*Deshabilita el boton envio*/\n return false;\n }\n else {\n\n return true;\n }\n}", "function cambiarCiudad(id_p){\n\t$.post(\"/contacts/get_city\",{id_pais:id_p},function(data){\n\t\tvar obj_int = jQuery.parseJSON(data);\n\t\tvar opciones = \"\";\n\t\tif(obj_int){\n\t\t\t$.each(obj_int, function(i, item) {\t\n\t\t\t\t//console.log(item);\n\t\t\t\topciones += '<option value=\"'+item.id+'\">'+item.name+'</option>';\n\t\t\t});\n\n\t\t}\t\n\t\t$(\".cbo-city\").html(opciones);\n\t\t\n\t\t\n\t});\n}", "function ContieneEspaciosVacios(cadena) {\n\n let contiene;\n const listaFinal = [];\n const listaCaracteresCadena = cadena.split('');\n \n listaCaracteresCadena.forEach(element => {\n if(element !== ' '){\n listaFinal.push(element);\n }\n \n });\n \n if(listaFinal.length !== listaCaracteresCadena.length ){\n contiene = true;\n }else{\n contiene = false;\n }\n \n return contiene;\n }", "function CamposRequeridosLogin(){\n var campos = [\n {campo:'email-username',valido:false},\n {campo:'password',valido:false}\n ];\n\n for(var i=0;i<campos.length;i++){\n campos[i].valido = validarCampoVacioLogin(campos[i].campo);\n }\n\n //Con uno que no este valido ya debe mostrar el Error-Login\n for (var i=0; i<campos.length;i++){\n if (!campos[i].valido)\n return;\n }\n //En este punto significa que todo esta bien\n guardarSesion();\n}", "function chequearVacio(field) {\r\nif (vacio(field.value.trim())) {\r\n setInvalido(field, `${field.name} no debe estar vacío`);\r\n return true;\r\n} else {\r\n setValido(field);\r\n return false;\r\n}\r\n}", "function ispisCene(){\n \n let ispisCena=racunajCenu(findDestPrice(dest),brOsoba);\n document.querySelector(\"#cena\").innerHTML = `${ispisCena}&euro;`;\n }", "getCiudad(){\r\nreturn this.ciudad;\r\n}", "function maskValidCpfCnpj(attribut) {\n var attributForm = Xrm.Page.getAttribute(attribut).getValue();\n if (attributForm != null) {\n var exp = /\\-|\\.|\\/|\\(|\\)| /g\n attributForm = attributForm.replace(exp, \"\");\n if ((attributForm.length == 11) && (attributForm != \"00000000000\") && (attributForm != \"11111111111\") && (attributForm != \"22222222222\") && (attributForm != \"33333333333\") && (attributForm != \"44444444444\") && (attributForm != \"55555555555\") && (attributForm != \"66666666666\") && (attributForm != \"77777777777\") && (attributForm != \"88888888888\") && (attributForm != \"99999999999\")) {\n maskValidCpf(attribut);\n } else if ((attributForm.length == 14) && (attributForm != \"00000000000000\") && (attributForm != \"11111111111111\") && (attributForm != \"22222222222222\") && (attributForm != \"33333333333333\") && (attributForm != \"44444444444444\") && (attributForm != \"55555555555555\") && (attributForm != \"66666666666666\") && (attributForm != \"77777777777777\") && (attributForm != \"88888888888888\") && (attributForm != \"99999999999999\")) {\n maskValidCnpj(attribut)\n } else {\n alert(\"Número de CPF - CNPJ inválido.\");\n attributForm = \"\";\n Xrm.Page.getAttribute(attribut).setValue(attributForm);\n }\n }\n}", "function canton(args) {\r\n let results = ecuador.data.lookupProvinces(args);\r\n results = results[0];\r\n let canton = [];\r\n for (var key in results.cities) {\r\n canton.push(results.cities[key].name);\r\n }\r\n return canton;\r\n}", "function validarcampos_p3 () {\n\t\n\tif (nom_div(\"nombre_p3\").value!=\"\"&&nom_div(\"opcion_3\").value!=0) {\n\n\t\treturn true;\n\n\t}\n\n\n\telse{\n\n\t\tif (nom_div(\"nombre_p3\").value==\"\") {\n\n\t\t\talert('Asigne un nombre al proceso 3');\n\t\t\tnom_div(\"nombre_p3\").focus();\n\t\t}\n\n\t\tif(nom_div(\"opcion_3\").value==0){\n\n\t\t\talert('¿Cuantas Lineas de codigo quiere compilar en el proceso 3?')\n\t\t\tnom_div(\"opcion_3\").focus();\n\t\t}\n\n\t\treturn false;\n\t};\n}//FIN**********VALIDAR CAMPOS PROCESO 1******", "function afficherPrenom() {\n return isValidPrenom(prenom.value);\n}", "function inmueble_onChange_estado_ciudad_colonia(estado, ciudad, colonia, _nombreCampoEstado, _nombreCampoCiudad, _nombreCamposColonia) {\n\tnombreCampoEstado = _nombreCampoEstado == null ? \"estado\" : _nombreCampoEstado;\n\tnombreCampoCiudad = _nombreCampoCiudad == null ? \"ciudad\" : _nombreCampoCiudad;\n\tnombreCamposColonia = _nombreCamposColonia == null ? \"colonia\" : _nombreCamposColonia;\n\t$(\"#\"+nombreCampoEstado).val(estado);\n\t\n\tif (estado != \"\") {\n\t\t$.ajax({\n\t\t\turl: \"lib_php/consDireccion.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tconsCiudad: 1,\n\t\t\t\testado: estado\n\t\t\t}\n\t\t}).always(function(respuesta_json){\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\t$(\"#\"+nombreCampoCiudad).prop(\"disabled\", false);\n\t\t\t\t$(\"#\"+nombreCampoCiudad+\" option[value!='-1']\").remove();\n\t\t\t\t\n\t\t\t\tfor (var x = 0; x < respuesta_json.datos.length; x++) {\n\t\t\t\t\t$(\"#\"+nombreCampoCiudad).append(\"<option value='\"+respuesta_json.datos[x].id+\"'>\"+respuesta_json.datos[x].nombre+\"</option>\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$(\"#\"+nombreCampoCiudad).val(ciudad);\n\t\t\t\t\n\t\t\t\tif (ciudad != \"\") {\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl: \"lib_php/consDireccion.php\",\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tconsColonia: 1,\n\t\t\t\t\t\t\tciudad: ciudad\n\t\t\t\t\t\t}\n\t\t\t\t\t}).always(function(respuesta_json2){\n\t\t\t\t\t\tif (respuesta_json2.isExito == 1) {\n\t\t\t\t\t\t\t$(\"#\"+nombreCamposColonia).prop(\"disabled\", false);\n\t\t\t\t\t\t\t$(\"#\"+nombreCamposColonia+\" option[value!='-1']\").remove();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (var x = 0; x < respuesta_json2.datos.length; x++) {\n\t\t\t\t\t\t\t\t$(\"#\"+nombreCamposColonia).append(\"<option value='\"+respuesta_json2.datos[x].id+\"' data-cp='\"+respuesta_json2.datos[x].cp+\"'>\"+respuesta_json2.datos[x].nombre+\"</option>\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$(\"#\"+nombreCamposColonia).val(colonia);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$(\"#\"+nombreCamposColonia).val(\"-1\");\n\t\t\t\t\t$(\"#\"+nombreCamposColonia).prop(\"disabled\", true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\telse {\n\t\t$(\"#\"+nombreCampoCiudad).val(\"-1\");\n\t\t$(\"#\"+nombreCamposColonia).val(\"-1\");\n\t\t\n\t\t$(\"#\"+nombreCampoCiudad).prop(\"disabled\", true);\n\t\t$(\"#\"+nombreCamposColonia).prop(\"disabled\", true);\n\t}\n}", "function esPContable(fecha) {\r\n\tvar dma = fecha.split(\"-\");\r\n\tif (typeof dma[0]==\"undefined\") dma[0]=\"\";\r\n\tif (typeof dma[1]==\"undefined\") dma[1]=\"\";\t\r\n\tvar a = new String (dma[0]); a=a.trim();\r\n\tvar m = new String (dma[1]); m=m.trim();\r\n\tif (m==\"\" || a==\"\" || m.length<2 || a.length<4) var esFecha=false; else var esFecha=true;\r\n\tif (!esFecha) {\r\n\t\tvar dma = fecha.split(\"/\");\r\n\t\tif (typeof dma[0]==\"undefined\") dma[0]=\"\";\r\n\t\tif (typeof dma[1]==\"undefined\") dma[1]=\"\";\r\n\t\tvar a = new String (dma[0]); a=a.trim();\r\n\t\tvar m = new String (dma[1]); m=m.trim();\t\r\n\t\tif (m==\"\" || a==\"\" || m.length<2 || a.length<4) var esFecha=false; else var esFecha=true;\r\n\t}\r\n\tif (!esFecha) return false;\r\n\telse {\r\n\t\tvar annios = new Number (a);\r\n\t\tvar meses = new Number (m);\r\n\t\tif (meses>12 || meses<=0 || annios<=0) return false; else return true;\r\n\t}\r\n}", "function isInMunicipios(municipio, provincia) {\n var foo;\n try {\n foo = municipiosData[provincia][municipio];\n } catch (e) { }\n return foo;\n}", "function validarcampos_p1 () {\n\t\n\tif (nom_div(\"nombre_p1\").value!=\"\"&&nom_div(\"opcion_1\").value!=0) {\n\n\t\treturn true;\n\n\t}\n\n\n\telse{\n\n\t\tif (nom_div(\"nombre_p1\").value==\"\") {\n\n\t\t\talert('Asigne un nombre al proceso 1');\n\t\t\tnom_div(\"nombre_p1\").focus();\n\t\t}\n\n\t\tif(nom_div(\"opcion_1\").value==0){\n\n\t\t\talert('¿Cuantas Lineas de codigo quiere compilar en el proceso 1?')\n\t\t\tnom_div(\"opcion_1\").focus();\n\t\t}\n\n\t\treturn false;\n\t};\n}//FIN**********VALIDAR CAMPOS PROCESO 1******", "function chkCamposInicializa(){\r\n\t\r\n\t//Validando los campos del formulario\r\n\t/***FECHA DE PUBLICACION DEL APOYO***/\r\n\tvar fecha = $('#fechaPeticion').val();\r\n\tif(fecha==\"\" || fecha==null){\r\n\t\t$('#dialogo_1').html('Seleccione la fecha de publicación de lineamientos');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\r\n\t/***TITULO DE AVISO***/\r\n\tvar descLineamiento = $('#descLineamiento').val();\r\n\tif(descLineamiento==\"\" || descLineamiento==null){\r\n\t\t$('#dialogo_1').html('Capture el título del lineamiento del esquema de apoyos');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t\r\n\t/***ARCHIVO DE PUBLICACION DOF***/\r\n\tvar editar = $('#editar').val();\r\n\tif(editar!=3){\r\n\t\tvar archivo = $('#doc').val();\r\n\t\tif(archivo==null || archivo == \"\"){\r\n\t\t\t$('#dialogo_1').html('Seleccione el archivo de publicación DOF.');\r\n\t\t\tabrirDialogo();\r\n\t\t return false;\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t/***AREA RESPONSABLE***/\r\n\tvar idArea = $('#idArea').val();\r\n\tif(idArea==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el area responsable');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t/***TIPO COMPONENTE***/\r\n\tvar idComponente = $('#idComponente').val();\r\n\tif(idComponente==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el tipo de componente');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t\r\n\t/***DESCRIPCION CORTA***/\r\n\tvar descCorta = $('#descCorta').val();\r\n\tif(descCorta==\"\" || descCorta==null){\r\n\t\t$('#dialogo_1').html('Capture la descripción corta del esquema de apoyos');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\tvar acronimoCA = $('#acronimoCA').val();\r\n\tif(acronimoCA==\"\" || acronimoCA==null){\r\n\t\t$('#dialogo_1').html('Capture la definición del acrónimo');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\tif ($('#errorValidaAcronimo').length){\r\n\t\t\tvar errorValidaAcronimo = $('#errorValidaAcronimo').val();\r\n\t\t\tif(errorValidaAcronimo!=0){\r\n\t\t\t\t$('#dialogo_1').html('El folio de la solicitud ya se encuentra registrado, por favor verifique');\r\n\t\t \t\tabrirDialogo();\r\n\t\t \t\treturn false;\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar leyendaAtentaNota = $('#leyendaAtentaNota').val();\r\n\tif(leyendaAtentaNota==\"\" || leyendaAtentaNota==null){\r\n\t\t$('#dialogo_1').html('Capture la leyenda de la atenta nota');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t\r\n\t\r\n\t/***CICLO***/\r\n\tvar numCiclos = $('#numCiclos').val();\r\n\tif(numCiclos ==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el número de ciclo a apoyar');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\tvar i=0;\r\n\t\tvar ciclo =\"\";\r\n\t\tvar anio =\"\";\r\n\t\tvar j =0;\r\n\t\tvar tempCiclo =\"\";\r\n\t\tvar tempAnio =\"\";\r\n\t\t\r\n\t\tfor (i=1;i<parseInt(numCiclos)+1;i++){\r\n\t\t\tciclo = $('#ci'+i).val();\r\n\t\t\tanio = $('#a'+i).val();\r\n\t\t\tif(ciclo==-1 || anio==-1 ){\r\n\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' de la captura de ciclos');\r\n\t\t \t\tabrirDialogo();\r\n\t\t \t\treturn false;\r\n\t \t\t }else{\r\n\t \t\t\t/*Valida que el ciclo seleccionado por el usuario no se encuentre repetido*/\r\n\t\t \t\t\tfor (j=1;j<parseInt(numCiclos)+1;j++){\r\n\t\t \t\t\t\tif(i!=j){\r\n\t\t \t\t\t\t\ttempCiclo = $('#ci'+j).val();\r\n\t\t \t\t\t\t\ttempAnio = $('#a'+j).val();\r\n\t\t \t\t\t\t\tif(ciclo == tempCiclo && anio == tempAnio){\r\n\t\t \t\t\t\t\t\t$('#dialogo_1').html('El ciclo del registro '+i+\", se encuentra repetido, favor de verificar\");\r\n\t\t \t\t\t\t \t\tabrirDialogo();\r\n\t\t \t\t\t\t \t\treturn false;\r\n\t\t \t\t\t\t\t}\r\n\t\t \t\t\t\t}\t \t\t\t\t\r\n\t\t \t\t\t} \r\n\t \t\t }\r\n\t\t}\r\n\t}\r\n\t\t\r\n\t\r\n\t/***CRITERIO DE PAGO***/\r\n\tvar idCriterioPago = $('#idCriterioPago').val();\r\n\tif(idCriterioPago ==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el criterio de pago');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\t/***VOLUMEN (1), ETAPA(2) y ETAPA/VOLUMEN (3)***/\r\n\t\tif(idCriterioPago==1 || idCriterioPago == 3){\r\n\t\t\t//valida volumen\t\t\t\r\n\t\t\t/***UNIDAD DE MEDIDA***/\r\n\t\t\tvar idUnidadMedida = $('#idUnidadMedida').val();\r\n\t\t\tif(idUnidadMedida ==-1){\r\n\t\t\t\t$('#dialogo_1').html('Seleccione la unidad de medida');\r\n\t\t\t\tabrirDialogo();\r\n\t\t\t \treturn false;\r\n\t\t\t}\r\n\t\t\t/***VOLUMEN***/\t\r\n\t\t\tvar volumen = $('#volumen').val();\r\n\t\t\tvar patron =/^\\d{1,10}((\\.\\d{1,3})|(\\.))?$/;\r\n\t\t\tif(!volumen.match(patron)){\r\n\t\t\t\t$('#dialogo_1').html('El valor del volumen máximo a apoyar es inválido, se aceptan hasta 10 dígitos a la izquierda y 3 dígitos máximo a la derecha');\r\n\t\t\t\tabrirDialogo();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tvar volxCulVar = $('input:radio[name=volxCulVar]:checked').val();\r\n\t\t\tif(volxCulVar == 0){ //si desea agregar volumen por cultivo-variedad \r\n\t\t\t\tvar numCamposVXCV = $('#numCamposVXCV').val();\r\n\t\t\t\tif(numCamposVXCV < 1 || numCamposVXCV ==null || numCamposVXCV ==\"\"){\r\n\t\t\t\t\t$('#dialogo_1').html('Capture el número de registros para el volumen por cultivo variedad');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar cultivoVXCV =\"\";\r\n\t\t\t\t\tvar variedadVXCV =\"\";\r\n\t\t\t\t\tvar volumenVXCV =\"\";\r\n\t\t\t\t\tvar cultivoVXCVTemp =\"\";\r\n\t\t\t\t\tvar variedadVXCVTemp = \"\";\r\n\t\t\t\t\tvar totalVolumen=0;\r\n\t\t\t\t\t//Validar que los campos sean seleccionados\t\t\t\t\t\r\n\t\t\t\t\tfor (i=1;i<parseInt(numCamposVXCV)+1;i++){\r\n\t\t\t\t\t\tcultivoVXCV = $('#cultivoVXCV'+i).val();\r\n\t\t\t\t\t\tvariedadVXCV = $('#variedadVXCV'+i).val();\r\n\t\t\t\t\t\tvolumenVXCV = $('#volumenVXCV'+i).val();\t\t\t\t\t\r\n\t\t\t\t\t\tif(cultivoVXCV ==-1 || variedadVXCV ==-1 || (volumenVXCV == \"\" || volumenVXCV == null)){\r\n\t\t\t\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' volumen por cultivo variedad');\r\n\t\t\t\t\t \t\tabrirDialogo();\r\n\t\t\t\t\t \t\treturn false;\r\n\t\t\t\t \t\t }else{\t\t\r\n\t\t\t\t \t\t\tconsole.log(i);\t\t\t\t \t\t\t\r\n\t\t\t\t \t\t\t //Valida que el cultivo y variedad no se encuentren repetidos\t\t\t\t \t\t\t\r\n\t\t\t\t \t\t\tfor (j=1;j<parseInt(numCamposVXCV)+1;j++){\r\n\t\t\t\t \t\t\t\tif(i!=j){\r\n\t\t\t\t \t\t\t\t\tcultivoVXCVTemp = $('#cultivoVXCV'+j).val();\r\n\t\t\t\t\t\t\t\t\tvariedadVXCVTemp = $('#variedadVXCV'+j).val();\r\n\t\t\t\t\t\t\t\t\tcuotaTemp = $('#cuota'+j).val();\r\n\t\t\t\t\t\t\t\t\tif(cultivoVXCV == cultivoVXCVTemp && variedadVXCV == variedadVXCVTemp ){\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$('#dialogo_1').html('El registro '+i+' en volumen por cultivo variedad se encuentra repetido, favor de verificar');\r\n\t\t\t\t\t \t\t\t \t\tabrirDialogo1();\r\n\t\t\t\t\t \t\t\t \t\treturn false;\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\t//console.log(totalVolumen);\r\n\t\t\t\t \t\t\ttotalVolumen = (totalVolumen+parseFloat(volumenVXCV));\r\n\t\t\t\t \t\t }//end es diferente de null o campos vacios\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(parseFloat(totalVolumen) > parseFloat(volumen) ){\r\n\t\t\t\t\t\t$('#dialogo_1').html('El volumen autorizado '+volumen+' debe ser mayor al volumen total '+totalVolumen+' volumen por cultivo variedad, favor de verificar');\r\n\t \t\t\t \t\tabrirDialogo();\r\n\t \t\t\t \t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}// end numCamposVXCV es dirente de vacio\t\t\t\t\t\r\n\t\t\t}// end volxCulVar si desea agregar volumen por cultivo-variedad\r\n\t\t\t\r\n\t\t}// end criterio == 1 o 3\r\n\t\r\n\t\tif(idCriterioPago==2 || idCriterioPago == 3){\r\n\t\t\t//Valida etapa\r\n\t\t\tnoEtapa = $('#noEtapa').val();\r\n\t\t\tif(noEtapa==-1){\r\n\t\t\t\t$('#dialogo_1').html('Seleccione el número de etapas');\r\n\t\t\t\tabrirDialogo();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t//Valida la captura de monto, cuota por etapa\r\n\t\t\tvar cuotaMonto = \"\";\r\n\t\t\tvar totalMonto =0;\r\n\t\t\tfor (j=1;j<parseInt(noEtapa)+1;j++){\r\n\t\t\t\tcuotaMonto = $('#cuotaMonto'+j).val();\r\n\t\t\t\tif(cuotaMonto == null || cuotaMonto ==\"\"){\t\t\t\t\t\r\n\t\t\t\t\t$('#dialogo_1').html('Capture los valores del registro '+j+' en la asignación de importe por etapa');\r\n \t\t\t \t\tabrirDialogo();\r\n \t\t\t \t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttotalMonto = (totalMonto+parseFloat(cuotaMonto));\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tif(idCriterioPago==2){\r\n\t\t\t\timporte = $('#importe').val();\r\n\t\t\t\tvar patron =/^\\d{1,10}((\\.\\d{1,2})|(\\.))?$/;\r\n\t\t\t\tif(!importe.match(patron)){\r\n\t\t\t\t\t$('#dialogo_1').html('El valor del importe máximo a apoyar es inválido, se aceptan hasta 10 dígitos a la izquierda y 2 dígitos máximo a la derecha');\r\n\t\t\t\t\tabrirDialogo();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(parseFloat(importe) != parseFloat(totalMonto)){\r\n\t\t\t\t\t\t$('#dialogo_1').html('El valor del importe autorizado a apoyar '+importe+' difiere de la suma '+totalMonto+'de los montos por etapa');\r\n\t\t\t\t\t\tabrirDialogo();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$(\".textCentrado\").removeAttr('disabled');\r\n\t\t\tconsole.log(\"desabilitando\");\r\n\t\t\t\r\n\t\t}// end criterio etapa (2) || volumen/etapa (3) \r\n\t\t\r\n\t}\r\n\t\r\n\t/***Valida los campos de los estados a apoyar***/\r\n\tvar numCampos = $('#numCampos').val();\t\r\n\tif(numCampos==0){\r\n\t\t$('#dialogo_1').html('Debe capturar los estados a apoyar');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\tvar cult = -1;\r\n\t\tvar edo = -1;\r\n\t\tvar variedad = -1;\r\n\t\tvar cuota =\"\";\r\n\t\tvar tempCult =\"\";\r\n\t\tvar tempEdo =\"\";\r\n\t\tvar tempVariedad =\"\";\r\n\t\tvar tempCuota =\"\";\r\n\t\tvar siCapturoPrecioPagado = 0;\r\n\t\tfor (i=1;i<parseInt(numCampos)+1;i++){\r\n\t\t\tcult = $('#c'+i).val();\r\n\t\t\tedo = $('#e'+i).val();\r\n\t\t\tvariedad = $('#va'+i).val();\r\n\t\t\tcuota = $('#cuota'+i).val();\r\n\t\t\tif(idCriterioPago == 1){\r\n\t\t\t\tif(cult==-1 || edo==-1 || variedad == -1 || (cuota == \"\" || cuota == null)){\r\n\t\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' en los estados a apoyar');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n\t\t \t\t }\r\n\t\t\t}else{\r\n\t\t\t\tif(cult==-1 || edo==-1 ){\r\n\t\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' en los estados a apoyar');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tvar precioPagado = \"\";\r\n\t \t\tfor (j=1;j<parseInt(numCampos)+1;j++){\r\n\t \t\t\tif(i!=j){\r\n\t \t\t\t\ttempCult = $('#c'+j).val();\r\n\t \t\t\t\ttempEdo = $('#e'+j).val();\r\n\t \t\t\t\ttempVariedad = $('#va'+j).val();\r\n\t \t\t\t\ttempCuota = $('#cuota'+j).val();\r\n\t \t\t\t\tprecioPagado = $('#precioPagado'+j).val();\r\n\t \t\t\t\tif(precioPagado != null && precioPagado != \"\" ){\r\n\t \t\t\t\t\tsiCapturoPrecioPagado = 1;\r\n\t \t\t\t\t}\r\n\t \t\t\t\tif(cult == tempCult && edo == tempEdo && variedad == tempVariedad && cuota == tempCuota){\r\n\t \t\t\t\t\t$('#dialogo_1').html('El registro '+i+' se encuentra repetido, favor de verificar');\r\n\t \t\t\t \t\tabrirDialogo();\r\n\t \t\t\t \t\treturn false;\r\n\t \t\t\t\t}\r\n\t \t\t\t}\t \t\t\t\t\r\n\t \t\t}\t \t\t\t\r\n\t \t\tif(idCriterioPago == 1){\r\n\t \t\t\tpatron =/^\\d{1,13}((\\.\\d{1,2})|(\\.))?$/;\r\n\t \t\t\tif(!cuota.match(patron)){\r\n\t\t \t\t\t$('#dialogo_1').html('El valor de la cuota \"'+cuota+'\" del registro '+i+' es inválido, se aceptan hasta 13 dígitos a la izquierda y 2 dígitos máximo a la derecha');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n\t \t\t\t}\t\r\n\t \t\t}\r\n\t\t}// end for\r\n\t\t\r\n\t\tif(parseInt(siCapturoPrecioPagado) == 1){\r\n\t\t\t//Verificar que todos los campos de precio pagado sean capturados\r\n\t\t\tfor (j=1;j<parseInt(numCampos)+1;j++){\r\n\t\t\t\tprecioPagado = $('#precioPagado'+j).val();\r\n \t\t\t\tif(precioPagado == null || precioPagado == \"\" ){\r\n \t\t\t\t\t$('#dialogo_1').html('Debe capturar el precio pagado en el registro '+j+', si eligió capturar este campo todos los registros serán requeridos');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n \t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}// end validacion de los campos de cuotas\t\r\n\tvar dia = \"\", mes = \"\", anio = \"\";\r\n\tvar fechaInicioAcopio = $('#fechaInicioAcopio').val(); \r\n\tvar fechaFinAcopio = $('#fechaFinAcopio').val();\r\n\t\r\n\tif(fechaInicioAcopio !=null && fechaInicioAcopio != \"\"){\r\n\t\tif(fechaFinAcopio == null || fechaFinAcopio == \"\"){\r\n\t\t\t$('#dialogo_1').html('Seleccione la fecha fin del periodo de acopio');\r\n\t\t\tabrirDialogo();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(fechaFinAcopio != null && fechaFinAcopio != \"\"){\r\n\t\tif(fechaInicioAcopio == null || fechaInicioAcopio == \"\"){\r\n\t\t\t$('#dialogo_1').html('Seleccione la fecha inicio del periodo de acopio');\r\n\t\t\tabrirDialogo();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tif(fechaInicioAcopio != null && fechaFinAcopio != null ){\r\n\t\tvar fechaInicioAcopioTmp = \"\";\r\n\t\tdia = fechaInicioAcopio.substring(0,2);\r\n\t\tmes = fechaInicioAcopio.substring(3,5);\r\n\t\tanio = fechaInicioAcopio.substring(6,10);\r\n\t\tfechaInicioAcopioTmp = anio+\"\"+\"\"+mes+\"\"+dia;\r\n\t\tvar fechaFinAcopioTmp = \"\";\r\n\t\tdia = fechaFinAcopio.substring(0,2);\r\n\t\tmes = fechaFinAcopio.substring(3,5);\r\n\t\tanio = fechaFinAcopio.substring(6,10);\r\n\t\tfechaFinAcopioTmp = anio+\"\"+\"\"+mes+\"\"+dia;\r\n\t\tif(parseInt(fechaFinAcopioTmp) < parseInt(fechaInicioAcopioTmp)){\r\n\t\t\t$('#dialogo_1').html('La fecha fin de acopio seleccionada no puede ser menor a la fecha inicio de acopio, por favor verifique');\r\n\t\t\tabrirDialogo();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\tvar periodoDOFSI = $('#periodoDOFSI').val();\r\n\tpatron =/^\\d{1,10}$/;\r\n\tif(!periodoDOFSI.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo DOF a SI es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tvar periodoOSIROSI = $('#periodoOSIROSI').val();\r\n\tpatron =/^\\d{1,10}$/;\r\n\tif(!periodoOSIROSI.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo OOSI a ROOSI es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\tvar periodoCASP = $('#periodoCASP').val();\r\n\tif(!periodoCASP.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo CA a SP es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar periodoSPOO = $('#periodoSPOO').val();\r\n\tif(!periodoSPOO.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo SP a OO es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar periodoORPago = $('#periodoORPago').val();\r\n\tif(!periodoORPago.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo OR a Pago es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n}", "function validar_formu() {\n\tvar valido = true;\n\tvar campo1 = document.getElementById(\"cod_cliente\");\n\tvar campo2 = document.getElementById(\"nombre_cliente\");\n\tif (campo_vacio(campo1) && campo_vacio(campo2)) {\n\t\tvalido = false;\n\t\talert(\"Uno de los dos campos son obligatorios para realizar la consulta de los datos del cliente.\");\n\t}\n\treturn valido;\n}", "function chequearVacio(field) {\n if (vacio(field.value.trim())) {\n setInvalido(field, `${field.name} no debe estar vacío`);\n return true;\n } else {\n setValido(field);\n return false;\n }\n}", "function limpiar_campos(){\r\n\r\n\t//NOMBRE\r\n\tdocument.getElementById(\"txt_nombre\").value = \"\";\r\n\t$(\"#div_nombre\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_nombre\").hide();\r\n\t\r\n\t//EMAIL\r\n\tdocument.getElementById(\"txt_email\").value = \"\";\r\n\t$(\"#div_email\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_email\").hide();\r\n\r\n\t//TELEFONO\r\n\tdocument.getElementById(\"txt_telefono\").value = \"\";\r\n\t$(\"#div_telefono\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_telefono\").hide();\r\n\r\n //TIENE HIJOS?\r\n tiene_hijos[0].checked=true;\r\n\r\n //ESTADO CIVIL\r\n document.getElementById(\"cbx_estadocivil\").value=\"SOLTERO\";\r\n\r\n //INTERESES\r\n document.getElementById(\"cbx_libros\").checked =false;\r\n document.getElementById(\"cbx_musica\").checked =false;\r\n document.getElementById(\"cbx_deportes\").checked =false;\r\n document.getElementById(\"cbx_otros\").checked =false;\r\n $(\"#div_intereses\").attr(\"class\",\"form-group\");\r\n $(\"#span_intereses\").hide();;\r\n}", "function checkTypeColeta() {\n\t\tif (document.frmCadCliente.hiddenTypeColeta.value == 0) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function comprobar_casillas (){\n //obtenemos los valores de las casillas\n var usuario = document.getElementById(\"user\").value;\n var contrasena = document.getElementById(\"password\").value;\n\n if(usuario == \"\" || contrasena == \"\"){\n cuadro.style.display = 'block';\n aviso.innerHTML = \"Falta introducir datos\";\n console.log('dentro de aviso')\n return false\n }\n return true;\n}", "function ValidaCPF(cpfEnviado) {\n Object.defineProperty(this, 'cpfLimpo', {\n get: function() {\n return cpfEnviado.replace(/\\D+/g, '');\n }\n });\n}", "function maskValidCep(attribut) {\n var attributForm = Xrm.Page.getAttribute(attribut).getValue();\n if (attributForm != null) {\n var exp = /\\-|\\.|\\/|\\(|\\)| /g\n attributForm = attributForm.replace(exp, \"\");\n if (attributForm.length == 8) {\n attributForm = attributForm.substr(0, 2) + '.' + attributForm.substr(2, 3) + '-' + attributForm.substr(5, 3);\n } else {\n alert(\"Número de CEP inválido.\");\n attributForm = \"\";\n focusAttibute(attribut);\n }\n Xrm.Page.getAttribute(attribut).setValue(attributForm);\n }\n}", "function Paciente(nombre, edad, rut, diagnostico) {\n this.nombre = nombre;\n this.edad = edad;\n this.rut = rut;\n this.diagnostico = diagnostico;\n}", "function comunidades() {\n var paises = document.getElementById(\"paises\");\n var ccaa = document.getElementById(\"preguntaccaa\");\n if (paises.value == \"73\") {\n ccaa.setAttribute(\"class\", \"visible\");\n } else {\n ccaa.setAttribute(\"class\", \"oculto\");\n \n }\n}", "function formatCampusLocation(campus) {\n if (campus == \"No Preference\") {\n return null;\n } else\n return campus;\n}", "function checkAceptaCondiciones(field){\r\n\tvar acepta = $(\"input[name='acepto_aviso_legal']:checked\").val();\r\n\tif ( acepta === undefined) {\r\n\t\treturn \"Lea y acepta los términos y condiciones de uso.\";\r\n\t}\t\t\t\r\n}", "function paisYciudad(pais, ciudad){\n console.log(pais + \" \" + ciudad)\n}", "function Cpalabras (cadena){\n var numerop = cadena.split(\" \").length;\n return (\"2.- Palabras: \"+numerop);\n}", "static checkCity(city) {\n try {\n NonEmptyString.validate(city, CITY_CONSTRAINTS);\n return \"\";\n }\n catch (error) {\n console.error(error);\n return \"The address' city should not be empty or larger than 120 letters\";\n }\n }", "static getCampus() {\n return [\n {\n name: 'BI',\n code: 3,\n }, {\n name: 'GI',\n code: 2,\n }, {\n name: 'AR',\n code: 1,\n },\n ];\n }", "function ConjuntoGenerico_Contem(chave) {\r\n if (chave == null) {\r\n throw \"NullPointerException {\" + chave + \"}\";\r\n }\r\n if (this.Tabela[chave] != null) {\r\n return true;\r\n }\r\n return false;\r\n}", "function validaPaciente(paciente){\n\n\tvar PESO_INVALIDO = \"Peso é inválido!\";\n\tvar ALTURA_INVALIDA = \"Altura é inválida!\";\n\tvar GORDURA_INVALIDA = \"Gordura é inválida!\";\n\n\tvar erros = [];\n\n\tif(!pesoValido(paciente.peso)) erros.push(PESO_INVALIDO); \n\tif(!alturaValida(paciente.altura)) erros.push(ALTURA_INVALIDA); \n\tif(!gorduraValida(paciente.gordura)) erros.push(GORDURA_INVALIDA);\n\n\treturn erros; \n\n}", "function info(cadena) {\n\n var resultado = \"La cadena \\\"\"+cadena+\"\\\" \";\n \n // Comprobar mayúsculas y minúsculas\n if(cadena == cadena.toUpperCase()) {\n resultado += \" está formada sólo por mayúsculas\";\n }\n else if(cadena == cadena.toLowerCase()) {\n resultado += \" está formada sólo por minúsculas\";\n }\n else {\n resultado += \" está formada por mayúsculas y minúsculas\";\n }\n \n return resultado;\n }", "function validarLocalidade(){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\tif( form.localidadeOrigemID.value == form.localidadeDestinoID.value ){\r\n\t\tform.setorComercialOrigemID.disabled = false;\r\n\t\tform.setorComercialDestinoID.disabled = false;\r\n\t}\r\n\telse if( form.localidadeOrigemID.value != form.localidadeDestinoID.value ){\r\n\t\tform.setorComercialOrigemID.disabled = true;\r\n\t\tform.setorComercialDestinoID.disabled = true;\r\n\t\tform.setorComercialOrigemID.value = '';\r\n\t\tform.setorComercialDestinoID.value = '';\r\n\t\tform.quadraOrigemID.value = '';\r\n\t\tform.quadraDestinoID.value = '';\r\n\t}\r\n\telse if( form.setorComercialOrigemID.value != form.setorComercialDestinoID.value ){\r\n\t\t\tform.quadraOrigemID.disabled = false;\r\n\t\t\tform.quadraDestinoID.disabled = false;\r\n\t\t}\r\n\r\n}", "function MascaraCNPJ(cnpj){\n\tif(mascaraInteiro(cnpj)==false){\n\t\tevent.returnValue = false;\n\t}\t\n\treturn formataCampo(cnpj, '00.000.000/0000-00', event);\n}", "function validarCampos3 () {\n\tvar id = inmueble_pos_comp;\n\tvar continua = true;\n\t\t\n\tif (id == -1) {\n\t\tcontinua = false;\n\t\t\t\n\t\tif (!vacio($(\"#imagen\").val(), \"Imagen\")) {\n\t\t\tcontinua = true;\n\t\t}\n\t}\n\t\t\n\tif (continua) {\n\t\tsaveImagen();\n\t}\n}", "function validarCampos3 () {\n\tvar id = inmueble_pos_comp;\n\tvar continua = true;\n\t\t\n\tif (id == -1) {\n\t\tcontinua = false;\n\t\t\t\n\t\tif (!vacio($(\"#imagen\").val(), \"Imagen\")) {\n\t\t\tcontinua = true;\n\t\t}\n\t}\n\t\t\n\tif (continua) {\n\t\tsaveImagen();\n\t}\n}", "function meu_callback(conteudo) {\r\r\n if (!(\"erro\" in conteudo)) {\r\r\n //Atualiza os campos com os valores.\r\r\n document.getElementById('logradouro').value=(conteudo.logradouro);\r\r\n document.getElementById('bairro').value=(conteudo.bairro);\r\r\n document.getElementById('cidade').value=(conteudo.localidade);\r\r\n document.getElementById('uf').value=(conteudo.uf);\r\r\n } //end if.\r\r\n else {\r\r\n //CEP não Encontrado.\r\r\n limpa_formulário_cep();\r\r\n alert(\"CEP não encontrado.\");\r\r\n }\r\r\n}", "function chutePalavra() {\n if(obj.palavra == document.getElementById('inp-palavra').value.trim().toUpperCase()) {\n alert('Parabéns você ganhou');\n document.forms['formJogo'].style.display = 'none';\n telaPrincipal();\n }\n}", "function validateCity(){\r\n\t\r\n\t\r\n\tvar city = document.forms[\"form\"][\"City\"].value;\r\n\tvar pCity = document.getElementById(\"valCity\");\r\n\t\r\n\tif (city == \"\")\r\n\t{\r\n\t\tpCity.innerHTML = \r\n\t\t\"City text field cannot contain more than 50 characters\";\r\n\t\tpCity.classList.remove(\"valid\");\r\n\t\tpCity.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse if(city.length > 50)\r\n\t{\r\n\t\tpCity.innerHTML = \r\n\t\t\"City text field cannot contain more than 50 characters\";\r\n\t\tpCity.classList.remove(\"valid\");\r\n\t\tpCity.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse \r\n\t{\r\n\t\tpCity.innerHTML = \r\n\t\t\"Valid City\";\r\n\t\tpCity.classList.remove(\"invalid\");\r\n\t\tpCity.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t\r\n}" ]
[ "0.6524344", "0.5869477", "0.578313", "0.57750964", "0.5773307", "0.5652721", "0.5649926", "0.56426054", "0.55872846", "0.556624", "0.55623364", "0.55515414", "0.55429775", "0.5536049", "0.55336326", "0.55009115", "0.549372", "0.5457524", "0.54054654", "0.53910077", "0.5369189", "0.5363998", "0.536059", "0.5335571", "0.5329348", "0.53264636", "0.5325506", "0.5312866", "0.531021", "0.53082824", "0.53053457", "0.5300476", "0.52932197", "0.5285322", "0.52470654", "0.52455956", "0.5235239", "0.52283484", "0.5221862", "0.52145576", "0.52074665", "0.5198027", "0.51938426", "0.5184398", "0.51833355", "0.5172313", "0.5167947", "0.5165831", "0.51654786", "0.51639515", "0.51570666", "0.5153519", "0.5153296", "0.5152887", "0.5152085", "0.5147643", "0.5145564", "0.51430565", "0.51403135", "0.51402473", "0.51339996", "0.5131995", "0.5131899", "0.51188195", "0.5117851", "0.5112136", "0.5107734", "0.5106971", "0.5103528", "0.5103225", "0.5099589", "0.5090199", "0.5088759", "0.5088497", "0.5084778", "0.5084276", "0.5077063", "0.5076776", "0.5076318", "0.5074573", "0.5072835", "0.5068087", "0.50654227", "0.5064002", "0.5062614", "0.50620556", "0.5062018", "0.50605375", "0.50480944", "0.5044732", "0.5044364", "0.5036714", "0.5033432", "0.5033338", "0.502666", "0.5024265", "0.5024265", "0.50206345", "0.50183237", "0.5005586" ]
0.5916437
1
Fala com o OpenWeather
function recebeOpenWeather(cidade) { $.ajax({ url:'http://api.openweathermap.org/data/2.5/weather?q=' + cidade + "&units=metric&lang=pt" + "&APPID=0799ebbcad862deddeeebe1f4ccc65d7", type:"GET", dataType:"json", success: function(data){ var widget = show(data); $("#show").html (widget); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGeoWeather() {\n \tweather.getGeoWeather()\n\t\t.then((results) => {\n\t\t\tui.display(results);\n\t\t})\n\t\t.catch((err) => err);\n}", "function getCurrentWeather() {\n \tvar dataObj = {\n \t\tlat: '',\n \t\tlon: '',\n \t\tAPPID: '923ac7c7344b6f742666617a0e4bd311',\n \t\tunits: 'metric'\n \t}\n }", "function showWeather(long, lat) {\n const proxy = `https://cors-anywhere.herokuapp.com/`; // Bez proxy Darksky blokuje połączenie\n const api = `${proxy}https://api.darksky.net/forecast/1103c310eb977ef805f5fffd2a88cfe5/${lat},${long}?units=si`;\n const air = `${proxy}https://api.openaq.org/v1/latest?coordinates=${lat},${long}`;\n\n fetch(air)\n .then(airData => {\n return airData.json();\n })\n\n .then(airData =>{\n console.log(airData);\n let pm10 = 'brak danych';\n let pm25 = 'brak danych';\n const airPollution = airData.results[0]\n const station = airPollution.location;\n \n for (x in airPollution.measurements){\n const item = airPollution.measurements[x];\n const item_value = airPollution.measurements[x].value\n if (item.parameter == 'pm10'){pm10 = Math.round(item_value)}\n if (item.parameter == 'pm25'){pm25 = Math.round(item_value)}\n }\n \n air_station.textContent = station;\n air_pm10.innerHTML = '<span class=\"p-air\">Pył pm10:</span> ' + pm10;\n air_pm25.innerHTML = '<span class=\"p-air\">Pył pm2,5:</span> ' + pm25;\n \n if (pm10 < 21){air_pm10.className='';air_pm10.classList.toggle('very-good');}\n else if (pm10 < 51){air_pm10.className='';air_pm10.classList.toggle('good');}\n else if (pm10 < 81){air_pm10.className='';air_pm10.classList.toggle('moderate');}\n else if (pm10 < 111){air_pm10.className='';air_pm10.classList.toggle('sufficient');}\n else if (pm10 < 151){air_pm10.className='';air_pm10.classList.toggle('bad');}\n else if (pm10 > 150){air_pm10.className='';air_pm10.classList.toggle('very-bad');}\n\n if (pm25 < 14){air_pm25.className='';air_pm25.classList.toggle('very-good');}\n else if (pm25 < 36){air_pm25.className='';air_pm25.classList.toggle('good');}\n else if (pm25 < 56){air_pm25.className='';air_pm25.classList.toggle('moderate');}\n else if (pm25 < 76){air_pm25.className='';air_pm25.classList.toggle('sufficient');}\n else if (pm25 < 111){air_pm25.className='';air_pm25.classList.toggle('bad');}\n else if (pm25 > 110){air_pm25.className='';air_pm25.classList.toggle('very-bad');}\n \n \n })\n \n fetch(api)\n .then(data => {\n return data.json();\n })\n\n .then(data => {\n console.log(data);\n const daily_array = data.daily.data;\n\n // Today info\n const {\n icon,\n time,\n temperature,\n windSpeed,\n humidity,\n pressure,\n } = data.currently;\n\n //Current Day\n var currentDate = new Date(time * 1000);\n\n var currentDay = currentDate.getDate();\n if (currentDay < 10) {\n currentDay = \"0\" + currentDay;\n }\n var currentMonth = currentDate.getMonth();\n\n //Sunrise & Sunset Time\n const todaySunriseTime = daily_array[0].sunriseTime;\n const todaySunsetTime = daily_array[0].sunsetTime;\n\n var sunriseDate = new Date(todaySunriseTime * 1000);\n var sunriseHour = sunriseDate.getHours();\n var sunriseMinutes = sunriseDate.getMinutes();\n if (sunriseMinutes < 10) {\n sunriseMinutes = \"0\" + sunriseMinutes;\n }\n\n var sunsetDate = new Date(todaySunsetTime * 1000);\n var sunsetHour = sunsetDate.getHours();\n var sunsetMinutes = sunsetDate.getMinutes();\n if (sunsetMinutes < 10) {\n sunsetMinutes = \"0\" + sunsetMinutes;\n }\n\n // Daily info\n const tomorrow_temperature = daily_array[2].temperatureLow;\n const after_tomorrow_temperature = daily_array[3].temperatureLow;\n\n const tomorrowIcon = daily_array[2].icon;\n const afterTomorrowIcon = daily_array[3].icon;\n\n //**** Set DOM elements from API ****\n // Today (first column)\n seticons(tomorrowIcon, html_tomorrow_icon);\n seticons(afterTomorrowIcon, html_after_tomorrow_icon);\n seticons(icon, html_icon);\n cur_temperature.textContent = Math.round(temperature);\n wind_speed.textContent = windSpeed;\n cur_humidity.textContent = humidity;\n cur_pressure.textContent = Math.round(pressure) + \" hPa\";\n sunrise_sunset.textContent = sunriseHour + \":\" + sunriseMinutes + \" - \" + sunsetHour + \":\" + sunsetMinutes;\n cur_date.textContent = currentDay + \".\" + currentMonth;\n\n // Tomorrow (second column)\n html_tomorrow_temperature.innerHTML = Math.round(tomorrow_temperature) + `<span class=\"h6 ml-1\">°C</span>`;\n\n // After tomorrow (third column)\n html_after_tomorrow_temperature.innerHTML = Math.round(after_tomorrow_temperature) + `<span class=\"h6 ml-1\">°C</span>`;\n\n })\n }", "function GetGlobalWeather(cityname,apiuri,apitkn){\n let current = httpGet(apiuri+'weather?appid='+apitkn+'&units=metric&q='+cityname);\n console.log(current.cod);\n if(current.cod == 200){\n let city = current.name;\n let coords = current.coord;\n let daily = httpGet(apiuri+'onecall?appid='+apitkn+'&lat='+coords.lat+'&lon='+coords.lon+'&exclude=hourly,current,minutely&units=metric');\n return {'current':current,'daily':daily.daily,'city':city};\n }else{\n alert(cityname+' Not finded')\n }\n \n}", "function get_data(){\n\n url_data = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" +latitude+ \"&lon=\" +longitude+ \"&appid=\" + app_id + \"&units=metric&exclude=hourly,minutely\";\n\n https.get(url_data, (response)=>{\n \n response.on(\"data\", (data)=>{\n let info = JSON.parse(data);\n\n const days = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n const month = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n const d = new Date();\n\n const nDate = new Date().toLocaleTimeString('en-US', {\n timeZone: 'Asia/Calcutta', hours:'long'\n });\n\n api_temp = Math.round(info.current.temp);\n api_city = city_name + \",\" +country_code;\n\n \n\n api_time_date = nDate.slice(0, -6) +\" \" + nDate.slice(-2) + \" - \"+ d.getDate()+ \"th\" + \" \" + month[d.getMonth()] + \" \" + d.getFullYear();\n api_cloud_percent = info.current.clouds + \"% cloudiness\";\n api_feels_like = \"Feels like \" + info.current.feels_like + \"°C. \" + info.current.weather[0].description +\".\";\n api_pressure = info.current.pressure;\n api_visibility = info.current.visibility/1000;\n api_uv = info.current.uvi;\n api_humidity = info.current.humidity;\n api_dew = info.current.dew_point;\n api_wind_speed = info.current.wind_speed;\n api_wind_degree = info.current.wind_deg;\n api_wind_gust = info.current.wind_gust + \" m/s\";\n\n\n for(var i=1; i<=8; i++){\n let week = (d.getDay() + i)%7;\n let m = d.getMonth();\n \n let t = d.getDate();\n\n if(m === 0){\n t = (t+i)%31;\n if(t === 0){\n t=31;\n }\n }\n else if(m===1){\n t = (t+i)%28\n }\n else if(m%2 === 0){\n t = (t+i)%30;\n if(t === 0){\n t=30;\n }\n }\n else{\n t = (t+i)%31;\n if(t === 0){\n t=31;\n }\n }\n\n if(t < d.getDate()){\n m++;\n }\n\n let day = days[week] + \", \" + month[m] +\" \"+ t;\n let temp_day = Math.round(info.daily[i-1].temp.day);\n let temp_night = Math.round(info.daily[i-1].temp.night);\n let temp = temp_day + \" / \" + temp_night+\"°C\";\n let stats = info.daily[i-1].weather[0].description;\n\n forecast_date.push(day);\n forecast_temp.push(temp);\n forecast_status.push(stats);\n }\n \n\n })\n })\n\n}", "function showWeather() {\ngiveCity()\npreForecast()\nfutureFore() \n}", "function getWeather() {\n\tlet query = \"https://api.openweathermap.org/data/2.5/weather?\" +\n\t\t\"q=\" + city + \"&units=imperial&appid=\" + OWM_API_KEY;\n\t\n\t$.ajax({\n\t\turl: query,\n\t\tmethod: \"GET\"\n\t}).done(data => {\n\t\tif (!data) return;\n\t\t\n\t\tif (data.main && data.main.temp && data.weather && data.weather.length > 0) {\n\t\t\t$('#temp').text(data.main.temp.toFixed(1) + '\\xB0' + 'F');\n\t\t\t\n\t\t\t$('#weather-main > i').remove();\n\t\t\t\n\t\t\tlet weatherData = data.weather[0];\n\t\t\t\n\t\t\tlet icon = $('<i>');\n\t\t\tlet time = weatherData.icon.endsWith('d') ? 'day-' : weatherData.icon.endsWith('n') ? 'night-' : '';\n\t\t\tlet iconClass = 'wi wi-owm-' + time + weatherData.id;\n\t\t\ticon.addClass(iconClass);\n\t\t\t$('#weather-main').prepend(icon);\n\t\t\t\n\t\t\tlet conditions = weatherData.description;\n\t\t\t$('#weather-conditions').text(titleCase(conditions));\n\t\t\t\n\t\t\t//console.log(data);\n\t\t}\n\t});\n\t\n\tquery = 'https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid in (select woeid from geo.places(1) where text=\"' + city.toLowerCase() + ', ' + state.toLowerCase() + '\")&format=json';\n\t$.ajax({\n\t\turl: query,\n\t\tmethod: \"GET\"\n\t}).done(data => {\n\t\tif (!data || !data.query || !data.query.results || !data.query.results.channel) return;\n\t\t\n\t\tconsole.log(data.query.results.channel);\n\t\t\n\t\tif (!data.query.results.channel.item || !data.query.results.channel.item.forecast) return;\n\t\t\n\t\tlet forecast = data.query.results.channel.item.forecast;\n\t\t\n\t\tif (forecast.length > 0) {\n\t\t\t$('#temp-high').text(forecast[0].high + '\\xB0' + 'F');\n\t\t\t$('#temp-low').text(forecast[0].low + '\\xB0' + 'F');\n\t\t\t\n\t\t\t$('#weather-weekly').empty();\n\t\t\tfor (let i = 1; i < 6 && i < forecast.length; i++) {\n\t\t\t\tlet col = $('<div>').addClass('col');\n\t\t\t\tlet panel = $('<div>').addClass('panel daily-forecast');\n\t\t\t\tlet dayWeather = forecast[i];\n\t\t\t\t\n\t\t\t\tpanel.append($('<p>').addClass('day').text(dayWeather.day.toUpperCase()));\n\t\t\t\tpanel.append($('<i>').addClass('wi wi-yahoo-' + dayWeather.code));\n\t\t\t\tpanel.append($('<p>').addClass('daily-high').text(dayWeather.high + '\\xB0' + 'F'));\n\t\t\t\tpanel.append($('<p>').addClass('daily-low').text(dayWeather.low + '\\xB0' + 'F'));\n\t\t\t\t\n\t\t\t\tcol.append(panel);\n\t\t\t\t$('#weather-weekly').append(col);\n\t\t\t}\n\t\t}\n\t\t\n\t});\n}", "static async getWeather() {\n try {\n let pos = await Weather.getGeoData();\n const response = await fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${pos.lat}&lon=${pos.lon}&exclude=hourly,minutely,alerts&units=metric&appid=${APIKey}`);\n const data = await response.json();\n\t\t\tlet result = data.daily.slice(0,8)\n\t\t\treturn result;\n } catch(err) {\n console.log(err);\n }\n }", "function getWeather() {\n var location = globals.location,\n usrInput = $('.input-div input').val() || '';\n\n getCityWeather(usrInput, location);\n getCityForecast(usrInput, location)\n\n }", "function getWeather() {\n\t\tcity.innerHTML = `${forecast.city},` + `${forecast.country}`;\n\t\tweather.innerHTML = `${forecast.description}`;\n\t\ttemp.innerHTML = `Current Temp:${forecast.temperature}&degC`;\n\t\ticon.innerHTML = `<img src=\"assets/${forecast.image}.png\">`;\n\n\t\tsearch.value = '';\n\t}", "async getWeather() {\n const response = await fetch(`http://cors-anywhere.herokuapp.com/https://api.darksky.net/forecast/${this.key}/${this.latitude},${this.longitude}`)\n const result = await response.json();\n\n const ocd = await fetch(`https://api.opencagedata.com/geocode/v1/json?key=${this.ocdkey}&q=${this.latitude}%2C${this.longitude}&language=en`)\n const ocdResult = await ocd.json();\n\n return {\n result,\n ocdResult,\n }\n }", "function geoLocationWeather() {\n navigator.geolocation.getCurrentPosition(function(position) {\n fetch(API + \"lat=\" + position.coords.latitude + \"&lon=\" + position.coords.longitude + \"&APPID=\" + KEY + \"&units=metric\")\n .then((resp) => resp.json())\n .then((data) => {\n getWeatherData(data);\n })\n .catch(function(error) {\n console.log(\"Wystąpił błąd: \" + error);\n })\n });\n }", "function tokyoWeather() {\n\n // use fetch to get the weather data from Tokyo\n fetch(\"https://api.openweathermap.org/data/2.5/weather?q=Tokyo,jp&units=imperial&appid=153a1ec8f6b54ec52d519c21641a079f\")\n \n .then(function(resp) { return resp.json() }) // Convert data to json\n .then(function(data) {\n displayWeather(data);\n })\n //catch errors\n .catch(function() {\n \n });\n}", "function getWeather () {\n console.log('getWeather');\n let cityName = $(\"#cityname\").val();\n let queryURL = `https://api.openweathermap.org/data/2.5/weather?q=${cityName}&appid=`;\n //saveToStorage(cityName);\n saveToStorage(cityName);\n addToHistory(event);\n\n \n \n\n \n let KELVIN = 273.15;\n \n $.ajax ({\n url: queryURL,\n success: function (result) {\n console.log(result);\n \n const mainIcon = result.weather[0].icon;\n const mainIconLink = \"https://openweathermap.org/img/wn/\" + mainIcon + \".png\"\n $('#mainIcon').attr('src', mainIconLink);\n $('.location').text(result.name);\n let C = Math.round(result.main.temp - KELVIN);\n let Celsius = C.toString();\n $(\".temp\").text(Celsius + \" \\u00B0C\");\n $('.humidityNr').text(result.main.humidity + \" %\");\n $('.windValue').text(result.wind.speed + \" MPH\");\n\n $('.description').text(result.weather[0].description);\n \n\n getUvIndex(result.coord.lon,result.coord.lat);\n \n\n }\n })\n }", "function getWeatherInfo () {\n\n const long = App.city.longitude;\n const lat = App.city.latitude;\n const url = \"https://api.darksky.net/forecast/8877941a6145fd159c584b8f95b52bb9/\" + lat + \",\" + long + \"?callback=?\";\n\n $.ajax({\n url: url,\n dataType: \"jsonp\",\n success: function (json) {\n App.weatherForecast = json;\n }\n }).done(function () {\n updateWeatherInfo(App.weatherForecast);\n });\n\n }", "function weat() {\n $.simpleWeather({\n woeid: '', //56244897 San Jose City Hall\n location: 'San Jose, CA',\n unit: 'f',\n success: function(weather) {\n html = '<h2>'+weather.temp+'&deg;'+weather.units.temp+'</h2>';\n html += '<ul><li>'+weather.city+', '+weather.region+'</li>';\n html += '<li class=\"currently\">'+weather.currently+'</li>';\n html += '<li>'+weather.alt.temp+'&deg;C</li></ul>';\n \n for(var i=0;i<weather.forecast.length;i++) {\n html += '<p class=\"fore\">'+weather.forecast[i].day+': '+weather.forecast[i].high+'</p>';\n }\n \n $(\"#weather\").html(html);\n },\n error: function(error) {\n $(\"#weather\").html('<p>'+error+'</p>');\n }\n });\n}", "function getWeather(lat, lon, city) {\n\n //var city = $(\"#citySearchTextField\").val();\n var baseURL = \"https://api.openweathermap.org/data/2.5/\";\n\n if (lat !== undefined && lon !== undefined) {\n var queryParam = \"lat=\" + lat + \"&lon=\" + lon;\n }\n else {\n var queryParam = \"q=\" + city;\n };\n\n\n var openWeatherUrl = baseURL + \"weather?&units=imperial&\" + queryParam + \"&APPID=\" + apiKey;\n openWeatherUrl = encodeURI(openWeatherUrl);\n\n // Call Weather API for general weather\n $.ajax({\n url: openWeatherUrl,\n method: \"GET\"\n\n\n }).then(function (responseW) {\n\n $(\"#currentDate\").html(\" (\" + moment().format(\"M/D/YYYY\") + \")\");\n\n $(\"#cityName\").html(responseW.name); \n $(\"#temperature\").html(\"Temperature: \"+ responseW.main.temp + \" &#8457\");\n $(\"#humidity\").html(\"Humidity: \"+ responseW.main.humidity + \"%\");\n $(\"#windSpeed\").html(\"Wind Speed: \"+ responseW.wind.speed + \" MPH\");\n\n // Set weather icon\n var image_src = \"https://openweathermap.org/img/wn/\" + responseW.weather[0].icon +\"@2x.png\";\n $(\"#currentImg\").attr(\"src\",image_src);\n \n // Call Weather API for UV Index\n var uvIndexUrl = baseURL + \"uvi?lat=\" + responseW.coord.lat + \"&lon=\" + responseW.coord.lon + \"&APPID=\" + apiKey;\n $.ajax({\n url: uvIndexUrl,\n method: \"GET\"\n\n }).then(function (responseU) {\n $(\"#uvIndex\").html(\"UV Index: <span class='bg-danger text-white py-1 px-2 rounded' >\" + responseU.value +\"</span>\");\n })\n\n });\n }", "function getWeather(){\n $.get(\"https://api.openweathermap.org/data/2.5/onecall\", {\n appid: openWeatherApi,\n lat: markerPosition[1],\n lon: markerPosition[0],\n exclude: \"minutely, hourly, alerts, current\",\n units: \"imperial\"\n }).done((data) => {\n let coordinates = {\n lat: data.lat,\n lng: data.lon\n }\n console.log(data);\n $(\"#time\").html(sunMotion(data.current.dt + data.timezone_offset + baseOffset));\n\n reverseGeocode(coordinates, mapboxToken).then((result) => {\n $(\"#city\").text(result);\n });\n\n weatherSpot[0].innerHTML = \"\";\n\n for (let i = 0; i < data.daily.length; i++) {\n weatherSpot[0].innerHTML += forecast(data, i);\n }\n })\n }", "function getWeather(latitude, longitude) {\r\n let api = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}&units=metric`;\r\n \r\n fetch(api).then(function (response) {\r\n let data = response.json();\r\n return data;\r\n })\r\n .then(function (data) {\r\n weather.temp = data.main.temp;\r\n weather.city = data.name;\r\n weather.country = data.sys.country;\r\n weather.info = data.weather[0].main;\r\n weather.icon = data.weather[0].icon;\r\n \r\n displayWeather();\r\n forecast(`forecast?lat=${latitude}&lon=${longitude}`, weather.city);\r\n })\r\n\r\n function displayWeather() {\r\n $('.temp').html(Math.round(weather.temp) + \" &deg;C\");\r\n\r\n $('img.icon-img').attr('src', `images/icons/${ weather.icon}.png`);\r\n $('.info').html(weather.info);\r\n $('.city').html(weather.city);\r\n $('.country').html(weather.country);\r\n }\r\n}", "function createWeatherUrl() {\r\n let baseUrl = 'https://api.openweathermap.org/data/2.5/weather'\r\n let searchQuery = '?zip=' + $('.whereToSkate').val()\r\n let apiKey = '&APPID=c6074c7eba5c1cd1fa563dd6e3da11ad'\r\n let fullUrl = baseUrl + searchQuery + apiKey\r\n getWeather(fullUrl);\r\n}", "function getWeatherData(data) {\n let date = new Date();\n let currentTime = date.getHours();\n if (data.clouds == undefined) {\n TEMPERATURE.textContent = \"-\";\n TEMP_MIN.textContent = \"-\";\n TEMP_MAX.textContent = \"-\";\n PRESSURE.textContent = \"---\";\n HUMIDITY.textContent = \"---\";\n WIND.textContent = \"---\";\n CLOUDS.textContent = \"---\";\n WIND_DIR.textContent = \"---\";\n CITY.textContent = \"Nie znaleziono miasta!\";\n RAIN.textContent = \"---\";\n MAIN_ICON.classList.add(\"wi-na\");\n } else if (currentTime >= 6 && currentTime <= 18 && data.clouds.all < \"25\") {;\n MAIN_ICON.classList.add(\"wi-day-sunny\");\n } else if (currentTime >= 18 && currentTime <= 6 && data.clouds.all < \"25\") {\n MAIN_ICON.classList.add(\"wi-night-clear\");\n } else if (currentTime >= 6 && currentTime <= 18 && data.clouds.all >= \"25\" && data.clouds.all < \"50\") {\n MAIN_ICON.classList.add(\"wi-day-cloudy\");\n } else if (currentTime >= 18 && currentTime <= 6 && data.clouds.all >= \"25\" && data.clouds.all < \"50\") {\n MAIN_ICON.classList.add(\"wi-night-alt-cloudy\");\n } else if (currentTime >= 6 && currentTime <= 18 && data.clouds.all >= \"50\" && data.clouds.all < \"75\") {\n MAIN_ICON.classList.add(\"wi-day-cloudy-high\");\n } else if (currentTime >= 18 && currentTime <= 6 && data.clouds.all >= \"50\" && data.clouds.all < \"75\") {\n MAIN_ICON.classList.add(\"wi-night-alt-cloudy-high\");\n } else if (data.clouds.all >= \"75\") {\n MAIN_ICON.classList.add(\"wi-cloudy\");\n }\n TEMPERATURE.textContent = data.main.temp;\n TEMP_MIN.textContent = data.main.temp_min;\n TEMP_MAX.textContent = data.main.temp_max;\n PRESSURE.textContent = data.main.pressure + \" hPa\";\n HUMIDITY.textContent = data.main.humidity + \" %\";\n WIND.textContent = data.wind.speed + \" m/s\";\n CLOUDS.textContent = data.clouds.all + \" %\";\n WIND_DIR.textContent = data.wind.deg;\n CITY.textContent = data.name;\n if (data.rain !== undefined) {\n RAIN.textContent = data.rain + \" %\";\n } else {\n RAIN.textContent = \"b/d\";\n }\n }", "function getWeather(data) {\n setWeather(data);\n }", "function loadWeather(location, woeid) {\n $.simpleWeather({\n location: location,//longigtude\n woeid: woeid,//latitude\n unit: 'f',//it can C,F or K which ever thing like i.e Celsius,Farhenit or Kelvin\n success: function(weather) {\n //current weather card UI\n html = '<h2><i class=\"icon-'+weather.code+'\"></i> '+weather.temp+'&deg;'+weather.units.temp+'</h2>';\n html += '<ul><li>'+weather.city+', '+weather.region+'</li>';\n html += '<li class=\"currently\">'+weather.currently+'</li>';\n html += '<li>'+weather.alt.temp+'&deg;C</li></ul>'; \n \n $(\"#weather\").html(html);\n },\n error: function(error) {\n $(\"#weather\").html('<p>'+error+'</p>');\n }\n });\n}", "function Weather1(latitude, longitude) {\r\n let api = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=09ca21f95fe2e882270a487a604359d5`;\r\n\r\n fetch(api)\r\n .then(function (response) {\r\n let Values = response.json();\r\n return Values;\r\n })\r\n .then(function (Values) {\r\n weather.temperature.value = Math.floor(Values.main.temp - 273);\r\n weather.description = Values.weather[0].description;\r\n weather.city = Values.name;\r\n weather.country = Values.sys.country;\r\n })\r\n .then(function () {\r\n displayWeather();\r\n });\r\n }", "function getLocationWeather(type, myCity = \"\", long = -1, lat = -1) {\r\n if (type === \"single\") {\r\n urlAPI = `http://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${long}&units=metric&appid=52414d27dc2eef44fd822fdf41d5fb78&lang=fr`\r\n } else if (type === \"multy\") {\r\n urlAPI = `https://api.openweathermap.org/data/2.5/forecast/daily?q=${myCity}&units=metric&cnt=5&appid=${apiKey}`;\r\n }\r\n\r\n axios\r\n .get(urlAPI)\r\n .then(function(response) {\r\n // Manage success\r\n if (type === \"single\") {\r\n city = response.data.name;\r\n $(\"#inputSearch\").val(city);\r\n getLocationWeather(\"multy\", city);\r\n } else if (type === \"multy\") {\r\n //console.log(response.data);\r\n\r\n // Converting Epoch(Unix) time to GMT\r\n let { description, icon } = response.data.list[0].weather[0];\r\n let { temp } = response.data.list[0];\r\n //let { feels_like } = response.data.list[0];\r\n\r\n // Converting Epoch(Unix) time to GMT\r\n let iconUrl = `http://openweathermap.org/img/wn/${icon}@2x.png`;\r\n let speed = ((response.data.list[0].speed) * 18) / 5\r\n let aDate = new Date(response.data.list[0].dt * 1000)\r\n let s_set = new Date(response.data.list[0].sunset * 1000)\r\n let s_rise = new Date(response.data.list[0].sunrise * 1000)\r\n // Interacting with DOM to show data\r\n iconImg.attr(\"src\", `${iconUrl}`)\r\n desc.text(description)\r\n loc.text(`${response.data.city.name}, ${response.data.city.country}`)\r\n tempC.text(`${temp.day.toFixed(0)}`)\r\n humidity.text(`${response.data.list[0].humidity} %`)\r\n wind.text(`${speed.toFixed(1)} K / M`)\r\n todatDate.text(`${aDate.toDateString()}`)\r\n todatDate2.text(`${aDate.toDateString()}`)\r\n sunriseDOM.text(`${s_rise.getHours()}:${s_rise.getMinutes()} AM`)\r\n sunsetDOM.text(`${s_set.getHours()}:${s_set.getMinutes()} PM`)\r\n\r\n // Craete ther other days cards\r\n rest.html(\"\");\r\n let row = $(\"<div>\").addClass(\"row\");\r\n for (const day in response.data.list) {\r\n if (day != 0) {\r\n let divContainer = $(\"<div>\").addClass(\"col-12 col-md-3\")\r\n let div = $(\"<div>\").addClass(\"day\")\r\n let header = $(\"<h3>\")\r\n .text(`${days[new Date(response.data.list[day].dt * 1000).getDay()]}`)\r\n .css({\r\n \"textTransform\": \"uppercase\"\r\n })\r\n let divContainerImg = $(\"<div>\").addClass(\"icon\")\r\n let img = $(\"<img>\").attr({\r\n \"src\": `http://openweathermap.org/img/wn/${response.data.list[day].weather[0].icon}@2x.png`,\r\n \"alt\": \"Icone\"\r\n })\r\n divContainerImg.append(img)\r\n let divContainerTempC = $(\"<div>\").addClass(\"temp\")\r\n let spanTemp = $(\"<span>\")\r\n .text(`${response.data.list[day].temp.eve.toFixed(0)}`)\r\n .css({ \"display\": \"block\" })\r\n let spanDesc = $(\"<span>\")\r\n .text(`${response.data.list[day].weather[0].description}`)\r\n divContainerTempC.append(spanTemp);\r\n divContainerTempC.append(spanDesc);\r\n\r\n\r\n let divContainerMinMax = $(\"<div>\").addClass(\"minmax d-md-none\")\r\n let spanMin = $(\"<span>\")\r\n .addClass(\"min\")\r\n .text(`${response.data.list[day].temp.min.toFixed(0)}`)\r\n let spanMax = $(\"<span>\")\r\n .addClass(\"max\")\r\n .text(`${response.data.list[day].temp.max.toFixed(0)}`)\r\n divContainerMinMax.append(spanMin)\r\n divContainerMinMax.append(spanMax)\r\n\r\n div.append(header)\r\n div.append(divContainerImg)\r\n div.append(divContainerTempC)\r\n div.append(divContainerMinMax)\r\n divContainer.append(div)\r\n row.append(divContainer);\r\n }\r\n }\r\n rest.append(row)\r\n }\r\n\r\n // Add current city to LocalStorage\r\n let tet = $(\"#inputSearch\").val().trim()\r\n if (tet !== \"\") {\r\n console.log(\"hello\");\r\n localStorage.setItem(`_${ tet.toUpperCase() }`, tet.toUpperCase());\r\n }\r\n })\r\n .catch(function(error) {\r\n // handle error\r\n $(\"#warning\")\r\n .html(\"<div> The city is not found!!\")\r\n .addClass(\"d-block\")\r\n .css({ \"color\": \"red\" })\r\n .fadeOut(3000)\r\n .removeClass(\"d-block\")\r\n })\r\n .then(function() {\r\n // always executed\r\n });\r\n}", "function currentWeather(city){\n // build the URL to get a data from server side.\n var queryURL= \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&APPID=\" + APIKey;\n $.ajax({\n url:queryURL,\n method:\"GET\",\n }).then(function(response){\n\n // parse the response to display the current weather including the City name. the Date and the weather icon. \n console.log(response);\n //Dta object from server side Api for icon property.\n var weathericon= response.weather[0].icon;\n var iconurl=\"https://openweathermap.org/img/wn/\"+weathericon +\"@2x.png\";\n // The date format method is taken from the https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\n var date=new Date(response.dt*1000).toLocaleDateString();\n //parse the response for name of city and concanatig the date and icon.\n $(currentCity).html(response.name +\"(\"+date+\")\" + \"<img src=\"+iconurl+\">\");\n // parse the response to display the current temperature.\n // Convert the temp to fahrenheit\n\n var tempF = (response.main.temp - 273.15) * 1.80 + 32;\n $(currentTemperature).html((tempF).toFixed(2)+\"&#8457\");\n // Display the Humidity\n $(currentHumidty).html(response.main.humidity+\"%\");\n //Display Wind speed and convert to MPH\n var ws=response.wind.speed;\n var windsmph=(ws*2.237).toFixed(1);\n $(currentWSpeed).html(windsmph+\"MPH\");\n // Display UVIndex.\n //By Geographic coordinates method and using appid and coordinates as a parameter we are going build our uv query url inside the function below.\n UVIndex(response.coord.lon,response.coord.lat);\n forecast(response.id);\n if(response.cod==200){\n sCity=JSON.parse(localStorage.getItem(\"cityname\"));\n console.log(sCity);\n if (sCity==null){\n sCity=[];\n sCity.push(city.toUpperCase()\n );\n localStorage.setItem(\"cityname\",JSON.stringify(sCity));\n addToList(city);\n }\n else {\n if(find(city)>0){\n sCity.push(city.toUpperCase());\n localStorage.setItem(\"cityname\",JSON.stringify(sCity));\n addToList(city);\n }\n }\n }\n\n });\n}", "['getForecast'](sessionId, context, cb) {\n\t request(\n\t\t `http://api.openweathermap.org/data/2.5/forecast/daily?q=${context.loc}&units=metric&lang=hu&cnt=15&APPID=07976ea0d7f1371a9e527add86391b84`, get7Day); \t function get7Day(err, response, body)\n\t {\n\t\t\tvar retData = JSON.parse(body);\n\t\t\tvar params = [];\n\t\t\tvar day = new Date();\n\t\t\tvar qq = 0;\t\t\t\t\t\t \n\t\t\tvar q = 0;\n /*\n {context.forecast = \n `Hola`\n }\n cb(context);\n\t\t*/\n\t\tif(!err && response.statusCode < 400){\n\n\t\t\tcontext.forecast = '';\n \n\t\t\tfor( qq in retData.list)\n\t\t\t{\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (qq < '0 0')\n\t\t\t\t{context.forecast = context.forecast +\n\t\t\t\t`Ma: Min:${JSON.stringify(retData.list[qq].temp.min)} Max:${JSON.stringify(retData.list[qq].temp.max)} \n ${retData.list[qq].weather[0].description}\n`\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{context.forecast = context.forecast +\n\t\t\t\t`${qq} ${day.getMonth()} ${day.getDate()}: Min:${JSON.stringify(retData.list[qq].temp.min)} Max:${JSON.stringify(retData.list[qq].temp.max)} \n\t${retData.list[qq].weather[0].description}\n`\n\t\t\t\t}\n\t\t\t\tday.setDate(day.getDate()+1);\t\n\t\t\t}\n \t\tcb(context);\n\t\t\tcontext = '';\n\t\t}\n\t\telse{\n\t\t\tconsole.log(err);\n\t\t\tconsole.log(response.statusCode);\n\t\t}\n \n\t}\n }", "function searchByName() {\n let loading = ora('Loading result...').start();\n axios({\n url: `http://jisutqybmf.market.alicloudapi.com/weather/query?city=${encodeURI(city)}`,\n method: 'GET',\n headers: {\n Authorization: 'APPCODE 892b326edd8a4cab9c321e8bc29dfe9a'\n }\n })\n .then((resp) => {\n loading.stop();\n const data = resp.data;\n if (data.status === 0) {\n const res = data.result;\n console.log(chalk.green(`\\t\\t\\t\\t\\t${res.city} 今日天气预报\\n`));\n console.log(chalk.blue(`${res.city}\\t${res.date}\\t${res.week}`));\n console.log(`天气:${chalk.blue(`${res.weather}${emoji.get(EMOJI[res.img])}\\t${res.templow} - ${res.temphigh} ℃`)}`);\n console.log(`风力:${chalk.blue(res.winddirect, res.windpower)}`);\n console.log(`pm2.5指数: ${chalk.green(res.aqi.ipm2_5)}`);\n console.log(AQI[res.aqi.quality].call(chalk, `空气质量: ${res.aqi.quality}`));\n \n console.log(chalk.green('\\t\\t\\t\\t\\t未来7天天气预报'));\n console.log(getDaily(res.daily));\n } else {\n loading.stop();\n console.log(chalk.red('check your city name'));\n }\n })\n .catch((err) => {\n loading.stop();\n console.log(chalk.bgRed('[ERROR]'), chalk.red('something error, check your options or city name'));\n })\n}", "function weatherDataFahrenheit() {\r\n navigator.geolocation.getCurrentPosition(locationHandler);\r\n function locationHandler(position){\r\n placelat = position.coords.latitude;\r\n placelon = position.coords.longitude;\r\n $.getJSON(\"http://api.openweathermap.org/data/2.5/weather?APPID=c87ae1ce207b86d32f1ac31b319e04ad&lat=\"+placelat+\"&lon=\"+placelon+\"&units=imperial\", function(dataTwo){\r\n placeName = dataTwo.name;\r\n placeTemp = dataTwo.main.temp;\r\n $( \".weather_Location\" ).html( placeName );\r\n $( \".temp_deg\" ).html( Math.round(placeTemp) + \"&nbsp;&deg;F\" );\r\n weatherIcon = dataTwo.weather[0].icon;\r\n switch (weatherIcon) {\r\n case '01d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/1_ee8m7x.png';\r\n backgroundColor = '#ffffcc';\r\n break;\r\n case '02d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/2_snkyrl.png';\r\n backgroundColor = '#ffffcc';\r\n break;\r\n case '03d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/3_wvvsmq.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n case '04d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/3_wvvsmq.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n case '09d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/4_vveyub.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '10d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/5_we8jwt.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '11d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/6_hkoodr.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '13d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/7_ikf9r1.png';\r\n backgroundColor = '#80ccff';\r\n break;\r\n case '50d':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/8_pwltiz.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n case '01n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/9_fiq6zz.png';\r\n backgroundColor = '#ffffcc';\r\n break;\r\n case '02n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/10_idcsnl.png';\r\n backgroundColor = '#ffffcc';\r\n break;\r\n case '03n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/3_wvvsmq.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n case '04n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/3_wvvsmq.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n case '09n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/4_vveyub.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '10n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/5_we8jwt.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '11n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/6_hkoodr.png';\r\n backgroundColor = '#b3d9ff';\r\n break;\r\n case '13n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/7_ikf9r1.png';\r\n backgroundColor = '#80ccff';\r\n break;\r\n case '50n':\r\n iconUrl = 'http://res.cloudinary.com/db6e0gluw/image/upload/v1498754536/8_pwltiz.png';\r\n backgroundColor = '#d9d9d9';\r\n break;\r\n }\r\n $(\".icon\").html(\"<img src='\" + iconUrl + \"'>\");\r\n $(\".main_body\").css(\"background-color\", backgroundColor );\r\n });\r\n }\r\n }", "function geolocationWeather() {\n geoLocated = true;\n let apiKey = \"7571852f2fa939aa0c80cd40a9611936\";\n let units = \"tbc\";\n if (isItCelsius === true) {\n units = \"metric\";\n } else {\n units = \"imperial\";\n }\n function changeMainWeather(position) {\n function getWeather(response) {\n let iconCode = response.data.weather[0].icon;\n let icon = document.querySelector(\"#todaysweathericon\");\n icon.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${iconCode}@2x.png`\n );\n let temperature = Math.round(response.data.main.temp);\n let humidity = `${response.data.main.humidity}%`;\n let clouds = `${response.data.clouds.all}%`;\n let windSpeed = `${Math.round(response.data.wind.speed * 3.6)} km/h`;\n let weatherDescription = response.data.weather[0].description;\n let temperatureSpaceMain = document.querySelector(\"#temperaturevalue\");\n temperatureSpaceMain.innerHTML = `${temperature}`;\n temperatureValue = temperature;\n let humiditySpace = document.querySelector(\"#mainHumidity\");\n let windSpeedSpace = document.querySelector(\"#mainWindSpeed\");\n let cloudsSpace = document.querySelector(\"#mainClouds\");\n cloudsSpace.innerHTML = clouds;\n humiditySpace.innerHTML = humidity;\n windSpeedSpace.innerHTML = windSpeed;\n if (\n weatherDescription.includes(\"rain\") ||\n weatherDescription.includes(\"drizzle\")\n ) {\n console.log(\"It is raining\");\n warnUmbrellaUser();\n } else {\n if (\n weatherDescription.includes(\"overcast\") ||\n weatherDescription.includes(\"cloudy\")\n ) {\n tentativelyWarnUmbrellaUser();\n } else {\n reassureUmbrellaUser();\n }\n }\n let descriptionSpace = document.querySelector(\n \"#todaysweatherdescription\"\n );\n descriptionSpace.innerHTML =\n weatherDescription.charAt(0).toUpperCase() +\n weatherDescription.slice(1);\n }\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n let apiURLgeolocation = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=${units}`;\n axios.get(apiURLgeolocation).then(getWeather);\n }\n navigator.geolocation.getCurrentPosition(changeMainWeather);\n // tomorrow\n function changeTomorrowsWeather(position) {\n function getWeather(response) {\n let temperature = Math.round(response.data.list[8].main.temp);\n let weatherDescription = response.data.list[8].weather[0].description;\n let tomorrowsTemperatureSpace = document.querySelector(\n \"#tomorrowstemperature\"\n );\n tomorrowsTemperatureSpace.innerHTML = temperature;\n tomorrowsTemperatureValue = temperature;\n let tomorrowsDescriptionSpace = document.querySelector(\n \"#tomorrowsweatherdescription\"\n );\n tomorrowsDescriptionSpace.innerHTML =\n weatherDescription.charAt(0).toUpperCase() +\n weatherDescription.slice(1);\n let iconCode = response.data.list[8].weather[0].icon;\n let tomorrowsicon = document.querySelector(\"#tomorrowsweathericon\");\n tomorrowsicon.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${iconCode}@2x.png`\n );\n }\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n let apiURLgeolocation = `https://api.openweathermap.org/data/2.5/forecast?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=${units}`;\n axios.get(apiURLgeolocation).then(getWeather);\n }\n navigator.geolocation.getCurrentPosition(changeTomorrowsWeather);\n // second day\n function changeSecondWeather(position) {\n function getWeather(response) {\n let temperature = Math.round(response.data.list[16].main.temp);\n let weatherDescription = response.data.list[16].weather[0].description;\n let secondTemperatureSpace = document.querySelector(\"#secondtemperature\");\n secondTemperatureSpace.innerHTML = temperature;\n secondTemperatureValue = temperature;\n let secondDescriptionSpace = document.querySelector(\n \"#secondweatherdescription\"\n );\n secondDescriptionSpace.innerHTML =\n weatherDescription.charAt(0).toUpperCase() +\n weatherDescription.slice(1);\n let iconCode = response.data.list[16].weather[0].icon;\n let secondicon = document.querySelector(\"#secondweathericon\");\n secondicon.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${iconCode}@2x.png`\n );\n }\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n let apiURLgeolocation = `https://api.openweathermap.org/data/2.5/forecast?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=${units}`;\n axios.get(apiURLgeolocation).then(getWeather);\n }\n navigator.geolocation.getCurrentPosition(changeSecondWeather);\n // third day\n function changeThirdWeather(position) {\n function getWeather(response) {\n let temperature = Math.round(response.data.list[24].main.temp);\n let weatherDescription = response.data.list[24].weather[0].description;\n let thirdTemperatureSpace = document.querySelector(\"#thirdtemperature\");\n thirdTemperatureSpace.innerHTML = temperature;\n thirdTemperatureValue = temperature;\n let thirdDescriptionSpace = document.querySelector(\n \"#thirdweatherdescription\"\n );\n thirdDescriptionSpace.innerHTML =\n weatherDescription.charAt(0).toUpperCase() +\n weatherDescription.slice(1);\n let iconCode = response.data.list[24].weather[0].icon;\n let thirdicon = document.querySelector(\"#thirdweathericon\");\n thirdicon.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${iconCode}@2x.png`\n );\n }\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n let apiURLgeolocation = `https://api.openweathermap.org/data/2.5/forecast?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=${units}`;\n axios.get(apiURLgeolocation).then(getWeather);\n }\n navigator.geolocation.getCurrentPosition(changeThirdWeather);\n // fourth day\n function changeFourthWeather(position) {\n function getWeather(response) {\n let temperature = Math.round(response.data.list[32].main.temp);\n let weatherDescription = response.data.list[32].weather[0].description;\n let fourthTemperatureSpace = document.querySelector(\"#fourthtemperature\");\n fourthTemperatureSpace.innerHTML = temperature;\n fourthTemperatureValue = temperature;\n let fourthDescriptionSpace = document.querySelector(\n \"#fourthweatherdescription\"\n );\n fourthDescriptionSpace.innerHTML =\n weatherDescription.charAt(0).toUpperCase() +\n weatherDescription.slice(1);\n let iconCode = response.data.list[32].weather[0].icon;\n let fourthicon = document.querySelector(\"#fourthweathericon\");\n fourthicon.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${iconCode}@2x.png`\n );\n }\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n let apiURLgeolocation = `https://api.openweathermap.org/data/2.5/forecast?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=${units}`;\n axios.get(apiURLgeolocation).then(getWeather);\n }\n navigator.geolocation.getCurrentPosition(changeFourthWeather);\n //fifth day\n function changeFifthWeather(position) {\n function getWeather(response) {\n let temperature = Math.round(response.data.list[39].main.temp);\n let weatherDescription = response.data.list[39].weather[0].description;\n let fifthTemperatureSpace = document.querySelector(\"#fifthtemperature\");\n fifthTemperatureSpace.innerHTML = temperature;\n fifthTemperatureValue = temperature;\n let fifthDescriptionSpace = document.querySelector(\n \"#fifthweatherdescription\"\n );\n fifthDescriptionSpace.innerHTML =\n weatherDescription.charAt(0).toUpperCase() +\n weatherDescription.slice(1);\n let iconCode = response.data.list[39].weather[0].icon;\n let fifthicon = document.querySelector(\"#fifthweathericon\");\n fifthicon.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${iconCode}@2x.png`\n );\n }\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n let apiURLgeolocation = `https://api.openweathermap.org/data/2.5/forecast?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=${units}`;\n axios.get(apiURLgeolocation).then(getWeather);\n }\n navigator.geolocation.getCurrentPosition(changeFifthWeather);\n let citySpace = document.querySelector(\"#city\");\n citySpace.innerHTML = \"Current Location\";\n}", "function getForecastWeatherURL(lat, lon) {\n return 'https://api.openweathermap.org/data/2.5/forecast?lat=' + lat + '&lon=' + lon + '&appid=YOUR_API_KEY';\n}", "function getWeather(){\r\n $.ajax('http://api.openweathermap.org/data/2.5/weather?q=sligo&appid=49afd2758cf9e7566e0cf2536a9d69ac&units=metric', {\r\n \r\n dataType: 'jsonp',\r\n success: function(json) {\r\n \r\n var temp = Number(json.main.temp.toFixed(0));\r\n $('div#city strong').text('Temp: '+temp +' C')\r\n $('div#icon').html(\"<img src='http://openweathermap.org/img/w/\" + json.weather[0].icon + \".png'>\");\r\n $('div#weather').text('Location: '+json.name + \" , \" + json.sys.country);\r\n \r\n }\r\n });\r\n }", "function cityJson(info) {\r\n const city = info.ville;\r\n api = `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric&appid=${apiKey}&lang=fr`;\r\n fetchData()//lance la demande api\r\n}", "function getWeather(city, country, location) {\n const splitLocation = location.split(',');\n const lat = splitLocation[0];\n const lon = splitLocation[1];\n $.getJSON('https://fcc-weather-api.glitch.me/api/current?lat=' + lat + '&lon=' + lon, (json) => {\n $('#location').html(json.name + ', ' + json.sys.country);\n $('#temperature').html(Math.round(json.main.temp));\n $('#main-weather').html(json.weather[0].main);\n $('#weather-icon').attr('src', json.weather[0].icon);\n if (!json.weather[0].icon) {\n $('#image-container').css({\n display: 'none'\n });\n } else {\n $('#image-container').css({\n display: 'block'\n });\n }\n $('#weather-description').html(json.weather[0].description);\n $('#humidity').html(json.main.humidity);\n $('#pressure').html(json.main.pressure/10);\n $('#wind-speed').html(Math.floor(100*json.wind.speed*36/10)/100);\n if (!!json.wind.gust) {\n $('#wind-gusts').html(Math.floor(100*json.wind.gust*36/10)/100);\n $('#wind-gust-units').html('km/h');\n } else {\n $('#wind-gusts').html('none');\n $('#wind-gust-units').html('');\n }\n $('#wind-direction').html(getDirection(json.wind.deg));\n // The API uses unix UTC time for both sunrise and sunset, i.e., number of\n // seconds since 'the epoch', while the toLocaleTimeString() requires milliseconds\n $('#sunrise').html(new Date(json.sys.sunrise*1000).toLocaleTimeString());\n $('#sunset').html(new Date(json.sys.sunset*1000).toLocaleTimeString());\n\n if (json.weather[0].main === 'Rain' || json.weather[0].main === 'Drizzle') {\n setRain();\n } else if (json.weather[0].main === 'Snow') {\n setSnow();\n } else if (json.weather[0].main === 'Clear') {\n setSunny();\n } else if (json.weather[0].main === 'Thunderstorm') {\n setStorm();\n }\n });\n}", "function sendRequest(url) {\n $.get( url, function adweather (data) {\n\n var weather = {};\n weather.date = data.current_observation.local_time_rfc822;\n weather.loc = data.current_observation.display_location.full;\n weather.temp = data.current_observation.temp_f;\n weather.icon = data.current_observation.icon;\n weather.description = data.current_observation.weather;\n weather.humidity = data.current_observation.relative_humidity;\n weather.pressure = data.current_observation.pressure_mb + \" Millibar\";\n weather.windSpeed = data.current_observation.wind_mph + \" MPH\";\n weather.windDirection = data.current_observation.wind_dir;\n weather.visibility = data.current_observation.visibility_mi + \"mi\";\n weather.uv = data.current_observation.UV;\n weather.feelslike = data.current_observation.feelslike_f ;\n weather.dewpoint = data.current_observation.dewpoint_f;\n weather.day1 = data.forecast.simpleforecast.forecastday[1].date.weekday;\n weather.day2 = data.forecast.simpleforecast.forecastday[2].date.weekday;\n weather.day3 = data.forecast.simpleforecast.forecastday[3].date.weekday;\n weather.day4 = data.forecast.simpleforecast.forecastday[4].date.weekday;\n weather.day5 = data.forecast.simpleforecast.forecastday[5].date.weekday;\n weather.date1 = data.forecast.simpleforecast.forecastday[1].date.day + \"/\" + data.forecast.simpleforecast.forecastday[1].date.month + \"/\" + data.forecast.simpleforecast.forecastday[1].date.year;\n weather.date2 = data.forecast.simpleforecast.forecastday[2].date.day + \"/\" + data.forecast.simpleforecast.forecastday[2].date.month + \"/\" + data.forecast.simpleforecast.forecastday[2].date.year;\n weather.date3 = data.forecast.simpleforecast.forecastday[3].date.day + \"/\" + data.forecast.simpleforecast.forecastday[3].date.month + \"/\" + data.forecast.simpleforecast.forecastday[3].date.year;\n weather.date4 = data.forecast.simpleforecast.forecastday[4].date.day + \"/\" + data.forecast.simpleforecast.forecastday[4].date.month + \"/\" + data.forecast.simpleforecast.forecastday[4].date.year;\n weather.date5 = data.forecast.simpleforecast.forecastday[5].date.day + \"/\" + data.forecast.simpleforecast.forecastday[5].date.month + \"/\" + data.forecast.simpleforecast.forecastday[5].date.year;\n weather.icon1 = data.forecast.simpleforecast.forecastday[1].icon;\n weather.icon2 = data.forecast.simpleforecast.forecastday[2].icon;\n weather.icon3 = data.forecast.simpleforecast.forecastday[3].icon;\n weather.icon4 = data.forecast.simpleforecast.forecastday[4].icon;\n weather.icon5 = data.forecast.simpleforecast.forecastday[5].icon;\n weather.condi1 = data.forecast.simpleforecast.forecastday[1].conditions;\n weather.condi2 = data.forecast.simpleforecast.forecastday[2].conditions;\n weather.condi3 = data.forecast.simpleforecast.forecastday[3].conditions;\n weather.condi4 = data.forecast.simpleforecast.forecastday[4].conditions;\n weather.condi5 = data.forecast.simpleforecast.forecastday[5].conditions;\n weather.low1 = data.forecast.simpleforecast.forecastday[1].low.fahrenheit;\n weather.low2 = data.forecast.simpleforecast.forecastday[2].low.fahrenheit;\n weather.low3 = data.forecast.simpleforecast.forecastday[3].low.fahrenheit;\n weather.low4 = data.forecast.simpleforecast.forecastday[4].low.fahrenheit;\n weather.low5 = data.forecast.simpleforecast.forecastday[5].low.fahrenheit;\n weather.high1 = data.forecast.simpleforecast.forecastday[1].high.fahrenheit;\n weather.high2 = data.forecast.simpleforecast.forecastday[2].high.fahrenheit;\n weather.high3 = data.forecast.simpleforecast.forecastday[3].high.fahrenheit;\n weather.high4 = data.forecast.simpleforecast.forecastday[4].high.fahrenheit;\n weather.high5 = data.forecast.simpleforecast.forecastday[5].high.fahrenheit;\n\n update(weather);\n });\n }", "function getForecastWeather(lat,lon){\n \n var forecastKey = 'a2b4c3401daabb98bf05eae4890ac57c'\n var forecastWeatherUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&units=imperial&exclude=minutely&appid=${forecastKey}`\n fetch(forecastWeatherUrl)\n .then(function(response){\n response.json().then(function(weather){\n getHourlyData(weather)\n\n })\n })\n}", "function getOpenWeather(cityQuery) {\n // var cityQuery = document.getElementById(\"#city-name\");\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${cityQuery}&appid=${owApiKey}`;\n fetch(apiUrl)\n .then(res => res.json())\n .then(data => {\n console.log(data);\n $(\"#current-weather\").empty();\n $(\"#error-message\").empty();\n let mainCard = $(\"<div>\").addClass(\"col-11 main-card card border-dark mb-3 card-body text-dark\");\n let title = $(\"<h3>\").addClass(\"card-title\").text(`${data.name}`);\n let icon = $(\"<img>\").attr(\"src\", `http://openweathermap.org/img/w/${data.weather[0].icon}.png`).addClass(\"forecast-icon\");\n let date = $(\"<p>\").addClass(\"card-text\").text(` (${new Date().toLocaleString().split(\",\")[0]}) `);\n let temp = $(\"<p>\").addClass(\"card-text\").text(`Temp: ${data.main.temp}\\xB0F`);\n let wind = $(\"<p>\").addClass(\"card-text\").text(`Wind Speed: ${data.wind.speed} mph`);\n let humidity = $(\"<p>\").addClass(\"card-text\").text(`Humidity: ${data.main.humidity}`);\n \n title.append(date, icon);\n mainCard.append(title, temp, wind, humidity);\n \n $(\"#current-weather\").append(mainCard);\n \n // uv info\n let lat = data.coord.lat;\n let lon = data.coord.lon;\n getUvi(lat, lon);\n getFiveDay(cityQuery);\n })\n .catch((error) => {\n $(\"#search-history\").empty(); \n \n let errorMessage = $(\"<p>\").addClass(\"error-mssg\").text(\"That city name isn't valid, queen.\");\n \n $(\"#error-message\").append(errorMessage);\n });\n }", "function findWeather() {\n url_old = \"https://api.darksky.net/forecast/d5d98e87f7b5cfc3cacc4f0539238087/\"+lat+\",\"+lon+\"?exclude=minutely,hourly,alerts,flags\";\n url = \"https://api.pirateweather.net/forecast/rcmjZwdspRKfOFmX/\"+lat+\",\"+lon\n // Dark Sky\n $.ajax({\n url: url,\n dataType: \"json\",\n success: function (pdata) {\n temp = pdata.currently.temperature;\n temp = Math.round(temp);\n \n min = pdata.daily.data[0].temperatureMin; // total low\n min = Math.round(min);\n mintime = pdata.daily.data[0].temperatureMinTime;\n\n hi = pdata.daily.data[0].temperatureHigh;\n hi = Math.round(hi);\n\n lo = pdata.daily.data[0].temperatureLow; // low for night\n lo = Math.round(lo);\n\n //OLD\n // lo = pdata.daily.data[1].temperatureLow; // low for next day..\n // lo = Math.round(lo);\n\n hitime = pdata.daily.data[0].temperatureHighTime;\n \n var buffer = 3600; // 1 hr in secs\n buffer = 4 * buffer; // 4 hour buffer before hi time\n hitime = hitime - buffer;\n console.log(hitime);\n if (curtime < hitime){lo = min;} // show lowest of two\n \n\n condition = pdata.currently.summary;//Condition\n \n console.log(pdata)\n \n var temp2 = temp + \"&deg;\";\n var hi2 = hi + \"&deg;\";\n var lo2 = lo + \"&deg;\";\n $('#temp span').html(temp2); // temp\n $('#hi span').html(hi2); // temp\n $('#lo span').html(lo2); // temp\n $('#content strong#a1').html(\"&#x2192;\"); // a1\n $('#content strong#a2').html(\"&#x2193;\"); // a2\n $('#condition').html(condition); // condition \n \n // $('#temp').css('font-size', temp); // temp\n \n }\n });\t\n \n}", "function getLocalWeather() {\n navigator.geolocation.getCurrentPosition(showPosition);\n}", "function getWeather(){\r\n let api = `http://api.openweathermap.org/data/2.5/forecast?q=hanoi&appid=${key}`;\r\n\r\n fetch(api)\r\n .then(function(response){\r\n let data = response.json();\r\n return data;\r\n })\r\n .then(function(data){\r\n weather.temperature.value[0] = Math.floor(data.list[6].main.temp - KELVIN);\r\n weather.temperature.value[1] = Math.floor(data.list[12].main.temp - KELVIN);\r\n weather.temperature.value[2] = Math.floor(data.list[18].main.temp - KELVIN);\r\n weather.temperature.value[3] = Math.floor(data.list[24].main.temp - KELVIN);\r\n weather.temperature.value[4] = Math.floor(data.list[30].main.temp - KELVIN);\r\n\r\n weather.description[0] = data.list[6].weather[0].description;\r\n weather.description[1] = data.list[12].weather[0].description;\r\n weather.description[2] = data.list[18].weather[0].description;\r\n weather.description[3] = data.list[24].weather[0].description;\r\n weather.description[4] = data.list[30].weather[0].description;\r\n\r\n weather.iconId[0] = data.list[6].weather[0].icon;\r\n weather.iconId[1] = data.list[12].weather[0].icon;\r\n weather.iconId[2] = data.list[18].weather[0].icon;\r\n weather.iconId[3] = data.list[24].weather[0].icon;\r\n weather.iconId[4] = data.list[30].weather[0].icon;\r\n \r\n weather.time[0] = data.list[6].dt_txt;\r\n weather.time[1] = data.list[12].dt_txt;\r\n weather.time[2] = data.list[18].dt_txt;\r\n weather.time[3] = data.list[24].dt_txt;\r\n weather.time[4] = data.list[30].dt_txt;\r\n\r\n \r\n //Location\r\n weather.city = data.city.name;\r\n weather.country = data.city.country;\r\n })\r\n .then(function(){\r\n displayWeather();\r\n })\r\n}", "function getWeather(latitude,longitude){\n let fullApi = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${KEY}`\n \n fetch(fullApi)\n .then(function(response){\n let data = response.json();\n return data;\n })\n .then(function(data){\n weather.temperature.value = Math.floor(data.main.temp - KELVIN);\n weather.description = data.weather[0].description;\n weather.iconId = data.weather[0].icon;\n weather.city = data.name;\n weather.country = data.sys.country;\n })\n .then(function(){\n displayWeather();\n });\n \n\n}", "function getWeatherData() {\n\n var url = 'http://api.openweathermap.org/data/2.5/weather?lat=' + latitude + '&lon=' + // build query url.\n longitude + '&APPID=936e860c72edb8cb527707e7d59da1ea' +\n '&units=' + countryUnits + '&preventCache=' + new Date(); // build query url\n\n $.getJSON(url, null, function(json, textStatus) {\n\n console.log(\"weather info \" + JSON.stringify(json) + \"response Satus is \" + textStatus);\n processresponse(json);\n\n });\n }", "function currentWeather(city){\n // Build URL to get data from server (search by \"city\")\n var queryURL= \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&APPID=\" + APIKey;\n $.ajax({\n url:queryURL,\n method:\"GET\",\n }).then(function(response){\n\n // parse the response to display the current weather including the City name, the date, and weather icon. \n console.log(response);\n //Dta object from server side Api for icon property.\n var weathericon= response.weather[0].icon;\n var iconurl=\"https://openweathermap.org/img/wn/\"+weathericon +\"@2x.png\";\n \n // Format date\n var date=new Date(response.dt*1000).toLocaleDateString();\n \n //parse the response for name of city, concantenate date and icon\n $(currentCity).html(response.name +\"(\"+date+\")\" + \"<img src=\"+iconurl+\">\");\n \n // Display current temperature\n var tempF = (response.main.temp - 273.15) * 1.80 + 32;\n // Convert the temp to fahrenheit\n $(currentTemperature).html((tempF).toFixed(2)+\"&#8457\");\n // Display the Humidity\n $(currentHumidty).html(response.main.humidity+\"%\");\n \n //Display wind speed and convert to MPH\n var ws=response.wind.speed;\n var windsmph=(ws*2.237).toFixed(1);\n $(currentWSpeed).html(windsmph+\"MPH\");\n \n // Display UVIndex.\n //By Geographic coordinates method and using appid and coordinates as a parameter we are going build our uv query url inside the function below.\n UVIndex(response.coord.lon,response.coord.lat);\n forecast(response.id);\n if(response.cod==200){\n eCity=JSON.parse(localStorage.getItem(\"cityname\"));\n console.log(eCity);\n if (eCity==null){\n eCity=[];\n eCity.push(city.toUpperCase()\n );\n localStorage.setItem(\"cityname\",JSON.stringify(eCity));\n cityList(city);\n }\n else {\n if(find(city)>0){\n eCity.push(city.toUpperCase());\n localStorage.setItem(\"cityname\",JSON.stringify(eCity));\n cityList(city);\n }\n }\n }\n\n });\n}", "function wetter_ddorf() {\n\tfetch('https://api.openweathermap.org/data/2.5/forecast?lat=51.2254&lon=6.7763&cnt=17&lang=de&appid=Hier ein gültiger Schlüssel') \n\t.then(function(resp) { return resp.json() }) // Convert data to json\n\t.then(function(data) {\n\t\t\t$.each(data.list, function(index, val) {\n\t\t\t\tif (index == 0){\n\t\t\t\t\tvar run = 1;\n\t\t\t\t\twetter_ausgeben(val, run);\n\t\t\t\t\t}\n\t\t\t\tif (index == 8){\n\t\t\t\t\tvar run = 2;\n\t\t\t\t\twetter_ausgeben(val, run);\n\t\t\t\t\t}\n\t\t\t\tif (index == 16){\n\t\t\t\t\tvar run = 3;\n\t\t\t\t\twetter_ausgeben(val, run);\n\t\t\t\t\t}\n\t\t\t\t});\n\t});\n}", "function weatherFound(temp, city) {\n cb(null, {\n city: city,\n fahrenheit: Math.round(9 / 5 * (temp - 273) + 32),\n celsius: Math.round(temp - 273)\n });\n }", "async getWeather() {\n // Convert location to latitude and longitude using Google Maps geocoder\n const latLong = await this.getLatLong();\n const lat = latLong[0].geometry.location.lat();\n const lng = latLong[0].geometry.location.lng();\n\n // Get general weather API info for this location, including URLs for forecast, city name, etc.\n const weatherApiInfo = await (\n await fetch(`https://api.weather.gov/points/${lat},${lng}`)\n ).json();\n const forecastCity =\n weatherApiInfo.properties.relativeLocation.properties.city;\n const forecastState =\n weatherApiInfo.properties.relativeLocation.properties.state;\n\n // Get list of all weather stations in the area. Use the first station in the list.\n const observationStations = await (\n await fetch(weatherApiInfo.properties.observationStations)\n ).json();\n const weatherStation = observationStations.features[0].properties.name;\n\n // Get the current conditions\n const currentConditions = await (\n await fetch(\n `https://api.weather.gov/stations/${observationStations.features[0].properties.stationIdentifier}/observations/latest?require_qc=false`\n )\n ).json();\n\n // Get daily (7-day) forecast\n const dailyForecast = await (\n await fetch(weatherApiInfo.properties.forecast)\n ).json();\n\n // Get hourly forecast\n const hourlyForecast = await (\n await fetch(weatherApiInfo.properties.forecastHourly)\n ).json();\n\n // Return all this info and let the other module parse it and convert it\n return {\n forecastCity: forecastCity,\n forecastState: forecastState,\n weatherStationLoc: weatherStation,\n currentConditions: currentConditions.properties,\n dailyForecast: dailyForecast.properties,\n hourlyForecast: hourlyForecast.properties,\n };\n }", "function getWeather(holdLat, holdLong){\n var holdSite= \"https://api.darksky.net/forecast/20b7fde308762cc3f03bac68dd67e36f/\" + holdLat + \",\" + holdLong;\n var holdSite2 = \"https://api.darksky.net/forecast/20b7fde308762cc3f03bac68dd67e36f/\" + holdLat + \",\" + holdLong + \"?units=si\";\n $.ajax({\n url:holdSite, \n dataType:\"jsonp\",\n success:function(result){\n $(\"#tempF\").text(result.currently.temperature + \"\\u00B0\" + \"F\");\n //weather condition\n $(\"#summary\").text(result.currently.summary);\n //create an animated weather icon\n var wIcon = new Skycons({\"color\":\"white\"});\n wIcon.add(\"weatherIcon\", result.currently.icon);\n wIcon.play();\n }\n });\n //created another api call for Celsius temperature\n $.ajax({\n url:holdSite2, \n dataType:\"jsonp\",\n success:function(res){\n document.getElementById(\"tempC\").textContent = res.currently.temperature + \"\\u00B0\" + \"C\";\n }\n })\n}", "function getWeather(city) {\n fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&APPID=${apiKey}`)\n .then(response => {\n return response.json();\n })\n .then(data => {\n $(\".date\").text(data.name + \" \" + date);\n latitude = data.coord.lat;\n longitude = data.coord.lon;\n fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${latitude}&lon=${longitude}&units=imperial&appid=${apiKey}`)\n .then(response => {\n return response.json();\n })\n .then(data => {\n iconCode = data.current.weather[0].icon;\n const iconUrl = \"http://openweathermap.org/img/w/\" + iconCode + \".png\";\n let uvi = data.current.uvi;\n $(\"#icon\").attr('src', iconUrl);\n $(\".temp\").text('Temp: ' + data.current.temp + '°F');\n $(\".wind\").text('Wind: ' + data.current.wind_speed + ' MPH');\n $(\".humidity\").text('Humidity: ' + data.current.humidity + ' %');\n $(\".index\").text(uvi);\n $(\".fiveCast\").empty();\n uvConditions(uvi);\n fiveDayForecast(data);\n console.log(data);\n })\n })\n }", "function getWeather(latitude, longitude) {\n let api = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\n console.log(api)\n\n fetch(api)\n .then(function (response) {\n let data = response.json();\n return data;\n })\n .then(function (data) {\n weather.city = data.name; // City name\n weather.country = data.sys.country; // Country name\n weather.iconId = data.weather[0].icon; // Icon\n weather.temperature.value = Math.floor(data.main.temp - KELVIN); // Temp\n weather.description = data.weather[0].description; // Short description\n weather.sunrise = convertTime(data.sys.sunrise); // Sunrise\n weather.sunset = convertTime(data.sys.sunset); // Sunset\n weather.wind = Math.round(data.wind.speed); // Wind speed\n weather.gust = Math.round(data.wind.gust); // Gust speed\n weather.feels_like = Math.floor(data.main.feels_like - KELVIN); // Feels-like\n weather.humidity = data.main.humidity; // Humidity \n weather.temp_min = Math.floor(data.main.temp_min - KELVIN); // Temp_min\n weather.temp_max = Math.floor(data.main.temp_max - KELVIN); // Temp_max\n })\n .then(function () {\n displayBackground();\n displayWeather();\n });\n}", "function getWeatherForecast(strReason) {\n weather.fetchWeather2(strReason,\"getWeatherForcast\",\"app::index\");\n}", "function displayResults(weather) {\r\n\r\n //il valore può essere Clouds, Clear, etc...\r\n let apiMeteo = weather.weather[0].main;\r\n\r\n\r\n console.log(\"Il meteo è \" + apiMeteo)\r\n //Rimane così perché non pensavo funzionasse, e invece :)\r\n function lollino() {\r\n console.log(\"CIAO AMICO MIO\");\r\n apiMeteo = \"Atmosphere\"\r\n }\r\n \r\n //SE il valore di apiMeteo è Mist o Smoke o... ALLORA invoca la funziona, tanto l'icona è sempre la stessa\r\n switch(apiMeteo) {\r\n case \"Mist\":\r\n lollino()\r\n break;\r\n case \"Smoke\":\r\n lollino();\r\n break;\r\n case \"Haze\":\r\n lollino();\r\n break;\r\n case \"Dust\":\r\n lollino();\r\n break;\r\n case \"Fog\":\r\n lollino();\r\n break;\r\n case \"Sand\":\r\n lollino();\r\n break;\r\n case \"Ash\":\r\n lollino();\r\n break;\r\n case \"Squall\":\r\n lollino();\r\n break;\r\n case \"Tornado\":\r\n lollino();\r\n break;\r\n \r\n }\r\n\r\n \r\n //icona posizione\r\n let iconPosition = document.querySelector(\"#icon-position\");\r\n iconPosition.textContent = \"room\";\r\n //nome città\r\n let city = document.querySelector(\"#nm-luogo\");\r\n city.textContent = `${weather.name}` //sostituisce il nome della città\r\n //temperatura\r\n let temperature = document.querySelector(\"#temperature\");\r\n let numberTemp = weather.main.temp;\r\n temperature.textContent = `${Math.round(numberTemp)}°c`;\r\n //icona del meteo ...\r\n let meteoIcon = document.querySelector(\".meteo-icon\");\r\n \r\n let imgUrl = apiMeteo.toLowerCase(); //trovo la cartella, avendo la lettera iniziale minuscola\r\n \r\n //giorno o notte?\r\n let dayornight = (weather.weather[0].icon).includes(\"n\"); //SE l'icona contiene la lettera 'n' che sta per notte [true], ALLORA è notte, ALTRIMENTI è giorno\r\n \r\n let isDay = \"-s\";\r\n let isNight = \"-m\";\r\n\r\n //funzione che restituisce -s se giorno, -m se notte (s = sun, m = moon)\r\n let dOrN = () => {\r\n\r\n if (dayornight == true) {\r\n return isNight\r\n } else {\r\n return isDay\r\n }\r\n \r\n };\r\n \r\n //prendi l'immagine in base al meteo\r\n meteoIcon.setAttribute(\"src\",`img/${imgUrl}/${imgUrl}${dOrN()}-b.png`);\r\n\r\n console.log(meteoIcon)\r\n //array con le frasi predefinite\r\n let frasiObj = {\r\n under10: \"Hey guarda! Un pinguino\",\r\n over10: \"Conviene portare il cappotto\",\r\n over20: \"Non fa freddo dai\",\r\n over25: \"Una t-shirt va più che bene\",\r\n over30: \"Fa caldo assai\",\r\n rainy: \"\\\"Fuori piove e...\\\"\",\r\n stayhome: \"Conviene restare a casa...\",\r\n snowy: \"Nevica 😍\",\r\n cloudy: \"Conviene portare l'ombrello\"\r\n }\r\n\r\n //cambia frase in base alla temperatura\r\n let frase = document.querySelector(\"#caption\");\r\n\r\n for(let i = 0; i <= numberTemp; i++) {\r\n if(i <= 10) {\r\n frase.textContent = frasiObj.under10;\r\n } else if (i < 17) {\r\n frase.textContent = frasiObj.over10;\r\n } else if(i < 24) {\r\n frase.textContent = frasiObj.over20; \r\n } else if(i < 29) {\r\n frase.textContent = frasiObj.over25;\r\n } else {\r\n frase.textContent = frasiObj.over30;\r\n }\r\n }\r\n\r\n //SE piove o nevica, cambia la frase\r\n let ifRain = meteoIcon.getAttribute(\"src\").toString();\r\n\r\n if(ifRain.includes(\"rain\")) {\r\n frase.textContent = frasiObj.rainy;\r\n } else if(ifRain.includes(\"snow\")) {\r\n frase.textContent = frasiObj.snowy;\r\n } else if(ifRain.includes(\"thunderstorm\")) {\r\n frase.textContent = frasiObj.stayhome;\r\n } else if(ifRain.includes(\"clouds\")) {\r\n frase.textContent = frasiObj.cloudy;\r\n }\r\n \r\n \r\n //informazioni aggiuntive: umidità, vento ...\r\n\r\n //umidità\r\n let humidityP = document.querySelector(\"#humidity\");\r\n humidityP.textContent = weather.main.humidity + \"%\";\r\n //vento\r\n let windP = document.querySelector(\"#wind\");\r\n windP.textContent = Math.round(weather.wind.speed) + \" km/h\";\r\n //nuvole (prova a contarle hihi)\r\n let cloudsP = document.querySelector(\"#clouds\");\r\n cloudsP.textContent = weather.clouds.all;\r\n\r\n\r\n //>>>>>>CHECKLIST\r\n//aggiungi le immagini ad ogni meteo --FATTO 2/06\r\n//cambia l'icona da geolocalizzata a posizione pin --FATTO 2/06\r\n//sistema i giorni successivi --> Mostra informazioni necessarie --FATTO 2/06, da aggiustare l'animazione\r\n//collega i dati aggiuntivi all'API\r\n\r\n} //fine funzione DisplayResults", "function Meteo(lattitude, longitude, MaDate) {\n\n fetch('http://api.openweathermap.org/data/2.5/forecast?lat=' + lattitude + '&lon=' + longitude + '&appid=7e39eceace89a2eabd5786d8248a25bd&units=metric')\n .then((res) => {\n return res.json();\n })\n .then((data) => {\n data.list.forEach(function (list_item) {\n if (list_item.dt_txt === MaDate + ' 18:00:00') {\n\t\t\t\t\tdocument.getElementById('weather_container').style.display = \"block\";\n document.getElementById('meteo').innerHTML = list_item.weather[0].main;\n document.getElementById('temp').innerHTML = list_item.main.temp + ' °C';\n document.getElementById('hum').innerHTML = list_item.main.humidity + ' %';\n }\n });\n });\n}", "function queryOpenWeather(thisPos) {\n  // getPosition();\n if(thisPos === undefined) {return;}\n  fetch(`${ENDPOINT}lat=${thisPos.coords.latitude}&lon=${thisPos.coords.longitude}&units=${UNITS}&APPID=${API_KEY}`)\n .then(function (response) {\n response.json()\n .then(function(data) {\n // We just want the current temperature\n var weather = {\n temperature: data[\"main\"][\"temp\"],\n conditions: data.weather[0].icon,\n name: data.name,\n }\n // console.log(JSON.stringify(weather));\n console.log(\"Sending updated weather\");\n localStorage.setItem(\"weather\", JSON.stringify(weather));\n // Send the weather data to the device\n returnWeatherData(weather);\n });\n })\n .catch(function (err) {\n console.log(\"Error fetching weather: \" + err);\n });\n}", "function searchWeather(lattitude, longitude){\n \n url = baseUrl + lattitude + longitude + apiKey;\n\n fetch(url)\n .then(function (response){\n return response.json();\n })\n .then(function (data){\n // console.log(data);\n // console.log(data.timezone);\n // console.log(data.current.weather[0].icon);\n // console.log(data.current.temp);\n // console.log(data.current.wind_speed);\n // console.log(data.current.humidity);\n // console.log(data.current.uvi);\n var weather = {\n cityName: data.timezone,\n cityCastIcon: data.current.weather[0].icon,\n cityTemp: data.current.temp,\n cityWind: data.current.wind_speed,\n cityHum: data.current.humidity,\n cityUvi: data.current.uvi,\n }\n weathers.push(weather);\n displayWeather(data);\n displayForecast(data);\n \n })\n \n}", "function getWeather(prefix,message){\n\tnotCommande(prefix,message);\n\tif(message.content.startsWith(prefix + \"getWeather\")){\n\t\tvar args = message.content.split(\" \");\n\t\tvar WeatherCities = [];\n\n\t\tfor(var i=1;i < args.length;i++){\n \t\tWeatherCities[i-1] = args[i];\n \t}\n \tapp.Weather(WeatherCities,function(resultat){\n \t\tmessage.channel.sendMessage(resultat);\n \t})\n\t}\n}", "function getCurrentWeather(){\r\n\r\n var curw = $(\"#w__current\");\r\n var url = \"http://api.openweathermap.org/data/2.5/find?q=\"+cfg.city+\"&units=metric&lang=ru&appid=\"+cfg.apikey;\r\n\r\n $.getJSON( url, function(data){\r\n\r\n // Icon\r\n var wicon = data.list[0].weather[0].id;\r\n var wicond = data.list[0].weather[0].description;\r\n curw.find(\".weather_icon\").html('<a title=\"'+wicond+'\"><i class=\"wi wi-owm-'+wicon+'\"></i></a>');\r\n\r\n // Wind icon\r\n var winddeg = data.list[0].wind.deg;\r\n var wwind = parseInt( ( winddeg < 180 ) ? winddeg + 180 : winddeg - 180 );\r\n curw.find(\".weather_wind\").html('<i class=\"wi wi-wind towards-'+wwind+'-deg\"></i>');\r\n\r\n // Wind speed\r\n var wwinds = data.list[0].wind.speed;\r\n curw.find(\".weather_ws\").html(wwinds+' м/с');\r\n\r\n // Temp\r\n var wtemp = Math.round(data.list[0].main.temp*10)/10;\r\n curw.find(\".weather_temp\").html(wtemp+'&deg;');\r\n\r\n // Pressure\r\n var wpres = parseInt(data.list[0].main.pressure/1.33322);\r\n curw.find(\".weather_pres\").html(wpres);\r\n\r\n // Humidity\r\n var whum = data.list[0].main.humidity;\r\n curw.find(\".weather_hum\").html(whum+' %');\r\n\r\n });\r\n\r\n}", "async clima(lat, lon) {\n try {\n // peticion http\n const instance = axios.create({\n baseURL: `https://api.openweathermap.org/data/2.5/weather`,\n params: { lat, lon, 'appid': process.env.OPENWEATHER_KEY, 'units': 'metric', 'lang': 'es' }\n });\n\n const resp = await instance.get();\n\n return {\n temp: resp.data.main.temp,\n min: resp.data.main.temp_min,\n max: resp.data.main.temp_max,\n desc: resp.data.weather[0].description\n }\n\n } catch (error) {\n return;\n }\n }", "function getWeather() {\n navigator.geolocation.getCurrentPosition(\n locationSuccess,\n locationError,\n {timeout: 15000, maximumAge: 60000}\n );\n}", "function init(){\n getWeatherData();\n}", "function searchCurrentWeather(city) {\n // \"https://api.openweathermap.org/data/2.5/weather?q={city name}&appid={your api key}\"\n var searchQueryURL =\n \"https://api.openweathermap.org/data/2.5/weather?q=\" +\n city +\n \"&appid=\" +\n apiKey;\n\n // Seach Current Weather\n $.ajax({\n url: searchQueryURL,\n method: \"GET\",\n }).then(function (response) {\n // Log the queryURL\n console.log(\"Search Query URL : \" + searchQueryURL);\n\n // Convert the temp to fahrenheit\n var tempF = (response.main.temp - 273.15) * 1.8 + 32;\n\n // Convert Kelvin to celsius : 0K − 273.15 = -273.1°C\n var tempC = response.main.temp - 273.15;\n\n var currentDate = new Date().toLocaleDateString();\n\n var latitude = response.coord.lat;\n var longitude = response.coord.lon;\n\n //UV API url\n var uvQueryURL =\n \"https://api.openweathermap.org/data/2.5/uvi?lat=\" +\n latitude +\n \"&lon=\" +\n longitude +\n \"&appid=\" +\n apiKey;\n\n var cityId = response.id;\n\n // Forecast url\n var forecastQueryURL =\n \"https://api.openweathermap.org/data/2.5/forecast?id=\" +\n cityId +\n \"&units=imperial&appid=\" +\n apiKey;\n\n $(\"#city-card\").show();\n\n $(\"#temperature\").text(\n \"Temperature : \" + tempF.toFixed(2) + \" °F/ \" + tempC.toFixed(2) + \"°C\"\n );\n $(\"#humidity\").text(\"Humidity : \" + response.main.humidity + \" %\");\n $(\"#wind-speed\").text(\"Wind Speed : \" + response.wind.speed + \" MPH\");\n\n var imageIcon = $(\"<img>\").attr(\n \"src\",\n \"https://openweathermap.org/img/wn/\" +\n response.weather[0].icon.toString() +\n \".png\"\n );\n\n $(\"#city-name\")\n .text(response.name + \" (\" + currentDate + \") \")\n .append(imageIcon);\n\n getUVIndex(uvQueryURL);\n\n showForecast(forecastQueryURL);\n });\n}", "function requestWeather(city) {\n let url = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=945a9a893fd4cd306992b37a55652fe2&units=metric`;\n let request = new XMLHttpRequest();\n request.open(\"GET\", url);\n request.responseType = \"json\";\n request.send();\n\n request.onload = function () {\n if (request.readyState === XMLHttpRequest.DONE) {\n if (request.status === 200) {\n let response = request.response;\n document.querySelector(\"#ville\").textContent = response.name;\n document.querySelector(\"#temperature_label\").textContent =\n response.main.temp;\n } else {\n alert(\"Nous rencontrons une erreur veuillez reessayer ultérieurement\");\n }\n }\n };\n}", "function getWeather(){\n const APIkey = '042dddf3fcb6c45c88287e33ed68f139';\n const city = 'merrimac';\n const hardCode = 'api.openweathermap.org/data/2.5/weather?q=merrimac&appid=042dddf3fcb6c45c88287e33ed68f139';\n\n const weatherData = fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${APIkey}`)\n .then(response => response.json())\n .then(data => {\n console.log(data);\n\n let tempKelvin = data.main.temp;\n let temp = kelvinToFahrenheit(tempKelvin);\n document.getElementById(\"temp\").innerText = temp + \"º\";\n\n let weatherName = data.weather[0].main;\n let weatherID = data.weather[0].id;\n let weatherDesc = data.weather[0].description;\n console.log(weatherID, weatherName);\n selectWeatherIcon(weatherID, weatherName); \n });\n\n}", "function getWeather(data){\n var api_key = '6996386e46f031703c26cea51cac9e6e';\n var url = `https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?units=imperial&APPID=${api_key}&${data}`;\n\n fetch(url).then(response => response.json()).then(json_response => displayWeather(json_response));\n}", "function forecast(cityText) {\n var unit = \"&units=imperial\"\n var key = \"cedb9c57ccdd0a6a3213271aa94438a7\"\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + cityText + unit + \"&appid=\" + key;\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n var link = \"https://openweathermap.org/img/wn/\" + response.weather[0].icon + \"@2x.png\"\n $(`#forecast`).html(`\n <h2>${ response.name }</h2>\n `)\n var now = moment();\n $(\"#currentDay\").text(now.format('l'))\n $(\"#forecastIcon\").attr(\"src\",link);\n $(`#temp`).html(`\n <p>Temperature: ${ response.main.temp } <sup>o</sup>F</p>\n `)\n\n $(`#humidity`).html(`\n <p>Humidity: ${ response.main.humidity }%</p>\n `)\n \n $(`#wind`).html(`\n <p>Wind Speed: ${ response.wind.speed } MPH</p>\n `)\n \n var lon= $( response.coord.lon)\n \n var lat= $( response.coord.lat )\n var uvURL = \"https://api.openweathermap.org/data/2.5/uvi?appid=\" + key + \"&lat=\" + lat[0] + \"&lon=\" + lon[0];\n // alert(uvURL)\n $.ajax({\n url: uvURL,\n method: \"GET\"\n }).then(function(responseUV) {\n var index = $( responseUV.value )[0]\n uvColor (index)\n }); \n });\n fiveDayForecast(cityText)\n }", "function getWeather(latitude , longitude){\n let api =`http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\n //console.log(api);\n fetch(api)\n .then(function(response){\n let data = response.json();\n return data;\n })\n .then(function(data){\n weather.temperature.value = Math.floor(data.main.temp -kelvin);\n weather.descripition = data.weather[0].descripition;\n weather.iconId = data.weather[0].icon;\n weather.city = data.name;\n weather.country = data.sys.country;\n })\n .then(function(){\n displayWeather();\n })\n}", "function getWeather(latitude, longitude) {\n var apiurl =\n \"https://fcc-weather-api.glitch.me/api/current?lat=\" +\n latitude +\n \"&lon=\" +\n longitude;\n /* Get the JSON and get the location, icon, weather type, and max, min, and current temperatures */\n $.getJSON(apiurl, function(json) {\n degrees = Math.ceil(json.main.temp);\n weathertype = json.weather[0].main;\n checkWeatherType(weathertype);\n $(\".location-section\").html(json.name);\n $(\".weathericon\").html('<img src=\"' + json.weather[0].icon + '\">');\n $(\".weathertype\").html(weathertype);\n $(\".temp_max\").html(json.main.temp_max + \"&deg;\");\n $(\".temp_min\").html(json.main.temp_min + \"&deg;\");\n $(\".degrees\").html(degrees + \"&deg;\");\n });\n }", "function getWeather(woeid) {\n fetch(`https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/${woeid}/`)\n .then(result => {\n // console.log(result);\n return result.json();\n })\n .then(data => {\n // console.log(data);\n const today = data.consolidated_weather[0];\n console.log(`Temperatures today in ${data.title} stay between ${today.min_temp} and ${today.max_temp}.`);\n })\n .catch(error => console.log(error));\n}", "async function getWeatherData() {\n getLocation();\n const URL = `http://api.openweathermap.org/data/2.5/weather?lat=${LAT}&lon=${LON}&appid=${API_KEY}`;\n const apiRES = await fetch(URL).then((res) => res.json());\n setActualTemperature(Math.ceil(apiRES.main.temp - 273.15));\n setWeatherDescription(apiRES.weather[0].description);\n setWeatherLocation(apiRES.name);\n const iconURL = `http://openweathermap.org/img/wn/${apiRES.weather[0].icon}.png`;\n setWeatherIcon(iconURL);\n }", "function getWeather() {\n weather\n .getWeather()\n .then((results) => {\n // console.log(results);\n ui.paint(results);\n })\n .catch((err) => console.log(err));\n}", "getWeather(){\n\n\t\t// Construct the API url to call\n\t\tlet url = 'https://api.openweathermap.org/data/2.5/weather?lat=' + this.state.latitude + '&lon=' + this.state.longitude + '&units=metric&appid=ce0cb4b99e8ee814c20a4f76609c8196';\n\t\t// console.log(url);\n\n\t\t// Call the API, and set the state of the weather forecast\n\t\tfetch(url)\n\t\t.then(response => response.json())\n\t\t.then(data => {\n\t\t\tconsole.log(data);\n\t\t\t// let tempData = JSON.stringify(data);\n\t\t\t\t// console.log(tempData);\n\t\t\t// alert(tempData);\n\t\t\tthis.processData(data);\n\t\t})\n\t\t.catch(function(error){\n\t\t\tconsole.log(error.message);\n\t\t\tthrow error.message;\n\t\t });\n\n\t\t// this.getForecast();\n\t}", "function recevoirTemperature(){\n const url = `https://api.openweathermap.org/data/2.5/weather?q=${villeChoisie}&appid=d99897bcbb91f8c4224052c9f6e9db33&units=metric`\n \n /*\n let request = new XMLHttpRequest();\n request.open('GET', url);\n request.responseType = 'json';\n request.send();\n\n request.onload = function() {\n if(request.readyState === XMLHttpRequest.DONE){\n if(request.status === 200){\n var reponse = request.response;\n let temperature = reponse.main.temp;\n let ville = reponse.name;\n\n document.querySelector('#temperature_label').textContent = temperature;\n document.querySelector('#ville').textContent = ville;\n }\n else{\n alert('un probleme est survenu, revenez plus tard.')\n }\n }\n }*/\n\n $.ajax({\n url: url,\n type: 'GET',\n dataType: 'json',\n success: (data) => {\n //console.log(data);\n $('#temperature_label').text(data.main.temp)\n $('#ville').text(data.name)\n },\n error: () => {\n alert('Un probleme est survenu, revenez plus tard.')\n }\n })\n\n\n}", "function updateWeather() {\n\t\tconsole.log('updating weather data...')\n\t\tgetLocation();\n\t}", "function dreamCityWeather(dreamplace){\n $(\"#newdiv1\").empty();\n var queryUrl = `https://cors-anywhere.herokuapp.com/https://api.openweathermap.org/data/2.5/weather?q=${dreamplace}&APPID={API key Require}`;\n dreamCityCall(queryUrl);\n }", "function getWeather(country) {\n // distracting key names from oneCity object to use \n const { lat, lon, display_name } = country;\n fetch(\n `${BASE_URL}/onecall?lat=${lat}&lon=${lon}&exclude=current&cnt=4&appid=${API_KEY}&units=metric&lang=en`\n )\n .then((res) => res.json())\n .then((data) => {\n // assign data for hourly, daily weather forecast\n setWeather({\n current: {\n ...normalizeWeatherData(data.hourly[0]),\n city: display_name.split(',')[0],\n },\n hourly: data.hourly.map((w) => normalizeWeatherData(w)),\n daily: data.daily.map((w) => normalizeWeatherData(w)),\n timeZone: data.timezone \n \n });\n setSearchBar(false);\n timeZone = data.timezone\n });\n }", "function getTheWeather(lat, long){\n\t\t\t$.get(\"http://api.openweathermap.org/data/2.5/forecast/daily\", {\n\t\t\tAPPID: \"fc9caa5abb6e3d03dc633c94d2b4d08a\",\n\t\t\t// q: \"San Antonio, TX\",\n\t\t\tlat: lat,\n\t\t\tlon: long,\n\t\t\tunits: \"imperial\",\n\t\t\tcnt: \"3\"\n\t\t}).done(function(data, status){\n\t\t\tconsole.log(data);\n\t\t\tsatxWeather(data);\n\t\t});\n\t}", "function dataWeather(response) {\n console.log(response.data);\n //for city\n let htmlCityValue = response.data.name;\n let htmlCity = document.querySelector(\"#city\");\n htmlCity.innerHTML = htmlCityValue;\n //degree\n let tempRound = Math.round(response.data.main.temp);\n let tempChange = document.querySelector(\"#degree-today\");\n tempChange.innerHTML = tempRound;\n //humidity\n let humRound = Math.round(response.data.main.humidity);\n let humChange = document.querySelector(\"#humidity\");\n humChange.innerHTML = `Humidity ${humRound} %`;\n //windspeed\n let windRound = response.data.wind.speed;\n let windChange = document.querySelector(\"#wind-speed\");\n windChange.innerHTML = `Wind speed ${windRound} m/s`;\n}", "function getWeather(request, response) {\n const url = `https://api.darksky.net/forecast/${process.env.WEATHER_API_KEY}/${request.query.data.latitude},${request.query.data.longitude}`;\n\n superagent.get(url)\n .then( data => {\n const weatherSummaries = data.body.daily.data.map(day => new Weather(day));\n response.status(200).send(weatherSummaries);\n })\n .catch( error => {\n errorHandler('So sorry, something went really wrong', request, response);\n });\n\n}", "function uvIndex(lat, lon) {\n var requestOptions = {\n method: 'GET',\n redirect: 'follow'\n };\n fetch(\"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&appid=de6cda6ee489e5192ad8edc5d0f21166&units=imperial\", requestOptions)\n .then(response => response.text())\n .then(result => {\n updateForecastDisplay(result)\n uvColors(result)\n })\n .catch(error => console.log('error', error));\n}", "function updateWeather(lat, lng)\n{\t\n\tif(PlatformOS === 'android')\n\t{\n\t\tindicator.message = '讀取天氣資訊中';\n\t}\n\tindicator.show();\n\tvar xhr = Titanium.Network.createHTTPClient();\n\txhr.onload = function()\n\t{\n\t\tindicator.hide();\n\t\tvar data = JSON.parse(this.responseText).data;\n\t\tvar condition = data.current_condition[0].weatherDesc[0].value;\n\t\tvar temp_f = data.current_condition[0].temp_F;\n\t\tvar temp_c = data.current_condition[0].temp_C;\n\t\tvar icon = data.current_condition[0].weatherIconUrl[0].value;\n\t\tvar humidity = data.current_condition[0].humidity;\n\t\tvar tempUnit = Titanium.App.Properties.getString('tempUnit', 'c');\n\t\tif(tempUnit === 'c')\n\t\t{\n\t\t\ttemperatureLabel.text = temp_c + '°C';\n\t\t\tif(PlatformOS === 'iphone' || PlatformOS === 'ipad')\n\t\t\t{\n\t\t\t\tTitanium.UI.iPhone.appBadge = temp_c;\n\t\t\t}\n\t\t}else if(tempUnit === 'f')\n\t\t{\n\t\t\ttemperatureLabel.text = temp_f + '°F';\n\t\t\tif(PlatformOS === 'iphone' || PlatformOS === 'ipad')\n\t\t\t{\n\t\t\t\tTitanium.UI.iPhone.appBadge = temp_f;\n\t\t\t}\n\t\t}\n\t\tweatherIcon.image = icon;\n\t\tdetailLabel.text = condition + '\\n';\n\t\tdetailLabel.text += humidity + '\\n';\n\t};\n\tapi_key = 'x5rdbt7d466du33m3rngxs2c';\n\tvar url = 'http://api.worldweatheronline.com/free/v1/weather.ashx?key='+api_key+'&format=json&q='+lat+','+lng;\n\tTi.API.info(url);\n\txhr.open('GET', url);\n\txhr.send();\n}", "function loadWeather(location, woeid) {\r\n $.simpleWeather({\r\n location: location,\r\n woeid: woeid,\r\n unit: 'c',\r\n success: function (weather) {\r\n city = weather.city;\r\n temp = weather.temp + '&deg;';\r\n wcode = '<img class=\"weathericon\" src=\"images/weathericons/' + weather.code + '.svg\">';\r\n wind = '<p>' + weather.wind.speed + '<br></p<p>' + weather.units.speed + '</p>';\r\n humidity = weather.humidity + ' %';\r\n\r\n $(\".location\").text(city);\r\n $(\".temperature\").html(temp);\r\n $(\".climate_bg\").html(wcode);\r\n $(\".windspeed\").html(wind);\r\n $(\".humidity\").text(humidity);\r\n },\r\n error: function (error) {\r\n $(\".error\").html('<p>' + error + '</p>');\r\n }\r\n\r\n });\r\n\r\n}", "function updateWeather(){\n\tconsole.log(\"updating weather\");\n\trequest(\"http://api.openweathermap.org/data/2.5/weather?q=london&units=metric&id=524901&APPID=ada3e1a80c2b74631f4be3499369198b\", function(error, response, body) {\n\t\tweather = JSON.parse(body);\n\t});\n}", "function getData () {\n $.get(`https://nominatim.openstreetmap.org/?q=${cityName}&addressdetails=1&countrycodes=US&format=json&limit=1`, function(response){\n //seting the latitude of the city\n lat = response[0].lat;\n //setting the laongitute of the city\n long = response[0].lon;\n //clean up the city name\n cityName = `${cityName}, ${response[0].address.state}`\n }).then(function(){\n $.get(`https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${long}&\n exclude=hourly,daily&appid=${api}`, function(response){\n //create a current weather opject to send to the build function\n var currentWeather = {}\n //city name\n currentWeather.name = cityName\n //using moment to convert the unix timestap to human date\n currentWeather.date = moment.unix(response.current.dt).format('L');\n //format the icon url to hit the image source from OWM \n currentWeather.icon = `http://openweathermap.org/img/wn/${response.current.weather[0].icon}.png`\n //weather description, not used right now but could be fun\n currentWeather.desc = response.current.weather[0].description\n //current temp converted from K\n currentWeather.temp = (response.current.temp * (9/5) -459.67).toFixed(1);\n //humidity\n currentWeather.humidity = response.current.humidity;\n //wind speed\n currentWeather.wind = response.current.wind_speed;\n //uv index\n currentWeather.uvi = response.current.uvi;\n //send the current weather object to the build function\n buildCurrent(currentWeather)\n \n //setup fiveDay weather by popping off the last 2 peeps\n var fiveDayWeather = response.daily.slice(1,6)\n buildForcast(fiveDayWeather)\n })\n \n })\n \n }", "function getLocation(location) {\n\naxios.get(`https://www.metaweather.com/api/location/search/?query=${location}`)\n .then(function (response) {\n var woeid = response.data[0].woeid;\n getWeather(woeid);\n })\n .catch(function (error) {\n console.log(error);\n });\n\n}", "async function getWeather() {\n let city = document.querySelector('#city');\n let response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city.value.toString()}&appid=${weatherApiKey}&units=${tempUnit()}`, {mode: 'cors'});\n let weatherData = await response.json();\n let relevantWeatherData = {\n location: weatherData.name,\n temperature: weatherData.main.temp,\n weather: weatherData.weather[0].description\n }\n console.table(relevantWeatherData);\n await determineTempRange(weatherData.main.temp, body);\n\n location.textContent = weatherData.name;\n\n let rawTempData = weatherData.main.temp;\n temperature.textContent = round(Number(rawTempData), 1);\n appendCelsiusOrFarenheit();\n\n forecast.textContent = weatherData.weather[0].description;\n\n}", "function fetchWeather(latitude, longitude) {\n\tvar country, city, woeid, unit, status;\n\tfetchLocation(latitude, longitude, function (location) {\n\t\tcountry = location.countrycode;\n\t\tcity = location.city;\n\t\twoeid = location.woeid;\n\t\tconsole.log('Country: ' + country);\n\t\tconsole.log('City: ' + city);\n\t\tconsole.log('WOEID: ' + woeid);\n\t\t\n\t\t// Determine temperature units from country code (US gets F, everyone else gets C)\n\t\tif (country == 'US')\n\t\t\tunit = 'F';\n\t\telse\n\t\t\tunit = 'C';\n\t\tconsole.log('Unit: ' + unit);\n\t\t\n\t\t// Fetch the weather data\n\t\t// URL for getting basic weather forecast data in XML format (RSS)\n\t\tgetHttpResponse('http://weather.yahooapis.com/forecastrss?w=' + woeid + '&u=' + unit.toLowerCase(), function(weatherResponse) {\n\t\t\t// Successfully retrieved weather data\n\t\t\tvar curr_temp, curr_temp_str, sunrise, sunrise_str, sunset, sunset_str;\n\t\t\tvar curr_time, forecast_day, forecast_date, high, low, icon, condition;\n\t\t\tvar sun_rise_set;\n\n\t\t\tcurr_time = new Date();\n\n\t\t\t// Get current temperature\n\t\t\tcurr_temp_str = getXmlAttrVal(weatherResponse, 'yweather:condition', 'temp');\n\n\t\t\tif (curr_temp_str === '')\n\t\t\t\tcurr_temp = '';\n\t\t\telse\n\t\t\t\tcurr_temp = getXmlAttrVal(weatherResponse, 'yweather:condition', 'temp') + '\\u00B0' + unit;\n\n\t\t\tsun_rise_set = '';\n\n\t\t\t// Get Sunrise and Sunset times, which also dictate if Daymode is on or not\n\t\t\tsunrise_str = getXmlAttrVal(weatherResponse, 'yweather:astronomy', 'sunrise');\n\t\t\tsunset_str = getXmlAttrVal(weatherResponse, 'yweather:astronomy', 'sunset');\n\n\t\t\tif (sunrise_str !== '' && sunset_str !== '') {\n\t\t\t\tsunrise = parseTime(sunrise_str);\n\t\t\t\tsunset = parseTime(sunset_str);\n\t\t\t}\n\n\t\t\tif (curr_time.getHours() >= 18) {\n\t\t\t\t// Between 6pm and Midnight, show tomorrow's forecast\n\t\t\t\tforecast_day = 'Tomorrow';\n\t\t\t\tforecast_date = addDays(new Date(), 1);\n\t\t\t} else {\n\t\t\t\t// At all other times, show today's forecast\n\t\t\t\tforecast_day = 'Today';\n\t\t\t\tforecast_date = new Date();\n\t\t\t}\n\n\t\t\tvar reDate = new RegExp('\\\\sdate\\\\s*=\\\\s*\"([^\"]+)\"');\n\t\t\tvar reAttr = new RegExp('([^\\\\s=>\"]+)\\\\s*=\\\\s*\"([^\"]+)\"');\n\t\t\tvar forecasts = weatherResponse.match(/<yweather:forecast[^>]+>/img);\n\n\t\t\tvar fd, attrs, attr, dateAttr;\n\n\t\t\tlow = ''; high = ''; condition = ''; icon = 0;\n\n\t\t\t// Parse the forecast data out of the XML\n\t\t\tfor (var i = 0; i < forecasts.length; i++) {\n\t\t\t\tdateAttr = reDate.exec(forecasts[i]);\n\n\t\t\t\tif (dateAttr && dateAttr.length == 2) {\n\t\t\t\t\tfd = new Date(dateAttr[1]);\n\t\t\t\t\t// Find the forecast data for today/tomorrow\n\t\t\t\t\tif (fd.getDate() == forecast_date.getDate()) {\n\t\t\t\t\t\tattrs = forecasts[i].match(/[^\\s=>\"]+\\s*=\\s*\"[^\"]+\"/img);\n\t\t\t\t\t\tfor (var a = 0; a < attrs.length; a++) {\n\t\t\t\t\t\t\tattr = reAttr.exec(attrs[a]);\n\t\t\t\t\t\t\t// Get all the weather forecast attribute values\n\t\t\t\t\t\t\tif (attr && attr.length == 3) {\n\t\t\t\t\t\t\t\tif (attr[1].toLowerCase() == 'low' && attr[2] !== '')\n\t\t\t\t\t\t\t\t\tlow = attr[2] + '\\u00B0' + unit;\n\t\t\t\t\t\t\t\telse if (attr[1].toLowerCase() == 'high' && attr[2] !== '')\n\t\t\t\t\t\t\t\t\thigh = attr[2] + '\\u00B0' + unit;\n\t\t\t\t\t\t\t\telse if (attr[1].toLowerCase() == 'text' && attr[2] !== '')\n\t\t\t\t\t\t\t\t\tcondition = attr[2];\n\t\t\t\t\t\t\t\telse if (attr[1].toLowerCase() == 'code' && attr[2] !== '')\n\t\t\t\t\t\t\t\t\ticon = iconFromWeatherId(attr[2]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set the status display on the Pebble to the time of the weather update\n\t\t\tstatus = 'U:' + curr_time.getHours() + ':' +\n\t\t\t(curr_time.getMinutes() < 10 ? '0' : '') + curr_time.getMinutes();\n\n\t\t\tconsole.log('Current Temp: ' + curr_temp);\n\t\t\tconsole.log('Sunrise: ' + sunrise.getHours() + ':' + sunrise.getMinutes());\n\t\t\tconsole.log('Sunset: ' + sunset.getHours() + ':' + sunset.getMinutes());\n\t\t\tconsole.log('Forecast Day: ' + forecast_day);\n\t\t\tconsole.log('Forecast Date: ' + forecast_date);\n\t\t\tconsole.log('Low: ' + low);\n\t\t\tconsole.log('High: ' + high);\n\t\t\tconsole.log('Condition: ' + condition);\n\t\t\tconsole.log('Icon: ' + icon);\n\n\t\t\t// Send the data to the Pebble\n\t\t\tpebbleMessage = {\n\t\t\t\t\"status\": status,\n\t\t\t\t\"curr_temp\": curr_temp,\n\t\t\t\t\"forecast_day\": forecast_day,\n\t\t\t\t\"high_temp\": high,\n\t\t\t\t\"low_temp\": low,\n\t\t\t\t\"icon\": icon,\n\t\t\t\t\"condition\": condition.slice(0, 50),\n\t\t\t\t\"city\": city.slice(0, 50),\n\t\t\t\t\"sun_rise_hour\": sunrise.getHours(),\n\t\t\t\t\"sun_rise_min\": sunrise.getMinutes(),\n\t\t\t\t\"sun_set_hour\": sunset.getHours(),\n\t\t\t\t\"sun_set_min\": sunset.getMinutes()\n\t\t\t};\n\t\t\tPebble.sendAppMessage(pebbleMessage);\n\t\t}, function(err) {\n\t\t\tconsole.log(\"Error\");\n\t\t\tpebbleMessage = {\n\t\t\t\t\"status\": \"Err: \" + err,\n\t\t\t\t\"city\": city.slice(0, 50)\n\t\t\t};\n\t\t\tPebble.sendAppMessage(pebbleMessage);\n\t\t});\n\t});\n}", "function getWeather(latitude, longitude) {\n let api = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${API_KEY}`;\n fetch(api)\n .then((response) => response.json())\n .then((data) => {\n weather.iconId = data.weather[0].icon;\n weather.temperature.value = Math.round(data.main.temp - KELVIN);\n weather.desc = data.weather[0].description;\n weather.city = data.name;\n weather.country = data.sys.country;\n })\n .then(() => displayWeather());\n}", "function getCurrentWeather () {\n\n var key = \"2fd6a7c1addf009b30af95d20e54bde2\";\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + searchCity + \"&units=imperial&appid=\" + key;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n // console.log(response);\n currentWeatherObj = response\n currentWeatherIcon = currentWeatherObj.weather[0].icon;\n // console.log(currentWeatherIcon);\n displayCurrentWeather();\n cityLongited = currentWeatherObj.coord.lon;\n cityLatitude = currentWeatherObj.coord.lat;\n getUVIndex();\n\n\n });\n}", "function getData() {\n var APIkey = \"c19b2f1f085df13be7309df32599c301\";\n var queryURL = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&exclude=hourly,minutely,alerts&units=imperial&appid=\" + APIkey;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(\"--------------------\");\n console.log(\"current date is \" + response.current.dt);\n console.log(\"current temperature is \" + response.current.temp);\n console.log(\"current humidity is \" + response.current.humidity);\n console.log(\"current wind speed is \" + response.current.wind_speed);\n console.log(\"current uv index is \" + response.current.uvi);\n console.log(\"current weather icon is \" + response.current.weather[0].icon);\n console.log(\"--------------------\");\n\n dt = response.current.dt;\n temp = response.current.temp;\n hum = response.current.humidity;\n wind = response.current.wind_speed;\n uvi = response.current.uvi;\n icon = response.current.weather[0].icon;\n daily = response.daily;\n \n currentData(city, dt, temp, hum, wind, uvi, icon);\n forecastData(daily);\n }); \n}", "function getWeather() {\n // View the city & country in HTML-fil by calling Id\n $(\"#state\").text(currentRegion +\", \");\n $(\"#country\").text(currentCountry);\n \n //Geting weather data from https://api.openweathermap.org/data/2.5/weather? by JOSN-format\n $.getJSON( URL + 'lat=' + currentLat + '&lon=' + currentLong + '&units=metric&APPID=' + APIKey , function(WeatherData) {\n // Get city name form API\n $(\"#cityname\").text(WeatherData.name);\n // Present temperature with Celsius characters\n var ShowCelius = true;\n var temcelcius = Math.round(WeatherData.main.temp); // convert to Celsius numbers/temperature\n var tempfahrenheit = Math.round((temcelcius * 9/5) + 32); // convert to fahrenheit temperature\n\n // Switch between Celsius and Fahrenheit temperature\n // by default, Celsius is selected\n $(\"#temp\").html(temcelcius);\n $('#unit-switch').off('click');\n $('#unit-switch').on('click', function() {\n if (ShowCelius === false) {\n $(\"#temp\").html(temcelcius);\n ShowCelius = true;\n } else {\n $(\"#temp\").html(tempfahrenheit); \n ShowCelius = false;\n }\n $(\"#unit-toggle\").toggleClass(\"toggle\"); \n });\n \n // Show weather icon\n var prefix = \"wi wi-owm-\";\n var weatherIcons = WeatherData.weather[0].id;\n var icon = prefix + weatherIcons;\n $(\"#wparameter\").html(\"<i class='\" + icon + \"'></i>\"); \n $(\"#wdescription\").text(WeatherData.weather[0].description);\n });\n }", "function getWeather(cityCoord, cityName) { //Here we have the getWeather function, which has the parameter cityCoord and cityName\n\tvar latAndLng = cityCoord; \t\n\n\n\tvar forecastURL = \"https://api.forecast.io/forecast/131adda0fbf7c3e18253029a4c5bf664/\" + latAndLng; //we take the city coords and add it to the forecast url. \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //this is how we get all the weather info for that location. \n\n\t$.ajax({ //Here is the ajax call \n\t\turl: forecastURL,\n\t\tjsonpCallBack: 'jsonCallBack', \n\t\tcontentType: \"application/json\", \n\t\tdataType: 'jsonp',\n\t\tsuccess: function(json) { //when its a success \n\t\t\tconsole.log(json); \n\t\t\t$(\"#temp\").html(Math.round(json.currently.temperature)+ \"&#176;F\"); \n\t\t\t$(\"#summary\").html(json.currently.summary);\n\t\t\t$(\"#temp\").attr(\"data-icon\", icons[json.currently.icon]); \n\t\t\t$(\"#location\").html(cityName); \n\t\t\t$(\"#precip\").html(\"Chance for Precipitation: \" + (Math.round(100*(json.currently.precipProbability))) + \"%\"); \n\t\t\t$(\"#wind\").html(\"Wind Speed: \" + (Math.round(json.currently.windSpeed)) + \"mph\"); \n\t\t\t$(\"#dailysum\").html(\"Today: \" + json.hourly.summary); \n\t\t\t//The section above shows the current weather data being put into the html content tags. \n\t\t\tvar rainStart = null; //here we are implementing code to tell you the times of the day when it could rain. \n\t\t\tvar rainEnd = null; \n\t\t\tvar precip = null; \n\t\t\tfor (var i =0; i < 49; i++) { //this for loop finds the first hour in the next 48 hours when it will rain\n\t\t\t\tprecip = json.hourly.data[i].precipProbability; \n\t\t\t\tif (precip > 0.1) { \n\t\t\t\t\trainStart = new Date(json.hourly.data[i].time *1000);\n\t\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i = 0; i < 49; i++) { //this finds the last hour it will rain\n\t\t\t\tprecip = json.hourly.data[i].precipProbability;\n\t\t\t\tif (precip <= 0.1 && precip >= 0) { \n\t\t\t\t\trainEnd = new Date(json.hourly.data[i].time *1000); \n\t\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\t}\n\t\t\tif (rainStart != null && rainEnd == null) { //if we cant tell when the rain ends then we just say it starts at a certain time\n\t\t\t\t$(\"#time\").html(\"It will start raining at: \" + rainStart.toLocaleTimeString()); \n\n\t\t\t}\n\t\t\telse if (rainStart == null) { //if there is no rain start...\n\t\t\t\t$(\"#time\").html(\"It will not be raining anytime soon...\"); \n\t\t\t}\n\t\t\telse if (rainEnd == null) { //if there is no rain end...\n\t\t\t\t$(\"#time\").html(\"It will not stop raining anytime soon...\"); \n\n\t\t\t}\n\t\t\telse { //if it finds both rain start and rain end then it will rain from the start time to the end time. \n\t\t\t\t$(\"#time\").html(\"It will rain from: \" + rainStart.toLocaleTimeString() + \" to \" + rainEnd.toLocaleTimeString()); \n\t\t\t} \n\t\t\tvar button = [\"#1\",\"#2\",\"#3\",\"#4\",\"#5\",\"#6\",\"#7\",\"#8\"]; //here are some arrays for the weekly forecast feature. These are ids for the buttons\n\t\t\tvar pop = [\"#day1\",\"#day2\",\"#day3\",\"#day4\",\"#day5\",\"#day6\",\"#day7\",\"#day8\"] //these are the tags for the popup summary \n\t\t\tvar poptemp = [\"#t1\",\"#t2\",\"#t3\",\"#t4\",\"#t5\",\"#t6\",\"#t7\",\"#t8\"] //these are the tags for the popup temp \n\t\t\tvar thisDate = null; \n\t\t\tfor (var i = 1; i < 8; i++) { //it then goes through the next eight days of values matches them with each button. \n\t\t\t\tthisDate = new Date(json.daily.data[i].time*1000)\n\t\t\t\t$(button[i]).html(thisDate.toLocaleDateString()); \n\t\t\t\t$(pop[i]).html(json.daily.data[i].summary);\n\t\t\t\t$(poptemp[i]).html(\"High: \" + Math.round(json.daily.data[i].temperatureMax) + \"&#176;F and Low: \" + Math.round(json.daily.data[i].temperatureMin) + \"&#176;F\");\n\t\t\t\t$(poptemp[i]).attr(\"data-icon\", icons[json.daily.data[i].icon]); \n\t\t\t} \n\t\t},\n\t\terror: function(e) { //if theres an error then it displays a message. \n\t\t\tconsole.log(e.message); \n\t\t}\n\t}); \n}", "function giveWeatherFromApi(response) {\n let apiWeather = Math.round(response.data.main.temp);\n let todaysTemp = document.querySelector(\".todaysTemp\");\n let apiWeatherDescription = response.data.weather[0].description;\n let weatherType = document.querySelector(\".weatherType\");\n let humidity = document.querySelector(\"#humidity\");\n let apiHumidity = response.data.main.humidity;\n let wind = document.querySelector(\"#wind\");\n let apiWind = Math.round(response.data.wind.speed);\n\n let apiIconCode = response.data.weather[0].icon;\n let weatherIcon = document.querySelector(\".weatherIcon\");\n weatherIcon.setAttribute(\n \"src\",\n `https://openweathermap.org/img/wn/${apiIconCode}@2x.png`\n );\n\n if (apiWeather > -99) {\n todaysTemp.innerHTML = `${apiWeather}`;\n weatherType.innerHTML = `${apiWeatherDescription}`;\n humidity.innerHTML = `${apiHumidity}`;\n wind.innerHTML = `${apiWind}`;\n }\n\n fahrenheitTemp = Math.round(response.data.main.temp);\n\n getWeeklyForecast(response.data.coord);\n}", "fetchForecast()\n {\n var url = \"http://api.openweathermap.org/data/2.5/forecast?APPID=0cf17e23b1d108b29a4d738d2084baf5&q=\" + this.state.location + \"&units=\" + this.state.units;\n \n $.ajax({\n\t\t\turl: url,\n dataType: \"jsonp\",\n\t\t\tsuccess : this.parseResponse,\n\t\t\terror : function(req, err){ console.log('API call failed ' + err); }\n })\n\n \n }", "async getWeather() {\r\n const weatherRespone = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city}&appid=${this.apiKey}&units=metric`);\r\n const weather = await weatherRespone.json();\r\n\r\n return {\r\n weather\r\n };\r\n\r\n }", "async function getAllWeatherData() {\n let weatherData = await getLocationWeather(\n `https://api.openweathermap.org/data/2.5/weather?q=${input}&APPID=${API}`\n );\n\n try {\n // Extract data needed for fetching forecast data.\n let testLat = weatherData.coord.lat;\n let testLon = weatherData.coord.lon;\n\n let response = await fetch(\n `https://api.openweathermap.org/data/2.5/onecall?lat=${testLat}&lon=${testLon}&exclude=minutely,hourly&appid=${API}`\n );\n let forecastData = await response.json();\n\n handleForecastState(forecastData);\n } catch {\n alert('Getting forecast failed.');\n }\n }", "function updateWeather() {\n\t//log (\"updateWeather ()\");\n\t\n\tif (globalWeather == \"\") return;\n\tsuppressUpdates();\n\t\n\ttry\n\t{\n\t\tvar modTemp = 'f';\n\t\tvar modSpeed = 'mph';\n\t\tvar modDistance = 'mi';\n\t\tvar modPressure = 'in';\n\t\t\n\t\tunitTemp = \"F\";\n\t\tunitDistance = \"mi\";\n\t\tunitSpeed = \"mph\";\n\t\tunitPres = \"in\";\n\t\tunitMeasure = \"in\";\n\t\t\n\t\tif (preferences.unitsPref.value == 1) {\n\t\t\tmodTemp = 'c';\n\t\t\tmodSpeed = 'kph';\n\t\t\tmodDistance = 'km';\n\t\t\tmodPressure = 'mb';\n\t\t\t\n\t\t\tunitTemp = \"C\";\n\t\t\tunitDistance = \"km\";\n\t\t\tunitSpeed = \"km/h\";\n\t\t\tunitPres = \"mb\";\n\t\t\tunitMeasure = \"mm\";\n\t\t}\n\t\t\n\t\tvar xml = globalWeather;\n\t\tvar fetchedLocation = xml.evaluate(\"string(response/current_observation/display_location/full)\");\n\t\tvar fetchedCity = xml.evaluate(\"string(response/current_observation/display_location/city)\");\n\t\tpreferences.cityName.value = fetchedCity;\n\t\t\n\t var fetchedObservationTime = Math.round(xml.evaluate(\"string(response/current_observation/observation_epoch)\"));\n\t\tvar fetchedLocationTimeEpoch = Math.round(xml.evaluate(\"string(response/current_observation/local_epoch)\"));\n\t\tvar fetchedLocationTimeRfc822 = xml.evaluate(\"string(response/current_observation/local_time_rfc822)\");\n\t\t\n\t\tvar fetchedTemp = Math.round(xml.evaluate(\"string(response/current_observation/temp_\"+modTemp+\")\"));\n\t\tvar fetchedCode = xml.evaluate(\"string(response/current_observation/icon)\");\n\t\tvar fetchedCondPhrase = xml.evaluate(\"string(response/current_observation/weather)\");\n\t\t\n\t\tvar fetchedWindSpeedMph = xml.evaluate(\"string(response/current_observation/wind_mph)\");\n\t\tvar fetchedWindDir = xml.evaluate(\"string(response/current_observation/wind_dir)\");\n\t\tvar fetchedWindPoint = xml.evaluate(\"string(response/current_observation/wind_degrees)\");\n\t\tvar fetchedWindGustMph = xml.evaluate(\"string(response/current_observation/wind_gust_mph)\");\n\t\t\n\t\tvar fetchedWindSpeed = fetchedWindSpeedMph;\n\t\tvar fetchedWindGust = fetchedWindGustMph;\n\t\tif (preferences.unitsPref.value == 1) {\n\t\t\tfetchedWindSpeed = Math.round(milesToKm(fetchedWindSpeedMph));\n\t\t\tfetchedWindGust = Math.round(milesToKm(fetchedWindGustMph));\n\t\t}\n\t\t\n\t\tvar fetchedPrec = xml.evaluate(\"string(response/current_observation/precip_today_metric)\");\n\t\tvar fetchedHmid = xml.evaluate(\"string(response/current_observation/relative_humidity)\");\n\t\tvar fetchedVis = xml.evaluate(\"string(response/current_observation/visibility_\"+modDistance+\")\");\n\t\tvar fetchedPres = xml.evaluate(\"string(response/current_observation/pressure_\"+modPressure+\")\");\n\t\tvar fetchedDewPoint = Math.round(xml.evaluate(\"string(response/current_observation/dewpoint_\"+modTemp+\")\"));\n\t\t\n\t\tvar fetchedCurrentHour = xml.evaluate(\"string(response/moon_phase/current_time/hour)\");\n\t\tvar fetchedCurrentMinute = xml.evaluate(\"string(response/moon_phase/current_time/minute)\");\n\t\tvar fetchedSunsetHour = xml.evaluate(\"string(response/moon_phase/sunset/hour)\");\n\t\tvar fetchedSunsetMinute = xml.evaluate(\"string(response/moon_phase/sunset/minute)\");\n\t\tvar fetchedSunriseHour = xml.evaluate(\"string(response/moon_phase/sunrise/hour)\");\n\t\tvar fetchedSunriseMinute = xml.evaluate(\"string(response/moon_phase/sunrise/minute)\");\n\t\t\n\t\tvar fetchedForecastUrl = xml.evaluate(\"string(response/current_observation/forecast_url)\");\n\t\tweatherLink\t\t= fetchedForecastUrl == '' ? null : fetchedForecastUrl;\n\t\tforecastLink\t= weatherLink + '#conds_details_fct';\n\t\t\n\t\tif (fetchedTemp == null) fetchedTemp = \"\";\n\t\t\n\t\tvar localTime = new Date();\n\t\tvar localTimeTimezoneOffset = -localTime.getTimezoneOffset();\n\t\t\n\t\tobservationTime = new Date(fetchedObservationTime*1000);\n\t\t\n\t\tvar currentDatetime = new Date(localTime.getTime());\n\t\tcurrentDatetime.setHours(fetchedCurrentHour);\n\t\tcurrentDatetime.setMinutes(fetchedCurrentMinute);\n\t\t\n\t\tvar sunsetDatetime = new Date(localTime.getTime());\n\t\tsunsetDatetime.setHours(fetchedSunsetHour);\n\t\tsunsetDatetime.setMinutes(fetchedSunsetMinute);\n\t\t\n\t\tvar sunriseDatetime = new Date(localTime.getTime());\n\t\tsunriseDatetime.setHours(fetchedSunriseHour);\n\t\tsunriseDatetime.setMinutes(fetchedSunriseMinute);\n\t\t\n\t\t// Gets the time zone of the selected location\n\t\tvar fetchedLocationTimezoneHours = Number(fetchedLocationTimeRfc822.substr(-5,3));\n\t\tvar fetchedLocationTimezoneMinutes = Number(fetchedLocationTimeRfc822.substr(-2,2));\n\t\tfetchedLocationTimezoneOffset = fetchedLocationTimezoneHours * 60 + fetchedLocationTimezoneMinutes;\n\t\t\n\t\t//log(\"fetchedLocationTimeRfc822: \"+fetchedLocationTimeRfc822);\n\t\t//log(\"localTimeTimezoneOffset: \"+localTimeTimezoneOffset);\n\t\t//log(\"fetchedLocationTimezoneOffset: \"+fetchedLocationTimezoneOffset);\n\t\t\n\t\t// Calculates the offset between the local time and the time at the location\n\t\tlocalLocationTimeOffset = fetchedLocationTimezoneOffset - localTimeTimezoneOffset;\n\t\t\n\t\t//log(\"localLocationTimeOffset: \"+localLocationTimeOffset);\n\t\t\n\t\tvar dayTime = (currentDatetime.getTime() > sunriseDatetime.getTime() && currentDatetime.getTime() < sunsetDatetime.getTime()) ? 'day' : 'night';\n\t\t\n\t\tvar iconName = getWeatherIcon(fetchedCode, fetchedCondPhrase, dayTime);\n\t\t\n\t\tnewConditionLogText = '\\nMain: ' + fetchedCode + ': ' + fetchedCondPhrase + ' (' + iconName + '.png)';\n\t\tweather.src\t\t= \"Resources/WeatherIcons/\" + iconName + \".png\";\n\t\tweather.onClick = onClickWeather;\n\t\t\n\t\tif (fetchedTemp == \"N/A\") fetchedTemp = \"?\";\n\t\ttheTemp.data = fetchedTemp + \"°\";\n\t\ttheCity.data = theDate.data = theTime.data = \"\";\n\t\n\t\tif (preferences.showDate.value == 1 || preferences.showTime.value == 1) {\n\t\t\tupdateTime();\n\t\t}\n\t\t\n\t\tvar theCondition = \"\";\n\t\tvar theFeelsLike = \"\";\n\t\tvar theHigh = \"\";\n\t\tvar theLow = \"\";\n\t\tvar theDewPoint = \"\";\n\t\tvar theHumidity = \"\";\n\t\tvar visData = \"\";\n\t\tvar presChange = \"\";\n\t\tvar thePressure = \"\";\n\t\tvar windData = \"\";\n\t\n\t\tif ( fetchedCondPhrase == \"N/A\" ) {\n\t\t\ttheCondition = widget.getLocalizedString(\"weather.conditions.unknown\");\n\t\t} else {\n\t\t\ttheCondition = fetchedCondPhrase;\n\t\t}\n\t\n\t\t//if ( fetchedHmid == \"N/A\" ) {\n\t\t//\ttheHumidity = \"Humidity: Unknown\";\n\t\t//} else {\n\t\t//\ttheHumidity = \"Humidity: \" + fetchedHmid;\n\t\t//}\n\t\n\t\tif (fetchedVis == \"Unlimited\") {\n\t\t\tvisData = widget.getLocalizedString(\"weather.conditions.visibility.unlimited\");\n\t\t} else if (fetchedVis == \"N/A\") {\n\t\t\tvisData = widget.getLocalizedString(\"weather.conditions.visibility.unknown\");\n\t\t} else {\n\t\t\tvisData = widget.getLocalizedString(\"weather.conditions.visibility.absolute\") + \": \" + fetchedVis + \" \" + unitDistance;\n\t\t}\n\t\n\t\t//if ( fetchedPres == \"N/A\" ) {\n\t\t//\tthePressure = \"Pressure: Unknown\";\n\t\t//} else {\n\t\t//\tthePressure = \"Pressure: \" + fetchedPres + \" \" + unitPres;\n\t\t//}\n\t\t\n\t\t//if ( fetchedDewPoint == \"N/A\" ) {\n\t\t//\ttheDewPoint = \"Dewpoint: Unknown\";\n\t\t//} else {\n\t\t//\ttheDewPoint = \"Dewpoint: \" + fetchedDewPoint + \"°\" + unitTemp;\n\t\t//}\n\t\t\n\t\tif (fetchedWindDir.match(/calm/i)) {\n\t\t\twindData = widget.getLocalizedString(\"weather.conditions.winds.calm\");\n\t\t}\n\t\telse {\n\n\t\t\tif (fetchedWindDir.match(/var/i)) {\n\t\t\t\twindData = widget.getLocalizedString(\"weather.conditions.winds.variable\") + \" \";\n\t\t\t}\n\t\t\telse {\n\t\t\t var windDirNorth = 360/16;\n\t\t\t var windDirSpan = 360/8;\n\t\t\t var windDirCode;\n\t\t\t if (fetchedWindPoint < windDirNorth) windDirCode = 'N';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan) windDirCode = 'NE';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 2) windDirCode = 'E';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 3) windDirCode = 'SE';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 4) windDirCode = 'S';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 5) windDirCode = 'SW';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 6) windDirCode = 'W';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 7) windDirCode = 'NW';\n\t\t\t else windDirCode = 'N';\n\t\t\t windDirection = widget.getLocalizedString(\"weather.conditions.winds.directions.\" + windDirCode);\n\t\t\t\tlog(fetchedWindPoint + \"°/\" + fetchedWindDir + \" => \" + windDirCode + \" => \" + windDirection);\n windData = widget.getLocalizedString(\"weather.conditions.winds.wind_from\").replace(/%{direction}/, windDirection) + \" \";\n\t\t\t}\n\t\t\n\t\t\twindData += widget.getLocalizedString(\"weather.conditions.winds.at\") + \" \" + fetchedWindSpeed + \" \" + unitSpeed;\n\t\t\n\t\t\tif (fetchedWindGust != \"0\"){\n\t\t\t\twindData += \"\\n\" + widget.getLocalizedString(\"weather.conditions.winds.with_gusts_up_to\") + \" \" + fetchedWindGust + \" \" + unitSpeed;\n\t\t\t}\n\n\t\t}\t\n\t\t\n\t\tvar toolTipData =\ttheCondition + \"\\n\" +\n\t\t\t\t\t\ttheFeelsLike +\n\t\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\t//theHumidity + \"\\n\" +\n\t\t\t\t\t\tvisData + \"\\n\" +\n\t\t\t\t\t\t//thePressure + \"\\n\" +\n\t\t\t\t\t\t//theDewPoint + \"\\n\" +\n\t\t\t\t\t\twindData + \"\\n\" +\n\t\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\twidget.getLocalizedString(\"weather.conditions.updated_at\") + \" \" + formattedDateAndTime(observationTime, false);\n\t\n\t\tif (showToolTips) {\n\t\t\tweather.tooltip = toolTipData;\n\t\t} else {\n\t\t\tweather.tooltip = \"\";\n\t\t}\n\t\t\n\t\tupdateForecasts(dayTime);\n\t\n\t}\n\tcatch(error)\n\t{\n\t log(error);\n\t}\n\tresumeUpdates();\n}", "function getWeather() {\n \n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=Denver&units=imperial&appid=b4e24afa7b1b97b59d4ac32e97c8b68d\";\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n \n $(`p`).text(\"\");\n temp.text(`Current Temperature: ` + Math.floor(response.main.temp) + ` °F`);\n humid.text(`Humidity: ` + response.main.humidity + `%`);\n wind.text(`Wind Speed: ` + response.wind.speed);\n })\n}", "function getWeather(cityName){\nfetch(\"https://api.openweathermap.org/data/2.5/weather?q=\"\n+\ncityName + \n\"&appid=c9a9ed03a355403f4cb9a36e931c0b4a\"\n)\n.then(function(response) {\n \n return response.json();\n})\n.then (function (response){\n console.log (response);\n named.innerHTML = \"Name: \" + response.name;\n currentTemp.innerHTML = \"Temperature: \" + kelvinToFarenheit(response.main.temp) + \" &#176F\";\n currentHumidity.innerHTML = \"Humidity: \" + response.main.humidity + \"%\";\n currentWind.innerHTML = \"Wind Speed: \" + response.wind.speed + \" MPH\";\n\n let lat = response.coord.lat;\n let lon = response.coord.lon;\n let UVQueryURL = \"https://api.openweathermap.org/data/2.5/uvi/forecast?\"+ \"&lat\" + lat + \"&lon\"+ lon +\"&appid=c9a9ed03a355403f4cb9a36e931c0b4a\";\n let UVIndex = document.createElement(\"span\");\n UVIndex.setAttribute(\"class\",\"badge badge-danger\");\n UVIndex.innerHTML = response.value;\n currentUV.innerHTML = \"UV Index: \";\n currentUV.append(UVIndex);\n \n \n \n \n\n})\n.catch(err => {\n\tconsole.log(err);\n});\n\n\n}", "function firstUpdate() {\n let apiEndpoint = \"https://api.openweathermap.org/data/2.5/weather?\";\n let apiKey = \"f8789029e0a5277fb2e5a66c29f35e2c\";\n let city = \"Charlotte\";\n let apiUrl = `${apiEndpoint}q=${city}&appid=${apiKey}&units=metric`;\n\n axios.get(apiUrl).then(localWeather);\n\n apiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(displayForecast);\n}", "function showWeather(response) {\n console.log(response.data); \n let iconElement = document.querySelector(\"#icon\");\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n document.querySelector(\"#current-date-time\").innerHTML = formatDate(\n response.data.dt * 1000 + (response.data.timezone * 1000\n ));\n document.querySelector(\"#city-input\").innerHTML = response.data.name;\n celsiusTemperature = response.data.main.temp;\n document.querySelector(\"#main-temperature\").innerHTML = Math.round(\n celsiusTemperature\n );\n document.querySelector(\"#feels-like\").innerHTML = Math.round(\n response.data.main.feels_like\n );\n let temperature = response.data.main.feels_like;\n document.querySelector(\"#feels-like-fahrenheit\").innerHTML = Math.round(\n (temperature * 9) / 5 + 32\n );\n document.querySelector(\"#weather-description\").innerHTML =\n response.data.weather[0].description;\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity;\n document.querySelector(\"#wind\").innerHTML = Math.round(\n response.data.wind.speed\n );\n}", "async function getWeatherForecast(lat, lon) {\r\n let res = await fetch(`https://api.openweathermap.org/data/2.5/forecast?lat=${lat}&lon=${lon}&appid=${API_KEY}`)\r\n let data = await res.json()\r\n return data\r\n}", "function weatherLookup(){\n var urlCall = \"https://api.darksky.net/forecast/0d17dd4babb710edb8f4ce2adf5bb4c2/\"+$scope.loc.lat()+\",\"+$scope.loc.lng()+\"?callback=JSON_CALLBACK\";\n $http.jsonp(urlCall).then(function(results){\n $scope.summText = \"Report: \"+results.data.currently.summary;\n $scope.temp = results.data.currently.temperature+\" \"+String.fromCharCode(176) + \"F\";\n $scope.precipProb = results.data.currently.precipProbability*100+\"%\";\n $scope.humidity = results.data.currently.humidity*100+\"%\";\n $scope.windSpeed = results.data.currently.windSpeed+\" miles/hour\"\n if(!$scope.$$phase) {\n $scope.$apply();\n }\n });\n }" ]
[ "0.68570834", "0.68568385", "0.68553346", "0.684191", "0.68400156", "0.6828727", "0.67853075", "0.67686415", "0.6762652", "0.67233264", "0.67045337", "0.669729", "0.66521275", "0.6651089", "0.6646564", "0.6644218", "0.6620485", "0.6620354", "0.66140944", "0.66072685", "0.65900296", "0.65811527", "0.6573021", "0.657284", "0.6557923", "0.6557795", "0.6555828", "0.6553469", "0.6553289", "0.6548454", "0.6545602", "0.6533254", "0.6527565", "0.6526169", "0.65212446", "0.65189403", "0.65145636", "0.65046483", "0.65021807", "0.6500028", "0.6493296", "0.6488503", "0.6479341", "0.6476936", "0.6468689", "0.6461041", "0.6459695", "0.6459108", "0.64560896", "0.6455313", "0.6451854", "0.64502525", "0.6439198", "0.6437854", "0.6435178", "0.6429613", "0.64264244", "0.6422996", "0.6422088", "0.64204895", "0.6419651", "0.64188975", "0.6418387", "0.6417555", "0.641649", "0.640733", "0.63965183", "0.6395742", "0.6386307", "0.63831705", "0.637779", "0.6376479", "0.6374994", "0.63701206", "0.6368288", "0.636723", "0.6366082", "0.6364872", "0.6354685", "0.63542503", "0.63492835", "0.6348939", "0.6348252", "0.63481724", "0.6341971", "0.63382524", "0.6337505", "0.6336534", "0.6329514", "0.6329478", "0.6328505", "0.632557", "0.63186574", "0.6318136", "0.6317577", "0.63164306", "0.6315607", "0.6311787", "0.63104796", "0.6306886", "0.63064784" ]
0.0
-1
VoterGroup Constructor for a VoterGroup object. VoterGroup has a ownerId.
constructor(ownerId, name) { this.ownerId = ownerId; this.membersId = new Array(); this.membersId.push(this.ownerId); this.name = name; this.groupId = 'group' + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); this.type = 'group'; this.electionsId = new Array(); if (this.__isContract) { delete this.__isContract; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(groupid, ownerusername, createdAt) {\n\n this.groupid = groupid;\n this.ownerusername = ownerusername;\n this.createdAt = createdAt\n\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnUserHierarchyGroup.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_connect_CfnUserHierarchyGroupProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnUserHierarchyGroup);\n }\n throw error;\n }\n cdk.requireProperty(props, 'instanceArn', this);\n cdk.requireProperty(props, 'name', this);\n this.attrUserHierarchyGroupArn = cdk.Token.asString(this.getAtt('UserHierarchyGroupArn', cdk.ResolutionTypeHint.STRING));\n this.instanceArn = props.instanceArn;\n this.name = props.name;\n this.parentGroupArn = props.parentGroupArn;\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnSecurityGroup.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'groupDescription', this);\n this.securityGroupId = this.getAtt('GroupId').toString();\n this.securityGroupVpcId = this.getAtt('VpcId').toString();\n this.securityGroupName = this.ref.toString();\n const tags = props === undefined ? undefined : props.tags;\n this.tags = new cdk.TagManager(cdk.TagType.Standard, \"AWS::EC2::SecurityGroup\", tags);\n }", "constructor() { \n \n Group.initialize(this);\n }", "function TreeGroup(id, label, tooltip, nodeState, checkState, selected, exprEvalStr, target, enabled) {\n\tvar a = arguments;\n\t\n\tthis.childNodes = new Array(); // Buffer for the child nodes\n\tthis.clientHandler = new Array(); // ClientHandler associated with this node\n\t\n\t// properties\n\tthis.id = id; // identifier for the tree node\n\tthis.parent = null; // the parent or root node\n\tthis.label = label; // label to display on the node\n\tthis.tooltip = (a.length >= 3) ? tooltip : ''; // Tooltip\n\tthis.nodeState = (a.length >= 4) ? nodeState : NodeState.COLLAPSE; // state of the node (expand, collapse, expandex)\n\tthis.checkState = (a.length >= 5) ? checkState : CheckState.UNCHECKED; // indicates if the node is checked\n\tthis.selected = (a.length >= 6) ? selected : false; // true, if the node is selected\n\tthis.exprEvalStr = (a.length >= 7) ? exprEvalStr : null; // RegEx to match for the image\n\tthis.target = (a.length >= 8) ? target : null; // the target attribute\n\tthis.enabled = (a.length >= 9) ? enabled : true; // indicates if this node was enabled\n\tthis.type = NodeType.GROUP; // indicates a tree group\n}", "function Group(/* null | group */)\n{\n this.internals = []; \t\t\t\t // a list of internal objects\n\tthis.transformationMarker = new Transformation(); // transformation marker\n\tthis.axes = [];\n\tGroup.count++;\n\tthis.name = \"Group\"+Group.count;\n\tthis.viewPoint = new Transformation();\n\tthis.vpd = 500;\n\t\n\tthis.initializeAxes();\n \n\t// not available yet\n\t//this.scenarioMarker = new Scenario(); // scenario marker\n\t\n\tif(arguments.length == 1 )\n\t{\n\t\tthis.internals = arguments[0].internals;\n\t\tthis.transformationMarker = arguments[0].transformationMarker;\n\t\tthis.axes = arguments[0].axes;\n\t\tthis.name = arguments[0].name;\n\t\tthis.viewPoint = arguments[0].viewPoint;\n\t\tthis.vpd = arguments[0].vpd;\n\t}\n}", "function setGroupObj(groupObj){\nthis.groupObj = groupObj;\n}", "constructor(idVertex, groupVertex) {\n this.id = idVertex;\n this.label = String(idVertex);\n this.group = groupVertex;\n }", "constructor(ctx, voterId, registrarId, firstName, lastName) {\n if (this.validateVoter(voterId) && this.validateRegistrar(ctx, registrarId)) {\n this.voterId = `Voter:${voterId}`;\n this.registrarId = registrarId;\n this.firstName = firstName;\n this.lastName = lastName;\n this.ballotCreated = false;\n this.type = 'voter';\n if (this.__isContract) {\n delete this.__isContract;\n }\n if (this.name) {\n delete this.name;\n }\n return this;\n\n } else if (!this.validateVoter(voterId)){\n throw new Error('the voterId is not valid.');\n } else {\n throw new Error('the registrarId is not valid.');\n }\n\n }", "constructor(groups = []) {\n this.groups = groups;\n }", "constructor() {\n super();\n\n this.groups = new Map();\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnPlacementGroup.resourceTypeName, properties: props });\n this.placementGroupName = this.ref.toString();\n }", "get associatedOwnerGroup() {\r\n return new SiteGroup(this, \"associatedownergroup\");\r\n }", "setGroup(group) { \n this.group = group; // a real implementation may need to do more than just this\n }", "init() {\n this.groups = {};\n }", "function Group() {\n var group = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Group);\n\n if (!group.sketchObject) {\n // eslint-disable-next-line no-param-reassign\n group.sketchObject = _Factory__WEBPACK_IMPORTED_MODULE_4__[\"Factory\"].createNative(Group).alloc().initWithFrame(new _models_Rectangle__WEBPACK_IMPORTED_MODULE_2__[\"Rectangle\"](0, 0, 100, 100).asCGRect());\n }\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Group).call(this, group));\n } // @deprecated", "constructor(scope, id, props) {\n super(scope, id, { type: CfnNetworkAcl.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'vpcId', this);\n this.networkAclName = this.ref.toString();\n const tags = props === undefined ? undefined : props.tags;\n this.tags = new cdk.TagManager(cdk.TagType.Standard, \"AWS::EC2::NetworkAcl\", tags);\n }", "function Group(name, members, maxMem, game, requ, tags) {\n\tthis.id = lastGroupsID;\n\tthis.name = name;\n\tthis.members = members;\n\tthis.maxMember = maxMem;\n\tthis.game = game;\n\tthis.requirements = requ;\n\tthis.tags = tags;\n\t\n\tlastGroupsID++\n}", "static fromTargetGroupAttributes(scope, id, attrs) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_elasticloadbalancingv2_TargetGroupAttributes(attrs);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.fromTargetGroupAttributes);\n }\n throw error;\n }\n return new ImportedNetworkTargetGroup(scope, id, attrs);\n }", "constructor(groupName, groupEntryId, notchId = 0) {\n this.groupName = groupName;\n this.groupEntryId = groupEntryId;\n this.notchId = notchId;\n }", "Group(groupData) {\n\t\tthis.utils.logger.debug({\n\t\t\tdescription: 'Group Action called.', groupData: groupData,\n\t\t\taction: new Group({app: this, groupData: groupData}),\n\t\t\tfunc: 'group', obj: 'Grout'\n\t\t});\n\t\treturn new Group(groupData);\n\t}", "group(val) {\n if (!val) {\n return this._group;\n }\n this._group = val;\n return this;\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnVPNGateway.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'type', this);\n this.vpnGatewayName = this.ref.toString();\n const tags = props === undefined ? undefined : props.tags;\n this.tags = new cdk.TagManager(cdk.TagType.Standard, \"AWS::EC2::VPNGateway\", tags);\n }", "function onCreateGroup(groupName){\n try{\n thisPresenter.addGroup(groupName);\n } catch (err) {\n alert(err);\n }\n }", "createGroup(abandonBehaviour = SpectateGroup.kStopAbandonBehaviour) {\n return new SpectateGroup(/* manager= */ null, abandonBehaviour);\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnVPC.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'cidrBlock', this);\n this.vpcCidrBlock = this.getAtt('CidrBlock').toString();\n this.vpcCidrBlockAssociations = this.getAtt('CidrBlockAssociations').toList();\n this.vpcDefaultNetworkAcl = this.getAtt('DefaultNetworkAcl').toString();\n this.vpcDefaultSecurityGroup = this.getAtt('DefaultSecurityGroup').toString();\n this.vpcIpv6CidrBlocks = this.getAtt('Ipv6CidrBlocks').toList();\n this.vpcId = this.ref.toString();\n const tags = props === undefined ? undefined : props.tags;\n this.tags = new cdk.TagManager(cdk.TagType.Standard, \"AWS::EC2::VPC\", tags);\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnAutoScalingGroup.CFN_RESOURCE_TYPE_NAME, properties: props });\n cdk.requireProperty(props, 'maxSize', this);\n cdk.requireProperty(props, 'minSize', this);\n this.maxSize = props.maxSize;\n this.minSize = props.minSize;\n this.autoScalingGroupName = props.autoScalingGroupName;\n this.availabilityZones = props.availabilityZones;\n this.capacityRebalance = props.capacityRebalance;\n this.cooldown = props.cooldown;\n this.desiredCapacity = props.desiredCapacity;\n this.healthCheckGracePeriod = props.healthCheckGracePeriod;\n this.healthCheckType = props.healthCheckType;\n this.instanceId = props.instanceId;\n this.launchConfigurationName = props.launchConfigurationName;\n this.launchTemplate = props.launchTemplate;\n this.lifecycleHookSpecificationList = props.lifecycleHookSpecificationList;\n this.loadBalancerNames = props.loadBalancerNames;\n this.maxInstanceLifetime = props.maxInstanceLifetime;\n this.metricsCollection = props.metricsCollection;\n this.mixedInstancesPolicy = props.mixedInstancesPolicy;\n this.newInstancesProtectedFromScaleIn = props.newInstancesProtectedFromScaleIn;\n this.notificationConfigurations = props.notificationConfigurations;\n this.placementGroup = props.placementGroup;\n this.serviceLinkedRoleArn = props.serviceLinkedRoleArn;\n this.tags = new cdk.TagManager(cdk.TagType.AUTOSCALING_GROUP, \"AWS::AutoScaling::AutoScalingGroup\", props.tags, { tagPropertyName: 'tags' });\n this.targetGroupArns = props.targetGroupArns;\n this.terminationPolicies = props.terminationPolicies;\n this.vpcZoneIdentifier = props.vpcZoneIdentifier;\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "create(name, description = \"\", ownerId, teamProperties = {}) {\r\n const groupProps = {\r\n \"description\": description && description.length > 0 ? description : \"\",\r\n \"[email protected]\": [\r\n `https://graph.microsoft.com/v1.0/users/${ownerId}`,\r\n ],\r\n };\r\n return graph.groups.add(name, name, GroupType.Office365, groupProps).then((gar) => {\r\n return gar.group.createTeam(teamProperties).then(data => {\r\n return {\r\n data: data,\r\n group: gar.group,\r\n team: new Team(gar.group),\r\n };\r\n });\r\n });\r\n }", "createAllignmentGroup() {\r\n //prompt to assign names \r\n let allignment = prompt(\"Enter new allignment group:\");\r\n //array where we keep all our npcs\r\n this.allignmentGroups.push(new AllignmentGroup(allignment));\r\n }", "function Group(options) {\n // parent can be position(global level) or another group\n\n\n this.children = [];\n this.points = [];\n this.circles = [];\n\n this.state = {\n inAir: false\n };\n\n this.dPos = [0,0];\n this.velocity = [0,0];\n this.acceleration = [0,0];\n\n this.childrenAngle = 0;\n this.childrenSpin = 0;\n\n this.lines = {\n fromOrigin: false,\n //ctx.strokeStyle\n color: 'black',\n //ctx.lineWidth\n width: '5',\n\n connectEnds: true,\n };\n\n this.fill = {\n filled: false,\n //\n fillMode: 'object',\n };\n\n}", "function EventGroup(parent) {\r\n this._id = EventGroup._uniqueId++;\r\n this._parent = parent;\r\n this._eventRecords = [];\r\n }", "function EventGroup(parent) {\r\n this._id = EventGroup._uniqueId++;\r\n this._parent = parent;\r\n this._eventRecords = [];\r\n }", "constructor(input) {\n this.group = [];\n }", "function Group(parent, groupSettings, sortedColumns, serviceLocator) {\n var _this = this;\n this.isAppliedGroup = false;\n this.isAppliedUnGroup = false;\n this.visualElement = createElement('div', {\n className: 'e-cloneproperties e-dragclone e-gdclone',\n styles: 'line-height:23px', attrs: { action: 'grouping' }\n });\n this.helper = function (e) {\n var gObj = _this.parent;\n var target = e.sender.target;\n var element = target.classList.contains('e-groupheadercell') ? target :\n parentsUntil(target, 'e-groupheadercell');\n if (!element) {\n return false;\n }\n _this.column = gObj.getColumnByField(element.firstElementChild.getAttribute('ej-mappingname'));\n _this.visualElement.textContent = element.textContent;\n _this.visualElement.style.width = element.offsetWidth + 2 + 'px';\n _this.visualElement.style.height = element.offsetHeight + 2 + 'px';\n _this.visualElement.setAttribute('e-mappinguid', _this.column.uid);\n gObj.element.appendChild(_this.visualElement);\n return _this.visualElement;\n };\n this.dragStart = function (e) {\n _this.parent.element.classList.add('e-ungroupdrag');\n if (isBlazor()) {\n e.bindEvents(e.dragElement);\n }\n };\n this.drag = function (e) {\n var target = e.target;\n var cloneElement = _this.parent.element.querySelector('.e-cloneproperties');\n _this.parent.trigger(columnDrag, { target: target, draggableType: 'headercell', column: _this.column });\n classList(cloneElement, ['e-defaultcur'], ['e-notallowedcur']);\n if (!(parentsUntil(target, 'e-gridcontent') || parentsUntil(target, 'e-headercell'))) {\n classList(cloneElement, ['e-notallowedcur'], ['e-defaultcur']);\n }\n };\n this.dragStop = function (e) {\n _this.parent.element.classList.remove('e-ungroupdrag');\n if (!(parentsUntil(e.target, 'e-gridcontent') || parentsUntil(e.target, 'e-gridheader'))) {\n remove(e.helper);\n return;\n }\n };\n this.drop = function (e) {\n var gObj = _this.parent;\n var column = gObj.getColumnByUid(e.droppedElement.getAttribute('e-mappinguid'));\n _this.element.classList.remove('e-hover');\n remove(e.droppedElement);\n _this.aria.setDropTarget(_this.parent.element.querySelector('.e-groupdroparea'), false);\n _this.aria.setGrabbed(_this.parent.getHeaderTable().querySelector('[aria-grabbed=true]'), false);\n if (isNullOrUndefined(column) || column.allowGrouping === false ||\n parentsUntil(gObj.getColumnHeaderByUid(column.uid), 'e-grid').getAttribute('id') !==\n gObj.element.getAttribute('id')) {\n _this.parent.log('action_disabled_column', { moduleName: _this.getModuleName(), columnName: column.headerText });\n return;\n }\n _this.groupColumn(column.field);\n };\n this.contentRefresh = true;\n this.aria = new AriaService();\n this.parent = parent;\n this.groupSettings = groupSettings;\n this.serviceLocator = serviceLocator;\n this.sortedColumns = sortedColumns;\n this.focus = serviceLocator.getService('focus');\n this.addEventListener();\n this.groupGenerator = new GroupModelGenerator(this.parent);\n }", "function createGroup(groupName){\n var newGroup = {\n name: groupName,\n tabs:[],\n open:false,\n active:true\n }\n groups.push(newGroup);\n storeGroups();\n}", "addToGroup(group) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_iam_IGroup(group);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.addToGroup);\n }\n throw error;\n }\n this.groups.push(group.groupName);\n }", "function PrefSubGroup(parent, name)\n{\n this.parent = parent; // Main group.\n this.name = name;\n this.fullGroup = this.parent.name + \".\" + this.name;\n this.label = getMsg(\"pref.group.\" + this.fullGroup + \".label\", null, this.name);\n this.help = getMsg(\"pref.group.\" + this.fullGroup + \".help\", null, \"\");\n this.gb = document.createElement(\"groupbox\");\n this.cap = document.createElement(\"caption\");\n this.box = document.createElement(\"box\");\n \n this.cap.setAttribute(\"label\", this.label);\n this.gb.appendChild(this.cap);\n this.box.orient = \"vertical\";\n \n // If there's some help text, we place it as the first thing inside \n // the <groupbox>, as an explanation for the entire subGroup.\n if (this.help)\n {\n this.helpLabel = document.createElement(\"label\");\n this.helpLabel.appendChild(document.createTextNode(this.help));\n this.gb.appendChild(this.helpLabel);\n }\n this.gb.appendChild(this.box);\n this.parent.box.appendChild(this.gb);\n \n return this;\n}", "constructor(scope, id, props) {\n super(scope, id, { type: CfnVPNConnection.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'customerGatewayId', this);\n cdk.requireProperty(props, 'type', this);\n cdk.requireProperty(props, 'vpnGatewayId', this);\n this.vpnConnectionName = this.ref.toString();\n const tags = props === undefined ? undefined : props.tags;\n this.tags = new cdk.TagManager(cdk.TagType.Standard, \"AWS::EC2::VPNConnection\", tags);\n }", "function SortableGroup(){this.namespace='sortable'+(++SortableGroup.instanceCount);this.draggables={};this.droppables={};this.sortables={};this.linkedGroups=[];this.linkedGroups.onlinkjump=bagofholding;this.rootNode=null;}", "createGroups() {\n const app = this.app;\n const participants = app.session.participants;\n const gIds = app.getGroupIdsForPeriod(this);\n\n // Create groups\n var pIds = [];\n for (var p in participants) {\n pIds.push(p);\n }\n\n let numGroups = this.numGroups();\n if (gIds[0].length != null) {\n numGroups = gIds.length;\n } else {\n for (let i in gIds) {\n numGroups = Math.max(numGroups, gIds[i]);\n }\n }\n for (var g=this.groups.length; g<numGroups; g++) {\n var group = new Group.new(g+1, this);\n group.save();\n this.groups.push(group);\n\n if (gIds[g].length != null) {\n // Label format\n // [['P1', 'P2'], ['P3', 'P4'], ...]\n for (var i=0; i<gIds[g].length; i++) {\n var pId = gIds[g][i];\n var participant = participants[pId];\n var player = new Player.new(pId, participant, group, i+1);\n participant.players.push(player);\n player.save();\n participant.save();\n group.players.push(player);\n }\n group.allPlayersCreated = true;\n group.save(); \n } else {\n // Numerical format\n // [['P1', 'P2'], ['P3', 'P4'], ...]\n for (var i=0; i<gIds.length; i++) {\n if (gIds[i] == group.id) {\n var participant = participants[pIds[i]];\n var player = new Player.new(pIds[i], participant, group, group.players.length+1);\n participant.players.push(player);\n player.save();\n participant.save();\n group.players.push(player);\n }\n }\n group.allPlayersCreated = true;\n group.save(); \n }\n }\n\n }", "function Group(port, cb) {\n if(arguments.length !== 2) {\n throw new Error('Not enough arguments');\n }\n\n // these are undefined in virtual mode\n this.cb = cb;\n this.port = port;\n\n var prefix = 'gid-';\n prefix += port ? port : '';\n\n this.info = {\n gid: Group.gid(prefix + '-'),\n complete: false,\n items: []\n };\n\n Object.defineProperty(this, 'length', {\n get: function() {\n return this.info.items.length;\n }\n });\n\n Object.defineProperty(this, 'complete', {\n get: function() {\n return this.info.complete;\n }\n });\n\n /**\n *\n * Used to collect incomming data.\n * Until everything from this group is received.\n *\n */\n this.store = [];\n\n // send out the group info\n // Ok this will not work with the virtual ones\n // there is no port to send to.\n this.send();\n}", "function Villian (villianAttributes) {\n Humanoid.call(this, villianAttributes);\n this.teammate = villianAttributes.teammate;\n this.opponent = villianAttributes.opponent;\n this.maxDamage = villianAttributes.maxDamage;\n this.hitChance = villianAttributes.hitChance;\n }", "attachToGroup(group) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_iam_IGroup(group);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.attachToGroup);\n }\n throw error;\n }\n if (this.groups.find(g => g === group)) {\n return;\n }\n this.groups.push(group);\n }", "addGroup() {\n\t\t//make a random group id\n\t\tlet gid = generateGroupID();\n\n\t\t//keep trying till a unique one is made\n\t\twhile(gid in this.groups) {\n\t\t\tgid = generateGroupID();\n\t\t}\n\n\t\tthis.groups[gid] = new Group();\n\n\t\treturn gid;\n\t}", "function makeGroupNode(name, isRoot = false) {\n\tlet node = makeNode(true, isRoot);\n\tnode.apiData = {\n\t\tname: `GROUP of ${name}`, \n\t\tid: \"\",\n\t};\n\tnode.apiName = name;\n\tnode.meaningfulName = node.apiData.name;\n\treturn node;\n}", "getById(id) {\r\n return new Group(this, id);\r\n }", "function Group(domoticz) {\n this.domoticz = domoticz;\n}", "static fromKeyGroupId(scope, id, keyGroupId) {\n return new class extends core_1.Resource {\n constructor() {\n super(...arguments);\n this.keyGroupId = keyGroupId;\n }\n }(scope, id);\n }", "function makeGroup(key, keyNamePairs){\n var headerPlusKey = \"OK\" + key;\n var keys = keyNamePairs.map(x => [x[0], crypto.encrypt(headerPlusKey, x[1], props.getPriv)])\n\n var group = {\n name: groupName,\n adminName: props.getName,\n keys: keys\n }\n\n console.log(group)\n return group;\n }", "function Test_CreateGroup() {\n return __awaiter(this, void 0, void 0, function () {\n var _a, in_rpc_set_group, out_rpc_set_group;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n console.log(\"Begin: Test_CreateGroup\");\n in_rpc_set_group = new VPN.VpnRpcSetGroup((_a = {\n HubName_str: hub_name,\n Name_str: \"group1\",\n Realname_utf: \"Cat group\",\n Note_utf: \"This is it! This is it!!\",\n UsePolicy_bool: true\n },\n _a[\"policy:Access_bool\"] = true,\n _a[\"policy:DHCPFilter_bool\"] = false,\n _a[\"policy:DHCPNoServer_bool\"] = true,\n _a[\"policy:DHCPForce_bool\"] = false,\n _a[\"policy:NoBridge_bool\"] = false,\n _a[\"policy:NoRouting_bool\"] = false,\n _a[\"policy:CheckMac_bool\"] = false,\n _a[\"policy:CheckIP_bool\"] = false,\n _a[\"policy:ArpDhcpOnly_bool\"] = false,\n _a[\"policy:PrivacyFilter_bool\"] = false,\n _a[\"policy:NoServer_bool\"] = false,\n _a[\"policy:NoBroadcastLimiter_bool\"] = false,\n _a[\"policy:MonitorPort_bool\"] = false,\n _a[\"policy:MaxConnection_u32\"] = 32,\n _a[\"policy:TimeOut_u32\"] = 15,\n _a[\"policy:MaxMac_u32\"] = 1000,\n _a[\"policy:MaxIP_u32\"] = 1000,\n _a[\"policy:MaxUpload_u32\"] = 1000000000,\n _a[\"policy:MaxDownload_u32\"] = 1000000000,\n _a[\"policy:FixPassword_bool\"] = false,\n _a[\"policy:MultiLogins_u32\"] = 1000,\n _a[\"policy:NoQoS_bool\"] = false,\n _a[\"policy:RSandRAFilter_bool\"] = false,\n _a[\"policy:RAFilter_bool\"] = false,\n _a[\"policy:DHCPv6Filter_bool\"] = false,\n _a[\"policy:DHCPv6NoServer_bool\"] = false,\n _a[\"policy:NoRoutingV6_bool\"] = false,\n _a[\"policy:CheckIPv6_bool\"] = false,\n _a[\"policy:NoServerV6_bool\"] = false,\n _a[\"policy:MaxIPv6_u32\"] = 1234,\n _a[\"policy:NoSavePassword_bool\"] = false,\n _a[\"policy:AutoDisconnect_u32\"] = 0,\n _a[\"policy:FilterIPv4_bool\"] = false,\n _a[\"policy:FilterIPv6_bool\"] = false,\n _a[\"policy:FilterNonIP_bool\"] = false,\n _a[\"policy:NoIPv6DefaultRouterInRA_bool\"] = false,\n _a[\"policy:NoIPv6DefaultRouterInRAWhenIPv6_bool\"] = false,\n _a[\"policy:VLanId_u32\"] = 0,\n _a[\"policy:Ver3_bool\"] = true,\n _a));\n return [4 /*yield*/, api.CreateGroup(in_rpc_set_group)];\n case 1:\n out_rpc_set_group = _b.sent();\n console.log(out_rpc_set_group);\n console.log(\"End: Test_CreateGroup\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "constructor(name, country, year, startDate, endDate) {\n const id = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);\n this.electionId = `Election:${id}`;\n\n if (this.validateElection(this.electionId)) {\n //create the election object\n this.name = name;\n this.country = country;\n this.year = year;\n this.startDate = startDate;\n this.endDate = endDate;\n this.type = 'election';\n if (this.__isContract) {\n delete this.__isContract;\n }\n return this;\n\n } else {\n throw new Error('not a valid election!');\n }\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnEndpointGroup.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_globalaccelerator_CfnEndpointGroupProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnEndpointGroup);\n }\n throw error;\n }\n cdk.requireProperty(props, 'endpointGroupRegion', this);\n cdk.requireProperty(props, 'listenerArn', this);\n this.attrEndpointGroupArn = cdk.Token.asString(this.getAtt('EndpointGroupArn', cdk.ResolutionTypeHint.STRING));\n this.endpointGroupRegion = props.endpointGroupRegion;\n this.listenerArn = props.listenerArn;\n this.endpointConfigurations = props.endpointConfigurations;\n this.healthCheckIntervalSeconds = props.healthCheckIntervalSeconds;\n this.healthCheckPath = props.healthCheckPath;\n this.healthCheckPort = props.healthCheckPort;\n this.healthCheckProtocol = props.healthCheckProtocol;\n this.portOverrides = props.portOverrides;\n this.thresholdCount = props.thresholdCount;\n this.trafficDialPercentage = props.trafficDialPercentage;\n }", "function PrefMainGroup(parent, name)\n{\n // Init this group's object.\n this.parent = parent; // Private data for pref object.\n this.name = name;\n this.groups = new Object();\n this.label = getMsg(\"pref.group.\" + this.name + \".label\", null, this.name);\n this.tab = document.createElement(\"tab\");\n this.tabPanel = document.createElement(\"tabpanel\");\n this.box = this.sb = document.createElement(\"scroller\");\n \n this.tab.setAttribute(\"label\", this.label);\n this.tabPanel.setAttribute(\"orient\", \"vertical\");\n this.sb.setAttribute(\"orient\", \"vertical\");\n this.sb.setAttribute(\"flex\", 1);\n \n this.parent.tabs.appendChild(this.tab);\n this.parent.tabPanels.appendChild(this.tabPanel);\n this.tabPanel.appendChild(this.sb);\n \n return this;\n}", "function Group(parent) {\n var _this = this;\n\n this.visualElement = sf.base.createElement('div', {\n className: 'e-cloneproperties e-dragclone e-gdclone',\n styles: 'line-height:23px',\n attrs: {\n action: 'grouping'\n }\n });\n\n this.helper = function (e) {\n var gObj = _this.parent;\n var target = e.sender.target;\n var element = target.classList.contains('e-groupheadercell') ? target : parentsUntil(target, 'e-groupheadercell');\n\n if (!element || !target.classList.contains('e-drag') && _this.parent.options.groupReordering) {\n return false;\n }\n\n _this.column = gObj.getColumnByField(element.firstElementChild.getAttribute('ej-mappingname'));\n _this.visualElement.textContent = element.textContent;\n _this.visualElement.style.width = element.offsetWidth + 2 + 'px';\n _this.visualElement.style.height = element.offsetHeight + 2 + 'px';\n\n _this.visualElement.setAttribute('e-mappinguid', _this.column.uid);\n\n gObj.element.appendChild(_this.visualElement);\n return _this.visualElement;\n };\n\n this.dragStart = function (e) {\n _this.parent.element.classList.add('e-ungroupdrag');\n\n document.body.classList.add('e-prevent-select');\n e.bindEvents(e.dragElement);\n };\n\n this.drag = function (e) {\n // if (this.groupSettings.allowReordering) {\n // this.animateDropper(e);\n // }\n var target = e.target;\n\n var cloneElement = _this.parent.element.querySelector('.e-cloneproperties'); // this.parent.trigger(events.columnDrag, { target: target, draggableType: 'headercell', column: this.column });\n\n\n if (!_this.parent.options.groupReordering) {\n sf.base.classList(cloneElement, ['e-defaultcur'], ['e-notallowedcur']);\n\n if (!(parentsUntil(target, 'e-gridcontent') || parentsUntil(target, 'e-headercell'))) {\n sf.base.classList(cloneElement, ['e-notallowedcur'], ['e-defaultcur']);\n }\n }\n };\n\n this.dragStop = function (e) {\n document.body.classList.remove('e-prevent-select');\n\n _this.parent.element.classList.remove('e-ungroupdrag');\n\n var preventDrop = !(parentsUntil(e.target, 'e-gridcontent') || parentsUntil(e.target, 'e-gridheader')); // if (this.groupSettings.allowReordering && preventDrop) { //TODO: reordering\n // remove(e.helper);\n // if (parentsUntil(e.target, 'e-groupdroparea')) {\n // this.rearrangeGroup(e);\n // } else if (!(parentsUntil(e.target, 'e-grid'))) {\n // let field: string = this.parent.getColumnByUid(e.helper.getAttribute('e-mappinguid')).field;\n // if (this.groupSettings.columns.indexOf(field) !== -1) {\n // this.ungroupColumn(field);\n // }\n // }\n // return;\n // } else\n\n if (preventDrop) {\n sf.base.remove(e.helper);\n return;\n }\n }; //TODO: reordering\n // private animateDropper: Function = (e: { target: HTMLElement, event: MouseEventArgs, helper: Element }) => {\n // let uid: string = this.parent.element.querySelector('.e-cloneproperties').getAttribute('e-mappinguid');\n // let dragField: string = this.parent.getColumnByUid(uid).field;\n // let parent: Element = parentsUntil(e.target, 'e-groupdroparea');\n // let dropTarget: Element = parentsUntil(e.target, 'e-group-animator');\n // // tslint:disable-next-line\n // let grouped: string[] = [].slice.call(this.element.querySelectorAll('.e-groupheadercell'))\n // .map((e: Element) => e.querySelector('div').getAttribute('ej-mappingname'));\n // let cols: string[] = JSON.parse(JSON.stringify(grouped));\n // if (dropTarget || parent) {\n // if (dropTarget) {\n // let dropField: string = dropTarget.querySelector('div[ej-mappingname]').getAttribute('ej-mappingname');\n // let dropIndex: number = +(dropTarget.getAttribute('index'));\n // if (dropField !== dragField) {\n // let dragIndex: number = cols.indexOf(dragField);\n // if (dragIndex !== -1) {\n // cols.splice(dragIndex, 1);\n // }\n // let flag: boolean = dropIndex !== -1 && dragIndex === dropIndex;\n // cols.splice(dropIndex + (flag ? 1 : 0), 0, dragField);\n // }\n // } else if (parent && cols.indexOf(dragField) === -1) {\n // cols.push(dragField);\n // }\n // this.element.innerHTML = '';\n // if (cols.length && !this.element.classList.contains('e-grouped')) {\n // this.element.classList.add('e-grouped');\n // }\n // this.reorderingColumns = cols;\n // for (let c: number = 0; c < cols.length; c++) {\n // this.addColToGroupDrop(cols[c]);\n // }\n // } else {\n // this.addLabel();\n // this.removeColFromGroupDrop(dragField);\n // }\n // }\n // private rearrangeGroup(e: { target: HTMLElement, event: MouseEventArgs, helper: Element }): void {\n // this.sortRequired = false;\n // this.updateModel();\n // }\n\n\n this.preventTouchOnWindow = function (e) {\n e.preventDefault();\n };\n\n this.drop = function (e) {\n var gObj = _this.parent;\n var column = gObj.getColumnByUid(e.droppedElement.getAttribute('e-mappinguid'));\n gObj.element.querySelector('.e-groupdroparea').classList.remove('e-hover');\n sf.base.remove(e.droppedElement);\n\n if (gObj.options.allowGrouping) {\n sf.base.EventHandler.remove(window, 'touchmove', _this.preventTouchOnWindow);\n }\n\n _this.parent.element.querySelector('.e-groupdroparea').removeAttribute(\"aria-dropeffect\");\n\n _this.parent.element.querySelector('[aria-grabbed=true]').setAttribute(\"aria-grabbed\", 'false');\n\n if (sf.base.isNullOrUndefined(column) || column.allowGrouping === false || parentsUntil(gObj.getColumnHeaderByUid(column.uid), 'e-grid').getAttribute('id') !== gObj.element.getAttribute('id')) {\n return;\n }\n\n gObj.dotNetRef.invokeMethodAsync(\"GroupColumn\", column.field, 'Group');\n };\n\n this.parent = parent;\n\n if (this.parent.options.allowGrouping && this.parent.options.showDropArea) {\n this.initDragAndDrop();\n }\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnRuleGroup.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_wafv2_CfnRuleGroupProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnRuleGroup);\n }\n throw error;\n }\n cdk.requireProperty(props, 'capacity', this);\n cdk.requireProperty(props, 'scope', this);\n cdk.requireProperty(props, 'visibilityConfig', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrId = cdk.Token.asString(this.getAtt('Id', cdk.ResolutionTypeHint.STRING));\n this.attrLabelNamespace = cdk.Token.asString(this.getAtt('LabelNamespace', cdk.ResolutionTypeHint.STRING));\n this.capacity = props.capacity;\n this.scope = props.scope;\n this.visibilityConfig = props.visibilityConfig;\n this.availableLabels = props.availableLabels;\n this.consumedLabels = props.consumedLabels;\n this.customResponseBodies = props.customResponseBodies;\n this.description = props.description;\n this.name = props.name;\n this.rules = props.rules;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::WAFv2::RuleGroup\", props.tags, { tagPropertyName: 'tags' });\n }", "function Owner(options){\n options=options || {};\n this.name=options.name;\n this.age=options.age;\n}", "function PublicKey(pubKey /* GroupElement */){\n this.pubKey = pubKey; // pubKeyObj\n}", "createGroup(name, group) {\n return axios.post(`${JPA_API_URL}/users/${name}/groups`, group);\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnVPCCidrBlock.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'vpcId', this);\n this.vpcCidrBlockId = this.ref.toString();\n }", "function Test_SetGroup() {\n return __awaiter(this, void 0, void 0, function () {\n var _a, in_rpc_set_group, out_rpc_set_group;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n console.log(\"Begin: Test_SetGroup\");\n in_rpc_set_group = new VPN.VpnRpcSetGroup((_a = {\n HubName_str: hub_name,\n Name_str: \"group1\",\n Realname_utf: \"Cat group 2\",\n Note_utf: \"This is it! This is it!! 2\",\n UsePolicy_bool: true\n },\n _a[\"policy:Access_bool\"] = true,\n _a[\"policy:DHCPFilter_bool\"] = false,\n _a[\"policy:DHCPNoServer_bool\"] = true,\n _a[\"policy:DHCPForce_bool\"] = false,\n _a[\"policy:NoBridge_bool\"] = false,\n _a[\"policy:NoRouting_bool\"] = false,\n _a[\"policy:CheckMac_bool\"] = false,\n _a[\"policy:CheckIP_bool\"] = false,\n _a[\"policy:ArpDhcpOnly_bool\"] = false,\n _a[\"policy:PrivacyFilter_bool\"] = false,\n _a[\"policy:NoServer_bool\"] = false,\n _a[\"policy:NoBroadcastLimiter_bool\"] = false,\n _a[\"policy:MonitorPort_bool\"] = false,\n _a[\"policy:MaxConnection_u32\"] = 32,\n _a[\"policy:TimeOut_u32\"] = 15,\n _a[\"policy:MaxMac_u32\"] = 1000,\n _a[\"policy:MaxIP_u32\"] = 1000,\n _a[\"policy:MaxUpload_u32\"] = 1000000000,\n _a[\"policy:MaxDownload_u32\"] = 1000000000,\n _a[\"policy:FixPassword_bool\"] = false,\n _a[\"policy:MultiLogins_u32\"] = 1000,\n _a[\"policy:NoQoS_bool\"] = false,\n _a[\"policy:RSandRAFilter_bool\"] = false,\n _a[\"policy:RAFilter_bool\"] = false,\n _a[\"policy:DHCPv6Filter_bool\"] = false,\n _a[\"policy:DHCPv6NoServer_bool\"] = false,\n _a[\"policy:NoRoutingV6_bool\"] = false,\n _a[\"policy:CheckIPv6_bool\"] = false,\n _a[\"policy:NoServerV6_bool\"] = false,\n _a[\"policy:MaxIPv6_u32\"] = 1234,\n _a[\"policy:NoSavePassword_bool\"] = false,\n _a[\"policy:AutoDisconnect_u32\"] = 0,\n _a[\"policy:FilterIPv4_bool\"] = false,\n _a[\"policy:FilterIPv6_bool\"] = false,\n _a[\"policy:FilterNonIP_bool\"] = false,\n _a[\"policy:NoIPv6DefaultRouterInRA_bool\"] = false,\n _a[\"policy:NoIPv6DefaultRouterInRAWhenIPv6_bool\"] = false,\n _a[\"policy:VLanId_u32\"] = 0,\n _a[\"policy:Ver3_bool\"] = true,\n _a));\n return [4 /*yield*/, api.SetGroup(in_rpc_set_group)];\n case 1:\n out_rpc_set_group = _b.sent();\n console.log(out_rpc_set_group);\n console.log(\"End: Test_SetGroup\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "constructor(signupGroup, checkinGroup) {\n this.signupGroup = signupGroup;\n this.checkinGroup = checkinGroup;\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnVPCPeeringConnection.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'peerVpcId', this);\n cdk.requireProperty(props, 'vpcId', this);\n this.vpcPeeringConnectionName = this.ref.toString();\n const tags = props === undefined ? undefined : props.tags;\n this.tags = new cdk.TagManager(cdk.TagType.Standard, \"AWS::EC2::VPCPeeringConnection\", tags);\n }", "constructor(aIsAccepted, aStudyGroupId, aSourceUser, aTargetUser) {\n super();\n this.is_accepted = aIsAccepted;\n this.study_group_id = aStudyGroupId;\n this.target_owner = aTargetUser;\n this.source_owner = aSourceUser\n\n }", "get associatedVisitorGroup() {\r\n return new SiteGroup(this, \"associatedvisitorgroup\");\r\n }", "function create(params) {\n let match = new groupModel(params);\n return groupDao.save(match);\n}", "function createGroup(g) {\n // Create the main button element\n var group = document.createElement('button');\n group.className = 'group';\n group.id = 'uniqueGroupId-' + g.name;\n\n // Create a span to contain the name on the left side of the button\n var nameSpan = document.createElement('span');\n nameSpan.className = 'alignleft'\n nameSpan.textContent = g.name;\n group.appendChild(nameSpan);\n\n // Create a span to contain the tab count on the right side of the button\n var countSpan = document.createElement('span');\n countSpan.className = 'alignright'\n countSpan.textContent = g.tabs.length;\n group.appendChild(countSpan);\n\n // Sets mouse interactions\n group.onclick = function(){openGroup(g.name)};\n\n // Adds to popup\n groupDiv.appendChild(group);\n}", "addgroup(group)\n {\n this.groupList.push(group);\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnSecurityGroupIngress.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'ipProtocol', this);\n this.securityGroupIngressId = this.ref.toString();\n }", "get group(){ return this.__group; }", "function circle(group, x, y, radius) {\n return {\n id: group.id,\n name: group.name,\n color: group.color || 'black',\n x,\n y,\n radius,\n children: [],\n parent: null,\n // Clusters are circles joined by an intersection\n clusters: [],\n draw: function() {\n ctx.beginPath();\n ctx.strokeStyle = this.color;\n ctx.lineWidth = 1.5;\n ctx.arc(this.x, this.y, this.radius, 0, 2 * Math.PI);\n ctx.stroke();\n ctx.globalAlpha = 0.1;\n ctx.fillStyle = this.color;\n ctx.fill();\n ctx.globalAlpha = 1.0;\n this.children.forEach(function (circle) {\n circle.draw.call(circle);\n });\n },\n createChildren: function(allCircles) {\n let childGroups = data.groups.filter((g) => g.parent === this.id);\n if (childGroups.length === 0) {\n return;\n }\n let radiuses = (this.radius * 2 / childGroups.length / 2) - 5; // 5 margin\n\n this.children = childGroups.map((group, index) => {\n let c = circle(group, (radiuses * 2 + 5) * index + radiuses + 5 + (this.x - radius),\n this.y, radiuses);\n c.parent = this;\n allCircles.push(c);\n c.createChildren(allCircles);\n return c;\n });\n },\n isPointInside: function(point) {\n const distance = Math.sqrt(Math.pow(this.x - point.x, 2) + Math.pow(this.y - point.y, 2));\n return distance < this.radius;\n }\n }\n}", "constructor(options, observer) {\n if (!_.has(options, \"groupBy\")) {\n throw new Error(\"Grouper: constructor needs 'groupBy' in options\");\n }\n\n if (_.isFunction(options.groupBy)) {\n this._groupBy = options.groupBy;\n } else if (_.isArray(options.groupBy)) {\n this._groupBy = (event) =>\n _.map(options.groupBy, column => `${event.get(column)}`).join(\"::\");\n } else if (_.isString(options.groupBy)) {\n this._groupBy = (event) => `${event.get(options.groupBy)}`;\n } else {\n throw Error(\"Unable to interpret groupBy argument passed to Grouper constructor\");\n }\n this._observer = observer;\n }", "function makeNewGroup(event) {\n event.preventDefault()\n\n let requestBody = {\n name: groupName,\n members_id: memberList\n }\n let token = Cookies.get('csrftoken')\n\n let newGroup = createNewGroup(token, requestBody)\n .then(res=> {\n hideAddGroup()\n history.push(\"/groups/\"+res.id)\n })\n\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnSecurityGroupEgress.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'groupId', this);\n cdk.requireProperty(props, 'ipProtocol', this);\n this.securityGroupEgressId = this.ref.toString();\n }", "function makeGroup() {\n groupClass = 'groups';\n var length = document.getElementsByClassName(groupClass).length;\n var previousItem = document.getElementsByClassName(groupClass).item(length-1);\n var index = 0;\n // handles getting the class index out of the previous div, so we don't repeat indices on delete->add\n if (previousItem != null) {\n parent = previousItem.parentElement;\n splitArray = parent.id.split(\"-\");\n index = parseInt(splitArray[1]) + 1;\n }\n \n var div = document.createElement('div');\n div.id = 'group-' + index;\n\n var newGroup = document.createElement('h4');\n newGroup.innerHTML = 'Group';\n newGroup.className = groupClass;\n div.appendChild(newGroup);\n\n var deleteGroupButton = document.createElement('input');\n deleteGroupButton.id = 'delete-group-' + index;\n deleteGroupButton.type = 'button';\n deleteGroupButton.value = 'Delete Group';\n deleteGroupButton.className = 'deleteGroupButton';\n deleteGroupButton.onclick = function() { deleteGroup(div.id); };\n div.appendChild(deleteGroupButton);\n \n var addMemButton = document.createElement('input');\n addMemButton.id = 'add-mem-group-' + index;\n addMemButton.type = 'button';\n addMemButton.value = 'Add Member';\n addMemButton.className = 'addMemButton';\n addMemButton.onclick = function() { addMember(div.id); };\n div.appendChild(addMemButton);\n\n return div;\n}", "function EventGroup(parent, onError) {\r\n if (onError === void 0) { onError = logToErrorHelper; }\r\n this._id = EventGroup._uniqueId++;\r\n this._parent = parent;\r\n this._onError = onError;\r\n this._eventRecords = [];\r\n }", "function EventGroup(parent, onError) {\r\n if (onError === void 0) { onError = logToErrorHelper; }\r\n this._id = EventGroup._uniqueId++;\r\n this._parent = parent;\r\n this._onError = onError;\r\n this._eventRecords = [];\r\n }", "function Glove(gloveId, gloveOwner, year) {\r\n this.gloveId = gloveId,\r\n this.gloveOwner = gloveOwner,\r\n this.year = year,\r\n this.showInfo = function() {\r\n console.log('The glove with id ' + this.gloveId + 'is owned by ' + this.gloveOwner + ' from ' + year);//don't forget \"this\"\r\n }\r\n}//use Capital letter in function name as convention of constructor", "function KalturaGroupUserService(client){\n\tthis.init(client);\n}", "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnUserHierarchyGroupPropsFromCloudFormation(resourceProperties);\n const ret = new CfnUserHierarchyGroup(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "function addGroupPlayer() {\n\tif (groupPlayer) { groupPlayer.destroy(); }\n\tgroupPlayer = game.add.group();\n\treturn groupPlayer;\n}", "function createOptionGroup($group, $container){\n\t\t\n\t\t//create <optgroup> for sub-nav items\n\t\tvar $optgroup = $('<optgroup label=\"'+$.trim(getText($group))+'\" />');\n\t\t\n\t\t//append top option to it (current list item's text)\n\t\tcreateOption($group,$optgroup, settings.groupPageText);\n\t\n\t\t//loop through each sub-nav list\n\t\t$group.children('ul, ol').each(function(){\n\t\t\n\t\t\t//loop through each list item and create an <option> for it\n\t\t\t$(this).children('li').each(function(){\n\t\t\t\tcreateOption($(this), $optgroup);\n\t\t\t});\n\t\t});\n\t\t\n\t\t//append to select element\n\t\t$optgroup.appendTo($container);\n\t\t\n\t}//createOptionGroup()", "function Groups(game) {\r\n this.game = game;\r\n this.enemies = game.add.group();\r\n this.bosses = game.add.group();\r\n}", "function TableGroup() {\n\t this.aggConfig = null;\n\t this.key = null;\n\t this.title = null;\n\t this.tables = [];\n\t }", "function BundleGroup(groupType) {\n var __arguments = new Array(arguments.length);\n for (var __argumentIndex = 0; __argumentIndex < __arguments.length; ++__argumentIndex) {\n __arguments[__argumentIndex] = arguments[__argumentIndex];\n }\n if (__arguments.length == 1) {\n var groupType_1 = __arguments[0];\n //super();\n this.fmliveswitchsdpBundleGroupInit();\n this.__mediaDescriptions = new Array();\n this.__mids = new Array();\n this.setGroupType(groupType_1);\n }\n else {\n throw new fm.liveswitch.Exception('Constructor overload does not exist with specified parameter count/type combination.');\n }\n }", "static createInstance(voter, ballotNumber, issueDateTime, electionNumber,electionDateTime) {\n return new Ballot({ voter, ballotNumber, issueDateTime, electionNumber,electionDateTime });\n }", "PatientGroup(id,text,value){\n this.id = id;\n this.text = text;\n this.cartList = 1;\n this.value = value;\n}", "function createDeveloperGroup(developerIds) {\n\t\n\t//create a new dev group\n\tvar newDevGroup = {\n\t\tid: \"devGroupId-\" + branchId + \"_\" + autoGeneratedDeveloperGroupId,\n\t\tmemberIds: developerIds\n\t};\n\n\t//create a new unique dev group id\n\tautoGeneratedDeveloperGroupId++;\n\n\t//add the new dev group \n\tallDeveloperGroups[newDevGroup.id] = newDevGroup;\n\t\n\treturn newDevGroup;\n}", "function GeneSetGroup (wrangler_file_id) {\n TabSeperatedFile.call(this, {\n wrangler_file_id: wrangler_file_id\n });\n\n // TODO: remove this (?)\n this.setSubmissionType.call(this, \"gene_set_collection\");\n}", "function TagLogGroupCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "function GroupRotatingTool() {\n go.RotatingTool.call(this);\n\n // Internal state\n // ._initialInfo holds references to all selected non-Link Parts and\n // their initial relative points and angles\n this._initialInfo = null;\n this._rotatePoint = new go.Point();\n this.handleAngle = 0;\n this.handleArchetype = $(go.Panel, \"Auto\", $(go.Shape, \"BpmnActivityLoop\", { width: 30, height: 30, stroke: \"green\", fill: \"transparent\" }), $(go.Shape, \"Rectangle\", {\n width: 30,\n height: 30,\n stroke: \"green\",\n fill: \"transparent\",\n strokeWidth: 0\n }));\n}", "function dvdInfAppMngGrp() {\n this.ruleID = 'dvdInfAppMngGrp';\n}", "function makeGroupTooltip(d, parentId) {\n // find group with this id\n var group = groups[groups.findIndex(elem => elem.id == d.data.id)]\n tooltipName.text(group.name)\n tooltipEmail.text(group.email)\n tooltipDescription.text(group.description)\n tooltipLink.attr(\"href\", \"/pages/groupdetails.html?group=\" + d.data.id)\n tooltipRemove.attr(\"onclick\", \"removeMemberModal('\" + d.data.id + \"', '\" + parentId + \"')\")\n tooltipAddMember.attr(\"onclick\", \"addMemberModal('\" + d.data.id + \"')\")\n}", "constructor(scope, id, props) {\n super(scope, id, { type: CfnVolume.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'availabilityZone', this);\n this.volumeId = this.ref.toString();\n const tags = props === undefined ? undefined : props.tags;\n this.tags = new cdk.TagManager(cdk.TagType.Standard, \"AWS::EC2::Volume\", tags);\n }" ]
[ "0.5636722", "0.56194675", "0.5404564", "0.5368507", "0.52721876", "0.5157866", "0.50252116", "0.50024897", "0.49790817", "0.49592012", "0.49435183", "0.48780602", "0.4846979", "0.48254502", "0.47996077", "0.46718708", "0.46257457", "0.45946336", "0.4593044", "0.45650542", "0.45576403", "0.4533844", "0.4458842", "0.44536665", "0.44408467", "0.44330657", "0.4430263", "0.44272983", "0.44272983", "0.44272983", "0.44272983", "0.44272983", "0.44272983", "0.44272983", "0.44141695", "0.44141546", "0.4397059", "0.43789598", "0.43789598", "0.43784264", "0.43769413", "0.43703184", "0.4363706", "0.43600482", "0.43582988", "0.4355848", "0.43491834", "0.434735", "0.43437797", "0.43199086", "0.43198687", "0.43022835", "0.4298297", "0.42728", "0.42680264", "0.42668837", "0.42583838", "0.42454594", "0.42454174", "0.42403504", "0.42380112", "0.42313343", "0.42302218", "0.4228481", "0.42283347", "0.42232263", "0.42219576", "0.421597", "0.42154208", "0.42085937", "0.4204924", "0.4198778", "0.4181622", "0.4178769", "0.41636854", "0.41631353", "0.41623983", "0.41494253", "0.4145405", "0.4134168", "0.41341367", "0.41323483", "0.41323483", "0.41250122", "0.41178834", "0.41169095", "0.41157642", "0.4106775", "0.4102071", "0.40984964", "0.40919134", "0.40902212", "0.40880093", "0.40874138", "0.40732878", "0.4070948", "0.40618092", "0.40563154", "0.40437958", "0.4041668" ]
0.700676
0
function that sets page to homepage
function loadHome() { app.innerHTML = nav + homepage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_home_page() {\n page = home_page;\n load_page();\n}", "function homepage()\n{\n window.location.href = '/';\n}", "function homePage() {\n window.location.href = initApi.homeUrl;\n //location.reload();\n }", "function loadHome(){\r\n switchToContent(\"page_home\");\r\n}", "function homepage() {\n chrome.storage.sync.get(['homepage'], function (result) {\n chrome.windows.getCurrent(function (win) {\n chrome.tabs.getSelected(win.id, function (tab) {\n chrome.tabs.update(tab.id, { url: result.homepage });\n });\n });\n });\n}", "function visitHomePage() {\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/index.html\";\n window.location = fullPath;\n}", "function Go_Home() {\n // Find my location \n var myLocation = window.location.href;\n var splited = myLocation.split('/');\n var newDir = myLocation.replace(splited[splited.length - 1], \"index.html\");\n\n window.location.replace(newDir);\n}", "function returnToHome(){\n\t\n}", "function home() {\n\t\t\tself.searchText('');\n\t\t\tconfigData.page = 1;\n\t\t\tgetPhotos();\n\t\t}", "function go_home() {\n\tdocument.getElementById(\"display-screen\").innerHTML = loading;\n\tx_home_page(\"\", do_display);\t\t\t\t\n}", "function goHome() {\n if (!isLoggedIn()) {\n return;\n }\n var home = '../personal/courses.html';\n window.location.assign(home);\n}", "function navigateToHome() {\n \twindow.location = \"/\";\n }", "function navigateToHome() {\n\t\t\twindow.location = \"/\";\n\t\t}", "function buildFrontPage() {\n $('.menu-home').toggleClass('selected-text');\n initHomepage()\n}", "function homePage(){\n document.getElementById(\"homepage\").style.display = \"block\";\n document.getElementById(\"detailpage\").style.display = \"none\";\n }", "function goHome(){\n window.location.replace('/')\n}", "function goHome() {\n window.location.assign(\"index.html\");\n}", "function returnToHome() {\n location.href = \"index.html\";\n}", "function showHomePage(page_name) {\n var root = $('<div>').addClass(_classes[page_name]).height(window.innerHeight);\n\n /* Title */\n //$('<figure>').append($('<img>').attr('src', 'resources/images/splash_title.png')).appendTo(root);\n /* Landing Logo */\n $('<div>').addClass('landing-logo fadeMe').appendTo(root).attr(\"style\", \"display:none\");\n /* Bottom */\n var qLandingBottom = $('<div>').addClass('landing-bottom fadeMe').attr(\"style\", \"display:none\").append($('<span>').html('Loading...'));\n qLandingBottom.appendTo(root);\n /* Loading Image */\n //$('<div>').addClass('landing-loader').append($('<img>').attr('src', 'resources/images/landig_loader.png')).appendTo(qLandingBottom);\n\n /* Google Anlytics */\n ga('send', 'screenview', {'screenName': 'Home'});\n\n return root;\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}", "function displayHome(pageToRemove) {\r\n\t\tcalculateNewBill(); // calculate for the homescreen\r\n\t\tremovePage(pageToRemove);\r\n\t\tdisplayPage(\"#mainOptions\");\r\n\t\tfocusOnInput(\"#optionsChoice\");\r\n\t\tcurrentPage = \"mainPage\";\r\n\t}", "function pageFirst()\n{\n\tcurrentPage = 1;\n\tviewPage();\n}", "function backHome(){\n window.location.replace(\"../homePage.html\");\n }", "static goToHome() {\n browser.refresh();\n new MenuBar().clickHome();\n }", "function goToHome() {\n if ($state.is('home')) $state.reload();\n else $state.go('home');\n }", "function goToHomePage(){\n window.location.href='./index.html';\n}", "function home(){\n\tapp.getView().render('vipinsider/insider_home.isml');\n}", "function navigateToHome(){\n window.location.assign('/home/');\n}", "function clickHome(){\r\n window.location.href = \"/\";\r\n}", "function backToHomeView () {\n currentFolder = -1\n showOneContainer(homeContain)\n fetchSingleUser(currentUser)\n }", "function go_mainpage(){\n\n object.getpage('mainpage.html');\n }", "function returnHome() {\n $state.go(constants.states.soon);\n }", "function toClientHome(){\n\t document.location.href = parentUrl(parentUrl(document.location.href));\n }", "function initialisePage(){\n\t\t\tcurrent_tab = \"about\";\n\t\t\tgenerateNav(register_navevents);\n\t\t\tgenerateFramework(current_tab, generatePage);\n\t\t\t// Enable button again\n\t\t\tbuttonOff();\n\t\t}", "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 renderHomePage() {\n var items = $('.cvt-report li');\n if (items) {\n items.remove();\n }\n \n var page = $('.home');\n page.addClass('visible');\n }", "function landing_page(){\n window.location.replace('./prototype.html');\n}", "function drawHomePage(req, res) {\n var db = req.db;\n var collection = db.get('pageContent');\n\n var data = collection.find({}, {}, function(e, docs) {\n var homeIntro = docs[0].homeIntro;\n var homeTitle = docs[0].homeTitle;\n var usrname = loggedInUser(req);\n\n if (usrname) {\n res.render('index', { title: homeTitle,\n intro: homeIntro,\n pagename: 'index',\n loginsite: 'Logout',\n username: usrname });\n }\n else {\n res.render('index', { title: homeTitle,\n intro: homeIntro,\n pagename: 'index',\n loginsite: 'Login',\n username: usrname });\n }\n });\n}", "function fnCallHomePage(){\n $('#rtnHomePage').html('<a class=\"navbar-brand\" onclick=\"window.location.replace(\\'index.html\\')\" title=\"Return To Home Page\"><i class=\"fa fa-reply-all\" aria-hidden=\"true\"></i></a>');\n }", "function moveToMainPage(pathName) {\n\tif(pathName.indexOf('locator.jsp') !== -1) {\n\t\t/* Moving to main_payment_page with #home for home(pay your bill) page */\n\t\tlocation.href = 'main_payment_page.jsp?resourceAppId=' + applicationId + '#home';\n\t\treturn;\n\t}\n\thashChangedCalled = true;\n\tmakeActiveTab('footerHomeTab');\n\tbookmarks.sethash(\"#home\", loadHomeScreenArea);\n}", "static resetToHomePage(params) {\n const {navigation} = params;\n navigation.navigate('Main');\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}", "function _page1_page() {\n}", "function showHome(request){\n\trequest.respond(\"This is the home page.\");\n}", "function gotoPage(){\n\t\t//checks for hashes\n\t\t\tif(window.location.hash) {\n\t\t\t\tvar hash\t\t=\twindow.location.hash.substring(1).split('/');\n\t\t\t\tpageNumber\t=\t(hash[1] == undefined)?1:parseInt(hash[1]);\n\t\t\t\tarticle\t\t\t=\tparseInt(hash[0]);\n\t\t\t\tupdatePageInfo();\n\t\t\t}\n\t\t\t\n\t\t\t$(\".page\").hide();\n\t\t\tif(!$(\".page-\"+pageNumber+\"#article_\"+article).is(':hidden'))\n\t\t\t{\n\t\t\t\t$(\".page.last#article_\"+article).show();\n\t\t\t\tpageNumber\t=\tparseInt($(\".page.last#article_\"+article).attr(\"data-pageNumber\"));\n\t\t\t\tupdatePageInfo();\n\t\t\t}else{\n\t\t\t\t$(\".page-\"+pageNumber+\"#article_\"+article).show();\n\t\t\t}\n\t\t}", "function setPage()\n{\n var winH = $(window).height();\n var winW = $(window).width();\n var winName = location.pathname.\n substring(location.pathname.lastIndexOf(\"/\") + 1);\n $('#restofpage').css('height', winH-90);\n $('#restofpage').css('width', winW);\n}", "function first_page(){\n\tif (localStorage.synced!='YES'){\t\n\t\tvar url = \"#login\";\n\t\t$.mobile.navigate(url);\t\t\n\t}else{\n\t\tvar url = \"#pageHome\";\n\t\t$.mobile.navigate(url);\t\t\n\t\t};\n}", "function setCurrentPage(){\n var navigationContainer = document.getElementById(\"navigation\")\n var navBarListCollection = navigationContainer.getElementsByTagName('li');\n var navBarLinkCollection = navigationContainer.getElementsByClassName('menulink');\n \n var currentPageArray = window.location.pathname.split('/');\n var currentPagePath = currentPageArray[1]\t\n \n for (var j=0; j < navBarListCollection.length; j++) {\n \n navBarLinkPathCollectionArray = navBarLinkCollection[j].pathname.split('/')\n\n\t\tif (currentPagePath == 'home' || currentPagePath == \"\") {\n\t \tnavBarLinkCollection[0].className = 'active';\n break;\t\n\t\t}else if (currentPagePath == navBarLinkPathCollectionArray[1] || currentPagePath == navBarLinkPathCollectionArray[0]) {\n\t \tnavBarLinkCollection[j].className = 'active';\n\t \tbreak;\n\t\t}\n }\n}", "function getHome() {\n var current = $(location).attr('href');\n var tabcurrent = current.split('/');\n var lastElement = tabcurrent[tabcurrent.length-1];\n var newlink = current.replace(lastElement,'home');\n window.location.href = newlink;\n}", "function returnToMain() {\n window.location = 'top-posts.html';\n}", "function homePage(){\r\n //This function will hide the sales and show homepage\r\n $(\".contain_Sales\").hide();\r\n $(\".contain_Charts\").hide();\r\n $(\".contain_Home\").show();\r\n }", "function visitHomePageBuy() {\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/index.html\";\n window.location = fullPath;\n}", "function goToHomePage(){\n clearques();\n self.location=\"index.html\";\n}", "function loadHomePage(){\n\tloadNavbar();\n\tloadJumbotron();\n\tgenerateCarousels();\t\n}", "function showHomePage() {\n $('#greet-user').text('Bookmarks');\n $('#logout-button').hide();\n $('#login-div').show();\n $('#register-div').hide();\n $('#bookmarks-view').hide();\n }", "function setNavData()\n{\n \nif (document.title == \"home.html\" || document.title == \"contact.html\" || document.title == \"project.html\") \n {\n loadHeader();\n loadFooter(); \n } \n}", "function goHome(){\n window.location = \"../../index.html\"\n}", "function redirectToHome() {\n\t\twindow.location = \"/\";\n\t}", "function home() {\n $('html, body').animate({\n scrollTop: $homePage.offset().top\n }, 800);\n }", "function onPopAndStart(){\n var l = location.href;\n //http://localhost/.../hash\n var pageName = l.substring(l.lastIndexOf(\"/\")+1);\n // if no pageName set pageName to false\n pageName = pageName || false;\n switchToSection(pageName);\n }", "function setHomeScreen(){\n var main = Ext.getCmp('MainPanel');\n var calendarButton = FRIENDAPP.app.getController('DashboardController').getCalendarButton();\n calendarButton.addCls('activeCls');\n FRIENDAPP.app.getController('DashboardController').activeButton = calendarButton;\n main.setActiveItem(1);\n return;\n }", "function initHomepageSlider() {\n\n\tvar home = $('.home');\n\n\tif ( home.length == 0 ) return;\n\n\n\tvar slider = $('.bxslider').bxSlider({\n\t\tauto: true,\n\t});\n\n\t$('.right-arrow').click( function() {\n\t\tslider.goToNextSlide();\n\t});\n\n\t$('.left-arrow').click( function() {\n\t\tslider.goToPrevSlide();\n\t});\n}", "function pageHome(request, response) {\r\n response.send('<h1>Welcome to Phonebook</h1>')\r\n}", "get homepageURL() {\n let url = this._formatURLPref(PREF_GETADDONS_BROWSEADDONS, {});\n return (url != null) ? url : \"about:blank\";\n }", "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 navToAbout() {\r\n location = \"about.html\"\r\n}", "function loadPage( url ){\n\tif(url == null){\n\t\t//home page first call\n\t\tpages[0].style.display = 'block';\n\t\thistory.replaceState(null, null, \"#home\");\t\n\t}else{\n \n for(var i=0; i < numPages; i++){\n if(pages[i].id == url){\n pages[i].style.display = \"block\";\n history.pushState(null, null, \"#\" + url);\t\n }else{\n pages[i].style.display = \"none\";\t\n }\n }\n for(var t=0; t < numLinks; t++){\n links[t].className = \"\";\n if(links[t].href == location.href){\n links[t].className = \"activetab\";\n }\n }\n\t}\n}", "function goToPage( pageName, config )\n {\n // If no pages, just go to home\n if( pageName.length === 0 )\n return;\n \n // Add current state to history\n if( window.history.pushState && config.useHistory )\n window.history.pushState( { page: pageName }, document.title, pageName );\n \n // Scroll to the proper page\n scrollToPage( pageName, config );\n }", "function initHome() {\n\tgetCurrentUser();\n\tinitializeStudentInfo();\n\tloadCourses(buildCourseContent);\n\tprogressBarFunc();\n\tw3_open(); \n}", "processGoHome() {\n window.todo.model.goHome();\n }", "function onUserEnter(){\n\n // *Checking if current page exists and if it has an history entry:\n if(history.state && pageExists(history.state.page_name)){\n // *If it exists:\n // *Loading it:\n loadPage();\n } else{\n // *If not (The user may be hard typing the url):\n // *Getting only the first part of the path:\n let match = /[^/]\\S*?[^/]*/gi.exec(window.location.pathname);\n var page_name = match?match[0]:'';\n\n // *Checking if it exists:\n if(pageExists(page_name)){\n // *If exists, navigate to it:\n navigateTo(page_name);\n } else{\n // *If it not:\n // *Navigating to fallback page:\n navigateTo();\n }\n }\n }", "function setPage(value) {\n currentPage = value;\n}", "function homePageLoader() {\n\n pageCreator(\"home-page\");\n navBar(\"home-page\");\n restaurantLogo();\n bookTableBtn(\"home-page\");\n socialMedia();\n}", "function setPageTitle(){\n\tif(pmgConfig.pmgSubTitle){\n\t\tdocument.tile = pmgConfig.siteTitle + ' - ' + pmgConfig.pmgSubTitle;\n\t}\n\telse{\n\t\tdocument.tile = pmgConfig.siteTitle;\n\t}\n}", "function redirectHome(request, response) {\n\t\tresponse.redirect('/home');\n\t}", "initialPage() {\n this.ltClicked({'page': 1});\n this.currentPage = 1;\n this.leftPage = 1;\n this.atFirstPage = true;\n this.setPageGroups(this.currentPage);\n }", "function initializePage() {\n if(!localStorage.getItem('curUser') && location.href.includes(\"index.html\")){\n location.replace('login.html');\n }\n}", "function goPage(url){\n var index=url.indexOf('#');\n if(index==-1){\n url=url+window.location.hash;\n }\n reload(url);\n}", "function tohome(loc) {\n\tvar url = \"index.html\";\n\tif (loc == \"non-payment\") // if the logo button is clicked in non payment pages , it will directly direct to homepage\n\t{\n\t\twindow.location.href = url;\n\t}\n\telse // if logo button is clicked in payment page then user has to confirm to leave the page\n\t{\n\t\tif (window.confirm(\"Are you sure you want to leave?\")) {\n\t\t\twindow.location.href = url;\n\t\t}\n\t\telse {\n\t\t\tdie();\n\t\t}\n\t}\n}", "function goToStudy() {\n window.location.pathname = '/study';\n}", "function init() {\n\n\t\t// > = greatar than\n\t\t// < = less than\n\t\t\n\n\t\t/* -------------------------------------------------- */\n\t\t/* CACHE\n\t\t/* -------------------------------------------------- */\n\t\t\n\t\tvar page = $('.page').data('page');\n\n\n\t\t/* -------------------------------------------------- */\n\t\t/* HOME\n\t\t/* -------------------------------------------------- */\n\n\t\tif ( page === 'index' ) {\n\t\t\t\n\t\t\tconsole.log('Home Page');\n\t\t\t\n\t\t}\n\t \n\t\t\n\t /* -------------------------------------------------- */\n\t\t/* PRIVACY AND TERMS OF USE\n\t\t/* -------------------------------------------------- */\n\n\t\telse if ( page === 'legal' ) {\n\n\t\t\tconsole.log('Privacy and Terms of Use Page');\n\t\t\t\n\t\t}\n\t \n\t\t\n\t\t/* -------------------------------------------------- */\n\t\t/* ERROR\n\t\t/* -------------------------------------------------- */\n\n\t\telse {\n\n\t\t\tconsole.log('Error Page');\n\t\t\t\n\t\t}\n\n\t}", "function loadHome() {\r\n hideall();\r\n\r\n var top = document.getElementById(\"Welcome\");\r\n\r\n top.innerHTML=(\"Weclome Home \" + user);\r\n \r\n $(\"#home\").show();\r\n $(\"#sidebar\").show();\r\n deactiveAll();\r\n $(\"#side-home\").addClass(\"active\");\r\n $(\"#navbar\").show();\r\n\r\n // Additonal calls \r\n clearCalendar();\r\n makeCalander();\r\n}", "function Start()\n {\n PageSwitcher();\n\n Main();\n }", "function homePage() {\n window.open('index.html', '_self');\n}", "function goHome(req, res){\n res.redirect('/');\n res.end();\n}", "function goHome(sourcefile) {\r\n\twindow.location.href = sourcefile + '/';\r\n}", "function home(req, res) {\n return res.render('index', {\n ENV: JSON.stringify(ENV), // pass environment variables to html\n title: 'Hack University',\n page: 'home',\n url: `${HOST}`,\n layout: 'layout' // change layout\n });\n}", "function setPage() {\n setNavigation();\n $('#tabs').tabs();\n resetGeneralDetailsForm();\n resetReportBugsForm();\n getAdminDetails();\n loadTermsOfUseDetails();\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 _init() {\r\n // set page <title>\r\n Metadata.set(home.title);\r\n\r\n // activate controller\r\n _activate();\r\n }", "changeToMainPage(num) {\n this.props.history.push(\"/\");\n }", "function LoadPageContent() {\n switch (document.title) {\n case \"Home\":\n LoadHomePage();\n break;\n\n case \"Projects\":\n LoadProjectsPage();\n break;\n\n case \"Contact\":\n LoadContactPage();\n break;\n }\n}", "function loginScreen() {\r\n var newLocation = \"#pageHome\";\r\n window.location = newLocation;\r\n}", "function goHome() {\n WinJS.log && WinJS.log(\"You are home.\", \"sample\", \"status\");\n }", "function index_page() {\n //Replaces index page with template page.\n window.open(\"index.html\", \"_self\");}", "function goToHome() {\n document.location.href = \"./TestMain.html\"\n}", "function initializePage() {\n\t// add any functionality and listeners you want here\n\n\t//listener function for the content buttons in the home page.\n\t\n\t\n\t\n\t\n}", "function definePage() {\n var fullURL = window.location.href;\n var splitURL = fullURL.split(\"\"); \n var holder = [];\n\n for(i = splitURL.length-1; i > splitURL.length-9; i--) {\n holder.push(splitURL[i]);\n }\n\n holder.reverse();\n \n userURL = holder.join(\"\");\n }", "function LoadPageContent(){\n switch (document.title) {\n\n case \"Home\":\n LoadHomePage();\n break;\n\n case \"Projects\":\n LoadProjectsPage();\n break;\n\n case \"Contact\":\n LoadContactPage();\n break;\n\n } //end case\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 }" ]
[ "0.7465852", "0.72381514", "0.7149455", "0.69634235", "0.6876936", "0.67171496", "0.65555054", "0.65536964", "0.6534664", "0.65315646", "0.6530716", "0.65119815", "0.64897424", "0.64876705", "0.6478199", "0.6460957", "0.64606", "0.64464563", "0.643787", "0.64369375", "0.6428498", "0.6425657", "0.6418992", "0.6409568", "0.64032406", "0.63768613", "0.6358569", "0.6340207", "0.6334533", "0.63316506", "0.6330657", "0.63213533", "0.6319347", "0.62744224", "0.62726206", "0.62722164", "0.6265473", "0.62520975", "0.62519085", "0.6225275", "0.62133", "0.6205455", "0.6202124", "0.6198601", "0.61939985", "0.6192181", "0.61921483", "0.6190263", "0.6187878", "0.6185305", "0.61677015", "0.6162003", "0.61489785", "0.6147663", "0.61444956", "0.6143135", "0.6141748", "0.6139273", "0.6134715", "0.6131983", "0.60834724", "0.60834205", "0.6081962", "0.6079566", "0.6068145", "0.60496193", "0.6029339", "0.6026312", "0.60133266", "0.60036093", "0.599952", "0.59935033", "0.5991722", "0.5984264", "0.59831893", "0.5980839", "0.5973113", "0.5972989", "0.5966994", "0.5952071", "0.59472346", "0.5941794", "0.59344786", "0.5929176", "0.5923519", "0.5922687", "0.59196126", "0.59193665", "0.5918032", "0.5917126", "0.59140444", "0.5913888", "0.59104586", "0.5910272", "0.59101087", "0.5902722", "0.58995056", "0.5896827", "0.5895918", "0.5895596" ]
0.6657743
6
fucntion that sets page to about page
function loadAbout() { app.innerHTML = nav + about; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toAbout() {\r\n window.location.replace('/about');\r\n }", "function navToAbout() {\r\n location = \"about.html\"\r\n}", "function aboutPage() {\n location.href = \"about.html\"\n}", "function goToAboutPage () {\n window.location.href = \"about.html\"\n}", "function updateAboutPage(urlObj, options) {\n\tvar $page = $( urlObj.hash );\n\t$page.page();\n\toptions.dataUrl = urlObj.href;\n\t$.mobile.changePage( $page, options );\n\tupdatePageLayout(\"#aboutContent\", \"#aboutHeader\", \"#aboutNavbar\");\n}", "function gotoAbout() {\n location.href = \"about.html\";\n}", "aboutPage() {\n return __awaiter(this, void 0, void 0, function* () {\n });\n }", "function renderAboutPage(){\n\t\tvar page = $('.about');\n\t\tpage.addClass('visible');\n\t}", "function renderAboutPage(){\n\t\tvar page = $('.about');\n\t\tpage.addClass('visible');\n\t}", "function activate() {\n\t\t\tappState.pageTitle = \"About\";\n\t\t}", "function GoToAboutUs() {\n\twindow.location.href=\"AboutUs.html\";\n}", "function onAboutPageButtonClicked(event)\n {\n this.aboutPageButtonView.toggleClass('open');\n this.aboutPageContainerView.toggleClass('open');\n }", "showAbout(request, response) {\n return response.render('app/pages/about-us');\n }", "function aboutUs(){\n window.location.href = \"about_us.html\";\n}", "function initialisePage(){\n\t\t\tcurrent_tab = \"about\";\n\t\t\tgenerateNav(register_navevents);\n\t\t\tgenerateFramework(current_tab, generatePage);\n\t\t\t// Enable button again\n\t\t\tbuttonOff();\n\t\t}", "function aboutmeClick(){\r\n\t\tcallAjax(createAboutme, \"aboutme\", \"get\");\r\n\t}", "function aboutPage()\n {\n // did we already download that?\n if (app.graphs === void 0) {\n $.getJSON(\"static/js/graphs.json\", function(graphs) {\n app.graphs = graphs;\n\n // mutate once to turn 0.75(...) to 75.(...)\n app.graphs.forEach(function (graph) {\n graph.series.forEach(function (member) {\n member.data.forEach(function (datum, _i, data) {\n // mutate array members\n data[_i] = (datum * 100);\n });\n });\n });\n\n // key iteration\n app.graphs.forEach(function (graph) {\n drawLineGraph(graph.title, {series: graph.series}, graph.time, graph.title);\n });\n });\n\n } else {\n // key iteration\n $(\"#line-graphs\").empty();\n\n app.graphs.forEach(function (graph) {\n drawLineGraph(graph.title, {series: graph.series}, graph.time, graph.title);\n });\n }\n\n // Clear graph content and about page if there\n //$('#metro-pie-charts').empty()\n //$('#census-pie-charts').empty()\n }", "function navigateToAbout() {\n return util.tapElementByCss(\"main.SettingsViewController ul li > button[value='about']\")\n .then(() => util.elementByCssDisplayed(\"main.AboutViewController.displayed\"));\n}", "function about(req, res){\n res.render('about', {selected: \"about\"});\n}", "function renderAboutPage(context) {\n context.loggedIn = sessionStorage.getItem('authtoken') !== null;\n context.username = sessionStorage.getItem('username');\n\n this.loadPartials({\n header: './templates/common/header.hbs',\n footer: './templates/common/footer.hbs'\n }).then(function () {\n this.partial('./templates/about/about.hbs');\n });\n }", "function openAboutPage() {\r\n\tif(askadmissionsPage === true){\r\n\t\tchrome.tabs.create({\"url\": \"/about.html\" });\r\n\t}\r\n}", "static get is() {\n return \"page-about\";\n }", "about(request, response){\n\t\tresponse.send('about HomeController');\n\t}", "about(request, response){\n\t\tresponse.send('about HomeController');\n\t}", "function gotoPage(){\n\t\t//checks for hashes\n\t\t\tif(window.location.hash) {\n\t\t\t\tvar hash\t\t=\twindow.location.hash.substring(1).split('/');\n\t\t\t\tpageNumber\t=\t(hash[1] == undefined)?1:parseInt(hash[1]);\n\t\t\t\tarticle\t\t\t=\tparseInt(hash[0]);\n\t\t\t\tupdatePageInfo();\n\t\t\t}\n\t\t\t\n\t\t\t$(\".page\").hide();\n\t\t\tif(!$(\".page-\"+pageNumber+\"#article_\"+article).is(':hidden'))\n\t\t\t{\n\t\t\t\t$(\".page.last#article_\"+article).show();\n\t\t\t\tpageNumber\t=\tparseInt($(\".page.last#article_\"+article).attr(\"data-pageNumber\"));\n\t\t\t\tupdatePageInfo();\n\t\t\t}else{\n\t\t\t\t$(\".page-\"+pageNumber+\"#article_\"+article).show();\n\t\t\t}\n\t\t}", "function showHomePage() {\n $('#greet-user').text('Bookmarks');\n $('#logout-button').hide();\n $('#login-div').show();\n $('#register-div').hide();\n $('#bookmarks-view').hide();\n }", "function about() {\n stopHandlers();\n AboutHandler.start();\n}", "function About() {\n\n}", "openHelpPage() {}", "function displayHelpPage() {\n // Set display to \"no category selected\".\n pageCollection.setCategory('noCat');\n // Display the default page.\n pageCollection.setPage('helpPage');\n}", "function goHome() {\n if (!isLoggedIn()) {\n return;\n }\n var home = '../personal/courses.html';\n window.location.assign(home);\n}", "function editor_about(objname) {\r\n showModalDialog(_editor_url + \"/html/egovframework/com/cmm/utl/htmlarea/popups/about.html\", window, \"resizable: yes; help: no; status: no; scroll: no; \");\r\n}", "function renderAbout(req, res) {\n res.ViewData.title = \"Labumentous - About\";\n res.render(\"about\", res.ViewData);\n }", "function switchHash(){\n\t\t\tif(location.hash.substring(1)==\"about\") return \"#\";\n\t\t\telse return \"#about\";\n\t\t}", "function aboutUs(req, res) {\n res.status(200).render('pages/aboutUs.ejs');\n}", "function go_mainpage(){\n\n object.getpage('mainpage.html');\n }", "function showAbout() {\n $(\"#page-content\").hide(1000, function () {\n $.get(URL_ABOUT, function (data) {\n $(\"#page-content\").html(data);\n $(\"#page-content\").show(1000);\n $([document.documentElement, document.body]).animate({\n scrollTop: $(\"#page-content\").offset().top\n }, 2000);\n });\n });\n}", "function aboutSetup(){\n\n}", "function goInfo() {\n window.location.href = \"infoPage.html\";\n }", "function fnCallHomePage(){\n $('#rtnHomePage').html('<a class=\"navbar-brand\" onclick=\"window.location.replace(\\'index.html\\')\" title=\"Return To Home Page\"><i class=\"fa fa-reply-all\" aria-hidden=\"true\"></i></a>');\n }", "function showAbout () {\n showModalDialog({\n type : 'about',\n app : {\n version : (packageJson && packageJson.version)\n }\n });\n}", "function CallAboutPage(){\n\tshowElementAbove(DOMPageContentList[1]);\n\tDIV_SgvHolder.style.overflow = \"scroll\";\n}", "function getAboutViewModel(callback) {\n var page = topLevelPages.about;\n callback(null, new ViewModel(page.title, page.pageTemplateName));\n }", "function renderPage(page){\n switch(page){\n case menuItems[0]:\n return <AboutMe/>;\n\n case menuItems[1]:\n return <Portfolio/>;\n\n case menuItems[2]:\n return <Resume/>;\n \n // case menuItems[3]:\n // return <ContactForm/>;\n\n //***shouldnt occur but it will present About Me section\n default:\n return <AboutMe/>;\n }\n }", "handleNavPage(e) {\n history.push('/GeneralQuestionnarie');\n }", "function setPage() {\n setNavigation();\n $('#tabs').tabs();\n resetGeneralDetailsForm();\n resetReportBugsForm();\n getAdminDetails();\n loadTermsOfUseDetails();\n}", "function openDetail () {\n\t\t\t$state.go('about.detail');\n\t\t}", "function homePage(){\n document.getElementById(\"homepage\").style.display = \"block\";\n document.getElementById(\"detailpage\").style.display = \"none\";\n }", "function load_home_page() {\n page = home_page;\n load_page();\n}", "function load_about() {\n\t\tvar about_card = new UI.Card({\n\t\t\tbody: 'WMATA With You\\n' +\n\t\t\t\t'version 2.5\\n' +\n\t\t\t\t'by Alex Lindeman\\n\\n' +\n\t\t\t\t'Built with Pebble.js and the WMATA API.',\n\t\t\tscrollable: true\n\t\t});\n\t\tabout_card.show();\n\t}", "function showAbout() {\n\n\t$('#modal_about').modal();\n\n}", "function _settings_page() {\n}", "function makeOverviewTutorialURL(includeNav) {\r\n return (overviewTutorialURL + \"#\" + \"pagemode=bookmarks\" + \"&\" +\"nameddest=\");\r\n}", "function show(view){\n\t\tif(view === 'about' ){\n\t\t\tsetHomeState(false)\n\t\t\tsetToggleWork(!toggleWork)\n\t\t\tsetContainerXPos('50')\n\t\t\tsetNavProjects(navWork === 'Work' ? '' : 'Projects')\n\t\t\tsetNavWork(navWork === 'Work' ? '': 'Work')\n\t\t\tsetNavAbout(navAbout === 'About' ? 'Home': 'About')\n\t\t\tsetGitState(gitState === 'Portfolio Git' ? '' : 'Portfolio Git')\n\t\t}\n\t\telse{\n\t\t\t\n\t \t\tsetGrayScale(!grayScale) \n\t\t\tsetHomeState(false)\n\t\t\tsetToggleWork(!toggleWork)\n\t\t\tsetContainerXPos('-50%')\n\t\t\tsetButton(button === '>' ? 'x': '>')\n\t\t\tsetNavWork(navWork === 'Work' ? 'Home': 'Work')\n\t\t}\n\t\n\t\t//We disable the html from scrolling when we are not on the home page\n\t\t!toggleWork ? document.querySelector('body').classList.remove('bodyNoScroll') : document.querySelector('body').classList.add('bodyNoScroll');\n\n\n\t\t//disable the ability to scroll if you're not on the Home section\n\t\t!toggleWork ? setHomeState(true) : setHomeState(false)\n\t\t!toggleWork ? setWidth(scrollBarW) : setWidth(0)\n\n\t\n\t}", "function setEditPage(){\r\n\r\n\t\tvar hash = location.hash;\r\n\t\tvar albumId = parseInt( hash.substring( hash.indexOf('/') + 1 ) );\r\n\t\t\r\n\t\tvar albumTitle;\r\n\t\tvar footerHTML;\r\n\r\n\t\tfor(var i = 0 ; i < albums.length ; i++){\r\n\t\t\tif(albumId === albums[i].id){\r\n\t\t\t\talbumTitle = albums[i].title;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tvar headerHTML = $('#albumHeader').html();\r\n\t\theaderHTML = headerHTML.replace( '{{AlbumTitle}}' , albumTitle );\r\n\r\n\t\t$('#header').html(headerHTML);\r\n\r\n\r\n\t\t//Code to set content\r\n\t\t$(\"#content\").html('');\r\n\r\n\t\tvar photos = albums[i].photos;\r\n\r\n\r\n\t\tfor( var i = 0 ; i < photos.length ; i++ ){\r\n\t\t\tvar photoHTML = $('#photoTemplate').html();\r\n\r\n\t\t\tphotoHTML = photoHTML.replace( '{{url}}' , photos[i].url);\r\n\t\t\tphotoHTML = photoHTML.replace( '{{albumId}}' , photos[i].albumId);\r\n\t\t\tphotoHTML = photoHTML.replace( '{{id}}' , photos[i].id);\r\n\t\t\tphotoHTML = photoHTML.replace( '{{edit}}' , '#editPhoto/'+albumId +'/' +photos[i].id);\r\n\t\t\tphotoHTML = photoHTML.replace( '{{delete}}' , '#deletePhoto/'+albumId +'/' +photos[i].id);\r\n\t\t\tphotoHTML = photoHTML.replace( '{{title}}' , photos[i].title);\r\n\r\n\t\t\t$('#content').append(photoHTML);\r\n\t\t}\r\n\t\tvar $fabAdd = $('<a />').attr(\"href\", '#addPhoto/'+albumId).attr('id' , 'fabAdd').html('+');\r\n\t\t$('#content').append($fabAdd);\r\n\r\n\r\n\t\tfooterHTML = $('#footerTemplate').html();\r\n\t\tfooterHTML = footerHTML.replace( '{{saveChanges}}' , '#saveAlbum/'+albumId);\r\n\t\tfooterHTML = footerHTML.replace( '{{cancelChanges}}' , '#cancelAlbum/'+albumId);\r\n\t\t$('#footer').css({\r\n\t\t\t'position':'fixed',\r\n\t\t\t'height' : '60px',\r\n\t\t\t'width' : '100%',\r\n\t\t\t'bottom' : '0px',\r\n\t\t\t'left' : '0px',\r\n\t\t\t'visibility' : 'visible'\r\n\t\t}).html(footerHTML);\r\n\r\n\r\n\t}", "function goToPage( pageName, config )\n {\n // If no pages, just go to home\n if( pageName.length === 0 )\n return;\n \n // Add current state to history\n if( window.history.pushState && config.useHistory )\n window.history.pushState( { page: pageName }, document.title, pageName );\n \n // Scroll to the proper page\n scrollToPage( pageName, config );\n }", "function getIt(thepage){\n changeView(thepage);\n override();\n $('#footer').fadeIn('slow');\n }", "function homePage() {\n window.location.href = initApi.homeUrl;\n //location.reload();\n }", "function helpNav(){\n helpBox.innerHTML = \"<h3 style='color: white; font-style: italic'>This is the navigation bar. It displays links to other basic applications on the site. Authentication is also listed.</h3>\";\n showHelp();\n }", "function goToHomePage(){\n clearques();\n self.location=\"index.html\";\n}", "function getAbout(request, response) {\r\n response.render('pages/about');\r\n app.use(express.static('./public'));\r\n}", "function About() {\n\n if (ClickAbout) { \n section_3.style.display=\"inline-block\";\n section_2.style.display=\"none\";\n linkAbout.setAttribute(\"href\", \"#section_3\");\n buttonAbout.setAttribute(\"value\", \"Corrispondenze\");\n ClickAbout=false;\n \n } else {\n linkAbout.setAttribute(\"href\", \"#section_1\");\n section_3.style.display=\"none\";\n buttonAbout.setAttribute(\"value\", \"About\");\n ClickAbout=true;\n }\n \n}", "function showAbout() {\n $('#modal-container').html(about_wpaudit_template())\n $('#modal-container').modal()\n}", "function AboutViewModel() {\n \n\t \n\t \n return AboutViewModel();\n }", "about(request, response){\n\t\tresponse.json({\n\t\t\tpage: 'about HomeController',\n\t\t\tisControllerFilter: response.locals.isControllerFilter,\n\t\t\tisActionFilter: response.locals.isActionFilter || false\n\t\t});\n\t}", "function about_scroll() {\n $('#about').click(function(){\n $('html, body').animate({\n scrollTop: $('.about').offset().top\n }, 500);\n });\n} // end of function about_scroll", "function titlePage(){\n\t\t$('.title-page').html('<h2 class=\"text-center\">'+objet_concours[last_concours]+'</h2>');\n\t}", "handleClick() {\n\t\tthis.props.changePage(\"aboutSplunk\");\n\t}", "function prepareAboutTab(){\n populateAboutVersionInformation()\n populateReleaseNotes()\n}", "function changeAboutContent(event) {\n\n aboutContents.forEach(content => {\n content.getAttribute('data-name') === event.target.getAttribute('data-name') ? content.style.display = 'block' : content.style.display = 'none'\n })\n aboutToggles.forEach(toggle => {\n toggle === event.target ? toggle.classList.add('about_toggle_on') : toggle.classList.remove('about_toggle_on')\n })\n\n }", "function loadHome(){\r\n switchToContent(\"page_home\");\r\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 drawHomePage(req, res) {\n var db = req.db;\n var collection = db.get('pageContent');\n\n var data = collection.find({}, {}, function(e, docs) {\n var homeIntro = docs[0].homeIntro;\n var homeTitle = docs[0].homeTitle;\n var usrname = loggedInUser(req);\n\n if (usrname) {\n res.render('index', { title: homeTitle,\n intro: homeIntro,\n pagename: 'index',\n loginsite: 'Logout',\n username: usrname });\n }\n else {\n res.render('index', { title: homeTitle,\n intro: homeIntro,\n pagename: 'index',\n loginsite: 'Login',\n username: usrname });\n }\n });\n}", "function _page1_page() {\n}", "function displayAbout() {\n window.scrollTo(0, window.innerHeight);\n setTimeout(() => {\n window.scrollTo(0, window.innerHeight * 2);\n setTimeout(() => {\n window.scrollTo(0, window.innerHeight * 3);\n }, 1000);\n }, 1000);\n}", "function createIntroWindow() {\n pageCollection.showHelp();\n}", "function setup(){\r\n document.getElementById('backButton').setAttribute('href', '/home/' + thisUser.id);\r\n\r\n}", "function PagesNavigation() {\n\n}", "function initializePage() {\n\t// add any functionality and listeners you want here\n\n\t//listener function for the content buttons in the home page.\n\t\n\t\n\t\n\t\n}", "function setPage (name, page, opts) {\n var el = document.getElementById('page-container')\n el.innerHTML = ''\n if (!opts || !opts.noHeader)\n el.appendChild(com.page(phoenix, name, page))\n else\n el.appendChild(h('#page.container-fluid.'+name+'-page', page))\n resizeControls()\n}", "function show_about_us_page_content() {\n\tif (checksameurl(location.href, aboutuspage) == true && about_us_auto_content == true) {\n\t\tif (show_if_enabled(company_address) !== false || show_company_location === true) {\n\t\t\tdocument.write(company_name + ' ');\n\t\t\tif (show_if_enabled(VAT_Tax_ID) !== false) { document.write('(' + VAT_Tax_ID + ')'); }\n\t\t\tdocument.write(' ' + translate_sentence('is a good online commercial company based in') + ' ');\n\t\t\tif (show_if_enabled(company_address) !== false) { document.write(translate_sentence(company_address) + ', '); }\n\t\t\tif (show_company_location === true) { document.write(translate_sentence(company_city) + ' (' + translate_sentence(company_country) + ')'); }\n\t\t\tdocument.write('. ');\n\t\t}\n\t\tdocument.write(translate_sentence('Our company has earned itself a solid reputation for quality, good service, reliability and professionalism in this field') + '. ');\n\t\tdocument.write(translate_sentence('Our operation capabilities cover favorable policy, instant and safe delivery, privacy protection and well-rounded customer support') + '. ');\n\t\tdocument.write(translate_sentence('The mission of') + ' ' + company_name + ' ' + translate_sentence('is to provide you with the best products to the best prices') + '.<br/><br/>');\n\t\tdocument.write(translate_sentence('Our reputation, experience and keen industry insight permit us to negotiate low prices on the net') + '. ');\n\t\tdocument.write(translate_sentence('If you have a suggestion you would like to share with our team, please let us know') + '. ');\n\t\tdocument.write(translate_sentence('Customer feedback shapes our business and allows us to better serve our audience so your ideas are always welcome') + '.<br/><br/>');\n\t\tdocument.write(company_name + ' ' + translate_sentence('respects your right to privacy') + '. ');\n\t\tdocument.write(translate_sentence('Our goal is your complete satisfaction and we are not in the business of sharing your information with others') + '. ');\n\t\tdocument.write(translate_sentence('All personal data is stored on our secure server with several layers of firewall protection') + '.<br/><br/>');\n\t\tdocument.write(translate_sentence('We promise to') + ':<br/> * ' + translate_sentence('Provide 24/7 customer support on weekdays') + '.<br/>');\n\t\tdocument.write(' * ' + translate_sentence('Streamline the buying and paying process') + '.<br/>');\n\t\tdocument.write(' * ' + translate_sentence('Deliver goods to our customers with speed and precision') + '.<br/>');\n\t\tdocument.write(' * ' + translate_sentence('Ensure the excellent quality of our products') + '.<br/> * ' + translate_sentence('Secure payment') + '.<br/><br/>');\n\t\tdocument.write(translate_sentence('We hope our customers get a great experience buying our products') + '.<br/>');\n\t}\n}", "function showHome(request){\n\trequest.respond(\"This is the home page.\");\n}", "function handleInfoIcon(){\n\tif(SOUNDS_MODE){\n\t\taudioClick.play();\t\n\t}\n\t\n\tTi.API.info('Show About screen');\n\t\n\tmtbImport(\"about.js\");\n\tbuildAboutView();\n\tviewAbout.animate(anim_in);\n}", "function showAbout() {\n var ui = HtmlService.createHtmlOutputFromFile('About')\n .setWidth(420)\n .setHeight(270);\n SpreadsheetApp.getUi().showModalDialog(ui, 'About CTracker');\n}", "function clickAbout(rquest, response) {\n console.log(\"Clicked to About\")\n response.end();\n}", "function runAbout() {\n //Amimation for about section\n about.addEventListener(\"click\", () => {\n sectionAbout.classList.add(\"fadeInLeft\", \"show\");\n sectionAbout.classList.remove(\"fadeInLeftBack\", \"hide\");\n sectionResume.classList.remove(\"fadeInLeft\");\n sectionResume.classList.add(\"fadeInLeftBack\", \"hide\");\n sectionBlog.classList.remove(\"fadeInLeft\");\n sectionBlog.classList.add(\"fadeInLeftBack\", \"hide\");\n sectionWork.classList.remove(\"fadeInLeft\");\n sectionWork.classList.add(\"fadeInLeftBack\", \"hide\");\n sectionContact.classList.remove(\"fadeInLeft\");\n sectionContact.classList.add(\"fadeInLeftBack\", \"hide\");\n });\n}", "function renderHome(){\n \n const content = document.getElementById('tab-content');\n content.classList.add('flex-lay');\n content.classList.remove('grid-lay');\n \n content.textContent = '';\n \n const aboutSection = createAboutSection();\n \n setBtnActive('home');\n \n content.appendChild(aboutSection);\n}", "function about() {\n chrome.extension.getBackgroundPage().about();\n window.close();\n return false;\n}", "function AboutController($location) {\n var ctrl = this;\n\n ctrl.selectOption = selectOption;\n ctrl.getHash = getHash;\n\n ctrl.options = {\n 'about' : {\n 'title': 'About RefStack',\n 'template': 'components/about/templates/README.html',\n 'order': 1\n },\n 'uploading-your-results': {\n 'title': 'Uploading Your Results',\n 'template': 'components/about/templates/' +\n 'uploading_private_results.html',\n 'order': 2\n },\n 'managing-results': {\n 'title': 'Managing Results',\n 'template': 'components/about/templates/' +\n 'test_result_management.html',\n 'order': 3\n },\n 'vendors-and-products': {\n 'title': 'Vendors and Products',\n 'template': 'components/about/templates/vendor_product.html',\n 'order': 4\n }\n };\n\n /**\n * Given an option key, mark it as selected and set the corresponding\n * template and URL hash.\n */\n function selectOption(key) {\n ctrl.selected = key;\n ctrl.template = ctrl.options[key].template;\n $location.hash(key);\n }\n\n /**\n * Get the hash in the URL and select it if possible.\n */\n function getHash() {\n var hash = $location.hash();\n if (hash && hash in ctrl.options) {\n ctrl.selectOption(hash);\n } else {\n ctrl.selectOption('about');\n }\n }\n\n ctrl.getHash();\n }", "function addEditIntro(name) {\n\t// Top link\n\tif( skin == 'oasis' ) {\n\t\t$('a[data-id=\"edit\"]').attr('href',$('a[data-id=\"edit\"]').attr('href') + '&editintro=' + name);\n\t\t$('span.editsection > a').each( function () {\n\t\t\t$(this).attr('href',$(this).attr('href') + '&editintro=' + name);\n\t\t} );\n\t} else {\n\t\tvar el = document.getElementById('ca-edit');\n\n\t\tif( typeof(el.href) == 'undefined' ) {\n\t\t\tel = el.getElementsByTagName('a')[0];\n\t\t}\n\n\t\tif (el)\n\t\t\tel.href += '&editintro=' + name;\n\n\t\t// Section links\n\t\tvar spans = document.getElementsByTagName('span');\n\t\tfor ( var i = 0; i < spans.length; i++ ) {\n\t\t\tel = null;\n\n\t\t\tif (spans[i].className == 'editsection') {\n\t\t\t\tel = spans[i].getElementsByTagName('a')[0];\n\t\t\t\tif (el)\n\t\t\t\t\tel.href += '&editintro=' + name;\n\t\t\t} else if (spans[i].className == 'editsection-upper') {\n\t\t\t\tel = spans[i].getElementsByTagName('a')[0];\n\t\t\t\tif (el)\n\t\t\t\t\tel.href += '&editintro=' + name;\n\t\t\t}\n\t\t}\n\t}\n}", "function home(){\n\tapp.getView().render('vipinsider/insider_home.isml');\n}", "static goToHome() {\n browser.refresh();\n new MenuBar().clickHome();\n }", "function gotonextpage(upperCase){\n clickAnchor(upperCase,getItem(\"more\"));\n}", "function addEditIntro(name) {\n\t// Top link\n\tif( skin == 'oasis' ) {\n\t\t$('#ca-edit').attr('href', $('#ca-edit').attr('href') + '&editintro=' + name);\n\t\t$('span.editsection > a').each( function () {\n\t\t\t$(this).attr('href', $(this).attr('href') + '&editintro=' + name);\n\t\t} );\n\t} else {\n\t\tvar el = document.getElementById('ca-edit');\n\n\t\tif( typeof(el.href) == 'undefined' ) {\n\t\t\tel = el.getElementsByTagName('a')[0];\n\t\t}\n\n\t\tif (el)\n\t\t\tel.href += '&editintro=' + name;\n\n\t\t// Section links\n\t\tvar spans = document.getElementsByTagName('span');\n\t\tfor ( var i = 0; i < spans.length; i++ ) {\n\t\t\tel = null;\n\n\t\t\tif (spans[i].className == 'editsection') {\n\t\t\t\tel = spans[i].getElementsByTagName('a')[0];\n\t\t\t\tif (el)\n\t\t\t\t\tel.href += '&editintro=' + name;\n\t\t\t} else if (spans[i].className == 'editsection-upper') {\n\t\t\t\tel = spans[i].getElementsByTagName('a')[0];\n\t\t\t\tif (el)\n\t\t\t\t\tel.href += '&editintro=' + name;\n\t\t\t}\n\t\t}\n\t}\n}", "function setPageURL(pagename, urlparams = undefined) {\n cleanURL().then(function () {\n switch (pagename) {\n case 'course_professormenu':\n case 'course_studentmenu':\n case 'panel-left':\n case 'desktopmainmenu':\n break;\n case 'coursehome':\n location.hash = pagename;\n setTimeout(function () {\n setURLParameters([{\n paramname: 'id',\n paramvalue: currentcourse.courseid\n }]);\n }, 300);\n break;\n default:\n location.hash = pagename;\n if (typeof urlparams !== 'undefined') {\n setTimeout(function () {\n setURLParameters(urlparams);\n }, 300);\n }\n }\n });\n}", "function viewSpecialsPage(uid) {\n\tdocument.cookie = \"MoreInfoUserID=\" + encodeURIComponent(uid) + \";\";\n window.location.assign('/MoreInfo');\n}", "function goToMintOverviewPage() {\n\tlet allLinkElements = document.getElementsByTagName(\"a\");\n\tfor (let i = 0; i < allLinkElements.length; i++) {\n\t\tif (allLinkElements[i].innerText == \"OVERVIEW\") {\n\t\t\tallLinkElements[i].click();\n\t\t}\n\t}\n}", "function navToHistory() {\r\n location = \"history.html\"\r\n}", "function definePage() {\n var fullURL = window.location.href;\n var splitURL = fullURL.split(\"\"); \n var holder = [];\n\n for(i = splitURL.length-1; i > splitURL.length-9; i--) {\n holder.push(splitURL[i]);\n }\n\n holder.reverse();\n \n userURL = holder.join(\"\");\n }", "switchToTitlePage() {\n if (this.currentPage !== null) {\n this.currentPage.hide();\n }\n Utility.RemoveElements(this.mainDiv);\n this.mainDiv.appendChild(this.titlePage.getDiv());\n this.currentPage = this.titlePage;\n this.titlePage.show();\n }" ]
[ "0.7394527", "0.727566", "0.7153666", "0.6941263", "0.69326866", "0.6881046", "0.68727916", "0.68418753", "0.68418753", "0.6720247", "0.6711964", "0.6683728", "0.6677873", "0.66585505", "0.6645836", "0.66351163", "0.65251905", "0.6488229", "0.63894325", "0.6367094", "0.6361202", "0.6358375", "0.62839806", "0.62839806", "0.62216526", "0.617018", "0.6168059", "0.6138491", "0.61252874", "0.6112392", "0.6112209", "0.6099973", "0.60799533", "0.60085535", "0.59452397", "0.5934552", "0.59298956", "0.5923788", "0.59230906", "0.59217423", "0.59096366", "0.59076333", "0.5898414", "0.5893737", "0.58648694", "0.5854862", "0.58409154", "0.5837318", "0.58060575", "0.57966155", "0.57795864", "0.57527894", "0.57442915", "0.57424414", "0.5739549", "0.57188576", "0.5718127", "0.5709127", "0.5701242", "0.5700928", "0.5700805", "0.56998736", "0.5699691", "0.5699688", "0.56976783", "0.56916225", "0.56827354", "0.56815654", "0.56786114", "0.5673358", "0.56691456", "0.56671053", "0.5660432", "0.56595135", "0.56563216", "0.56534785", "0.5646213", "0.56437165", "0.56384283", "0.5638184", "0.56368464", "0.5627617", "0.5626614", "0.56245136", "0.5620901", "0.56179374", "0.5613932", "0.5599725", "0.5597856", "0.5597583", "0.55951536", "0.55897367", "0.5584326", "0.55823034", "0.5578983", "0.5578374", "0.5574893", "0.5566381", "0.55643976", "0.5556645" ]
0.6780121
9
Extend an existing object with a method from another
function augment(receivingClass, givingClass) { //only provide certain methods if (arguments[2]) { for (var i=2, len=arguments.length; i<len; i++) { receivingClass.prototype[arguments[i]] = givingClass.prototype[arguments[i]]; } } // provide all methods else { for (var methodName in givingClass.prototype) { if (!Object.hasOwnProperty.call(receivingClass.prototype, methodName)) { receivingClass.prototype[methodName] = givingClass.prototype[methodName]; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extend() {}", "extend() {}", "function extendNode(source, target, avoid) {\n Object.getOwnPropertyNames(source).forEach(mymethod => {\n if (!avoid || !avoid.includes(mymethod)) {\n target[mymethod]=source[mymethod];\n }\n });\n }", "function ExtraMethods() {}", "function Extend(target, source){\r\n if((target) && (source) && (typeof source == 'object')) {\r\n for(var property in source) {\r\n if (source.hasOwnProperty(property)) {\r\n try { target[property] = source[property]; } catch (exception) { ; }\r\n }\r\n }\r\n }\r\n return target;\r\n}", "function extend (target, source) {\n for(prop in source) {\n target[prop] = source[prop];\n }\n return target;\n }", "function extend(to, from, skipFuncs) {\n\t\tif (typeof from != 'object') { return to; }\n\t\t\n\t\tif (to && from) {\t\t\t\n\t\t\teach(from, function(name, value) {\n\t\t\t\tif (!skipFuncs || typeof value != 'function') {\n\t\t\t\t\tto[name] = value;\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn to;\n\t}", "function $extend(destiny, source) {\r\n\t\tif (!$defined(destiny) || !$defined(source)) return destiny;\r\n\t\tfor (var prop in source) {\r\n\t\t\tif (destiny.prototype) destiny.prototype[prop] = source[prop];\r\n\t\t\telse destiny[prop] = source[prop];\r\n\t\t}\r\n\t\treturn destiny;\r\n\t}", "extend(fn, ...args) {\n fn(this, ...args);\n return this;\n }", "function extend(a,b){for(var prop in b){a[prop]=b[prop];}return a;}", "function extend(target, options){\n options = options||{};\n var parentClass = this;\n logger.trace(\"Extending from \", parentClass._angoosemeta.name, options);\n var rv = null;\n if(typeof (target) == 'function'){\n rv = target;\n mixinInstance(parentClass, rv, options);\n }\n else{ \n /** schema object */ \n rv = parentClass.$extend( target );\n }\n \n /** mixin Angoose class level functions */ \n rv = mixinStatic(parentClass, rv, options); \n if(rv._angoosemeta.name){\n /** register it with Angoose */\n require(\"./angoose\").registerClass(rv._angoosemeta.name, rv);\n }\n return rv;\n}", "function extendWithNew(target, obj) {\r\n properties(obj).forEach( function(prop) {\r\n if (target[prop]===undefined) target[prop] = obj[prop];\r\n });\r\n}", "function addMethod(object, name, fn) {\r\n var old = object[ name ];\r\n object[ name ] = function () {\r\n if (fn.length === arguments.length)\r\n return fn.apply(this, arguments);\r\n else if (typeof old === 'function')\r\n return old.apply(this, arguments);\r\n };\r\n }", "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "function extend(prototype, api) {\n if (prototype && api) {\n // use only own properties of 'api'\n Object.getOwnPropertyNames(api).forEach(function(n) {\n // acquire property descriptor\n var pd = Object.getOwnPropertyDescriptor(api, n);\n if (pd) {\n // clone property via descriptor\n Object.defineProperty(prototype, n, pd);\n // cache name-of-method for 'super' engine\n if (typeof pd.value == 'function') {\n // hint the 'super' engine\n pd.value.nom = n;\n }\n }\n });\n }\n return prototype;\n }", "function extend(prototype, api) {\n if (prototype && api) {\n // use only own properties of 'api'\n Object.getOwnPropertyNames(api).forEach(function(n) {\n // acquire property descriptor\n var pd = Object.getOwnPropertyDescriptor(api, n);\n if (pd) {\n // clone property via descriptor\n Object.defineProperty(prototype, n, pd);\n // cache name-of-method for 'super' engine\n if (typeof pd.value == 'function') {\n // hint the 'super' engine\n pd.value.nom = n;\n }\n }\n });\n }\n return prototype;\n }", "function extend(prototype, api) {\n if (prototype && api) {\n // use only own properties of 'api'\n Object.getOwnPropertyNames(api).forEach(function(n) {\n // acquire property descriptor\n var pd = Object.getOwnPropertyDescriptor(api, n);\n if (pd) {\n // clone property via descriptor\n Object.defineProperty(prototype, n, pd);\n // cache name-of-method for 'super' engine\n if (typeof pd.value == 'function') {\n // hint the 'super' engine\n pd.value.nom = n;\n }\n }\n });\n }\n return prototype;\n }", "function extend(target, source) {\n for (var prop in source) {\n if (has(source, prop)) {\n target[prop] = source[prop];\n }\n }\n\n return target;\n }", "function extend(a, b) {\r\n for (var prop in b) {\r\n a[prop] = b[prop];\r\n }\r\n return a;\r\n }", "function __extend__(a,b) {\n\tfor ( var i in b ) {\n\t\tvar g = b.__lookupGetter__(i), s = b.__lookupSetter__(i);\n\t\tif ( g || s ) {\n\t\t\tif ( g ) a.__defineGetter__(i, g);\n\t\t\tif ( s ) a.__defineSetter__(i, s);\n\t\t} else\n\t\t\ta[i] = b[i];\n\t} return a;\n}", "function __extend__(a,b) {\n\tfor ( var i in b ) {\n\t\tvar g = b.__lookupGetter__(i), s = b.__lookupSetter__(i);\n\t\tif ( g || s ) {\n\t\t\tif ( g ) a.__defineGetter__(i, g);\n\t\t\tif ( s ) a.__defineSetter__(i, s);\n\t\t} else\n\t\t\ta[i] = b[i];\n\t} return a;\n}", "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "function extend(to,_from){for(var key in _from){to[key]=_from[key];}return to;}", "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n }", "function extend(a, b) {\n for (var prop in b) {\n a[ prop ] = b[ prop ];\n }\n return a;\n }", "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "function createAnother(original){\n var clone = object(original); //create a new object by calling a function\n clone.sayHi = function(){ //augment the object in some way\n alert(\"hi\");\n };\n return clone; //return the object\n}", "function register() {\n if (Object.prototype.extend !== boundExtend) {\n oextend = Object.prototype.extend;\n Object.prototype.extend = boundExtend;\n }\n }", "function extend(target) {\n var objs = Array.prototype.slice.call(arguments, 1);\n objs.forEach(function (obj) {\n var props = Object.getOwnPropertyNames(obj);\n props.forEach(function (key) {\n target[key] = obj[key];\n });\n });\n return target;\n }", "function boundExtend() {\n var args, val;\n args = Array.prototype.slice.call(arguments);\n val = this.valueOf(); // jshint ignore:line\n args.unshift(val);\n return extend.apply(null, args);\n }", "function around (obj, method, fn) {\n var old = obj[method]\n \n obj[method] = function () {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) args[i] = arguments[i]\n return fn.call(this, old, args)\n }\n }", "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "function extend( a, b ) {\r\n for ( var prop in b ) {\r\n a[ prop ] = b[ prop ];\r\n }\r\n return a;\r\n }", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n }", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n }", "function extend(obj, source) {\n for (var prop in source) {\n obj[prop] = source[prop];\n }\n return obj;\n }", "function extend(target, source) {\n if (source) {\n for (var _i = 0, _a = Object.keys(source); _i < _a.length; _i++) {\n var prop = _a[_i];\n target[prop] = source[prop];\n }\n }\n return target;\n}", "function mixin(obj) {\n each(functions(obj), function (name) {\n console.log('name', name);\n var func = (_[name] = obj[name]);\n _.prototype[name] = function () {\n //把方法挂到原型链上\n var args = [this._wrapped]; //['京城一灯']\n push.apply(args, arguments); //['京城一灯',回调函数]\n console.log(\"合并之后的args\", arguments);\n return func.apply(_, args)\n };\n });\n }", "function extend(target, source) {\n for (var prop in source) {\n if (has(source, prop)) {\n target[prop] = source[prop];\n }\n }\n return target;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n }", "function around(obj, method, fn) {\n var old = obj[method]\n\n obj[method] = function () {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) args[i] = arguments[i]\n return fn.call(this, old, args)\n }\n}", "function extendWith(\n object,\n traitObject,\n traitMethodList) {\n\n // We WILL NOT override methods on the object that have the\n // same name as methods in the trait object. That means the\n // given object methods always override the trait methods.\n var isMethodOverridable = R.compose(R.not, R.hasIn(R.__, object));\n\n R.filter(isMethodOverridable, traitMethodList)\n .forEach(function ( methodName ) {\n var traitMethod = traitObject[methodName];\n var proxyMethod = function () {\n return traitMethod.apply(traitObject, arguments);\n };\n object[methodName] = proxyMethod;\n });\n }", "function extend( a, b ) {\r\n for ( var prop in b ) {\r\n a[ prop ] = b[ prop ];\r\n }\r\n return a;\r\n}", "function addCustomGlobalMethod(obj) {\n this.customMethod = obj.customMethod;\n\n}", "function extend(obj, from, from2) {\n from && each(Object.keys(from), function(key) {\n obj[key] = from[key]\n })\n return from2 ? extend(obj, from2) : obj\n}", "function around(obj, method, fn) {\n const old = obj[method];\n\n obj[method] = (...args) => {\n const newArgs = new Array(arguments.length);\n for (let i = 0; i < newArgs.length; i += 1) newArgs[i] = args[i];\n return fn.call(this, old, newArgs);\n };\n}", "function around(obj, method, fn) {\n var old = obj[method];\n\n obj[method] = function() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) args[i] = arguments[i];\n return fn.call(this, old, args);\n };\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}" ]
[ "0.673649", "0.673649", "0.6684899", "0.65976304", "0.6497918", "0.6474648", "0.643005", "0.6369684", "0.6351232", "0.63347876", "0.6291876", "0.628176", "0.6256702", "0.62486285", "0.62427306", "0.62427306", "0.62427306", "0.62391615", "0.62263936", "0.6223693", "0.6223693", "0.6216436", "0.6216436", "0.6216436", "0.6213343", "0.6213134", "0.62082946", "0.620312", "0.620312", "0.6200663", "0.6196804", "0.6184007", "0.617937", "0.61753196", "0.61646545", "0.61646545", "0.61646545", "0.61600465", "0.61523736", "0.61523736", "0.6148655", "0.6145935", "0.61425644", "0.6131912", "0.6108927", "0.6099872", "0.60925275", "0.6088868", "0.60843533", "0.60715044", "0.60599124", "0.6057073", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364", "0.60499364" ]
0.0
-1
Populate's info panel with $this_element's information
function populate_info_panel(this_element){ $('#pregunta_info_name').html(this_element.name); $('#pregunta_info_type').html(convert_type(this_element.type)); if(this_element.type == 'MULTI' || this_element.type == 'CONDITIONAL'){ var answers_content = ''; $.each(connections_array, function(i){ if(this_element.connect_id == this.source){ var label_text; if(this_element.type == 'CONDITIONAL'){ //console.log(this.label.substring(0,2)) switch(this.label.substring(0,2)){ case 'lt': label_text = 'Menor que ' +this.label.substring(2); break; case 'gt': label_text = 'Mayor que ' +this.label.substring(2); break; case 'eq': label_text = 'Igual que ' +this.label.substring(2); break; case 'ne': label_text = 'No igual a ' +this.label.substring(2); break; case 'le': label_text = 'Menor o igual que ' +this.label.substring(2); break; case 'ge': label_text = 'Mayor o igual que ' +this.label.substring(2); break; case 'ra': label_text = 'En rango '+this.label.substring(2); break; case '!r': label_text = 'Afuera del rango'; break; default: label_text = 'ERROR: ha escrito condicion incorrectamente'; } } else { label_text = this.label; } answers_content += "<li class='list-group-item'>"+label_text+"</li>"; } }); $('#pregunta_info_responses').html(answers_content); $('#possible_answers').show(); } else { $('#possible_answers').hide(); } // set id values of info panel buttons $('#btn_edit_item').attr('data-id', this_element.id); $('#btn_delete_item').attr('data-id', this_element.id); $('#btn_delete_item').attr('source-id', this_element.connect_id); $('#btn_edit').attr('data-id', this_element.id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function build_protein_info_panel(data, div) {\n div.empty();\n var protein = data.controller.get_current_protein();\n div.append(protein['description']);\n div.append(\"<br>----<br>\");\n div.append(dict_html(protein['attr']));\n}", "renderInformationAdditional() {\n document.getElementsByClassName('pk-name')[0].innerHTML = this.pokemonSelected.Name;\n document.getElementsByClassName('pk-image')[0].setAttribute('src', pathImages + this.pokemonSelected.Image);\n /** Load Information Additional.**/\n document.getElementsByClassName('pk-description-no')[0].innerHTML = this.pokemonSelected.Data.Position;\n document.getElementsByClassName('pk-description-level')[0].innerHTML = this.pokemonSelected.Data.Level;\n document.getElementsByClassName('pk-description-type')[0].innerHTML = this.pokemonSelected.Data.Type;\n document.getElementsByClassName('pk-description-ability')[0].innerHTML = this.pokemonSelected.Data.Ability;\n document.getElementsByClassName('pk-description-height')[0].innerHTML = this.pokemonSelected.Data.Height;\n document.getElementsByClassName('pk-description-weight')[0].innerHTML = this.pokemonSelected.Data.Weight;\n }", "function fillInfo() {\n nameLabel.innerHTML = cocktail[0];\n cocktailInfoLabel.innerHTML = cocktailInfo;\n}", "function disp_info(d) {\n //console.log(d);\n materialInfo.html(getMaterialInfo(d))\n .attr(\"class\", \"panel_on\");\n }", "function showDetails() {\n _('infoDiv').innerHTML = infoText;\n _('infoPanel').style.display = 'block';\n}", "displayInfo() {\n this.getTime();\n $('#modalTitle').html(`${this.name}`);\n $('#modalInfo').html(\n `<li>Current Time: &nbsp; ${this.time}</li><li>Latitude: &nbsp; ${this.latitude}</li><li>Longitude: &nbsp; ${this.longitude}</li><li>Distance from your location: &nbsp; ${this.distance}km</li>`\n );\n $('#wikiInfo').removeClass('show');\n $('#forecastInfo').removeClass('show');\n $('#weatherInfo').removeClass('show');\n $('#generalInfo').addClass('show');\n $('#infoModal').modal();\n }", "function populateInformationModal() {\n\t// add text to the label\n\tvar category = allViews[activeView];\n\t// trim the heading \"TissueSpecific\" if necessary\n\tif (category.substr(0,14) == \"TissueSpecific\") {\n\t\tcategory = category.substr(14);\n\t}\n\t$('#informationLabel').text(category+\" Information\"); \n\t\n\t// now put info text in body\n\t$('#informationBody').html(allInfoFiles[activeView]);\n\t\n}", "function buildInfoPanel(info) {\n var html = \"<div class='panel panel-default minimal'>\";\n html += \"<a data-toggle='collapse' data-parent='#accordion' href='#colps\" + info.id + \"'>\";\n html += \"<div class='tab-panel-heading' style='padding-top: 10px;'><span class='panel-title'>\";\n html += \"<small class='col-sm-3' style='color: #000;'>\" + info.PostedDate + \"</small> &emsp;\";\n html += \"<span class='col-sm-push-1'><strong>\" + info.Title + \"</strong></span>\";\n html += \"</span><i class='icon-down-open' style='float: right;'></i></div></a>\";\n html += \"<div id='colps\" + info.id + \"' class='panel-collapse collapse'>\" + info.Content + \"</div></div>\";\n $(\"#otherinfopanel\").append(html);\n}", "function showDetails() {\n $(this).closest('.panel-body').find('.projInfo').slideDown();\n }", "function updateInformation(obj){\r\n $('#summary-information .inner')\r\n .empty()\r\n .append($('<p>').html('Current zoom: ' + obj.zoomLevel + ', style type: ' + obj.styleType))\r\n }", "function loadElementInfo(element)\r\n{\r\n\tgetElementInfo( element,\r\n\t\tfunction ( type, id, childcount, data )\r\n\t\t{\r\n\t\t\tvar dataList = \"{\";\r\n\t\t\tfor ( var key in data )\r\n\t\t\t{\r\n\t\t\t\tdataList += key + \" = \" + (typeof(data[key]) === \"object\" ? JSON.stringify(data[key]) : data[key]) + \", \";\r\n\t\t\t}\r\n\t\t\tif ( dataList != \"{\" )\r\n\t\t\t{\r\n\t\t\t\tdataList = dataList.substr(0, dataList.length-2);\r\n\t\t\t\tdataList += \"}\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tdataList = \"\";\r\n\r\n\t\t\tvar listElement = document.getElementById(\"E\" + element.id);\r\n\t\t\tvar idText = \"\";\r\n\t\t\tif ( id != \"\" )\r\n\t\t\t\tidText = \"<strong>\" + id + \"</strong>: \";\r\n\t\t\tlistElement.innerHTML = idText + type + \" <i>\" + dataList + \"</i> <span class='temp' id='T\" + element.id + \"'></span>\";\r\n\t\t\telement.childcount = childcount;\r\n\t\t\tif ( childcount != 0 )\r\n\t\t\t{\r\n\t\t\t\tlistElement.className = \"plus\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tlistElement.className = \"empty\";\r\n\t\t}\r\n\t);\r\n}", "displayInfo() {\n let imageContainer = document.querySelector(\"#image-container\");\n let thumbnailEl = document.createElement(\"img\");\n thumbnailEl.setAttribute(\"src\", this.thumbnailImg)\n imageContainer.append(thumbnailEl);\n let artistNameDiv = document.querySelector(\"#artist-name\");\n artistNameDiv.textContent = this.name;\n let artistInfoDiv = document.querySelector(\"#profile-info\");\n artistInfoDiv.textContent = this.profileInfo;\n\n }", "function getInfo() { return document.getElementById('info') }", "function displayInfo(element) {\n const container = document.getElementById('container');\n const divInfo = createAndAppend('div', container, {\n id: 'leftSide',\n class: 'left-div whiteframe',\n });\n // Table info\n createAndAppend('table', divInfo, { id: 'table' });\n const table = document.getElementById('table');\n createAndAppend('tbody', table, { id: 'tbody' });\n function createTableRow(label, description) {\n const tableR = createAndAppend('tr', table);\n createAndAppend('td', tableR, { text: label, class: 'label' });\n createAndAppend('td', tableR, { text: description });\n }\n\n createTableRow('Repository: ', element.name);\n createTableRow('Description: ', element.description);\n createTableRow('Forks : ', element.forks);\n const newDate = new Date(element.updated_at).toLocaleString();\n createTableRow('Updated: ', newDate);\n }", "function BeamInfoDisplay( element )\n{\n // console.debug(\"BeamInfoDisplay::ctor\",element);\n this.fElement = element;\n\n // gStateMachine.BindObj(\"mcChange\",this,\"Build\");\n gStateMachine.BindObj(\"gateChange\",this,\"Build\");\n}", "static displayInfoPanel(panel, data) {\n // Updatte and display panel\n LibrariesMap.updatePanel(panel, data);\n panel.style(\"display\", \"block\");\n // Update pie charts\n LibrariesMap.updatePieCharts(panel, data);\n }", "function showInfoWindow() { \n currentmarker = this;\n infoWindow.open(map, currentmarker);\n buildIWContent();\n\n}", "function populate_info_panel($this_usuario){\n // populate basic information panel\n \n var type;\n $('#info_panel_heading').text($this_usuario.first_name + \" \" + $this_usuario.last_name1 + \" \" + $this_usuario.last_name2);\n if($this_usuario.middle_initial == null) {\n $('#usuario_info_name').text($this_usuario.first_name);\n } else {\n $('#usuario_info_name').text($this_usuario.first_name + \" \" + $this_usuario.middle_initial);\n }\n $('#usuario_info_lastname_paternal').text($this_usuario.last_name1);\n $('#usuario_info_lastname_maternal').text($this_usuario.last_name2);\n //$('#usuario_info_contact').text($this_usuario.email + \" \" + $this_usuario.phone_number);\n $('#usuario_info_telefono').text($this_usuario.phone_number);\n $('#usuario_info_contact').text($this_usuario.email);\n //$('#usuario_telefono').text($this_usuario.phone_number);\n\n\n\n if($this_usuario.type == 'agent')\n {\n type = 'Agente';\n $('#assigned_locations').show();\n } \n else if ($this_usuario.type == 'specialist')\n {\n type = 'Especialista';\n $('#assigned_locations').hide();\n } \n else \n {\n type = 'Administrador';\n $('#assigned_locations').hide();\n }\n\n $('#usuario_info_type').text(type);\n\n if(locations_array.length>0){\n // populate associated locations panel\n var table_content = '';\n $.each(locations_array, function(i){\n if($this_usuario.user_id == this.user_id){\n table_content += '<tr><td>'+this.location_name+'</td></tr>';\n }\n }); \n\n if(table_content == '')\n {\n table_content = \"Usuario no tiene localizaciones asignadas.\";\n }\n $('#usuario_locations').html(table_content);\n }\n\n\n $('#specialty_panel').show();\n\n if(specialties_array.length>0){\n populate_specialties_info($this_usuario);\n }\n \n\n //Categoria de Localizacion\n\n //$('#especializacion_title').text(\"Tipo de Especializacion\" + \" - \" + $this_usuario.email)\n \n // set id values of info panel buttons\n $('#btn_edit_panel').attr('data-id', $this_usuario.user_id);\n $('#btn_delete').attr('data-id', $this_usuario.user_id);\n $('#btn_delete').attr('data-username', $this_usuario.username); \n }", "function setup_showInfo() {\n\tdocument.getElementById(\"basic\").style.display = \"none\";\n\tdocument.getElementById(\"create\").style.display = \"none\";\n\tdocument.getElementById(\"source\").style.display = \"none\";\n\tdocument.getElementById(\"info\").style.display = \"block\";\n}", "function createInfoPanel() {\n return new Ext.Panel({\n border: true,\n id: 'infoPanel',\n baseCls: 'md-info',\n autoWidth: true,\n contentEl: 'infoContent',\n autoLoad: {\n url: '../../apps/search/home_' + catalogue.LANG + '.html',\n callback: loadCallback,\n scope: this,\n loadScripts: false\n }\n });\n }", "function InfoWidget (id, controller) {\n\t// Call superconstructor first (AutomationModule)\n\tInfoWidget.super_.call(this, id, controller);\n}", "function open_infobox(point_id) {\n var point_bullet = $(window.point_list[point_id]);\n $('.infobox h1').text(point_bullet.find('h3').text());\n $('.infobox__insertedhtml').html(point_bullet.find('.point_data__content').html());\n $('.infobox').fadeIn(\"fast\", function () {\n $(this).addClass('show');\n });\n}", "function showInfo() {\n $('#user-name').text(curUser.first_name + ' ' + curUser.last_name);\n $('#first-name').text(curUser.first_name);\n $('#last-name').text(curUser.last_name);\n $('#email').text(curUser.email);\n $('#phone').text(curUser.phone_number);\n }", "function _fnFeatureHtmlInfo(oSettings) {\n\t\t\tvar nInfo = document.createElement('div');\n\t\t\tnInfo.className = oSettings.oClasses.sInfo;\n\n\t\t\t/* Actions that are to be taken once only for this feature */\n\t\t\tif (typeof oSettings.aanFeatures.i == \"undefined\") {\n\t\t\t\t/* Add draw callback */\n\t\t\t\toSettings.aoDrawCallback.push({\n\t\t\t\t\t\"fn\" : _fnUpdateInfo,\n\t\t\t\t\t\"sName\" : \"information\"\n\t\t\t\t});\n\n\t\t\t\t/* Add id */\n\t\t\t\tif (oSettings.sTableId !== '') {\n\t\t\t\t\tnInfo.setAttribute('id', oSettings.sTableId + '_info');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn nInfo;\n\t\t}", "function showInformation(marker){\n document.getElementById(\"property-name\").innerHTML = \"<b>Properity Name</b>: \" + marker.data.property_name;\n document.getElementById(\"property-type\").innerHTML = \"<b>Properity Type</b>: \" + marker.data.property_type;\n document.getElementById(\"community-area-name\").innerHTML = \"<b>Community Area Name</b>: \" + marker.data.community_area;\n document.getElementById(\"address\").innerHTML = \"<b>Address</b>: \" + marker.data.address;\n document.getElementById(\"management_company\").innerHTML = \"<b>Management Company</b>: \" + marker.data.management_company;\n document.getElementById(\"phone-number\").innerHTML = \"<b>Phone Number</b>: \" + marker.data.phone_number;\n}", "function fill_data(ele) {\n var p_tag = ele.children('p.tab_type');\n var meta_title = ele.children('h3').text();\n var meta_desc = ele.children('p.meta_desc').text();\n var meta_date = p_tag.children('span.type_latest').text();\n var meta_download = p_tag.children('span.type_hot').text();\n var meta_likes = p_tag.children('span.type_favorite').text();\n\n $('#theme_detail_panel h3').text(meta_title);\n $('#theme_detail_panel p').text(meta_desc);\n $('#theme_detail_panel ul li.info_date').text(meta_date);\n $('#theme_detail_panel ul li.info_download').text(meta_download);\n $('#theme_detail_panel ul li.info_fb').text(meta_likes);\n\n }", "function _fnFeatureHtmlInfo ( oSettings )\n\t\t{\n\t\t\tvar nInfo = document.createElement( 'div' );\n\t\t\tnInfo.className = oSettings.oClasses.sInfo;\n\t\t\t\n\t\t\t/* Actions that are to be taken once only for this feature */\n\t\t\tif ( typeof oSettings.aanFeatures.i == \"undefined\" )\n\t\t\t{\n\t\t\t\t/* Add draw callback */\n\t\t\t\toSettings.aoDrawCallback.push( {\n\t\t\t\t\t\"fn\": _fnUpdateInfo,\n\t\t\t\t\t\"sName\": \"information\"\n\t\t\t\t} );\n\t\t\t\t\n\t\t\t\t/* Add id */\n\t\t\t\tif ( oSettings.sTableId !== '' )\n\t\t\t\t{\n\t\t\t\t\tnInfo.setAttribute( 'id', oSettings.sTableId+'_info' );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn nInfo;\n\t\t}", "function information() {\n\t//alert(\"Created by Monica Michaud\\nIn the Institute for New Media Studies\\nAdviser: Gordon Carlson, PhD\\nDev Version: 0.2 (Apr 25)\");\n\n\tvar mapInfoBoxString;\n\t\n\tmapInfoBoxString = '<div id=\"content\"><h1 id=\"infoWindowHeading\" class=\"infoWindowHeading\">Information : </h1>' +\n\t\t'<div id=\"infoWindowBodyContent\"><p>Created by Monica Michaud <br /> In the Institute for New Media Studies <br /> Adviser: Gordon Carlson, PhD <br /> Dev Version: 0.2 (Apr 25)</p></div></div>';\n\t\n\tmap.setCenter(MAP_CENTER_COORDINATES); \n\tinfoWindow.setContent(mapInfoBoxString);\n\tinfoWindow.setPosition(MAP_CENTER_COORDINATES);\n\tinfoWindow.open(map);\n}", "function initInstanceInfoTooltip() {\n jQuery('#instance-tooltip').tooltip();\n}", "function showinfo(object)\n{\n var clicked = object;\n var id = clicked.innerHTML.trim();\n var info = document.getElementById(id);\n\n if(clicked.className == \"expanderPlus\")\n \tclicked.className = \"collapseMin\";\n else\n \tclicked.className = \"expanderPlus\";\n\n if(info.style.display == \"none\")\n \tinfo.style.display = \"table-row\";\n else\n \tinfo.style.display = \"none\";\n}", "function displayInfo(html) {\n infoElement.innerHTML = html;\n show(infoElement);\n}", "pushIntoInfo(data) {\n if (data.response.venue) {\n const object = data.response.venue;\n\n let rating = \"there is no information\";\n if (object.rating !== undefined) rating = object.rating;\n const html = `\n <img src=\"${object.bestPhoto.prefix}300x200${\n object.bestPhoto.suffix\n }\" alt=\"${object.name}\" tabindex=\"0\">\n <div style=\"color: #${\n object.ratingColor\n };\" tabindex=\"0\"><b>Rating:</b> ${rating}</div>\n <div class=\"#selectedLocation\" tabindex=\"0\"><b>Address:</b> ${\n object.location.formattedAddress[0]\n }</div>\n <div tabindex=\"0\"><b>Likes:</b> ${object.likes.count}</div>\n <a href=\"${\n object.canonicalUrl\n }\" target=\"_blank\">Look at this on FourSquare</a>`;\n document.getElementById(`info${object.id}`).innerHTML = html;\n document.getElementById(`infos`).classList.add(\"unvisible\");\n } else {\n const html = `<div> Unable to load information from FourSquare (${\n data.meta.errorDetail\n })</div>`;\n document.getElementById(`infos`).innerHTML = html;\n document.getElementById(`infos`).classList.remove(\"unvisible\");\n }\n }", "function customerInfo() {\n let currentCustomer = vm.customers[vm.currentIndices.customer];\n let customerInfoElement = document.getElementById(\"CUSTOMER_INFO\").children;\n customerInfoElement[1].innerText = currentCustomer.name;\n customerInfoElement[4].innerText = currentCustomer.age;\n customerInfoElement[7].innerText = currentCustomer.email;\n customerInfoElement[10].innerText = currentCustomer.phone;\n customerInfoElement[13].innerText = currentCustomer.address;\n customerInfoElement[16].innerText = currentCustomer.registered;\n customerInfoElement[19].innerText = currentCustomer.about;\n }", "function setInfobox(props){\r\n \r\n var infoValue, i = infoValue = 0;\r\n do {\r\n var infoValue = parseFloat(props[expressed]).toFixed(i);\r\n i++;\r\n }\r\n while (infoValue <= 0);\r\n \r\n if (isNaN(infoValue)) {\r\n var infoValue, infoAcres = infoValue = 0;\r\n } else {\r\n var infoValue = comma(parseFloat(props[expressed]).toFixed(i));\r\n var infoAcres = comma(props[displayed]);\r\n }\r\n\r\n var infoDesc2 = \"Acreage \" + drop2Choice;\r\n var infoDesc1 = \"Total Acreage of \" + drop1Choice;\r\n \r\n //label content\r\n var infoAttribute1 = '<h2><span id=\"inf\">' + infoDesc1 + ': </span> ' + infoAcres + '</h2>';\r\n var infoAttribute2 = '<h2><span id=\"inf\">' + infoDesc2 + ': </span> ' + infoValue + '</h2>';\r\n var stateName = '<h2>' + props.geo_name + '</h2>';\r\n \r\n //create info label div\r\n var infolabel = d3.select(\"body\")\r\n .append(\"div\")\r\n .attr(\"class\", \"infolabel\")\r\n .attr(\"id\", props.geo_id + \"_label\")\r\n .html(stateName);\r\n\r\n var stateName = infolabel.append(\"div\")\r\n .attr(\"class\", \"infogoo\")\r\n .html(infoAttribute1);\r\n var stateName = infolabel.append(\"div\")\r\n .attr(\"class\", \"infogoo\")\r\n .html(infoAttribute2);\r\n }", "function setupPlayerInfo(element, info) {\n var img = document.createElement(\"img\");\n img.className = \"player\";\n img.src = info.picture;\n element.appendChild(img);\n\n var nameArea = document.createElement(\"div\");\n nameArea.className = \"nameArea\";\n element.appendChild(nameArea);\n\n var nameBox = document.createElement(\"div\");\n nameBox.className = \"name\";\n nameBox.innerHTML = info.name;\n nameArea.appendChild(nameBox);\n\n var elo = document.createElement(\"div\");\n elo.className = \"elo\";\n elo.innerHTML = info.elo;\n if (info.name == \"Stockfish\") {\n elo.id = \"stockfishLevel\";\n elo.innerHTML = \"\";\n\n stockFishLevelMenu = document.createElement(\"select\");\n for (var i = 0; i < 11; ++i) {\n var opt = document.createElement(\"option\");\n opt.value = i;\n if (i == 0) opt.value = \"thermal\";\n opt.innerHTML = opt.value;\n stockFishLevelMenu.appendChild(opt);\n }\n\n elo.innerHTML += \"Level: \";\n elo.appendChild(stockFishLevelMenu);\n }\n nameArea.appendChild(elo);\n\n var clock = document.createElement(\"div\");\n clock.className = \"clock\";\n clock.innerHTML = \"05:00\";\n element.appendChild(clock);\n }", "function changeLInfo(event) {\n // \n event.preventDefault();\n \n // If the addLeistung panel is visible, hide it and show updateLeistung panel\n if($('#addLPanel').is(\":visible\")){\n togglePanels();\n }\n \n // Get Index of object based on _id value\n var _id = $(this).attr('rel');\n var arrayPosition = listData.map(function(arrayItem) { return arrayItem._id; }).indexOf(_id);\n \n // Get our Leistung Object\n var thisLObject = listData[arrayPosition];\n\n // Populate Info Box\n $('#updateBezeichnung').val(thisLObject.bezeichnung);\n $('#updatePreis').val(thisLObject.preis);\n $('#updateVon').val(thisLObject.von);\n $('#updateFuer').val(thisLObject.fuer);\n\n // Put the LeistungID into the REL of the 'update Leistung' block\n $('#updateL').attr('rel',thisLObject._id);\n}", "function displayUserInformationToDom(){\n\tvar panelTime = document.getElementById('panel-time-element').innerText = userInformation.totalTime;\n\tvar panelDistance = document.getElementById('panel-distance-element').innerText = userInformation.totalDistance;\n\n\n\tdocument.getElementById('panel').className = \"shown\";\n}", "function showInfo(info, targetElementId) {\r\n var el;\r\n if (targetElementId == null) {\r\n el = document.createElement('div');\r\n el.innerHTML = info;\r\n document.body.insertBefore(el, document.body.firstChild);\r\n } else {\r\n el = document.getElementById(targetElementId);\r\n el.innerHTML = info;\r\n }\r\n el.style.border = \"2px dotted red\";\r\n el.style.padding = \"4px\";\r\n}", "function setListingInfo(info){\n\n\tconsole.log('setListingInfo.1.0: ', info);\n\t//setup the popup.html, show the available listing\n\t$('#status').text(info.status);\n\t$('#manage').text(info.manage);\n\t$('#postdate').text(info.postedDate);\n\t$('#title').text(info.title);\n}", "function createDataInformationPanel(dataInfoSelector) {\n infoManager = $(dataInfoSelector).empty();\n }", "displayInfo() {\n clear(dogInfo())\n\n let image = document.createElement('img')\n image.src = this.image\n\n let h2 = document.createElement('h2')\n h2.innerText = this.name\n\n let button = document.createElement('button')\n button.innerText = this.buttonText()\n button.id = `toggle${this.id}`\n \n dogInfo().appendChild(image)\n dogInfo().appendChild(h2)\n dogInfo().appendChild(button)\n }", "function processInfo(encounterData) {\n \t// Inform configurator of the patient's name and ID. Note that the location\n \t// of this information in encounterData returned by the server is always the same.\n this.trigger(sewi.constants.BEI_BEI_LOADED_EVENT, {\n id: encounterData[1][1][1],\n name: encounterData[1][2][1] + \", \" + encounterData[1][3][1]\n });\n\n // Render the information.\n for(var i = 0; i < encounterData.length; i++) {\n $(sewi.constants.BEI_HEADER_DOM)\n .html(encounterData[i][0][1])\n .appendTo(this.mainDOMElement);\n\n for(var j = 1; j < encounterData[i].length; j++) {\n $(sewi.constants.BEI_ENTRY_DOM)\n .append(\n $(sewi.constants.BEI_ENTRY_KEY_DOM).html(encounterData[i][j][0])\n )\n .append(\n $(\"<br>\")\n )\n .append(\n $(sewi.constants.BEI_ENTRY_VALUE_DOM).html(encounterData[i][j][1])\n )\n .appendTo(this.mainDOMElement);\n }\n }\n\n // Give it a scrollbar, for y-overflows.\n this.mainDOMElement.slimScroll({\n color: '#000',\n size: '4px',\n width: \"100%\",\n height: \"100%\"\n });\n\n fixMainDomElementWidth.call(this, false);\n }", "setDetails() {\n product = this.findElement('.carousel__body__main__product');\n product.children[0].textContent = this.currentProduct.name;\n product.children[1].textContent = this.currentProduct.description;\n product.children[2].textContent = `${this.currentProduct.price} ${this.currentProduct.price_currency_code}`;\n product.children[3].children[0].textContent = this.currentProduct.date_published;\n product.children[3].children[1].textContent = this.currentProduct.availability;\n product.children[3].children[2].children[0].href = this.currentProduct.url;\n }", "information() {\n if (this.over()) {\n this.info.innerHTML = 'Joueur ' + this.activePlayer.id + ' vous avez gagné !';\n this.info.classList.add('alert-success');\n this.alert.classList.remove('show');\n } else {\n this.info.innerHTML = `C'est à vous de jouez : joueur ` + this.activePlayer.id;\n }\n\n player1.description();\n player2.description();\n }", "function fillInformation() {\n\tfor (i = 0; i < 3; i++)\n\t\t{\n\t\t\t//fill in the SPEC x/x/x\n\t\t\tdocument.getElementById('spec' + i).innerHTML = pointsTree[i];\t\n\t\t}\n\t//required level\n\tdocument.getElementById('levelRequired').innerHTML = rankPointsMax - rankPoints + levelMin - 1;\n\t//pointsLeft\n\tdocument.getElementById('tabPointsAvailable').innerHTML = rankPoints;\n}", "function _display(){\n\t\t\t$(levelID).html(level);\n\t\t\t$(pointsID).html(points);\n\t\t\t$(linesID).html(lines);\n\t\t}", "function SetItems() {\n //configuracion del tootip de ayuda\n //tooltip de navegacion superior\n $('.navigationTop a').cluetip({ splitTitle: '|', width: 250, delayedClose: 1200, cursor: 'pointer', sticky: false });\n //tooltip para el link del mapa\n $('.SiteMapa span a').cluetip({ splitTitle: '|', width: 250, delayedClose: 1200, cursor: 'pointer', sticky: false });\n \n $('.tooltip').cluetip({ splitTitle: '|',delayedClose: 1200, width: 150, cursor: 'pointer', sticky: false });\n //tooltip de los buttonfields\n $('input[type=image]').cluetip({ splitTitle: '|', attribute: 'alt', titleAttribute: 'alt', delayedClose: 1200, width: 150, cursor: 'pointer', sticky: false });\n \n //menu popup\n $('#toplistmenu01').popupmenu({ target: \"#PanelNew\", time: 300 });\n $('.note').truncate({ max_length: 40, showLinks: false });\n \n }", "function fillInfoBox(year, weapons, info) {\n\n var infoboxChart = $('#stats .infobox-after');\n\n //Retrieves from database\n infoboxChart.find('#stat-year').html(\"Årtal \" + year);\n infoboxChart.find('#stat-weapons').html(weapons + \" Miljarder kr\");\n infoboxChart.find('#stat-info').html(info);\n\n //Displays correct infobox\n changeInfobox();\n}", "function showSelfInfo(selfInfo) {\n var state = \"\";\n\n // Set user name, image of this user..\n $('#selfinfo-name').text(selfInfo.username);\n $('#selfinfo-img').attr('src', selfInfo.img);\n\n if(selfInfo.id == \"BOT\") {\n // Set bot information..\n $('#selfinfo-mood').text(\"The bot of this chat!\");\n }\n else if(selfInfo.id == \"CONCIERGE\") {\n // Set bot information..\n $('#selfinfo-mood').text(\"Administrator of this chat!\");\n }\n else {\n // Set email of this user..\n $('#selfinfo-mood').text(selfInfo.email);\n }\n}", "function setChartInfoSubPanel(graphId) {\n\tvar html = '<div class=\"chartGeneralInfo subPanel\" >';\n\t// chart title and id\n\thtml += '<div class=\"subPanelTitle row\">General Information</div>'\n\t\t\t+ '<div class=\"row title\">Graph Name: '\n\t\t\t+ MAIN_GRAPHS[graphId].graphTitle + '</div>';\n\t// num of nodes\n\thtml += '<div class=\"row \"> <div class=\"cell\"># of Nodes: '\n\t\t\t+ MAIN_GRAPHS[graphId].getGraphSize()\n\t\t\t+ '</div> <div class=\"cell\"># of Edges: '\n\t\t\t+ MAIN_GRAPHS[graphId].allEdges.length + '</div></div>';\n\thtml += '</div><div class=\"left-panel-header\">Result</div><div id=\"panel-result\"></div>';\n\tvar infoPanel = $('#secondPageInfoPanel');\n\tinfoPanel.append($(html));\n\n}", "function updatePetInfoInHtml() {\n $('.name').text(pet_info['name']);\n $('.weight').text(pet_info['weight']);\n $('.happiness').text(pet_info['happiness']);\n }", "function updatePetInfoInHtml() {\n $('.name').text(pet_info['name']);\n $('.weight').text(pet_info['weight']);\n $('.happiness').text(pet_info['happiness']);\n }", "function renderInfo() {\n /** Get state */\n if (!wave.getState()) {\n return;\n }\n var state = wave.getState();\n \n /** Retrieve topics */\n var topics = toObject(state.get('topics','[]'));\n var votes = toObject(state.get('votes','[]'));\n \n /** Add topics to the canvas */\n var html = \"\";\n for (var i = 0; i < topics.length; i++){\n var id = \"topic\"+i;\n html += '<div class=\"topic\"><h4> ' + topics[i] + '</h4></div>';\n }\n document.getElementById('body').innerHTML = html;\n \n /** Create \"Add topic\" button to the footer */\n html += '<input type=\"text\" id=\"textBox\" value=\"\"/><button id=\"addInput\" onclick=\"addInput()\">Add Topic</button>';\n document.getElementById('footer').innerHTML = html;\n \n /** Adjust window size dynamically */\n gadgets.window.adjustHeight();\n}", "function setInfoWindowContents() {\n for (const store of brewData) {\n coordObj.lat = store.latitude;\n coordObj.lng = store.longitude;\n createMarker(store, coordObj);\n\n loc = new google.maps.LatLng(marker.position.lat(), marker.position.lng());\n bounds.extend(loc);\n\n hours = store.hoursOfOperation || '';\n\n address = store.streetAddress || '';\n\n description = store.brewery.description || 'No Description Avaliable';\n\n phone = store.phone || '';\n\n if (store.website === undefined) {\n website = '';\n brewName = '';\n } else {\n website = store.website;\n brewName = store.brewery.name;\n }\n\n if (store.brewery.images === undefined) {\n logo = '';\n } else {\n logo = `<img src=${store.brewery.images.medium}>`;\n }\n\n\n content = '<div id=\"content\">' +\n `<h3 id=\"firstHeading\" class=\"firstHeading\">${store.brewery.name}</h3>` +\n `<div>${logo}` +\n '<div id=\"bodyContent\">' +\n `${description} ` +\n '</div>' +\n '</br>' +\n `<div>${address}</div>` +\n '</br>' +\n `<div>${hours}</div>` +\n '</br>' +\n `<div><a href='tel:${phone}'>${phone}</div>` +\n '</br>' +\n `<div><a href=${website}>${brewName}</div>` +\n '</div>';\n\n infowindow = new google.maps.InfoWindow({\n content: content\n });\n\n setEventListner();\n }\n }", "function updatePetInfoInHtml() {\n $('.name').text(pet_info.name);\n $('.weight').text(pet_info.weight);\n $('.happiness').text(pet_info.happiness);\n $('.message').text(pet_info.message);\n }", "function getInfo(element) {\n setupDefaultInfo(\n element,\n 'name',\n 'name_en',\n 'category',\n 'phone',\n 'rating',\n 'location',\n 'google_map',\n 'image',\n 'description'\n )\n getIdAndSetupRoute(element)\n}", "addExtraInfoElement(info, node, withContainer = false) {\n // Don't create if there's nothing to show\n if (info.length == 0) return;\n\n let container;\n if (withContainer) {\n container = document.createElement('div');\n container.classList.add('TWPT-extrainfo-container');\n } else {\n container = node;\n }\n\n let tooltips = [];\n\n for (const i of info) {\n let chip = document.createElement('material-chip');\n chip.classList.add('TWPT-extrainfo-chip');\n\n let chipCont = document.createElement('div');\n chipCont.classList.add('TWPT-chip-content-container');\n\n let content = document.createElement('div');\n content.classList.add('TWPT-content');\n\n const [badge, badgeTooltip] = createExtBadge();\n\n let span = document.createElement('span');\n span.append(i);\n\n content.append(badge, span);\n chipCont.append(content);\n chip.append(chipCont);\n container.append(chip);\n\n tooltips.push(badgeTooltip);\n }\n\n if (withContainer) node.append(container);\n\n for (const tooltip of tooltips) new MDCTooltip(tooltip);\n }", "function _fnFeatureHtmlInfo ( oSettings )\n\t\t{\n\t\t\tvar nInfo = document.createElement( 'div' );\n\t\t\tif ( oSettings.sTableId !== '' )\n\t\t\t{\n\t\t\t\tnInfo.setAttribute( 'id', oSettings.sTableId+'_info' );\n\t\t\t}\n\t\t\tnInfo.className = \"dataTables_info\";\n\t\t\treturn nInfo;\n\t\t}", "function updateInfo(e) {\n const section_id = e.closest('section').id;\n const info_container = document.querySelector('#' + section_id + ' .info-container');\n //cleaning the container\n emptyDiv(info_container);\n if (section_id === 'cards') {\n for (let key of cards)\n if (e.dataset.number === key.number) {\n const children = getChildren(CARD_INFO_TEMPLATE(key));\n for (let i of children) {\n const child = info_container.appendChild(i);\n }\n }\n } else {\n for (let key of loans)\n if (key.number === e.dataset.number) {\n const children = getChildren(LOANS_INFO_TEMPLATE(key));\n for (let i of children) {\n const child = info_container.appendChild(i);\n }\n }\n }\n}", "addInfo(data) {\n document.getElementById('ip-address').textContent = `${data.ip}`;\n document.getElementById('location').textContent = `${data.location.region}, ${data.location.country}`;\n document.getElementById('timezone').textContent = `UTC ${data.location.timezone}`;\n document.getElementById('isp').textContent = `${data.isp}`;\n }", "function ShowPopupInformation(sInformation) {\n //var popupInformation = document.getElementById('popup-information');\n //popupInformation.innerHTML = sInformation;\n //$(\"#popup-information\").show(250);\n $(\"#divinformationContainer\").html(sInformation);\n}", "function showInfoBox(e, i, j) {\n\n\n //TODO: Cambiar por angular?\n\n if (i == null) $(\"#infobox\").hide();\n else {\n //TODO: Can we move this to angular?\n var politician = data[i];\n var membership = politician.memberships[j];\n\n\n\n var info = \"<span class='title'>\" + politician.name + \"</span>\";\n info += \"<br />\";\n info += \"<img src='\" + politician.image + \"'>\" ;\n info += \"<br />\" + membership.role ;\n info += \"<br />\" + membership.organization.name ;\n info += \"<br />\" + formatYear(membership.start) + \" - \" + formatYear(membership.end);\n\n\n //Initial pos;\n var infoPos;\n if (i <= data.length/2) infoPos = { left: e.pageX, top: e.pageY };\n else infoPos = { left: e.pageX-200, top: e.pageY-80 };\n\n var classes = \"bar \" + membership.post.cargotipo.toLowerCase() + \" \" + membership.organization.level.toLowerCase() + \" \" + membership.role.toLowerCase();\n //clear all clases\n document.getElementById('infobox').className = '';\n\n $(\"#infobox\")\n .addClass(classes)\n .html(info)\n .css(infoPos)\n .show();\n }\n\n}", "function showInfoWindow(event) {\n\tvar $elementFired = $( event.data.elementPlotter );\n\t\n\tif (exists($elementFired)) {\n\t\tvar id = $elementFired.attr('item-id');\n\t\t\n\t\tif (id) {\n\t\t\tfor (var indexInfoMarks = 0; indexInfoMarks < markers.length; indexInfoMarks++) {\n\t\t\t\tvar infoMark = markers[indexInfoMarks];\n\t\t\t\t\n\t\t\t\tif (infoMark.id == id) {\n\t\t\t\t\tnew google.maps.event.trigger( infoMark.googleOBJ , 'click' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function addMovieInformation() {\n document.querySelector( '.movie-information' ).innerHTML = getTemplate();\n }", "function updateDetails() {\n const d = d3.select(this).datum();\n const details = d3.select(\"#details\");\n details.select(\"h3\")\n .text(d.properties.NAME);\n details.select(\"#popn\")\n .text(d.properties.population);\n details.select(\"#literacy\")\n .text(\n isNaN(d.properties.value) ?\n \"No tests\" :\n d.properties.value + \"% below basic literacy\"\n );\n}", "showOnDom(data) {\n\t\tthis.location.textContent = data.name;\n\t\tthis.description.textContent = data.main.temp_min;\n\t\tthis.string.textContent = data.weather[0].main;\n\t\tthis.icon.setAttribute(\n\t\t\t\"src\",\n\t\t\t`http://openweathermap.org/img/w/${data.weather[0].icon}.png`\n\t\t);\n\t\tthis.humidity.innerHTML = `<span class=\"badge badge-sm badge-secondary\">Relative Humidity</span> ${data.main.humidity}`;\n\t\tthis.dewpoint.innerHTML = `<span class=\"badge badge-sm badge-secondary\">Pressure</span> ${data.main.pressure}`;\n\t\tthis.feels.innerHTML = `<span class=\"badge badge-sm badge-secondary\">Feels_like</span> ${data.main.feels_like} `;\n\t\tthis.wind.innerHTML = `<span class=\"badge badge-sm badge-secondary\">Wind: Speed</span> ${data.wind.speed} <span class=\"badge badge-sm badge-secondary\">Degree</span> ${data.wind.deg}`;\n\n\t}", "function showSpotDetails() {\n //get element\n var spotPanel = document.getElementById(\"spot-view\");\n //set global panel var\n spotDetailPanel = spotPanel;\n //add class to selected element\n spotDetailPanel.classList.add(\"visible\");\n //set panel spotname\n document.getElementById(\"spot-name-display\").innerHTML = pubSpotInfo.spotName;\n //set panel spotname\n document.getElementById(\"spot-img-display\").src = pubSpotInfo.imgUrl;\n}", "function displayInfo(widget) {\n var info = document.getElementById('divInfo');\n info.innerHTML = 'Position: ' + widget.get('position') + ', Distance (in Km): ' +\n widget.get('distance');\n}", "static displayInfoProfile(photographer)\n {\n const infoProfile = InfoProfileFactory.create(photographer)\n document.querySelector(\".main\").appendChild(infoProfile)\n }", "function updateInfoSecMenu(obj){\n clickMenuInfo1(obj.objInfoView.base);\n clickMenuInfo2(obj.objInfoView.category);\n mainData.infoSections[currentPanel][objInfoView.base][objInfoView.category] = obj.objBaseInfo;\n }", "constructor(info) {\n this.id = null;\n this.caption = \"\";\n this.className = null;\n this.main = null;\n this.target = null;\n this.listInput = null;\n this.wins = [];\n this.forms = [];\n this.tab = null;\n this.data = [];\n for (var x in info) {\n if (this.hasOwnProperty(x)) {\n this[x] = info[x];\n }\n }\n let main = this.id ? $(this.id) : false;\n if (main) {\n if (main.ds(\"gtType\") === \"alarm\") {\n return;\n }\n }\n else {\n main = $.create(\"div\").attr(\"id\", this.id);\n }\n this.create(main);\n }", "function detail_result(json_parse) {\n\n document.getElementsByClassName('panel')[0].className = \"panel panel-default show\"\n document.getElementsByClassName('panel-heading')[0].innerHTML = '<strong>' + json_parse.Title + '</strong><br/>(' + json_parse.Released + ')'\n document.getElementsByClassName('panel-body')[0].innerHTML = '<div class=\"detail_holder\">' +\n '<div><strong>Genre:</strong>&nbsp;&nbsp;' + json_parse.Genre + '</div>' +\n '<div><strong>Starring:</strong>&nbsp;&nbsp;' + json_parse.Actors + '</div>' +\n '<div>' + json_parse.Plot + '</div>' +\n '</div>'\n \n \n \n}", "function appendInfo(e){\n var $snippet = $(e.target).closest(\".snippet\");\n snippet_id = $snippet[0]['id']\n $('#modal-snippet-body').html($('#body-'+snippet_id).html());\n $('#modal-snippet-notes').html($('#notes-'+snippet_id).html());\n $('#modal-snippet-tags').html($('#tags-'+snippet_id).html());\n}//------ end of append info function ------", "function renderInfo(name, description){\n $name.textContent = name\n $description.textContent = description\n}", "function showInformation() {\n information.style.display='block';\n events.style.display='none';\n sights.style.display='none';\n informationButton.className = 'categoryButton selected material-icons';\n eventsButton.className = 'categoryButton material-icons';\n sightsButton.className = 'categoryButton material-icons';\n}", "function loadInfo() {\r\n\t\tvar info = JSON.parse(this.responseText);\r\n\t\tdocument.getElementById(\"title\").innerHTML = info.title;\r\n\t\tdocument.getElementById(\"author\").innerHTML = info.author;\r\n\t\tdocument.getElementById(\"stars\").innerHTML = info.stars;\r\n\t}", "function setUpI() {\n\tif (currentStepInfo.built != false && currentStepInfo.collate != \"true\") {\n\t\t\n\t\t// _____ INFO ALREADY BUILT - RELOAD IT _____\n\t\t$stepHolder.prepend(currentStepInfo.built);\n\t\t\n\t\tif (currentStepInfo.lastStep == \"true\") {\n\t\t\t$newBtn.show();\n\t\t}\n\t\t\n\t\tsetUpSection(currentStepInfo.section, $stepHolder.children(\".step\"));\n\t\t\n\t} else {\n\t\t\n\t\t// _____ BUILD NEW INFO _____\n\t\tvar icon = \"fa-exclamation\";\n\t\tif (currentStepInfo.faIcon != undefined && currentStepInfo.faIcon != \"\") {\n\t\t\ticon = \"fa-\" + currentStepInfo.faIcon;\n\t\t}\n\t\t\n\t\tvar authorSupport = \"\";\n\t\tif (allParams.authorSupport == \"true\") {\n\t\t\tauthorSupport = '<span class=\"hint\">' + currentStepInfo.name + ' </span>';\n\t\t}\n\t\t\n\t\tvar mediaInfo = checkForMedia();\n\t\t\n\t\t$stepHolder.prepend('<div class=\"step\"><span class=\"fa ' + icon + ' fa-2x pull-left fa-border fa-fw\"/><div class=\"info\">' + mediaInfo[0] + authorSupport + addLineBreaks(iFrameCheck(currentStepInfo.text)) + collateResult(currentStepInfo.collate, currentDecision, \"html\") + '</div></div>');\n\t\t\n\t\tvar $thisStep = $stepHolder.children(\".step\");\n\t\t\n\t\tif (mediaInfo[1] != undefined) {\n\t\t\tvar $stepMedia = $(\".stepAudio, .stepVideo\");\n\t\t\tif ($stepMedia.hasClass(\"stepAudio\")) {\n\t\t\t\t$stepMedia.appendTo($stepMedia.parent());\n\t\t\t}\n\t\t\twindow[mediaInfo[1]]($stepMedia, currentStepInfo.img);\n\t\t}\n\t\t\n\t\tif (currentStepInfo.helpTxt != undefined && currentStepInfo.helpTxt != \"\") {\n\t\t\tsetUpHelp($thisStep);\n\t\t}\n\t\t// can this be the last step? If yes, the option to continue will still be there but the overview can also be viewed too\n\t\tif (currentStepInfo.lastStep == \"true\") {\n\t\t\t$thisStep.append('<a id=\"viewThisBtn\" href=\"javascript:viewThisClickFunct()\" class=\"floatL\">' + allParams.viewThisBtn + '</a>');\n\t\t\t$newBtn.show();\n\t\t}\n\t\tsetUpSection(currentStepInfo.section, $stepHolder.children(\".step\"));\n\t\t\n\t\t// save reference to this step so it can be reloaded later if needed\n\t\tallSteps[currentStepInfo.index].built = $stepHolder.children(\".step\");\n\t}\n\t\n\t$submitBtn\n\t\t.show()\n\t\t.button(\"enable\");\n}", "function displayInfo(){\n runsDisplay.innerHTML = runsMessage + ' <span>' + player.runs + '</span>';\n scoreboard.appendChild(pickedFruitDisplay);\n scoreboard.appendChild(eatenFruitDisplay);\n scoreboard.appendChild(runsDisplay);\n \n // adding classes for fruit in basket and fruit added to player score for different styling\n pickedFruitDisplay.setAttribute('class', 'pickedFruit');\n eatenFruitDisplay.setAttribute('class', 'eatenFruit');\n\n // only display intro panel text first time around\n if (gameStarted === false && gameOver === false){\n scoreboard.appendChild(infoPanel);\n infoPanel.innerHTML = startText;\n infoPanel.appendChild(form);\n form.appendChild(startButton);\n startButton.focus();\n }\n}", "function show_info(txt)\r\n{\r\n\t//alert(txt);\r\n $('info_div').show();// = 'shown';\r\n //var info_style = \r\n $('info_div').setStyle({left:mouseX+\"px\",top:mouseY+\"px\"});\r\n //info_style.left = mouseX+\"px\";\r\n //info_style.top = mouseY+\"px\";\r\n $('info_div').update(txt);\r\n}", "additionalContent() {\n let info = this.state.data.info;\n return (\n <div key=\"inside_components\" id=\"inside-contents\"> \n <City key={guidGenerator()} name={info.current_observation.display_location.full} />\n <InfoBox key=\"infoBoxDiv\" data_obv={info.current_observation} metricState={this.state.metric} />\n </div>\n )\n }", "showDetails(element)\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}", "display(){\n this.htmlBuilder.build();\n this.displayCityName();\n this.displayTodayWeather();\n this.displayWeekWeather();\n this.displayTimeSlots();\n }", "function updateInfo() {\r\n markers[0].setIcon(FIRST_ICON);\r\n $(\".airport .first\").html(markers[0].data.name);\r\n\r\n if (markers.length > 1) {\r\n markers[1].setIcon(SECOND_ICON);\r\n $(\".airport .second\").html(markers[1].data.name);\r\n var distance = PosUtil.getDistance(markers[0].getPosition(), markers[1].getPosition());\r\n $(\".airport .distance\").html(distance + \"km\");\r\n }\r\n }", "function updateInfo(e) {\n var marker = e.target;\n info.update(marker.valueOf().options);\n }", "function openTrackerInfoPanel(feature) {\n // get the features properties, i.e. the data to show on the modal\n var properties = feature.attributes;\n // get the popup object itself and customize\n var popup = $('#tracker-modal');\n // go through each property for this one feature, and write out the value to the correct span, according to data-name property\n $.each(properties, function(dataname, value) {\n // get preferred text for each status types\n if (dataname == 'status') value = CONFIG.status_types[value].text;\n // write the status name to the dialog\n $('#tracker-modal .modal-content span').filter('[data-name=\"' + dataname + '\"]').text(value);\n })\n\n // wiki page needs special handling to format as <a> link\n var wiki = $('#tracker-modal .modal-content a').filter('[data-name=\"wiki_page\"]');\n if (properties['url']) {\n wiki.attr('href', properties['url']);\n wiki.parent().show();\n } else {\n wiki.parent().hide();\n }\n\n // format the zoom-to button data.zoom attribute. See initZoom();\n // this lets one zoom to the location of the clicked plant\n var zoomButton = $('#btn-zoom');\n zoomButton.attr('data-zoom', feature.attributes.lat + \",\" + feature.attributes.lng);\n\n // all set: open the dialog\n popup.modal();\n}", "function initializeInfoPopup() {\n /* Based on code from https://getbootstrap.com/docs/4.0/components/modal/ */\n $('#infoPopup').on('show.bs.modal', function (event) {\n let button = $(event.relatedTarget); // Button that triggered the modal\n let missionId = button.data('mission'); // Extract info from data-* attributes\n if (!missionId) {\n return;\n }\n \n let mission = getData().Missions.find(m => m.Id == missionId);\n \n let modal = $(this);\n modal.find('.modal-title').html(describeMission(mission, \"none\"));\n modal.find('#infoReward').html(describeReward(mission.Reward));\n modal.find('#calc').html(renderCalculator(mission));\n \n if (missionId in missionCompletionTimes) {\n modal.find('#completionTimeContainer').addClass('show');\n modal.find('#completionTime').text(new Date(missionCompletionTimes[missionId]));\n } else {\n modal.find('#completionTimeContainer').removeClass('show');\n }\n \n $(function () {\n $('[data-toggle=\"popover\"]').popover();\n $('#numberExample').html(`${(1.58).toLocaleString()} AA`);\n loadFormValues();\n });\n });\n}", "function attachInfo(removeBeforeAttach) {\n const { height, weight, diet, species } = info;\n const infoTable = document.createElement(\"DIV\");\n infoTable.classList.add(\"info\");\n infoTable.setAttribute(\"id\", `${species.replace(\" \", \"_\")}-details`);\n const tabledInfo = { height, weight, diet };\n //for each detail, create a section at 50% width\n Object.keys(tabledInfo).forEach((key) => {\n const item = document.createElement(\"DIV\");\n item.classList.add(\"info-item\");\n item.innerHTML = `<strong>${key}</strong> : <i>${tabledInfo[key]}</i>`;\n infoTable.appendChild(item);\n });\n //add table to the tile\n const layout = document.querySelector(`#${species.replace(\" \", \"_\")}-slot`);\n if (removeBeforeAttach) {\n this.detachInfo();\n }\n layout.appendChild(infoTable);\n }", "function setInfoHeight() {\n\tvar height = $('div.map').height() - 36;\n\t$('div.info').height(height);\n}", "function populateInfoWindow(details, marker, infowindow) {\n\n var content = '<div class=\"card\" style=\"width: 12rem;\">\\n' +\n ' <img class=\"card-img-top\" src=\"'+details.picture+'\" alt=\"Card image cap\">\\n' +\n ' <div class=\"card-body\">\\n' +\n ' <h5 class=\"card-title\">'+details.name+'</h5>\\n' +\n ' <p class=\"card-text\">'+details.address+'</p>\\n' +\n ' </div>\\n' +\n '</div>';\n // check if infoWindow is already opened\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent(content);\n infowindow.open(map, marker);\n // clear marker when infoWindow is closed\n infowindow.addListener(\"closeclick\", function(){\n infowindow.setMarker = null;\n });\n }\n }", "function getDetails(e, $row, id, record) {\n $('#feature-title').text(record.title);\n $('#feature-priority').text(record.client_priority);\n $('#feature-target-date').text(record.target_date);\n $('#feature-client').text(record.client);\n $('#feature-product-area').text(record.product_area_name);\n\t$('#feature-description').text(record.description);\n }", "function buildDetailInfoBlock(mainDirectory, subDirectory, infoData) {\n var field = cmap[mainDirectory][subDirectory]['detailField'];\n var basicInfo = field.basicInfo\n var detailInfo = field['detailInfo']\n console.log('basicInfo',basicInfo)\n var basicInfoHtml = ''\n var detailInfoHtml = ''\n $.each(basicInfo, function (index, val) {\n if (val in infoData) {\n switch (val)\n {\n case 'name':\n basicInfoHtml += '<div class=\"form-group col-md-6 formBlock wordBreak\">\\\n <label class=\"formItem\">*项目名称:</label>\\\n <input type=\"text\" class=\"form-control\" name=\"name\" value=\"\">\\\n <span class=\"originInfo name\"></span>\\\n </div>'\n }\n }\n })\n\n}", "function PopupInformacion(){\n\n this.$modal_informacion = $('#modal_ver_informacion')\n this.$boton_salir = $('#id_boton_salir')\n this.$contenido = $('#contenido')\n this.$contenido_respuesta = $('#contenido_respuesta')\n\n this.init_Components()\n this.init_Events()\n}", "function packageDetails() {\n let currentCustomer = vm.customers[vm.currentIndices.customer];\n let currentOrder = currentCustomer.orders[vm.currentIndices.order];\n let currentShipment = currentOrder.shipments[vm.currentIndices.shipment];\n if (currentShipment !== undefined) {\n let packageInfoElement = document.getElementById(\"PACKAGE_DETAILS\").children;\n packageInfoElement[1].innerText = currentShipment.ship_date;\n let contents = \"\";\n for(let i = 0; i < currentShipment.contents.length; i++){\n contents += currentShipment.contents[i];\n contents += \", \";\n }\n packageInfoElement[4].innerText = contents.substring(0,contents.length-2);\n }\n }", "function handleInfo() {\n\t\t// setJob({\n\t\t// \tjob: 'Front-end developer',\n\t\t// \tlang: 'JS',\n\t\t// });\n\n\t\tsetPerson({\n\t\t\tname: 'Sina',\n\t\t\temail: '[email protected]',\n\t\t});\n\t}", "function displayInfobox(e) {\n infowindow.setOptions({description: e.target.Description, visible: true, showPointer: false});\n infowindow.setLocation(e.target.getLocation());\n }", "function load_info_box(deal) {\n info_box = \"<div class='info-box\";\n\n if(n_info_box % 2){\n info_box += \" slidein_left\";\n n_info_box++;\n } else{\n info_box += \" slidein_right\";\n n_info_box++;\n }\n\n if(deal.class == \"Equity\"){\n info_box += \" class-equity'>\";\n } else if(deal.class == \"Multi-Asset\"){\n info_box += \" class-multi-asset'>\";\n } else if(deal.class == \"Bond\"){\n info_box +=\" class-bond'>\";\n } else if(deal.class == \"Money Market\"){\n info_box +=\" class-money-market'>\";\n } else if(deal.class == \"ARIS\"){\n info_box +=\" class-aris'>\";\n } else if(deal.class == \"Other\"){\n info_box +=\" class-other'>\";\n } else{\n info_box += \"'>\";\n }\n\n info_box += \"<div class='info-box-name'>\"+deal.name+\n \"<img class='mini-country-flag' src='static/media/flags/\"+deal.region+\".png' title='\"+deal.region+\"'alt='\"+deal.region+\"'/>\"+\n \"</div>\"+\n \"<div class='info-box-content'>\"+\n \"<table>\"+\n \"<tr>\"+\n \"<th>Currency</th>\"+\n \"<th>Sector</th>\"+\n \"<th>Fees</th>\"+\n \"<th>Region</th>\"+\n \"<th>Class</th>\"+\n \"</tr>\"+\n \"<tr>\"+\n \"<td><span class='info-box-currency'>\"+deal.currency+\"</span></td>\";\n if(deal.sector.length <= 32){\n info_box += \"<td><span class='info-box-sector'>\"+deal.sector+\"</span></td>\";\n } else{\n info_box += \"<td><span class='info-box-sector smaller_text' title='\"+deal.sector+\"'>\"+deal.sector.substring(0, 32)+\"...</span></td>\";\n }\n info_box += \"<td><span class='info-box-fees'>\"+deal.fees+\"</span></td>\"+\n \"<td><span class='info-box-region'>\"+deal.region+\"</span></td>\"+\n \"<td><span class='info-box-class'>\"+deal.class+\"</span></td>\"+\n \"</tr>\"+\n \"</table>\"+\n \"<span class='info-box-region'>\"+\n \"<img class='country-flag' src='static/media/flags/\"+deal.region+\".png' title='\"+deal.region+\"'alt='\"+deal.region+\"'/>\"+\n \" </span>\"+\n \"</div>\"+ \n \"</div>\";\n \n return info_box;\n}", "function insertContentForMember() {\n /**\n * <div>Orbit Metrics (orbit level, reach, love)</div>\n */\n const detailsMenuOrbitMetrics = createOrbitMetrics(\n $orbit_level,\n $reach,\n $love\n );\n\n $detailsMenuElement.appendChild(detailsMenuOrbitMetrics);\n\n /**\n * <div>Tag list</div>\n */\n\n if ($tag_list.length > 0) {\n const detailsMenuTagList = createTagList($tag_list);\n\n $detailsMenuElement.appendChild(detailsMenuTagList);\n }\n\n /**\n * <span class=\"dropdown-divider\"></span>\n */\n const dropdownDivider1 = window.document.createElement(\"span\");\n dropdownDivider1.setAttribute(\"role\", \"none\");\n dropdownDivider1.classList.add(\"dropdown-divider\");\n $detailsMenuElement.appendChild(dropdownDivider1);\n\n /**\n * <span>Contributed X times to this repository</span>\n */\n if (isRepoInWorkspace) {\n const detailsMenuRepositoryContributions = createDropdownItem(\n $contributions_on_this_repo_total === 1\n ? \"First contribution to this repository\"\n : `Contributed ${getThreshold(\n $contributions_on_this_repo_total\n )} times to this repository`\n );\n $detailsMenuElement.appendChild(detailsMenuRepositoryContributions);\n }\n\n /**\n * <span>Contributed Y times to Z repository</span>\n */\n const detailsMenuTotalContributions = createDropdownItem(\n `Contributed ${getThreshold($contributions_total)} times on GitHub`\n );\n $detailsMenuElement.appendChild(detailsMenuTotalContributions);\n\n /**\n * <span class=\"dropdown-divider\"></span>\n */\n const dropdownDivider2 = window.document.createElement(\"span\");\n dropdownDivider2.setAttribute(\"role\", \"none\");\n dropdownDivider2.classList.add(\"dropdown-divider\");\n $detailsMenuElement.appendChild(dropdownDivider2);\n\n /**\n * <a href=\"…\">Add to to X’s content</a>\n */\n const detailsMenuLinkContent = window.document.createElement(\"a\");\n detailsMenuLinkContent.setAttribute(\"aria-label\", \"See profile on Orbit\");\n detailsMenuLinkContent.setAttribute(\"role\", \"menuitem\");\n detailsMenuLinkContent.classList.add(\n \"dropdown-item\",\n \"dropdown-item-orbit\",\n \"btn-link\"\n );\n detailsMenuLinkContent.textContent = `Add to ${gitHubUsername}’s content`;\n detailsMenuLinkContent.addEventListener(\"click\", handleAddCommentToMember);\n $detailsMenuElement.appendChild(detailsMenuLinkContent);\n\n /**\n * <a href=\"…\">See X’s profile on Orbit</a>\n */\n const detailsMenuLinkProfile = window.document.createElement(\"a\");\n detailsMenuLinkProfile.setAttribute(\"aria-label\", \"See profile on Orbit\");\n detailsMenuLinkProfile.setAttribute(\"role\", \"menuitem\");\n detailsMenuLinkProfile.setAttribute(\n \"href\",\n `${ORBIT_API_ROOT_URL}/${normalizedWorkspace}/members/${gitHubUsername}`\n );\n detailsMenuLinkProfile.setAttribute(\"target\", \"_blank\");\n detailsMenuLinkProfile.setAttribute(\"rel\", \"noopener\");\n detailsMenuLinkProfile.classList.add(\n \"dropdown-item\",\n \"dropdown-item-orbit\",\n \"btn-link\"\n );\n detailsMenuLinkProfile.textContent = `See ${gitHubUsername}’s profile on Orbit`;\n $detailsMenuElement.appendChild(detailsMenuLinkProfile);\n }", "populate() {\n this.div.innerHTML = ''\n\n this.createHeader()\n this.createAddButton()\n this.createAddForm()\n this.createExpensesDiv()\n }", "function updateDisplay(info) {\n\n display.innerHTML = info;\n\n }", "function toggleInfo() {\n if (infoContainer.style.display === 'none') {\n infoContainer.style.display = 'block';\n infoBtn.innerText = 'Less Info';\n infoContainer.innerText = info;\n } else {\n infoContainer.style.display = 'none';\n infoBtn.innerText = 'More Info';\n infoContainer.innerText = '';\n }\n }" ]
[ "0.68516606", "0.6616169", "0.6546088", "0.653402", "0.64927727", "0.64778954", "0.64655906", "0.6436454", "0.6373621", "0.6226559", "0.6214764", "0.6151009", "0.6143463", "0.6140021", "0.61026335", "0.60969007", "0.6077895", "0.60622436", "0.6056217", "0.6040273", "0.6028269", "0.5964583", "0.59618163", "0.59614724", "0.59302086", "0.5909729", "0.5908074", "0.58761644", "0.585905", "0.5851981", "0.5846711", "0.5822746", "0.5808895", "0.58022285", "0.5785675", "0.5778127", "0.57682234", "0.5757844", "0.57504493", "0.5745115", "0.5743641", "0.57331955", "0.568", "0.567811", "0.567692", "0.56720024", "0.5664769", "0.5661568", "0.5648955", "0.56421727", "0.5626774", "0.5626774", "0.5621784", "0.56190056", "0.56116474", "0.561082", "0.5602558", "0.5599991", "0.5596971", "0.55913824", "0.5570175", "0.5570108", "0.55683243", "0.55639046", "0.556058", "0.55489534", "0.5547092", "0.55226004", "0.5521273", "0.5520438", "0.55180347", "0.5517821", "0.54914373", "0.5490558", "0.5489156", "0.54810405", "0.5478112", "0.5477289", "0.5476963", "0.54718465", "0.5468859", "0.5468465", "0.5465417", "0.54545045", "0.54514784", "0.5446095", "0.5443468", "0.5441802", "0.54392487", "0.54390967", "0.54329985", "0.5432644", "0.5429839", "0.5423263", "0.541821", "0.5413589", "0.5412123", "0.5412055", "0.5409317", "0.5403637" ]
0.68623334
0
check if labels for an element's connections have the same name
function check_equal_labels(element, the_label){ for(var j = 0; j< connections_array.length; j++){ if(element.connect_id == connections_array[j].source){ if(the_label == connections_array[j].label){ return false; } } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkSameLabel(label){ \n // if already have label return false.\n return $(data.selectedDiv).has(label).length == 0;\n}", "function isLabeledBy(node, labelName) {\n for (var owner = node.parent; owner.kind === 214 /* LabeledStatement */; owner = owner.parent) {\n if (owner.label.text === labelName) {\n return true;\n }\n }\n return false;\n }", "function hasUniqueLabels() {\n // Ignore duplicates in different forms.\n const problemLabels = findDuplicates(elementData.label, 'textContent', 'formAncestorID')\n .map(label => stringifyElement(label));\n if (problemLabels.length) {\n const item = {\n // description: 'Labels should have unique values.',\n details: 'Found labels in the same form with duplicate values:<br>• ' +\n `${problemLabels.join('<br>• ')}`,\n learnMore: 'Learn more: <a href=\"https://equalizedigital.com/accessibility-checker/duplicate-form-label/\">Duplicate Form Labels</a>',\n title: 'Labels in the same form should have unique values.',\n type: 'warning',\n };\n items.push(item);\n }\n}", "function reportDuplicateLabels(ast) {\n function checkExpressionWithClonedEnv(node, env) {\n check(node.expression, objects.clone(env));\n }\n\n var check = visitor.build({\n rule: function(node) {\n check(node.expression, { });\n },\n\n choice: function(node, env) {\n arrays.each(node.alternatives, function(alternative) {\n check(alternative, objects.clone(env));\n });\n },\n\n action: checkExpressionWithClonedEnv,\n\n labeled: function(node, env) {\n if (env.hasOwnProperty(node.label)) {\n throw new GrammarError(\n \"Label \\\"\" + node.label + \"\\\" is already defined \"\n + \"at line \" + env[node.label].start.line + \", \"\n + \"column \" + env[node.label].start.column + \".\",\n node.location\n );\n }\n\n check(node.expression, env);\n\n env[node.label] = node.location;\n },\n\n text: checkExpressionWithClonedEnv,\n simple_and: checkExpressionWithClonedEnv,\n simple_not: checkExpressionWithClonedEnv,\n optional: checkExpressionWithClonedEnv,\n zero_or_more: checkExpressionWithClonedEnv,\n one_or_more: checkExpressionWithClonedEnv,\n group: checkExpressionWithClonedEnv\n });\n\n check(ast);\n}", "function checkLabels(theDoc) {\n\tvar labels = theDoc.layers.itemByName(layerName).textFrames;\n\tcheckForDuplicate(labels);\n\t\tfor (var i = 0; i < labels.length; i++){\n \t\t\tvar theLabel = labels[i];\n \t\t checkLabelOverlap(theLabel);\n \t\t\tcheckBounds(theLabel);\n\t\t\tcheckLabelOverlap(theLabel);\n \t\t};\n}", "function reportDuplicateLabels(ast) {\n function checkExpressionWithClonedEnv(node, env) {\n check(node.expression, objects.clone(env));\n }\n\n var check = visitor.build({\n rule: function (node) {\n check(node.expression, {});\n },\n choice: function (node, env) {\n arrays.each(node.alternatives, function (alternative) {\n check(alternative, objects.clone(env));\n });\n },\n action: checkExpressionWithClonedEnv,\n labeled: function (node, env) {\n if (env.hasOwnProperty(node.label)) {\n throw new GrammarError(\"Label \\\"\" + node.label + \"\\\" is already defined \" + \"at line \" + env[node.label].start.line + \", \" + \"column \" + env[node.label].start.column + \".\", node.location);\n }\n\n check(node.expression, env);\n env[node.label] = node.location;\n },\n text: checkExpressionWithClonedEnv,\n simple_and: checkExpressionWithClonedEnv,\n simple_not: checkExpressionWithClonedEnv,\n optional: checkExpressionWithClonedEnv,\n zero_or_more: checkExpressionWithClonedEnv,\n one_or_more: checkExpressionWithClonedEnv,\n group: checkExpressionWithClonedEnv\n });\n check(ast);\n}", "function nonExistantOrLabel(element) {\n\treturn !element || isLabel(element);\n}", "function nonExistantOrLabel(element) {\n return !element || isLabel(element);\n}", "function _isLabelByChild(child) {\n return element.labelEdge === 'inside' || child.labelEdge === 'inside' || child.labelEdge === 'none';\n }", "function sameCategoryName()\n {\n categories.each(function() {\n var name = $(this).data(\"name\").toString();\n\n var sameCategoryId = container.find(\"[data-name='\" + name + \"']\");\n\n if(sameCategoryId.length > 1) {\n console.error(\"There are categories with the same name: \" + name);\n }\n });\n }", "validateLabel(elem, labels) {\n const visible = labels.filter(isVisible);\n if (visible.length === 0) {\n this.report(elem, `<${elem.tagName}> element has label but <label> element is hidden`);\n }\n }", "_overlapsLabel(label) {\n const that = this,\n labelRect = label.getBoundingClientRect();\n let headRect = that._headRect;\n\n if (headRect.height === 0) {\n headRect = that._headRect = that._head.getBoundingClientRect();\n }\n\n return !(labelRect.right - 10 < headRect.left ||\n labelRect.left + 10 > headRect.right ||\n labelRect.bottom - 10 < headRect.top ||\n labelRect.top + 10 > headRect.bottom);\n }", "function checkLabel(name, value) {\n let input = doc.querySelector(`.shortcut-input[name=\"${name}\"]`);\n let label = input.previousElementSibling;\n if (label.dataset.l10nId) {\n is(label.dataset.l10nId, value, \"The l10n-id is set\");\n } else {\n is(label.textContent, value, \"The textContent is set\");\n }\n }", "function labelsUnique() {\n\n var labels = {};\n\n var status = true;\n if (json.hasOwnProperty('segment')) {\n json.segment.every(function (segment) {\n\n if (segment.hasOwnProperty('host')) {\n segment.host.every(function (host) {\n if (labels[host.label]) {\n console.error('host label ' + host.label + ' is not unique');\n status = false;\n } else {\n labels[host.label] = host.label;\n }\n return status;\n });\n }\n if (!status) {\n return status;\n }\n if (segment.hasOwnProperty('gateway')) {\n segment.gateway.every(function (gateway) {\n if (labels[gateway.label]) {\n console.error('gateway label ' + gateway.label + ' is not unique');\n status = false;\n } else {\n labels[gateway.label] = gateway.label;\n }\n return status;\n\n });\n }\n return status;\n });\n }\n\n return status;\n}", "function nodeName(elem, name) {\r\n return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();\r\n }", "function nodeName( elem, name ) { // 2842\n // 2843\n return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); // 2844\n // 2845\n}", "function nodeName(elem, name) {\n return elem.nodeName && elem.nodeName.toUpperCase() ===\n name.toUpperCase();\n }", "function isConnected(a, b) {\n\t\t return linked[a.index + \", \" + b.index] || linked[b.index + \", \" + a.index];\n\t\t}", "function hasUniqueForAttributes() {\n const duplicates = findDuplicates(elementData.label, 'for');\n let problemLabels = duplicates.map(label => stringifyElement(label));\n // Deduplicate.\n problemLabels = [...new Set(problemLabels)];\n if (problemLabels.length) {\n const item = {\n // description: 'The for attribute of a label must be unique.',\n details: 'Found label(s) with the same <code>for</code> attribute:<br>• ' +\n problemLabels.join('<br>• '),\n learnMore: 'Learn more: <a href=\"https://equalizedigital.com/accessibility-checker/duplicate-form-label/\">Duplicate Form Label</a>',\n title: 'The for attribute of a label must be unique.',\n type: 'error',\n };\n items.push(item);\n }\n}", "function isConnected(a, b) {\r\n return linkedByIndex[a.index + \",\" + b.index] || linkedByIndex[b.index + \",\" + a.index] || a.index == b.index;\r\n }", "function checkNameforId(element) {\n return element.name === country;\n }", "function isSink (node, nodeName) {\n var result = true,\n nextNodeName = null;\n for (nextNodeName in node.edges) {\n if(nextNodeName != nodeName) {\n result = false;\n }\n }\n return result;\n }", "is(name) {\n if (typeof name == 'string') {\n if (this.name == name)\n return true;\n let group = this.prop(NodeProp.group);\n return group ? group.indexOf(name) > -1 : false;\n }\n return this.id == name;\n }", "function ifExists(nodes, string){\n var found = false;\n for(var i = 0; i < nodes.length; i++) {\n if (nodes[i].label == string) {\n found = true;\n break;\n }\n }\n return found;\n}", "function hasElementsWithUniqueNames() {\n let duplicates = findDuplicates(inputsSelectsTextareas, 'name', 'formAncestorID')\n // Radio buttons have duplicate names.\n .filter(field => field.type !== 'radio');\n let problemFields = duplicates.map(field => stringifyElement(field));\n // Deduplicate items with same tagName and id.\n problemFields = [...new Set(problemFields)];\n if (problemFields.length) {\n const item = {\n // description: 'Autocomplete values must be valid.',\n details: 'Found fields in the same form with duplicate <code>name</code> attributes:<br>• ' +\n `${problemFields.join('<br>• ')}`,\n learnMore: 'Learn more: <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname\">The input element name attribute</a>',\n title: 'Fields in the same form must have unique <code>name</code> values.',\n type: 'error',\n };\n items.push(item);\n }\n}", "function isConnection(element) {\n return element.waypoints;\n}", "function isConnection(element) {\n return element.waypoints;\n}", "function isConnection(element) {\n return element.waypoints;\n}", "areCousins(node1, node2) {}", "function isDuplicate(item) {\n\t\tvar list = $(\"#items li .label\");\n\n\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\tif ($(list[i]).text() == item) {\n\t\t\t\treturn true;\n\t\t\t}\n \t\t}\n\n \t\t// by default return false\n \t\treturn false;\n\t}", "function neigh(a, b) {\n return a == b || adjlist[a + \"-\" + b];\n}", "function checkForDuplicates(elements, value) {\r\n var length = Object.keys(elements).length;\r\n for(var i=0;i<length;i++) {\r\n if(elements[i].name === value) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "areCousins(node1, node2) {\n\n }", "areCousins(node1, node2) {\n\n }", "soyNodo(label, nodo) {\n if (nodo == null || !(nodo instanceof Object)) {\n return false;\n }\n if (nodo.hasOwnProperty('label') && nodo.label != null) {\n return nodo.label === label;\n }\n return false;\n }", "function sameItemName()\n {\n items.each(function() {\n var name = $(this).data(\"name\").toString();\n\n var sameItemId = container.find(\"[data-name='\" + name + \"']\");\n\n if(sameItemId.length > 1) {\n console.error(\"There are items with the same name: \" + name);\n console.log(sameItemId);\n }\n });\n }", "isValidTagName(newName) {\n let isValid = true;\n this.tags.forEach(tag => {\n if (tag.name == newName) {\n isValid = false;\n }\n });\n return isValid;\n }", "function checkConnectionBetweenProps( target1, target2, excludedNodes ) {\n\tconst { subNodes: subNodes1, prevNodeMap: prevNodeMap1 } = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( target1, excludedNodes.subNodes );\n\tconst { subNodes: subNodes2, prevNodeMap: prevNodeMap2 } = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( target2, excludedNodes.subNodes );\n\n\tfor ( const sharedNode of subNodes1 ) {\n\t\tif ( subNodes2.has( sharedNode ) ) {\n\t\t\tconst connection = [];\n\n\t\t\tconnection.push( sharedNode );\n\n\t\t\tlet node = prevNodeMap1.get( sharedNode );\n\n\t\t\twhile ( node && node !== target1 ) {\n\t\t\t\tconnection.push( node );\n\t\t\t\tnode = prevNodeMap1.get( node );\n\t\t\t}\n\n\t\t\tnode = prevNodeMap2.get( sharedNode );\n\n\t\t\twhile ( node && node !== target2 ) {\n\t\t\t\tconnection.unshift( node );\n\t\t\t\tnode = prevNodeMap2.get( node );\n\t\t\t}\n\n\t\t\tconsole.log( '--------' );\n\t\t\tconsole.log( { target1 } );\n\t\t\tconsole.log( { sharedNode } );\n\t\t\tconsole.log( { target2 } );\n\t\t\tconsole.log( { connection } );\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "function isHideLabel(anObject){\n try\n {\n var currentObject = anObject;\n return (currentObject.name.indexOf(\"noLabel_\") != -1); //\tIf noLabel_ exists in the name, return true.\n }\n catch(err)\n {\n try\n {\n var isVisible = true;\n var currentObject = anObject;\n while (isVisible && currentObject != null)\n {\n isVisible = currentObject.visible;\n currentObject = currentObject.parent;\n }\n return isVisible;\n }\n catch(err)\n {\n console.log(\"Excception: \" + err);\n }\n console.log(\"Excception: \" + err);\n }\n}", "edgeVerifySvgId(edges) {\n\t\tif (edges.length > 0) {\n\t\t\tlet oldSvgId = edges[0].source.svgId\n\t\t\tlet index = edges[0].source.svgId.indexOf('_')\n\t\t\tlet oldSelectorName = oldSvgId.substring(index + 1, oldSvgId.length)\n\n\t\t\tif (oldSelectorName != this.selectorName) {\n\t\t\t\tedges.forEach(e => {\n\t\t\t\t\te.source.svgId = e.source.svgId.replace(oldSelectorName, this.selectorName)\n\t\t\t\t\te.target.svgId = e.target.svgId.replace(oldSelectorName, this.selectorName)\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}", "isSameNode(otherNode) {\n return this.unique === otherNode.unique;\n }", "function isInGraph(node) {\n var n = node;\n while (n !== null && n.parentElement !== n) {\n if (n.tagName === 'svg') return true;\n n = n.parentElement;\n }\n return false;\n}", "function findLink(axisName){\n var targetLink = \"\"; \n // For each axis to axis link in the mapping, check if the given axis name matches the source attribute of the mapping.\n // If so, return the corresponding target link. \n formData.get(\"axisConnections\").forEach(function(link){ // link is an object of the form {\"source\":\"string\", \"target\":\"string\"}\n if(link.source === axisName) {\n targetLink = link.target;\n }\n });\n return targetLink;\n}", "function hasLabel(label) {\n return map(context.payload.pull_request.labels, (label) => label.name).includes(label)\n}", "function checkforDuplicateName(newName)\n{\n var currentName;\n var currentObject\n\n var curCellIndex = curEditValue.parentNode.parentNode.parentNode.parentNode.cellIndex;\n var curRowIndex= curEditValue.parentNode.parentNode.parentNode.parentNode.parentNode.rowIndex;\n\n //loop through all the rows looking for the name\n for(var row =0; row < globalPathTable.rows.length; row++)\n {\n\t//loop throug all the cells that could contain a custom select\n\t//only odd numbered cells can contain a custom select so we start\n\t//at 1 and increment by 2\n\tfor(var cell = 1; cell < globalPathTable.rows[row].cells.length; cell +=2)\n\t{\n\t currentObject =getSubNode(globalPathTable.rows[row].cells[cell], \"value\", 0, 0);\n\t if(currentObject)\n\t {\n\t\tif(currentObject.value == newName && (cell != curCellIndex || row != curRowIndex))\n\t\t{\n\t\t return true;\n\t\t}\n\t }\n\t}\n }\n return false;\n}", "sameNames(obj) {\n // tripple equals\n return obj.name === this.obj.friends.name;\n }", "function cf_namespace_isConnected(searchWord,item) {\n\tsearchWord=searchWord.trim();\n\tsearchWord=searchWord.toLowerCase();\n\tif(g.nodesStrings.indexOf(searchWord) === -1) {return false}\n\tsearchWord=g.nodes[g.nodesStrings.indexOf(searchWord)];\n\n\tlet connectedItemList=orderExpand(item);//returns all items connected to item in order searchLinkOrder\n\tif (connectedItemList.indexOf(searchWord) === -1) {return false}\n\telse {return true}\n}", "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure === \"Diamond\");\n }", "hasEdge(node1, node2) {\n const list = this.lists[node1];\n if (list == null) {\n return false;\n }\n // once we got the list of successors, we look for node2\n for (let i = 0; i < list.getSize(); i++) {\n if (list.get(i) === node2) {\n return true;\n }\n }\n }", "function detectElement(tags) {\n\n var resultdetect = false, $node = getSelectedNode(), parentsTag;\n\n if ($node) {\n $.each(tags, function (i, val) {\n parentsTag = $node.prop('tagName').toLowerCase();\n\n if (parentsTag == val)\n resultdetect = true;\n else {\n $node.parents().each(function () {\n parentsTag = $(this).prop('tagName').toLowerCase();\n if (parentsTag == val)\n resultdetect = true;\n });\n }\n });\n\n return resultdetect;\n }\n else\n return false;\n }", "function isConnectedLink(node, link) {\n //link.source and link.target is invalid as it had been automatically replaced with real data.\n if (link.target.index == node.index || link.source.index == node.index)\n return true;\n return false;\n }", "_addVirtualLabel(name) {\n if (this.virtualNode.labels[name] !== true) {\n this.virtualNode.labels[name] = true;\n\n if (name in this.labelMappings) {\n this.target[this.labelMappings[name]] = true;\n }\n }\n }", "function AreAdjacentNouns(stims) {\n\tvar are_adj = false;\n\tvar i = 0;\n\twhile (are_adj == false && i < (stims.length-1) ) {\n\t\tif (stims[i].noun == stims[i+1].noun){\n\t\t\tare_adj = true;\t\t\t\n\t\t} \n\t\ti++;\n\t}\n\treturn are_adj;\n}", "function checkInput(element) {\n const $label = $(element).siblings('.groupLabel');\n\n if ($(element).val()) {\n $label.addClass('labelMini');\n }\n else {\n $label.removeClass('labelMini');\n }\n}", "function nodesEqualOnto(node1,node2){\n node1.each(function(d){\n node2.each(function(d1){\n return d.index==d1.index;\n });\n });\n}", "function hasNoEmptyLabels() {\n const problemLabels = elementData.label\n .filter(label => label.textContent === '')\n .map(label => stringifyElement(label));\n if (problemLabels.length) {\n const item = {\n // description: 'The for attribute of a label must not be empty.',\n details: `Found empty label(s):<br>• ${problemLabels.join('<br>• ')}`,\n learnMore: 'Learn more: <a href=\"https://equalizedigital.com/accessibility-checker/empty-missing-form-label\">Empty or Missing Form Label</a>',\n title: 'Labels must have text content.',\n type: 'error',\n };\n items.push(item);\n }\n}", "function _labelIsWrapping(){\n\n\t\tif (this.getWrapping && !this.isPropertyInitial(\"wrapping\")) {\n\t\t\treturn this.getWrapping();\n\t\t}\n\n\t\treturn true;\n\n\t}", "function isDescendantSelector( name )\n{\n\treturn ( name.charAt( 0 ) === '!' );\n}", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _Object = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _Object.subNodes,\n prevNodeMap1 = _Object.prevNodeMap;\n\n var _Object2 = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _Object2.subNodes,\n prevNodeMap2 = _Object2.prevNodeMap;\n\n var _iterator471 = _createForOfIteratorHelper(subNodes1),\n _step471;\n\n try {\n for (_iterator471.s(); !(_step471 = _iterator471.n()).done;) {\n var sharedNode = _step471.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator471.e(err);\n } finally {\n _iterator471.f();\n }\n\n return false;\n }", "function ancestoryTest(node1, node2) {\n var tmp = node1;\n while (tmp) {\n if (tmp === node2) return true;\n tmp = tmp.parent;\n }\n tmp = node2;\n while (tmp) {\n if (tmp === node1) return true;\n tmp = tmp.parent;\n }\n return false;\n }", "function isConnected(a, b) {\n let c1 = indexLink[a.index + \"|\" + b.index];\n let c2 = indexLink[b.index + \"|\" + a.index];\n return (c1 || c2);\n }", "checkLabelandAttributeOverrrides() {\n const attributeMappingKeys = Object.keys(this.attributeMappings);\n\n const labelMappingKeys = Object.keys(this.labelMappings);\n\n this.target.getAttributeNames().forEach(name => {\n // remove all override targets for attributes\n attributeMappingKeys.forEach(attr => {\n if (attr === name) {\n delete this.attributeMappings[attr];\n }\n });\n\n // remove all override targets for labels\n labelMappingKeys.forEach(attr => {\n if (attr === name) {\n delete this.labelMappings[attr];\n }\n });\n });\n }", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _Object = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _Object.subNodes,\n prevNodeMap1 = _Object.prevNodeMap;\n\n var _Object2 = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _Object2.subNodes,\n prevNodeMap2 = _Object2.prevNodeMap;\n\n var _iterator504 = _createForOfIteratorHelper(subNodes1),\n _step504;\n\n try {\n for (_iterator504.s(); !(_step504 = _iterator504.n()).done;) {\n var sharedNode = _step504.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator504.e(err);\n } finally {\n _iterator504.f();\n }\n\n return false;\n }", "function getLabel(me) {\n\t\treturn +me.parentNode.getAttribute(\"id\").split(\"label\")[1];\n\t}", "function bar_label_compare(a, b) {\n\t\tvar a = $(a).find('label').text();\n\t\tvar b = $(b).find('label').text();\n\t\treturn a.localeCompare(b);\n\t}", "foundSimilarConnections(nodes, edges) {\n let graphNewNodes = []\n let graphNewEdges = []\n for (let i=0; i < edges.length; ) {\n graphNewEdges.push(edges.shift())\n if(edges.length) {\n let indexes = []\n // eslint-disable-next-line no-loop-func\n let rez = edges.reduce((rez, item, i) => { \n if((item.from === graphNewEdges[graphNewEdges.length-1].from) & (item.to === graphNewEdges[graphNewEdges.length-1].to)) {\n rez+=', '+item.label\n indexes.push(i)\n }\n return rez }, [''])\n edges = edges.filter((item ,i) => !indexes.includes(i) && item)\n graphNewEdges[graphNewEdges.length-1].label+=rez\n }\n }\n if(!!!graphNewNodes.length) graphNewNodes = nodes\n if(!!!graphNewEdges.length) graphNewEdges = edges\n return { nodes: graphNewNodes, edges: graphNewEdges }\n }", "sameMarkup(other) {\n return this.hasMarkup(other.type, other.attrs, other.marks);\n }", "function isDescendant(tree,vLabel,rootLabel){return rootLabel.low<=vLabel.lim&&vLabel.lim<=rootLabel.lim}", "function Xml_IsNodeName(objNode, strName)\r\n{\r\n return objNode.nodeName == strName;\r\n}", "function nameBlankNodes(unique, duplicates, unnamed) {\n // name unique bnodes in sorted hash order\n var named = false;\n var hashes = Object.keys(unique).sort();\n for(var i = 0; i < hashes.length; ++i) {\n var bnode = unique[hashes[i]];\n namer.getName(bnode);\n named = true;\n }\n\n if(named) {\n // continue to hash bnodes if a bnode was assigned a name\n return hashBlankNodes(unnamed);\n } else {\n // name the duplicate hash bnodes\n return nameDuplicates(duplicates);\n }\n }", "function hasAriaLabel(element) {\n var node = angular.element(element)[0] || element;\n\n /* Check if compatible node type (ie: not HTML Document node) */\n if (!node.hasAttribute) {\n return false;\n }\n\n /* Check label or description attributes */\n return node.hasAttribute('aria-label') || node.hasAttribute('aria-labelledby') || node.hasAttribute('aria-describedby');\n }", "exists() {\n const source = internal(this).source;\n const model = internal(source).model;\n return internal(model).connections.contains(this);\n }", "function same(el1, el2) {\n if (el1 && el2) {\n let first = el1.getBoundingClientRect();\n let second = el2.getBoundingClientRect();\n let state = first.top === second.top && first.left === second.left;\n return state;\n }\n return true;\n}", "function containsNode(name, arr){\n for(var i =0;i<arr.length; i++){\n if(arr[i].name == name){\n //console.log(i);\n return true;\n }\n }\n return false;\n}", "function ui_isOptionDuplicate (str_optionLabel, id_targetList){\n\tvar _list = ui_getObjById(id_targetList);\n\tfor (var i=0; i< _list.options.length; i++){\n\t\tif (_list.options[i].text == ui_trim(str_optionLabel)){\n\t\t\treturn true; //return true if duplicate\n\t\t}\n\t}\n\treturn false;\n\n}", "function _labelBlankNodes(namer, element) {\n if(_isArray(element)) {\n for(var i = 0; i < element.length; ++i) {\n element[i] = _labelBlankNodes(namer, element[i]);\n }\n } else if(_isList(element)) {\n element['@list'] = _labelBlankNodes(namer, element['@list']);\n } else if(_isObject(element)) {\n // rename blank node\n if(_isBlankNode(element)) {\n element['@id'] = namer.getName(element['@id']);\n }\n\n // recursively apply to all keys\n var keys = Object.keys(element).sort();\n for(var ki = 0; ki < keys.length; ++ki) {\n var key = keys[ki];\n if(key !== '@id') {\n element[key] = _labelBlankNodes(namer, element[key]);\n }\n }\n }\n\n return element;\n}", "function _labelBlankNodes(namer, element) {\n if(_isArray(element)) {\n for(var i = 0; i < element.length; ++i) {\n element[i] = _labelBlankNodes(namer, element[i]);\n }\n } else if(_isList(element)) {\n element['@list'] = _labelBlankNodes(namer, element['@list']);\n } else if(_isObject(element)) {\n // rename blank node\n if(_isBlankNode(element)) {\n element['@id'] = namer.getName(element['@id']);\n }\n\n // recursively apply to all keys\n var keys = Object.keys(element).sort();\n for(var ki = 0; ki < keys.length; ++ki) {\n var key = keys[ki];\n if(key !== '@id') {\n element[key] = _labelBlankNodes(namer, element[key]);\n }\n }\n }\n\n return element;\n}", "function isCallWindow(){\n var labels=document.querySelectorAll('label.qmandatory');\n for(var i=0; i<labels.length; i++){\n if(labels[i].textContent.trim() == \"Art des Anrufs:\"){\n return true;\n }\n }\n return false; \n}", "function alreadyExist(list, vertex) {\n var exists = false;\n\n $.each(list, function () {\n if (this.label === vertex.label) {\n exists = true;\n }\n });\n return exists;\n}", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _ref84 = (0, _getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _ref84.subNodes,\n prevNodeMap1 = _ref84.prevNodeMap;\n\n var _ref85 = (0, _getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _ref85.subNodes,\n prevNodeMap2 = _ref85.prevNodeMap;\n\n var _iterator471 = _createForOfIteratorHelper(subNodes1),\n _step471;\n\n try {\n for (_iterator471.s(); !(_step471 = _iterator471.n()).done;) {\n var sharedNode = _step471.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator471.e(err);\n } finally {\n _iterator471.f();\n }\n\n return false;\n }", "function checkUnique(name){\n let unique = true;\n grid.forEach( column => {\n column.forEach( tile =>{\n row = grid.indexOf(column);\n col = column.indexOf(tile);\n if (grid[row][col].content != null){\n if (grid[row][col].content.name != null){\n if ((grid[row][col].content.name) === name){\n unique = false;\n \n alert(\"Entity Names must be unique\")\n \n }\n }\n }\n });\n });\n\n return unique;\n}", "function isConnection() {\n return state.core.isConnection(state.nodes[_id].node);\n }", "function containsAnnotations(elm) {\n var children = elm.children;\n var childrenLength = children.length;\n for (var i = 0; i < childrenLength; i++) {\n var child = children[i];\n var styles = window.getComputedStyle(child);\n if (styles.getPropertyValue(CSS_COL) != \"1\" || styles.getPropertyValue(CSS_ROW) != \"1\") { // IE will automatically determine that all elements are at (1, 1)\n return true;\n }\n }\n return false;\n }", "function doesNodeAlreadyExist(nodes, node){\n\t//console.log(node);\n\tfor (var i = 0; i < nodes.length; i++) {\n\t\tif(nodes[i].name == node.name){\n\t\t\treturn i;\n\t\t}\n\t}\n\n\treturn -1;\n}", "function sharedpoint_exist(name)\n {\n for(var i=0; i<sharedpoints.length; i++)\n if(sharedpoints[i].name == name)\n return true;\n }", "getIntersectedLabel(x, y) {\n // debugger\n for (const label of this._.labelSet) {\n if (label.minimized) continue;\n if (Utils2D.coordsInElement(x, y, this.refs[getLabelRef(label.id, this._.componentId)])) {\n return label;\n }\n }\n return null;\n }", "function nameBlankNodes(unique, duplicates, unnamed) {\n // name unique bnodes in sorted hash order\n var named = false;\n var hashes = Object.keys(unique).sort();\n for(var i = 0; i < hashes.length; ++i) {\n var bnode = unique[hashes[i]];\n namer.getName(bnode);\n named = true;\n }\n\n if(named) {\n // continue to hash bnodes if a bnode was assigned a name\n hashBlankNodes(unnamed);\n } else {\n // name the duplicate hash bnodes\n nameDuplicates(duplicates);\n }\n }", "function nameBlankNodes(unique, duplicates, unnamed) {\n // name unique bnodes in sorted hash order\n var named = false;\n var hashes = Object.keys(unique).sort();\n for(var i = 0; i < hashes.length; ++i) {\n var bnode = unique[hashes[i]];\n namer.getName(bnode);\n named = true;\n }\n\n if(named) {\n // continue to hash bnodes if a bnode was assigned a name\n hashBlankNodes(unnamed);\n } else {\n // name the duplicate hash bnodes\n nameDuplicates(duplicates);\n }\n }", "get labels() {\n if (this.elementInternals) {\n return Object.freeze(Array.from(this.elementInternals.labels));\n } else if (this.proxy instanceof HTMLElement && this.proxy.ownerDocument && this.id) {\n // Labels associated by wrapping the element: <label><custom-element></custom-element></label>\n const parentLabels = this.proxy.labels; // Labels associated using the `for` attribute\n\n const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`));\n const labels = parentLabels ? forLabels.concat(Array.from(parentLabels)) : forLabels;\n return Object.freeze(labels);\n } else {\n return emptyArray;\n }\n }", "function detectRelationships(data) {\n var identical, similar;\n\n visible.unique1 = data.unique1;\n visible.unique2 = data.unique2;\n identical = data.identical;\n similar = data.similar;\n\n if (identical || similar) {\n visible.numIdenticalSets = identical.length;\n\n for (var i = 0; i < identical.length; i++) {\n var set = identical[i];\n\n for (var j = 0; j < set.length; j++) {\n visible.identical[set[j]] = set;\n }\n }\n\n for (var i = 0; i < similar.length; i++) {\n set = similar[i];\n\n for (var j = 0; j < set.items.length; j++) {\n visible.similar[set.items[j]] = set;\n }\n }\n }\n }", "connected(n1, n2) {\n console.log(\"Testing connection between \" + n1 + ' and ' + n2);\n return (this.root(n1) == this.root(n2));\n }", "isRangeHaveSelector(range) {\n return range.names.some(({ mains }) => mains !== null);\n }", "function is_similar(selectedIDS, comparisonIDS) {\n for (var i in comparisonIDS) { \n if(selectedIDS[i] != \"none\") {\n //si no coinciden\n if(comparisonIDS[i] !== selectedIDS[i]) {\n return false;\n }\n }\n }\n return true;\n }", "function showLinkLabel(e) {\n var label = e.subject.findObject('LABEL');\n if (label !== null) {\n label.visible = (e.subject.fromNode.data.category === 'Conditional');\n }\n }", "function notAlreadyMarked(node) {\n \"use strict\";\n return ($(node).closest(\"a.gloss\").length === 0);\n}", "hasChangedBesidesElement_() {\n\t\tvar count = Object.keys(this.changes_).length;\n\t\tif (this.changes_.hasOwnProperty('element')) {\n\t\t\tcount--;\n\t\t}\n\t\treturn count > 0;\n\t}", "hasCycle() {\n const numOfNodes = this.nodes.size;\n const numOfEdges = this.getNumOfEdges();\n const numOfConnectedComponents = this.getNumOfConnectedComponents();\n return numOfEdges > numOfNodes - numOfConnectedComponents;\n }", "function validateNames (el) {\n if(el.value == 0 || el.value.length <= 2) {\n\n setError(el, errorMessages.names);\n return false;\n }\n else { \n removeError(el);\n return true;\n }\n}", "hasSameAdiAs(op) {\n return this.attributes.align === op.attributes.align\n && this.attributes.direction === op.attributes.direction\n && this.attributes.indent === op.attributes.indent;\n }", "function hasNoLabelsMissingForAttributes() {\n const problemLabels = elementData.label\n .filter(label => label.for === null)\n .map(label => stringifyElement(label));\n if (problemLabels.length) {\n const item = {\n // description: 'All labels should have a for attribute.',\n details: 'Found label(s) without a <code>for</code> attribute:<br>• ' +\n `${problemLabels.join('<br>• ')}`,\n learnMore: 'Learn more: <a href=\"https://developer.mozilla.org/docs/Web/HTML/Attributes/for#usage\">The HTML for attribute</a>',\n title: 'Labels must have a for attribute.',\n type: 'error',\n };\n items.push(item);\n }\n}" ]
[ "0.6721919", "0.6202323", "0.60005915", "0.5977667", "0.596287", "0.5962072", "0.59042984", "0.5884175", "0.5784174", "0.5713267", "0.5676578", "0.5655946", "0.5605312", "0.5587715", "0.5550891", "0.5538444", "0.55327916", "0.5512373", "0.5485291", "0.5386358", "0.53746575", "0.53377926", "0.53293335", "0.53049487", "0.5284479", "0.5168609", "0.5168609", "0.5168609", "0.51443696", "0.514247", "0.5114827", "0.5070603", "0.5064139", "0.5064139", "0.5048066", "0.50300074", "0.5025744", "0.49949288", "0.4985075", "0.49845335", "0.49736464", "0.49611917", "0.49545172", "0.4947936", "0.4944406", "0.49404287", "0.49311668", "0.49180982", "0.49119183", "0.49109825", "0.4906825", "0.49031028", "0.48999605", "0.48953623", "0.48908648", "0.48775238", "0.48753607", "0.48665056", "0.48651102", "0.4859468", "0.4858429", "0.48354453", "0.48350352", "0.48245704", "0.4824", "0.48215282", "0.48143062", "0.48040804", "0.48037335", "0.4803466", "0.47964403", "0.4796409", "0.4792297", "0.47897202", "0.47719568", "0.47709808", "0.47709808", "0.476367", "0.4758521", "0.47450075", "0.47443643", "0.4742336", "0.4736936", "0.47353515", "0.47320378", "0.4730297", "0.47294533", "0.47294533", "0.47119853", "0.47111112", "0.4710378", "0.47077492", "0.4693623", "0.46824378", "0.46805936", "0.46792045", "0.4676476", "0.4675648", "0.46729788", "0.46661878" ]
0.7951297
0
gets first and end item ids from elements_array, if they exist
function check_for_endpoints(){ var first_item = -1 , end_item = -1; for(var i=0; i<elements_array.length; i++){ if(elements_array[i].type == 'START'){ for(var x=0; x<connections_array.length; x++){ if(elements_array[i].connect_id == connections_array[x].source){ first_item = connections_array[x].target; // 'START' item's target } } } else if(elements_array[i].type == 'END'){ /* for(var x=0; x<connections_array.length; x++){ if(elements_array[i].id == connections_array[x].target){ end_item = connections_array[x].source; } }*/ end_item = elements_array[i].id; // 'END' item } } return {first_id: first_item, end_id: end_item}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkIds(elements) {\r\n let len = elements ? elements.length : 0\r\n let ids = []\r\n for (let i = 0; i < len; i++) {\r\n const regexToSearchFor = /id=\".*\"/g;\r\n let id = elements[i].match(regexToSearchFor);\r\n if (id) {\r\n id = id[0]\r\n id = id.split('\"')[1]\r\n }\r\n if (id) {\r\n ids.push(id)\r\n } else {\r\n ids.push('');\r\n }\r\n }\r\n return ids\r\n }", "function elementIdFetcher(elArr) {\n return elArr.map(function(el) {\n var newObj = {value: el.value._id, number: el.number};\n return newObj;\n });\n}", "function parseIdArray(element_id) {\n\tvar idArray = []\n\t\n\tif (element_id.indexOf('dimension') > -1) {\n\t\tstr = element_id.slice(10);\n\t\tcut = str.indexOf(\"_\");\n\t\tidArray[0] = str.slice(0,cut);\n\t} else if (element_id.indexOf('parameter') > -1) {\n\t\tstr0 = element_id.slice(10);\n\t\tcut0 = str0.indexOf(\"_\");\n\t\tidArray[0] = str0.slice(0,cut0);\n\t\t\n\t\tstr1 = str0.slice(cut0 + 1);\n\t\tcut1 = str1.indexOf(\"_\");\n\t\tidArray[1] = str1.slice(0,cut1);\n\t} else if (element_id.indexOf('spell_id') > -1) {\n\t\tstr0 = element_id.slice(9);\n\t\tcut0 = str0.indexOf(\"_\");\n\t\tidArray[0] = str0.slice(0,cut0);\n\t\t\n\t\tstr1 = str0.slice(cut0 + 1);\n\t\tcut1 = str1.indexOf(\"_\");\n\t\tidArray[1] = str1.slice(0,cut1);\n\t\t\t\n\t\tif (element_id.indexOf('include') > -1) {\n\t\t\tidArray[2] = 'include';\n\t\t} else if (element_id.indexOf('exclude') > -1) {\n\t\t\tidArray[2] = 'exclude';\n\t\t} else {\n\t\t\tidArray[2] = str1.slice(cut1 + 1);\n\t\t}\n\t};\n\treturn idArray;\n}", "function arrayIDs(arr){\n var ids = [];\n if(arr != undefined){\n arr.forEach(ele =>{\n ids.push(ele.id);\n }); \n }\n return ids;\n}", "function nextId(ids){\n let filteredArr = ids.filter(elm => {\n return ids.indexOf(elm) === ids.lastIndexOf(elm)\n })\n let uniqueArr = ids.filter(elm => {\n return ids.indexOf(elm) != ids.lastIndexOf(elm)\n })\n for (id of uniqueArr) {\n if (filteredArr.includes(id)) {\n \n } else {\n filteredArr.push(id)\n }\n }\n let sortedArr = filteredArr.sort((a, b) => a - b)\n//Haha maybe include \n for (let i = 0; i <= sortedArr.length; i++) {\n if (sortedArr[i] != i) {\n return i\n }\n }\n}", "function get_item_ids(id) {\n\t\tvar arr = id.split(\"_\");\n\t\treturn [arr[0], arr[1]];\n\t}", "function getElements(items){\n\t\tvar _ids = new Array();\n\n\t\tvar _elements = new Array();\n\t\tconsole.log(\"*** getElements() called for items.lenght:\"+items.length);\n\t\tfor (var i in items){\n\t\t\t_ids.push(items[i].id);\n\t\t\t_elements.push(d3.select(\"#item_\"+items[i].id));\n\t\t\tconsole.log(\"************ in getElements(): pushing - id:\"+items[i].id);\n\n\t\t}\n\t\t//var _ids=new Array(200,201,208,209)\n\t\t/*\n\t\tvar _elements = d3.select(\"#items\").selectAll(\"g\").filter(function(d){return _ids.indexOf(d.id)>=0;});\n\t\t*/\n\t\tconsole.log(\"*** returning \"+_elements.length+\" elements\");\n\n\t\treturn _elements;\n}", "elementoById(id, array){\r\n return array.find((ele) => ele.getId() === id);\r\n }", "sliceIds(begin, end) {\n let ids = [];\n let idsWithDates = this.idsWithDates;\n for (let i = begin; i < end; i++) {\n ids.push(idsWithDates[i].id);\n }\n return ids;\n }", "function nextId(ids){\n \n for (let i=0; i <= ids.length; i++) {//loops through 'ids' and sees if 0 is there = true, 1 is there = true,....4 is there = false...\n if(!ids.some((element) => element === i)) {//some() checks to see ifthere is some of that thing in the array IT COMPARES true or false \n return i//returns 4!! Or first unused number\n }\n }\n}", "function getItemsId() {\n let ids = sessionStorage.getItem(`items`);\n console.log(\"geting items id\", ids);\n if (ids != null) {\n ids = ids.replaceAll(`id-`, ``);\n\n console.log(ids.split(`_`));\n return ids.split(`_`);\n }\n console.log(\"Get Items null from storage\");\n return [];\n }", "function updateEntityIds (elem) {\n if (elem && elem.__data__) {\n var data = elem.__data__;\n var idFields = ['startId', 'endId', 'originId'];\n idFields.forEach(function(field){\n if (data.hasOwnProperty(field)) {\n data[field] = guid();\n }\n });\n\n // 'id' field is obligatory\n data.id = guid();\n }\n\n return elem;\n }", "function getItemsSameID(element){\n \n const elements=$EL_numsEntered.querySelector(`div[data-id='${element.dataset.id}']`)\n \n return item=[ number= elements.querySelector('h2'),\n buttondelete= elements.querySelector('button.buttonDel'),\n buttonmod= elements.querySelector('button.buttonMod')]\n \n\n}", "function getItemIds(items,taxcode){\n \t\t\ttry{\n \t\t\t\tvar columns = ['internalid','name','displayname','internalid'];\n\t \t\t\tvar newItems = [];\n\t \t\t\tfor(var i = 0;i < items.length;i++){\n\t \t\t\t\tvar itemSearch = search.create({\n\t\t \t\t\t\ttype:search.Type.ITEM,\n\t\t \t\t\t\ttitle:'Find item id',\n\t\t \t\t\t\tcolumns:columns,\n\t\t \t\t\t\tfilters:[['name','is',items[i].item]]\n\t\t \t\t\t});\n\n\t\t \t\t\tvar results = itemSearch.run().getRange({start: 0, end: 1000});\n\t\t \t\t\tlog.debug ({\n\t\t title: 'Finding items',\n\t\t details: results.length\n\t\t });\n\n\t\t var internalid = searchResults(results,columns,items[i].item,'name');\n\t\t log.debug ({\n\t\t title: 'item id',\n\t\t details: internalid\n\t\t });\n\t\t newItems.push({\n\t\t \titem:internalid,\n\t\t \tquantity:items[i].quantity,\n\t\t \ttaxcode:taxcode,\n\t\t \tprice:items[i].price,\n\t\t \trate:items[i].rate\n\t\t })\n\t \t\t\t}\n\n\t return newItems;\n \t\t\t}\n \t\t\tcatch(err){\n \t\t\t\tlog.error({\n\t\t\t\t\ttitle:err.name + ' error getting item ids',\n\t\t\t\t\tdetails:err\n\t\t\t\t});\n \t\t\t}\n \t\t\t\n \t\t}", "function magicIdxDuplicates(arr, start = 0, end = arr.length - 1) {\n if (end < start) return -1\n const midIdx = Math.floor((start + end) / 2);\n const midVal = arr[midIdx];\n\n if (midVal === midIdx) return midIdx;\n\n const leftIdx = Math.min(midIdx - 1, midVal);\n const left = magicIdxDuplicates(arr, start, leftIdx);\n if (left >= 0) return left\n\n const rightIdx = Math.max(midIdx + 1, midVal);\n const right = magicIdxDuplicates(arr, rightIdx, end);\n return right;\n}", "function ArrayToRemoveIniObeya(elements, idRida) {\r\n\r\n\tvar ids = Array();\r\n\tfor (var i in elements) {\r\n\t\tids.push(elements[i].id);\r\n\t}\r\n\t\r\n\t//stats(idRida); // TODO: code commenté, pas clair.... ???\r\n\t\t\r\n\treturn ids;\r\n}", "getSelectedActualElements(elementIdString, ids, resize) {\n const array = [];\n const templateElements = !this.state.translationModeOn ? this.props.templateElements : this.props.templateTranslationElements;\n\n _.each(ids, id => {\n if (resize) {\n if (!templateElements[id].document_field_choices) {\n array.push(document.getElementById(`${elementIdString}${id}`));\n }\n } else {\n array.push(document.getElementById(`${elementIdString}${id}`));\n }\n });\n return array;\n }", "function extract_preselected_ids(element) {\n var preselected_ids = [];\n var delimiter = ',';\n if (element.val()) {\n if (element.val().indexOf(delimiter) != -1)\n $.each(element.val().split(delimiter), function () {\n preselected_ids.push({ id: this[0] });\n });\n else\n preselected_ids.push({ id: element.val() });\n }\n return preselected_ids;\n}", "function getIds(id) {\n let list = id.split(' ');\n let idReturn = [],\n item;\n for (let i = 0; i < list.length; i++) {\n item = document.getElementById(list[i]);\n if (item) {\n idReturn.push(item);\n\n }\n }\n return (idReturn);\n }", "function reduceIDs(arr) {\n if (arr === undefined || !Array.isArray(arr)) return 0;\n return arr.reduce((prev, current) => (prev.identifier > current.identifier) ? prev : current).identifier;\n}", "function getElementIDsToArray(selector) {\n /*\n * param eles: cy.elements\n * return: array of element id strings\n */\n\n var idArray = [];\n try {\n cy.elements(selector).forEach(function (el) {\n var id = el.id();\n var filter = content.filter.toLowerCase();\n var filterIncludes = id.toLowerCase().includes(filter);\n\n if (content.filter == '' || content.filter == 'undefined') {\n idArray.push(id);\n } else {\n if (filterIncludes) {\n idArray.push(id);\n }\n }\n });\n } catch (e) {\n console.error(e);\n }\n return idArray;\n }", "getEntityIds() {\n return Object.keys(this.items)\n }", "getFilteredIds () {\n let res = [], rows = {}, filteredItems = []\n\n rows = $.extend(true, rows, this.props.rows)\n\n if (this.props.filters.items &&\n this.props.filters.items.length &&\n this.props.filters.isActive) {\n //filters are active and present\n filteredItems = rows.items.filter(this.runFilters)\n\n filteredItems.map((item) => {\n res.push(item.id())\n })\n\n } else {\n //or not, returning an array with all the IDs\n rows.items.map((item) => {\n res.push(item.id())\n })\n }\n\n return res\n }", "static getAllElementIDs()\n\t{\n\t\tvar elementIDs = [];\n\t\tlet elemsArray = document.getElementsByClassName(\"OMC\");\n\t\tfor (let i = 0, len = elemsArray.length; i < len; i++)\n\t\t{\n\t\t\tlet elem = elemsArray[i];\n\t\t\tif(elem.hasAttribute('id'))\n\t\t\t{\n\t\t\t\telementIDs.push(elem.id);\n\t\t\t}\n\t\t}\n\t\treturn elementIDs;\n\t}", "function returnIdsOnly(modelArray) {\n var ids = Array();\n for (i = 0; i < modelArray.length; i++) {\n ids.push(String(modelArray[i]._id));\n }\n return ids;\n}", "function nextId(ids) {\n\tfor (let i = 0; i < ids.length; i++) {\n\t\tif (ids.indexOf(i) == -1) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn ids.length;\n}", "function findNewItems ({prevIds}, items) {\n return {\n prevIds: items.map(item => item[idAttribute]),\n addedItems: items.filter(item => prevIds.indexOf(item[idAttribute]) === -1)\n };\n }", "function getFilteredItemIDs( iso ) {\n return iso.filteredItems.map( function( item ) {\n return item.element.getAttribute('data-item-id');\n });\n }", "function checkIfArrayOfObjectIds(array) {\n return !!(array.length && array[0].$oid);\n}", "function getEventObject(array, object){\n var len = array.length;\n \n for (var i = 0; i < len; i++){\n if ( object.attr('id') == array[i].object.attr('id')){\n return i;\n }\n }\n\n return -1;\n}", "function getHeaderIds(){\n\n var headers = []\n\n $(\":header[id^='header-']\").each(function(){\n var id = $(this).attr(\"id\")\n\n\n headers.push(id)\n })\n\n headers.push(headers.shift())\n return headers\n}", "get selectedRowIds() {\n const rowIds = this.selectedCheckboxes.map((checkbox) => {\n const checkboxId = checkbox.id.toString();\n const idArr = checkboxId.split('-');\n const rowIdIndex = 1;\n return idArr[rowIdIndex];\n });\n return rowIds;\n }", "function getIds(){\n let idArr = [];\n let objArr = document.querySelectorAll('div.h1container');\n objArr.forEach(function(div){\n idArr.push(div.getAttribute('id'))\n })\n return idArr;\n }", "_setUniqueIds() {\n this.ids = this.titleElements.map(() => getRandomInt())\n }", "buscarIndex(id,array){\r\n return array.findIndex((elem) => elem.getId() === id);\r\n }", "function includes (array, element) {\n\t\n\tfor (var i = 0; i < array.length; i++) if (array[i].id == element.id) return true;\n\treturn false;\n\t\n}", "function updateID(array) {\n if (array.length != 0) {\n for (let i = 0; i < array.length; i++) {\n array[i].id = i;\n }\n }\n}", "function properlyHandleMultipleIds(idList, dst) {\n if (typeof dst === \"undefined\") { dst = []; }\n for (var i = 0; i < idList.length; i++) {\n if (isNaN(idList[i])) {\n // dst = dst.concat(properlyHandleMultipleIds(idList[i], dst));\n properlyHandleMultipleIds(idList[i], dst);\n } else if (dst.indexOf(idList[i]) === -1) {\n dst.push(idList[i]);\n }\n }\n\n // console.log(dst);\n return dst;\n}", "function selectedEntityIds(scope) {\n var arr = [];\n var selectedEntities = getSelectedEntities(scope);\n if (selectedEntities && selectedEntities.length > 0) {\n for (var i = 0; i < selectedEntities.length; i++) {\n if (selectedEntities[i]) {\n arr.push(selectedEntities[i].id());\n }\n }\n }\n return arr;\n }", "function getID(array, key) {\n let index = array\n .map(function (e) {\n return e.name;\n })\n .indexOf(key);\n return array[index].id;\n}", "function $ID(element) \n{\n\tif (arguments.length > 1) \n\t{\n\t\tfor (var i = 0, elements = [], length = arguments.length; i < length; i++)\n\t\t{\n \t\telements.push($ID(arguments[i]));\n \t}\n\t\treturn elements;\n\t}\n\tif (typeof element == \"string\")\n\t{\n\t\telement = document.getElementById(element);\n\t\treturn element;\n\t}\n}", "addUniqueID(elements, target) {\n const idx = [...elements].indexOf(target);\n\n if (target.id === 'undefined') {\n target.id = idx;\n }\n }", "function getAdvertiserIds() {\n var advertiserIds = [];\n var advertiserFeed = new FeedProvider(constants.ADVERTISERS_TAB).load();\n\n while(advertiser = advertiserFeed.next()) {\n var advertiserId = advertiser[constants.ADVERTISER_ID_HEADER];\n var partnerId = advertiser[constants.PARTNER_ID_HEADER];\n\n if(advertiserIds.indexOf(advertiserId) == -1) {\n advertiserIds.push({\n 'advertiserId': advertiserId,\n 'partnerId': partnerId\n });\n }\n }\n\n return advertiserIds;\n }", "allId() {\n\t\treturn this.idsOfProducts\n\t}", "function getIds(){\n let ids = [];\n let kimochis = $(\".kimochi\");\n for(let i=0; i<kimochis.length; i++){\n ids.push($(kimochis[i]).attr(\"id\"));\n }\n return ids;\n}", "function findFirstAndLastVisibleProduct(arrLi) {\n var firstVisibleElement = undefined,\n lastVisibleElement,\n arrLis = arrLi;\n\n for (var i = 0; i < arrLis.length; i+= 1) {\n if (arrLis[i].className == 'visible-products') {\n firstVisibleElement == undefined ? firstVisibleElement = i : lastVisibleElement = i;\n }\n }\n return [firstVisibleElement, lastVisibleElement];\n }", "function getIdsBelow(id,column){\n var specs_onscreen = document.getElementById('specify').children;\n var specs_ids = [specs_onscreen[0].id]\n for (var i=1; i<specs_onscreen.length; i++){\n specs_ids.push(specs_onscreen[i].id);\n }\n var id_index = specs_ids.indexOf(id);\n if (id_index+1<=specs_ids.length){\n var ids_below = specs_ids.slice(id_index+1,specs_ids.length)\n return ids_below\n } else {\n return []\n }\n}", "function indexOf(item, array) {\n if (typeof item == 'undefined' || typeof array == 'undefined' || array.length <= 0) {\n return -1;\n }\n\n if (typeof item.id == 'undefined') {\n return -1;\n }\n\n var length = array.length;\n var index = -1;\n for (var i = 0; i < length; i++) {\n if (item.id === array[i].id) {\n index = i;\n break;\n }\n }\n\n return index;\n }", "function getIDArray(data){\r\n\tvar ids = [];\r\n\tfor(var i in data){\r\n\t\tvar site = data[i];\r\n\t\tids.push(site.siteID);\r\n\t}\r\n\treturn ids;\r\n}", "function fillInIds() {\n entityObj.curRcrds = attachTempIds(entityObj.curRcrds); //console.log(\"entityObj.curRcrds = %O\", entityObj.curRcrds)\n }", "function inArray(array,item) {\n\t\t\t\t\t\t\t\tvar present = false;\n\t\t\t\t\t\t\t\t_.each(array, function (testItem) {\n\t\t\t\t\t\t\t\t\t\t\t\tif(item.identifier===testItem.identifier){\n\t\t\t\t\t\t\t\t\t\t\t\t\tpresent = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t}//function\n\t\t\t\t\t\t\t\t})//angular.forEach\n\t\t\t\t\t\t\t\treturn present;\n\t\t\t\t\t\t\t}", "get ids() {\n return this.getListAttribute('ids');\n }", "get selectedIds() {\n return this.selected.map(target => target.dataset.id)\n }", "function carregarIdElementosPagina() {\n\tarrayIdsElementsPage = new Array;\n\tfor (form = 0; form <= document.forms.length; form++) {\n\t\tvar formAtual = document.forms[form];\n\t\tif (formAtual != undefined) {\n\t\t\tfor (i = 0; i < document.forms[form].elements.length; i++) {\n\t\t\t\tif (document.forms[form].elements[i].id != '') {\n\t\t\t\t\tarrayIdsElementsPage[i] = document.forms[form].elements[i].id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function getOrderedResourceIds() {\n return getOrderedResourceEls().map(function(i, node) {\n return $(node).data('resource-id')\n }).get()\n }", "assignElementIndices() {\n // Analytics: Assign numeric index to each episode.\n let elementIndex = 0;\n\n // Reserve first elementIndex to the elevated episode, if one exists.\n if (this.elevated && this.elevated.episode) {\n this.elevated.episode.elementIndex = elementIndex++;\n }\n\n if (this.series && this.series.seasons) {\n this.series.seasons\n .filter(season => season.episodes)\n .forEach((season) => {\n season.episodes\n .forEach((episode) => episode.elementIndex = elementIndex++);\n });\n }\n }", "function getSingleItemsIndex(dates) {\n var indexArray = [];\n\n for (var i = 0; i < dates.length; i++) {\n //Gets the index placed in the last position of the date string\n var index = dates[i].slice(-1),\n counter = 0;\n \n for (var j = 0; j < dates.length; j++) {\n var innerIndex = dates[j].slice(-1);\n if (index === innerIndex) {\n counter++;\n if (counter > 1){\n break;\n }\n }\n }\n if (counter === 1) {\n indexArray.push(i);\n }\n }\n return indexArray;\n}", "inArray(articleId, sharedArray) {\n let length = sharedArray.length;\n for (let i = 0; i < length; i++) {\n if (sharedArray[i] === articleId) {\n return true;\n }\n }\n return false;\n }", "function getIDs(indices)\n\t{\n\t\tvar choices = problem.get('choices');\n\t\tvar out = [];\n\t\t_.each(indices, function(val, idx) {\n\t\t\tif (val !== 0)\n\t\t\t\tout.push(choices[idx].id);\n\t\t});\n\n\t\treturn out;\n\t}", "function getIndexes(ids, val) {\n let indexes = [];\n\n ids.forEach((element, index) => {\n if (element === val)\n indexes.push(index + 1);\n });\n\n return indexes;\n }", "function getFieldIds(){\r\n\treturn $('inpFieldIds').value.split(',');\r\n}", "function find_preselections(preselected_ids) {\n var pre_selections = []\n for (index in arrICDData)\n for (id_index in preselected_ids) {\n var objects = find_object_with_attr(selections[index], { key: 'id', val: preselected_ids[id_index].id })\n if (objects.length > 0)\n pre_selections = pre_selections.concat(objects);\n }\n return pre_selections;\n}", "setItemID() {\n let cnt = 0;\n\n do {\n cnt += 1;\n // eslint-disable-next-line no-loop-func\n } while (this.items.some((e) => e.id === cnt));\n\n return cnt;\n }", "indexContainingID(currentArray, id) {\n for (let i = 0; i < currentArray.length; i++) {\n if (JSON.stringify(currentArray[i]).includes(id)) {\n return i;\n }\n }\n return -1;\n }", "diffMapElements(elementIds, data) {\n const result = {};\n let empty = true;\n\n for (const kind in elementIds) {\n if (!this.shouldDrawObjectOfThisElementKind(kind)) {\n continue;\n }\n\n result[kind] = [];\n const newIds = elementIds[kind];\n const oldData = data[kind];\n for (let i = 0; i < newIds.length; ++i) {\n const found = oldData ? oldData.find((old) => old.id.id === newIds[i]) : false;\n\n if (!found) {\n empty = false;\n result[kind].push(newIds[i]);\n }\n }\n }\n\n return empty ? {} : result;\n }", "function get_ids_fron_email_given(email, id) {\n client_email = \"\";\n client_name = \"\";\n client_id = \"\";\n agent_name = \"\";\n agent_id = \"\";\n array_key = \"\";\n object_key = \"\";\n agent_or_client_assoc = \"\";\n\n if (total_agents > 0) {\n assoc_client = false;\n //ASSOC CLIENT ID TO THE FIRST NULL AGENT\n for (var i = 0; i < total_agents; i++) {\n array_key = i;\n agent_element = agents_ids_assoc_clients[i];\n if (typeof agent_element !== 'undefined') {\n agent_id = agents_ids_assoc_clients[i].agend_id;\n agent_name = agents_ids_assoc_clients[i].agent_name;\n if (agent_id == id) {\n //find agent\n agent_or_client_assoc = \"agent\";\n assoc_client = true;\n break;\n }\n for (var e in agent_element) {\n if (agent_element[e].client_email == email || agent_element[e].client_id == id) {\n object_key = e;\n client_email = agent_element[e].client_email;\n client_name = agent_element[e].client_name;\n client_id = agent_element[e].client_id;\n agent_or_client_assoc = \"client\";\n assoc_client = true;\n break;\n }\n }\n if (assoc_client)\n break;\n } else {\n console.log(\"------------------------AGENTE UNDEFINED \" + id + \"------------------------\");\n }\n }\n if (assoc_client) {\n if (agent_or_client_assoc != \"\")\n return {\n ak: array_key,\n ok: object_key,\n client_or_agent: agent_or_client_assoc\n };\n else\n return {\n ak: array_key,\n ok: object_key\n };\n } else\n return false;\n }\n}", "getUserIds() {\n const userIdsString = this.get(USER_IDS_STORAGE_KEY);\n const userIds = userIdsString ? JSON.parse(userIdsString) : [];\n\n if (Array.isArray(userIds)) {\n // Remove any duplicates that might have been added\n // The Set preserves insertion order\n return [...new Set(userIds)];\n } else {\n throw new Error('Expected the user ids to be an array');\n }\n }", "function OwnerID(){}// http://jsperf.com/copy-array-inline", "function OwnerID(){}// http://jsperf.com/copy-array-inline", "function getAttrId(arr, attr, id) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]._id === id) {\n return i;\n }\n }\n}", "function createElIds () {\n // squares on the board\n for (var i = 0; i < num_rows(); i++) {\n for (var j = 0; j < num_cols(); j++) {\n let square = i + '-' + j;\n squareElsIds[square] = square + '-' + uuid()\n }\n }\n }", "function findIndexFromId(array, attr, value) {\n for (var i = 0; i < array.length; i += 1) {\n if (array[i][attr] === value) {\n return i;\n }\n }\n return -1;\n }", "function ids(ids, opt_document) {\r\n opt_document = opt_document || document;\r\n var suffix, i, l = (ids = typeOf(ids, 'Array') ? ids : [ids]).length, ret = [];\r\n ret.input = ids;\r\n do {\r\n ret.suffix = suffix = ('_' + Math.random()).replace('0.', '');\r\n for (i = 0; i < l && !opt_document.getElementById(ret[i] = ids[i] + suffix); i++);\r\n } while (i < l);\r\n return ret;\r\n }", "function getNextItem($item) {\n return $item.nextAll('[id^=\"update-\"]').first(); // We want to skip over Start G+'s items\n}", "function getIdsString(elements, needType){\n\tif(!elements){\n\t\treturn \"\";\n\t}\n\t\n\tif(needType == null){\n\t\tneedType = true;\n\t}\n\t\n\tvar names = [];\n\tfor(var i = 0; i < elements.length; i++) {\n\t\tvar a = null\n\t\tif(needType){\n\t\t\ta = elements[i].type + \"|\" + elements[i].id;\n\t\t}\n\t\telse{\n\t\t\ta = elements[i].id;\n\t\t}\n\t\t\n\t\tnames[names.length] = a + (elements[i].excludeChildDepartment ? \"|1\" : \"\");\n\t}\n\t\n\treturn names.join(\",\");\n}", "indexOfId(id) {\n for (let index = 0; index < this.items.length; index++) {\n if (this.items[index].id === id) return index;\n }\n }", "function createElIds() {\n // squares on the board\n for (var i = 0; i < COLUMNS.length; i++) {\n for (var j = 1; j <= 8; j++) {\n var square = COLUMNS[i] + j;\n SQUARE_ELS_IDS[square] = square + '-' + createId();\n }\n }\n\n // spare pieces\n var pieces = 'KQRBNP'.split('');\n for (var i = 0; i < pieces.length; i++) {\n var whitePiece = 'w' + pieces[i];\n var blackPiece = 'b' + pieces[i];\n SPARE_PIECE_ELS_IDS[whitePiece] = whitePiece + '-' + createId();\n SPARE_PIECE_ELS_IDS[blackPiece] = blackPiece + '-' + createId();\n }\n}", "function getIdFromSplit(element) {\r\n var idArray = element.split(\"_\");\r\n var first = idArray[0];\r\n var id = parseInt(idArray[1]);\r\n return id;\r\n}", "getOldIds() {\n return [...this._existing.keys()];\n }", "getOldIds() {\n return [...this._existing.keys()];\n }", "function locateAll(element, arr) {\n var results = [];\n var idx = arr.indexOf(element);\n \n while (idx != -1) {\n results.push(idx);\n idx = arr.indexOf(element, idx + 1);\n }\n \n return results;\n}", "getItemCleanStart (id) {\n var ins = this.getItem(id);\n if (ins === null || ins._length === 1) {\n return ins\n }\n const insID = ins._id;\n if (insID.clock === id.clock) {\n return ins\n } else {\n return ins._splitAt(this.y, id.clock - insID.clock)\n }\n }", "function getID(date, realDate) {\n if (tileArr.includes(date)) return;\n setTileArr([date, ...tileArr]);\n }", "function indexOfEl(listPast, el) {\n let current = listPast\n let index = 0\n const idxArr = []\n while (current) {\n if (current.value === el) idxArr.push(index)\n current = current.next\n index++\n }\n console.log(`idxArr ${idxArr}`)\n return idxArr\n }", "function intersectionOfIds(parent_array, secondary_array){\n\n\tvar resultArray = [];\n\n\tparent_array.forEach(function(str){\n\n\t\tif(secondary_array.indexOf(str) >= 0)\n\t\t\tresultArray.push(str);\n\n\t});\n\n\treturn resultArray;\n}", "function ArrayIndex(){\n var indices = [];\n var array = ['a', 'b', 'a', 'c', 'a', 'd'];\n var element = 'a';\n var idx = array.lastIndexOf(element);\n \n console.log('Index of Element', idx)\n \n while (idx != -1) {\n\n indices.push(idx);\n\n idx = (idx > 0 ? array.lastIndexOf(element, idx - 1) : -1);\n //Output\n // [ 4, 2, 0 ]\n }\n\n console.log('Postions of \"a\" element in Array',indices);\n\n}", "function get_ruby_id(new_values)\n{\n\n try\n {\n var array_update = new_values.split(\",\");\n\n for(updated_item = 0 ; updated_item < array_update.length ;updated_item++ )\n {\n var update_array_detail = array_update[updated_item].split(\"#\");\n var update_key = update_array_detail[0];\n var update_value = update_array_detail[1];\n if (update_key == \"id\")\n {\n return update_value;\n }\n }\n }\n catch(x)\n {\n alert(x);\n }\n}", "concatArray(arr1, arr2, itemid) {\n if (arr1.length == 0) {\n return arr2;\n }\n\n if (arr2.length == 0)\n return arr1;\n\n if (!itemid)\n itemid = \"id\";\n let newArray = arr1;\n for (let i = 0; i < arr2.length; i++) {\n let arr2T = arr2[i], bFound = false;\n for (let n = 0; n < arr1.length; n++) {\n if (arr1[n][itemid] == arr2T[itemid]) {\n bFound = true;\n break;\n }\n }\n if (!bFound)\n newArray.push(arr2T);\n }\n\n return newArray;\n }", "function getIndexElemFrom(id, list) {\n for (var index = 0; index < list.length; index++) {\n var element = list[index];\n if (element.id === id) {\n return index;\n }\n }\n }", "getArray (obj) {\r\n return !obj['@id'] ? obj.map(e => e['@id']) : [obj['@id']]\r\n }", "getEntityIdsAsString() {\n const d = Object.keys(this.items)\n .filter((item) => this.items[item].datasource == undefined && this.items[item].stateOnly == false)\n .map((item) => this.items[item].id)\n return [...new Set(d)].join(\",\")\n }", "function elementComponentIdsFromAttrs (element) {\n return [].map.call(element.attributes || [], function (attr) {\n return attr.nodeName;\n });\n }", "function getElementId(){\n\tslides.forEach(slide => {\n\t\tconst elements = slide.getPageElements();\n\t\telements.forEach(element => {\n\t\t\t\tconst type =\n\t\t\t\telement.getPageElementType().toJSON().toLowerCase();\n\t\t\t\tif (type === 'shape') {\n\t\t\t\t\tconsole.log(element.getObjectId(),\n\t\t\t\t\telement.asShape().getText().asString());\n\t\t\t\t}\n\t\t});\n\t});\n }", "function UltraGrid_GetCellsFromSetIds(theObject, ids)\n{\n\t//create a return array\n\tvar result = [];\n\t//valid id?\n\tif (ids)\n\t{\n\t\t//ids are a string?\n\t\tif (typeof (ids) == \"string\")\n\t\t{\n\t\t\t//convert it into an object\n\t\t\ttry { ids = JSON.parse(ids); } catch (error) { Common_Error(error); }\n\t\t}\n\t\t//is it an array\n\t\tif (ids instanceof Array)\n\t\t{\n\t\t\t//loop through it\n\t\t\tfor (var i = 0, c = ids.length; i < c; i++)\n\t\t\t{\n\t\t\t\t//concat these\n\t\t\t\tresult = result.concat(UltraGrid_GetCellsFromSetIds(theObject, ids[i]));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//has it got a cell id\n\t\t\tif (ids.CellId)\n\t\t\t{\n\t\t\t\t//try to get it\n\t\t\t\tvar cell = theObject.Data.Cells.Ids[ids.CellId];\n\t\t\t\t//valid?\n\t\t\t\tif (cell)\n\t\t\t\t{\n\t\t\t\t\t//add it\n\t\t\t\t\tresult.push(cell);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//has cell for selection?\n\t\t\telse if (ids.Cell)\n\t\t\t{\n\t\t\t\t//try to get it\n\t\t\t\tvar cell = theObject.Data.Cells.Ids[ids.Cell];\n\t\t\t\t//valid?\n\t\t\t\tif (cell)\n\t\t\t\t{\n\t\t\t\t\t//add it\n\t\t\t\t\tresult.push(cell);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//has it got a header id?\n\t\t\telse if (ids.HeaderId)\n\t\t\t{\n\t\t\t\t//try to get it\n\t\t\t\tvar cell = theObject.Data.Headers.Ids[ids.HeaderId];\n\t\t\t\t//valid?\n\t\t\t\tif (cell)\n\t\t\t\t{\n\t\t\t\t\t//add it\n\t\t\t\t\tresult.push(cell);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//header range?\n\t\t\telse if (ids.HeadersRange)\n\t\t\t{\n\t\t\t\t//get the start\n\t\t\t\tvar start = Get_Number(ids.HeadersRange.Start, 0);\n\t\t\t\t//get the end\n\t\t\t\tvar end = Get_Number(ids.HeadersRange.End, -1);\n\t\t\t\t//loop through the headers\n\t\t\t\tfor (var cells = theObject.Data.Headers.Cells, iCell = start, cCell = (end == -1 ? (cells.length - 1) : end); iCell <= cCell; iCell++)\n\t\t\t\t{\n\t\t\t\t\t//add this one\n\t\t\t\t\tresult.push(cells[iCell]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//has row range? or Row\n\t\t\telse if (ids.RowRange || ids.Row)\n\t\t\t{\n\t\t\t\t//get the start\n\t\t\t\tvar startRow = ids.Row ? (ids.Row == \"-1\" ? 0 : Get_Number(ids.Row, 0)) : Get_Number(ids.RowRange.Start, 0);\n\t\t\t\t//get the end\n\t\t\t\tvar endRow = ids.Row ? (ids.Row == \"-1\" ? theObject.Data.Cells.Rows.length - 1 : (startRow)) : Get_Number(ids.RowRange.End, -1);\n\t\t\t\t//loop through all the rows\n\t\t\t\tfor (var rows = theObject.Data.Cells.Rows, iRow = startRow, cRow = endRow; iRow <= cRow; iRow++)\n\t\t\t\t{\n\t\t\t\t\t//get this row\n\t\t\t\t\tvar row = rows[iRow];\n\t\t\t\t\t//all columns?\n\t\t\t\t\tif (ids.CellIndex == \"-1\")\n\t\t\t\t\t{\n\t\t\t\t\t\t//loop through the headers\n\t\t\t\t\t\tfor (var cells = row.Columns, iCell = 0, cCell = row.Columns.length; iCell < cCell; iCell++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//add this one\n\t\t\t\t\t\t\tresult.push(cells[iCell]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//has specific index? (careful! 0 will evaluate to false!)\n\t\t\t\t\telse if (Get_Number(ids.CellIndex, null) != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//add just this one\n\t\t\t\t\t\tresult.push(row.Columns[Get_Number(ids.CellIndex, 0)]);\n\t\t\t\t\t}\n\t\t\t\t\t//has range?\n\t\t\t\t\telse if (ids.CellRange)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get the start\n\t\t\t\t\t\tvar start = Get_Number(ids.CellRange.Start, 0);\n\t\t\t\t\t\t//get the end\n\t\t\t\t\t\tvar end = Get_Number(ids.CellRange.End, -1);\n\t\t\t\t\t\t//loop through the headers\n\t\t\t\t\t\tfor (var cells = row.Columns, iCell = start, cCell = end; iCell <= cCell; iCell++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//add this one\n\t\t\t\t\t\t\tresult.push(cells[iCell]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//return them\n\treturn result;\n}", "doneIf(start, end, ids) {\n return ids.length === 1;\n }", "function getArtifacts() {\r var value = retrieve(\"artifacts\");\r if (value != null) {\r var rawValues = value.split(\",\");\r var ids = Array(rawValues.length)\r for (index = 0; index < rawValues.length; index++) { \r try {\r ids[index] = parseInt(rawValues[index], 10); \r }\r catch (e) {\r ids[index] = -1;\r }\r }\r return ids;\r }\r else {\r return []; \r }\r}", "function _id(items, name) {\n for (var i = 0; i < items.length; i++) items[i].id = name + i; // TODO change to zid\n return items;\n }", "function sameItemId()\n {\n items.each(function() {\n var id = $(this).data(\"id\").toString();\n var name = $(this).data(\"name\").toString();\n\n var sameItemId = container.find(\"[data-id='\" + id + \"']\");\n\n if(sameItemId.length > 1) {\n console.error(\"There are items with the same id: \" + name + \" (\" + id + \")\");\n console.log(sameItemId);\n }\n });\n }", "function nextId(idArray = []) {\n for (let i = 0; i < 1000; i++) {\n if (!idArray.includes(i)) {\n return i;\n }\n }\n Logger.warn(`Can't find a new ID.`);\n return false;\n}", "function getIdOfItem(item){\n return item.id;\n}" ]
[ "0.66241837", "0.63447386", "0.60591054", "0.6016531", "0.57674015", "0.5758919", "0.5662905", "0.5604465", "0.5570588", "0.5519695", "0.5519374", "0.5504044", "0.5468202", "0.5363117", "0.53249633", "0.5312236", "0.53068423", "0.53050715", "0.528641", "0.52692664", "0.525966", "0.5252797", "0.5245064", "0.5231739", "0.5216173", "0.51726544", "0.5165139", "0.51636076", "0.5151609", "0.5126941", "0.512121", "0.5120767", "0.51196265", "0.5115697", "0.5107337", "0.5099943", "0.50872844", "0.5077679", "0.5049141", "0.50449514", "0.50442845", "0.50425565", "0.50374115", "0.50205815", "0.50110537", "0.4954387", "0.49524653", "0.4930355", "0.4920432", "0.49153665", "0.49031508", "0.4896897", "0.48823184", "0.4866665", "0.48663697", "0.48648974", "0.4858689", "0.48509753", "0.48497638", "0.48489025", "0.48433536", "0.48413733", "0.48361164", "0.48333925", "0.4832279", "0.48134366", "0.4811326", "0.47996703", "0.47996703", "0.4791956", "0.47837174", "0.47766688", "0.47700584", "0.47697866", "0.47644496", "0.47642535", "0.47607353", "0.47583392", "0.4749732", "0.4749732", "0.474878", "0.47481412", "0.47479156", "0.4747723", "0.473544", "0.47347564", "0.47339293", "0.47288075", "0.47252318", "0.47237745", "0.4721422", "0.47147632", "0.47118574", "0.47112742", "0.4709514", "0.46962452", "0.46918654", "0.4690389", "0.46887594", "0.46884042" ]
0.5562735
9
Check item type == 'START' is a source in only one connection all items where type != 'END' || 'START' are a source in at least one connection and item type == 'END' is a target in at least one connection not used when user just saves a flowchart under construction
function check_item_connections(){ var start_count = 0; var end_count = 0; var valid_item_count = 0; var multi_count = 0; var this_element; var element_num; //substring(5) for(var i = 0; i < elements_array.length; i++){ this_element = elements_array[i]; multi_count = 0; for(var j = 0; j < connections_array.length; j++){ if(this_element.type == 'START'){ if(this_element.connect_id == connections_array[j].source){ start_count++; } } else if(this_element.type == 'END'){ if(this_element.id == connections_array[j].target){ end_count++; } } else { if(this_element.connect_id == connections_array[j].source){ if(this_element.type == 'MULTI' || this_element.type == 'CONDITIONAL'){ if(multi_count < 2){ if(multi_count < 1){ valid_item_count++; } multi_count++; } } else { valid_item_count++; } } } } console.log('Item type and multi count'); console.log(this_element.type); console.log(multi_count); if((this_element.type == 'CONDITIONAL' && multi_count !=2) || (this_element.type == 'MULTI' && multi_count <2) ){ return false; } } console.log(valid_item_count + ' - '+elements_array.length); if(start_count == 1 && end_count > 0 && (valid_item_count==elements_array.length-2)){ return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_for_endpoints(){\n \t\tvar first_item = -1\n \t\t\t, end_item = -1;\n \t\tfor(var i=0; i<elements_array.length; i++){\n \t\t\tif(elements_array[i].type == 'START'){\n \t\t\t\tfor(var x=0; x<connections_array.length; x++){\n \t\t\t\t\tif(elements_array[i].connect_id == connections_array[x].source){\n \t\t\t\t\t\tfirst_item = connections_array[x].target; // 'START' item's target\n \t\t\t\t\t}\t\n \t\t\t\t}\n \t\t\t} else if(elements_array[i].type == 'END'){\n/* \t\t\t\tfor(var x=0; x<connections_array.length; x++){\n \t\t\t\t\tif(elements_array[i].id == connections_array[x].target){\n \t\t\t\t\t\tend_item = connections_array[x].source;\n \t\t\t\t\t}\t\n \t\t\t\t}*/\n \t\t\t\tend_item = elements_array[i].id; // 'END' item\n \t\t\t}\n \t\t}\n \t\treturn {first_id: first_item, end_id: end_item};\n \t}", "function checksCreatedSourceOrSink(graph, to, from, currentEdge) {\n if (graph.adjacencyList[from.number].neighborsOut.length < 2 || graph.adjacencyList[to.number].neighborsIn.length < 2)\n return true;\n return false;\n}", "function validateFlow(){\n if((jsPlumb.getAllConnections().length == 0) || (jsPlumb.getAllConnections().length <= eleList.length-2)){\n return false;\n }\n return true;\n}", "function canTargetContainSource(targetItem, sourceItem) {\n if (isContainer(targetItem)) {\n if (isTab(targetItem)) {\n // Target is a tab item\n // Target can only contain\n // non app tab nav sections\n return isNavSection(sourceItem);\n } else if (isNavSection(targetItem)) {\n // Target is a nav section. It can only contain non-nav sections\n return !isNavSection(sourceItem) && !isTab(sourceItem);\n } else {\n return !isNavSection(sourceItem) && !isTab(sourceItem);\n }\n } else {\n // Target is not a container\n return false;\n }\n }", "valid_connection(target) {\n return this.source.level < CONSTANTS.MAXIMUM_CELL_LEVEL &&\n // To allow `valid_connection` to be used to simply check whether the source is valid,\n // we ignore source–target compatibility if `target` is null.\n // We allow cells to be connected even if they do not have the same level. This is\n // because it's often useful when drawing diagrams, even if it may not always be\n // semantically valid.\n (target === null || target.level < CONSTANTS.MAXIMUM_CELL_LEVEL);\n }", "function testType(d, type) {\n return node_by_id[d.source].type === type || node_by_id[d.target].type === type;\n } //A version that has to be used after the simulations have run", "function connectNodes() {\n\n for (var key in workflowNodes) {\n $('#' + workflowNodes[key].id).append('<div class=\"deleteNode\" data-placement=\"bottom\" data-container=\"body\"></div>');\n $('#' + workflowNodes[key].id + ' .deleteNode').append('<span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span>');\n }\n\n $('body').on('click', '.item', function (e) {\n if (e.target !== this)\n return;\n\n if (srcClick == \"\") {\n srcClick = $(this).attr(\"id\");\n firstNode = $(this);\n firstNode.addClass('borderHighlight');\n console.log(\"set src: \" + $(this).attr(\"id\"));\n } else if (srcClick == $(this).attr(\"id\")) {\n srcClick = \"\";\n firstNode.removeClass('borderHighlight');\n console.log(\"make src empty: \" + $(this).attr(\"id\"));\n } else if (trgClick == \"\") {\n trgClick = $(this).attr(\"id\");\n for (var key in arrConnect) {\n if (srcClick == arrConnect[key].sourceId && trgClick == arrConnect[key].targetId) {\n console.log(\"FOUND\");\n found = true;\n }\n }\n if (found == true) {\n console.log(\"already set!\");\n // $(\"#connectionExistsAlert\").alert('open');\n $(\"#connectionExistsAlert\").show();\n $(\"#connectionExistsAlert\").fadeTo(2000, 500).slideUp(500, function () {\n $(\"#connectionExistsAlert\").hide();\n });\n srcClick = \"\";\n trgClick = \"\";\n console.log(\"make both empty\");\n found = false;\n firstNode.removeClass('borderHighlight');\n\n } else { // create the arrow\n var label = \"\";\n\n createArrow(srcClick, trgClick);\n\n // create an arrow between 2 nodes\n arrConnect.push(jsPlumb.connect({\n type: \"edit\",\n source: srcClick,\n target: trgClick,\n detachable: false\n }, common));\n\n srcClick = \"\";\n trgClick = \"\";\n console.log(\"make both empty\");\n firstNode.removeClass('borderHighlight');\n }\n }\n });\n\n var arrowIdTemp;\n var cSourceId;\n var cTargetId;\n var cObject;\n // click on arrow to get the arrowId\n jsPlumb.bind(\"click\", function (c) {\n console.log(c.sourceId + \" \" + c.targetId);\n cObject = c;\n cSourceId = c.sourceId;\n cTargetId = c.targetId;\n // look for the right node in local array\n var found;\n for (var key in workflowNodes) {\n // console.log(\"iterate workflow: \" + workflowNodes[key].id + workflowNodes[key].arrows);\n if (workflowNodes[key].id == c.sourceId) {\n // console.log(\"found: \" + workflowNodes[key].id);\n found = key;\n }\n }\n // look for the arrow that has been clicked\n for (var key in workflowNodes[found].arrows) {\n //console.log(\"iterate arrow: \" + workflowNodes[found].arrows[key].id);\n if (c.sourceId == workflowNodes[found].arrows[key].sourceNode && c.targetId == workflowNodes[found].arrows[key].targetNode) {\n // console.log(\"THIS ARROW ID: \" + workflowNodes[found].arrows[key].id);\n arrowIdTemp = workflowNodes[found].arrows[key].id;\n }\n }\n // TODO Maybe if no arrow is set -> warning\n });\n //////////////////////////////////////////////////Update Arrow//////////////////////////////////////////////////////\n // clicklistener on arrow to show option to add a label or delete the arrow\n $('path').off().on('click', function (e) {\n var offset = $(this).offset();\n var left = e.pageX;\n var top = e.pageY;\n var theHeight = $('.popoverArrow').height();\n $('.popoverArrow').show();\n $('.popoverArrow').css('left', (left + 10) + 'px');\n $('.popoverArrow').css('top', (top - (theHeight / 2) - 10) + 'px');\n });\n\n\n $('.btnSaveLabel').off().on('click', function () {\n var inputLabelVal = $(\".inputLabel\").val();\n var arrconnLabel;\n updateArrow(arrowIdTemp, cSourceId, cTargetId, inputLabelVal);\n\n for (var key in arrConnect) {\n if (cSourceId == arrConnect[key].sourceId && cTargetId == arrConnect[key].targetId) {\n arrconnLabel = arrConnect[key].getOverlay(\"label\");\n }\n }\n arrconnLabel.setLabel(inputLabelVal);\n\n $('.popoverArrow').hide();\n });\n // delete arrow\n $('.btnDeleteArrow').off().on('click', function (c) {\n console.log(arrowIdTemp + \" | \" + cSourceId + \" | \" + cTargetId);\n deleteArrow(arrowIdTemp);\n for (var key in arrConnect) {\n if (cSourceId == arrConnect[key].sourceId && cTargetId == arrConnect[key].targetId) {\n delete arrConnect[key];\n }\n }\n // delete arrow in UI\n jsPlumb.detach(cObject);\n $('.popoverArrow').hide();\n });\n\n $('.btnCloseLabel').off().on('click', function () {\n $('.popoverArrow').hide();\n });\n } // content()", "function isValidTarget(item){\n return item.team != this.team && (this.canAttackLand && (item.type == \"buildings\" || item.type == \"vehicles\")|| (this.canAttackAir && (item.type == \"aircraft\")));\n}", "function detectOverlap() {\n // Reload timeblocks for overlap check\n var timeBlocks = [];\n totalDuration = 0;\n for (var i = 0; i < eventSource.length; i++) {\n var event = eventSource[i]\n var block = {};\n block.start = event.start.getHours() + event.start.getMinutes()/60;\n block.end = event.end.getHours() + event.end.getMinutes()/60;\n totalDuration += block.end - block.start;\n timeBlocks.push(block);\n }\n\n for (var i = 0; i < travelTimeEventSource.length; i++) {\t\n var event = travelTimeEventSource[i]\n var block = {};\n block.start = event.start.getHours() + event.start.getMinutes()/60;\n block.end = event.end.getHours() + event.end.getMinutes()/60;\n totalDuration += block.end - block.start;\n timeBlocks.push(block);\n }\n\n var problem = \"Two of the items in the itinerary are overlapping. Move them around so that no activities cover each other, or remove activities to free up time.\";\n var n = new note(\"Itinerary items are overlapping\",\n problem, ['todo', 'time']);\n var si = new streamitem('todo', n, null);\n si.id = 'sys_overlap_items';\n\n var add = false;\n for (var j in timeBlocks) {\n var check = timeBlocks[j];\n for (var k in timeBlocks) {\n var other = timeBlocks[k];\n \t\tif (check.end*60 < calBegin || other.end*60 < calBegin) {\n \t\t\tcontinue;\n \t\t}\n if ((check.start < other.end && check.start > other.start) || (check.end > other.start && check.end < other.end)) {\n add = true;\n }\n }\n }\n\n if (add && $(\"#stream_sys_overlap_items\").length == 0) {\n sysStream.push(si);\n \n if (inProgress) {\n displayStreamItem(\"#replanStreamBody\", si);\n } else {\n displayStreamItem(\"#sysStreamBody\", si);\n }\n }\n}", "isCycleable() {\n return this.messageType.workflow.states.length > 1;\n }", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _Object = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _Object.subNodes,\n prevNodeMap1 = _Object.prevNodeMap;\n\n var _Object2 = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _Object2.subNodes,\n prevNodeMap2 = _Object2.prevNodeMap;\n\n var _iterator504 = _createForOfIteratorHelper(subNodes1),\n _step504;\n\n try {\n for (_iterator504.s(); !(_step504 = _iterator504.n()).done;) {\n var sharedNode = _step504.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator504.e(err);\n } finally {\n _iterator504.f();\n }\n\n return false;\n }", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _Object = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _Object.subNodes,\n prevNodeMap1 = _Object.prevNodeMap;\n\n var _Object2 = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _Object2.subNodes,\n prevNodeMap2 = _Object2.prevNodeMap;\n\n var _iterator471 = _createForOfIteratorHelper(subNodes1),\n _step471;\n\n try {\n for (_iterator471.s(); !(_step471 = _iterator471.n()).done;) {\n var sharedNode = _step471.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator471.e(err);\n } finally {\n _iterator471.f();\n }\n\n return false;\n }", "function _checkIds(flow, nodeDefinitions) {\n\n var i;\n var knownIds = [];\n var nodes = {};\n var node;\n var link;\n var source;\n var target;\n\n if (flow.nodes.length > 0 && !nodeDefinitions) {\n throw new Error('Cannot validate without nodeDefinitions');\n }\n\n // we will not add the flow, we will show a warning and stop adding the\n // flow.\n for (i = 0; i < flow.nodes.length; i++) {\n\n node = flow.nodes[i];\n\n // nodeDefinition should be loaded\n if (!node.ns) {\n throw new ValidationError(\n 'NodeDefinition without namespace: ' + node.name\n );\n }\n if (!nodeDefinitions[node.ns]) {\n throw new ValidationError(\n 'Cannot find nodeDefinition namespace: ' + node.ns\n );\n }\n if (!nodeDefinitions[node.ns][node.name]) {\n throw new ValidationError(\n 'Cannot find nodeDefinition name ' + node.ns + ' ' + node.name\n );\n }\n\n knownIds.push(node.id);\n nodes[node.id] = node;\n\n //_checkPortDefinitions(nodeDefinitions[node.ns][node.name]);\n }\n\n for (i = 0; i < flow.links.length; i++) {\n\n link = flow.links[i];\n\n // links should not point to non-existing nodes.\n if (knownIds.indexOf(link.source.id) === -1) {\n throw new ValidationError(\n 'Source node does not exist ' + link.source.id\n );\n }\n if (knownIds.indexOf(link.target.id) === -1) {\n throw new ValidationError(\n 'Target node does not exist ' + link.target.id\n );\n }\n\n // check if what is specified as port.out is an input port on the target\n source = nodes[link.source.id];\n target = nodes[link.target.id];\n\n // allow :start\n if (link.source.port[0] !== ':' &&\n !nodeDefinitions[source.ns][source.name]\n .ports.output[link.source.port]) {\n throw new ValidationError([\n 'Process',\n link.source.id,\n 'has no output port named',\n link.source.port,\n '\\n\\n\\tOutput ports available:',\n '\\n\\n\\t',\n Object.keys(\n nodeDefinitions[source.ns][source.name].ports.output\n ).join(', ')\n ].join(' '));\n }\n\n if (link.target.port[0] !== ':' &&\n !nodeDefinitions[target.ns][target.name]\n .ports.input[link.target.port]) {\n throw new ValidationError([\n 'Process',\n link.target.id,\n 'has no input port named',\n link.target.port,\n '\\n\\n\\tInput ports available:',\n '\\n\\n\\t',\n Object.keys(\n nodeDefinitions[target.ns][target.name].ports.input\n ).join(', ')\n ].join(' '));\n }\n\n }\n\n return true;\n\n}", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _ref84 = (0, _getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _ref84.subNodes,\n prevNodeMap1 = _ref84.prevNodeMap;\n\n var _ref85 = (0, _getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _ref85.subNodes,\n prevNodeMap2 = _ref85.prevNodeMap;\n\n var _iterator471 = _createForOfIteratorHelper(subNodes1),\n _step471;\n\n try {\n for (_iterator471.s(); !(_step471 = _iterator471.n()).done;) {\n var sharedNode = _step471.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator471.e(err);\n } finally {\n _iterator471.f();\n }\n\n return false;\n }", "function isConnectedLink(node, link) {\n //link.source and link.target is invalid as it had been automatically replaced with real data.\n if (link.target.index == node.index || link.source.index == node.index)\n return true;\n return false;\n }", "function checkConnectionBetweenProps( target1, target2, excludedNodes ) {\n\tconst { subNodes: subNodes1, prevNodeMap: prevNodeMap1 } = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( target1, excludedNodes.subNodes );\n\tconst { subNodes: subNodes2, prevNodeMap: prevNodeMap2 } = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( target2, excludedNodes.subNodes );\n\n\tfor ( const sharedNode of subNodes1 ) {\n\t\tif ( subNodes2.has( sharedNode ) ) {\n\t\t\tconst connection = [];\n\n\t\t\tconnection.push( sharedNode );\n\n\t\t\tlet node = prevNodeMap1.get( sharedNode );\n\n\t\t\twhile ( node && node !== target1 ) {\n\t\t\t\tconnection.push( node );\n\t\t\t\tnode = prevNodeMap1.get( node );\n\t\t\t}\n\n\t\t\tnode = prevNodeMap2.get( sharedNode );\n\n\t\t\twhile ( node && node !== target2 ) {\n\t\t\t\tconnection.unshift( node );\n\t\t\t\tnode = prevNodeMap2.get( node );\n\t\t\t}\n\n\t\t\tconsole.log( '--------' );\n\t\t\tconsole.log( { target1 } );\n\t\t\tconsole.log( { sharedNode } );\n\t\t\tconsole.log( { target2 } );\n\t\t\tconsole.log( { connection } );\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "function isDataSourceNode(node) {\n return node instanceof SourceNode || node instanceof GraticuleNode || node instanceof SequenceNode;\n }", "validateProtocolSetup(type){\r\n\r\n let isValid = false;\r\n let validationArry = [];\r\n if(this.state.setupRules && this.state.setupRules.length){\r\n\r\n\r\n this.state.setupRules && this.state.setupRules.forEach( (dx,dix)=>{\r\n\r\n const hasEncounter = dx.encounters.length ? true : false;\r\n const hasEpochConnected = dx.parent.length && dx.child.length ? true : false;\r\n if( hasEncounter && hasEpochConnected){\r\n validationArry.push(true);\r\n }\r\n else{\r\n validationArry.push(false);\r\n }\r\n if(type===\"publish\" && dx.encounters.length){\r\n\r\n dx.encounters.forEach( (elx,inx)=>{\r\n elx.elements.length ? validationArry.push(true) : validationArry.push(false) ;\r\n })\r\n\r\n }\r\n })\r\n if(validationArry.indexOf(false)>-1){\r\n isValid = false\r\n }\r\n else{\r\n isValid = true\r\n }\r\n\r\n }else{\r\n isValid = false\r\n }\r\n\r\n return isValid;\r\n\r\n }", "checkDataSouresItems() {\n return Object.keys(this.items).filter((item) => this.items[item].datasource != undefined)\n }", "function setLinkType(link){\nif (!link.getTargetElement() || !link.getSourceElement()){\n\tlink.attr(\".link-type\", \"Error\");\n\treturn;\n}\nvar sourceCell = link.getSourceElement().attributes.type;\nvar targetCell = link.getTargetElement().attributes.type;\nvar sourceCellInActor = link.getSourceElement().get('parent');\nvar targetCellInActor = link.getTargetElement().get('parent');\n\nswitch(true){\n\t// Links of actors must be paired with other actors\n\tcase ((sourceCell == \"basic.Actor\" || sourceCell == \"basic.Actor2\") && (targetCell == \"basic.Actor\" || targetCell == \"basic.Actor2\")):\n\t\tlink.attr(\".link-type\", \"Actor\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Actor\") && (!targetCellInActor)):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((targetCell == \"basic.Actor\") && (!sourceCellInActor)):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Actor2\") && (!targetCellInActor)):\n\t\tlink.attr(\".link-type\", \"Dependency\");\n\t\tbreak;\n\tcase ((targetCell == \"basic.Actor2\") && (!sourceCellInActor)):\n\t\tlink.attr(\".link-type\", \"Dependency\");\n\t\tbreak;\n\tcase ((!!sourceCellInActor) && (!targetCellInActor && (targetCell == \"basic.Actor\" || targetCell == \"basic.Actor2\"))):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((!!targetCellInActor) && (!sourceCellInActor && (sourceCell == \"basic.Actor\" || sourceCell == \"basic.Actor2\"))):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((!!sourceCellInActor) && (!targetCellInActor)):\n\t\tlink.attr(\".link-type\", \"Dependency\");\n\t\tbreak;\n\tcase ((!!targetCellInActor) && (!sourceCellInActor)):\n\t\tlink.attr(\".link-type\", \"Dependency\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Goal\") && (targetCell == \"basic.Goal\")):\n\t\tlink.attr(\".link-type\", \"Refinement\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Goal\") && (targetCell == \"basic.Softgoal\")):\n\t\tlink.attr(\".link-type\", \"Contribution\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Goal\") && (targetCell == \"basic.Task\")):\n\t\tlink.attr(\".link-type\", \"Refinement\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Goal\") && (targetCell == \"basic.Resource\")):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Softgoal\") && (targetCell == \"basic.Goal\")):\n\t\tlink.attr(\".link-type\", \"Qualification\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Softgoal\") && (targetCell == \"basic.Softgoal\")):\n\t\tlink.attr(\".link-type\", \"Contribution\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Softgoal\") && (targetCell == \"basic.Task\")):\n\t\tlink.attr(\".link-type\", \"Qualification\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Softgoal\") && (targetCell == \"basic.Resource\")):\n\t\tlink.attr(\".link-type\", \"Qualification\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Task\") && (targetCell == \"basic.Goal\")):\n\t\tlink.attr(\".link-type\", \"Refinement\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Task\") && (targetCell == \"basic.Softgoal\")):\n\t\tlink.attr(\".link-type\", \"Contribution\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Task\") && (targetCell == \"basic.Task\")):\n\t\tlink.attr(\".link-type\", \"Refinement\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Task\") && (targetCell == \"basic.Resource\")):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Resource\") && (targetCell == \"basic.Goal\")):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Resource\") && (targetCell == \"basic.Softgoal\")):\n\t\tlink.attr(\".link-type\", \"Contribution\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Resource\") && (targetCell == \"basic.Task\")):\n\t\tlink.attr(\".link-type\", \"NeededBy\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Resource\") && (targetCell == \"basic.Resource\")):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\n\tdefault:\n\t\tconsole.log('Default');\n}\nreturn;\n}", "switch (action.type) {\n case 'START_DND':\n case 'UPDATE_DND':\n case 'STOP_DND':\n case 'MOUSE_MOVE':\n case 'START_TCO':\n case 'STOP_TCO':\n return 'SKIP'\n default:\n }\n\n const lastAction = lastRecord.action\n // If last action type doesn't equals to current action - always add it\n if (lastAction.type !== action.type) {\n return 'ADD'\n }\n else {\n // Depending on action type and it's attrs, add or replace record //todo: flow unable to understand, that action.type === lastAction.type\n if (action.type === 'SELECT' && lastAction.type === 'SELECT') {\n if (action.target !== lastAction.target) {\n return 'ADD'\n }\n else if (action.target === 'TABLE' && lastAction.target === 'TABLE') {\n return action.table === lastAction.table ? 'REPLACE' : 'ADD'\n }\n else if (action.target === 'ATTR' && lastAction.target === 'ATTR') {\n return action.table === lastAction.table && action.attr === lastAction.attr ? 'REPLACE' : 'ADD'\n }\n }\n if (action.type === 'MOVE_TABLE' && lastAction.type === 'MOVE_TABLE') {\n return action.table === lastAction.table ? 'REPLACE' : 'ADD'\n }\n if (action.type === 'SWITCH_ATTRS' && lastAction.type === 'SWITCH_ATTRS') {\n return (action.table === lastAction.table && action.attr1 === lastAction.attr1) ? 'REPLACE' : 'ADD'\n }\n if (action.type === 'CANCEL_SELECT' && lastAction.type === 'CANCEL_SELECT') {\n return 'REPLACE'\n }\n if (action.type === 'ADD_ATTR' && lastAction.type === 'ADD_ATTR') {\n return 'ADD'\n }\n if (action.type === 'UPDATE_ATTR' && lastAction.type === 'UPDATE_ATTR') {\n return 'ADD'\n }\n if (action.type === 'DELETE_ATTR' && lastAction.type === 'DELETE_ATTR') {\n return 'ADD'\n }\n if (action.type === 'ADD_TABLE' && lastAction.type === 'ADD_TABLE') {\n return 'ADD'\n }\n if (action.type === 'UPDATE_TABLE' && lastAction.type === 'UPDATE_TABLE') {\n return 'ADD'\n }\n if (action.type === 'DELETE_TABLE' && lastAction.type === 'DELETE_TABLE') {\n return 'ADD'\n }\n if (action.type === 'ADD_LINK' && lastAction.type === 'ADD_LINK') {\n return 'ADD'\n }\n if (action.type === 'DELETE_LINK' && lastAction.type === 'DELETE_LINK') {\n return 'ADD'\n }\n if (action.type === 'IMPORT_SCHEME_STATE' && lastAction.type === 'IMPORT_SCHEME_STATE') {\n return (JSON.stringify(action.schemeState) === JSON.stringify(lastAction.schemeState)) ? 'SKIP' : 'ADD'\n }\n if (action.type === 'CHANGE_SCHEME_SIZE' && lastAction.type === 'CHANGE_SCHEME_SIZE') {\n return 'REPLACE'\n }\n if (action.type === 'CHANGE_STYLE' && lastAction.type === 'CHANGE_STYLE') {\n return action.change.field === lastAction.change.field ? 'REPLACE' : 'ADD'\n }\n return 'SKIP'\n }\n}", "if (\n this.props.entity &&\n this.props.entity !== prevProps.entity\n ) {\n this.setState({ forceSource: false });\n this.analyzeFluentMessage();\n }", "network(classification, params, callback) {\n const { sourceType, kind, dateMin, dateMax, productClassification, product } = params;\n\n const query = new Query(),\n where = new Expression(),\n match = [];\n\n //-- Do we need to match a product?\n if (productClassification) {\n // Adding the product filter in the main query\n match.push(\"(f:Flow)-[:OF]->(product)\");\n where.and(new Expression(\"product IN products\"));\n\n query.match(\"(product:Product)<-[:AGGREGATES*1..]-(pci:ClassifiedItem)<-[:HAS]-(pc:Classification)\");\n const whereProduct = new Expression(\"pc.id = $productClassification\");\n query.params({ productClassification });\n if (product) {\n const productFilter = filterItemsByIdsRegexps(product, \"pci\");\n whereProduct.and(productFilter.expression);\n query.params(productFilter.params);\n }\n query.where(whereProduct);\n query.with(\"collect(product) AS products\");\n }\n\n // start query from partner classification\n // define import export edge type filter\n let exportImportFilter = \":FROM|:TO\";\n if (kind === \"import\") exportImportFilter = \":FROM\";\n else if (kind === \"export\") exportImportFilter = \":TO\";\n match.push(\n `(f:Flow)-[${exportImportFilter}]->(:Partner)<-[:AGGREGATES*1..]-(cci:ClassifiedItem)<-[:HAS]-(cc:Classification)`,\n );\n const wherePartner = new Expression(\"cc.id = $classification\");\n query.params({ classification });\n\n where.and(wherePartner);\n\n //-- Do we need to match a source type?\n if (sourceType) {\n if (!sourceType.toLowerCase().includes(\"best guess\")) {\n match.push(\"(f:Flow)-[:TRANSCRIBED_FROM]->(s:Source)\");\n where.and(\"s.type IN $sourceType\");\n query.params({ sourceType: [sourceType] });\n } else {\n where.and(`f.${camelCase(sourceType)} = true`);\n }\n }\n\n if (match.length > 0) query.match(match);\n //restrict flows to those which has region\n where.and(\"exists(f.region)\");\n\n if (dateMin) {\n where.and(\"f.year >= $flowYearMin\");\n query.params({ flowYearMin: database.int(dateMin) });\n }\n\n if (dateMax) {\n where.and(\"f.year <= $flowYearMax\");\n query.params({ flowYearMax: database.int(dateMax) });\n }\n // filter out absurd values\n where.and(\"(NOT EXISTS(f.absurdObservation) OR f.absurdObservation<>'absurd')\");\n \n if (!where.isEmpty()) query.where(where);\n\n query.return(\"cci.name as partner, f.region AS region, count(f) AS count, sum(f.value) AS value\");\n\n database.cypher(query.build(), function(err, data) {\n if (err) return callback(err);\n if (!data.length) return callback(null, null);\n\n return callback(null, data);\n });\n }", "function isConnection() {\n return state.core.isConnection(state.nodes[_id].node);\n }", "function canConnect(source, target) {\n return rules.allowed('connection.create', {\n source: source,\n target: target\n });\n }", "function checkATIconnections() {\n\n // reset array\n pathToCC.length = 0;\n\n // find an ATI module\n ati = firstOfType('ATI');\n\n // check if ati exists\n if (ati != -1) {\n\n // add nodes and path\n for (var i = 0, n = nodes.length; i < n; i++) {\n if (getTipoNo(nodes[i]) == 'TT') {\n pathToCC.push({\n startNode: i,\n endNode: ati,\n path: findPath(ati, i, neighbourNodes(ati, []), []).reverse()\n })\n }\n }\n }\n}", "doneIf(start, end, ids) {\n return ids.length === 1;\n }", "function isRoot(cell){\nvar outboundLinks = App.graph.getConnectedLinks(cell, {outbound: true});\nvar inboundLinks = App.graph.getConnectedLinks(cell, {inbound: true});\nvar inboundQualificationCount = 0;\nvar outboundQualificationCount = 0;\n\nfor (var i = inboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = inboundLinks[i].attr('.link-type')\n\tif (linkType == 'Error' || linkType == 'Dependency' || linkType == 'Actor' ){\n\t\treturn false;\n\t}\n\tif (linkType == 'Qualification'){\n\t\tinboundQualificationCount = inboundQualificationCount + 1;\n\t}\n}\n\nfor (var i = outboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = outboundLinks[i].attr('.link-type')\n\tif (linkType == 'Error' || (linkType != 'Dependency' && linkType != 'Actor' && linkType != 'Qualification')){\n\t\treturn false;\n\t}\n\n\tif (linkType == 'Qualification'){\n\t\toutboundQualificationCount = outboundQualificationCount + 1;\n\t}\n}\n\n// If no outbound and inbound link, do not highlight anything\n// If all outbound links are qualification, and all inbound links are qualification, do not highlight anything\nif (outboundLinks.length == outboundQualificationCount && inboundLinks.length == inboundQualificationCount){\n\treturn false;\n}\n\nreturn true;\n}", "function _reachable(records, asyncid1, asyncid2, path, visited, filterLinkType) {\n path.push(asyncid1);\n visited[asyncid1] = true;\n\n if (asyncid1 == asyncid2)\n return true;\n\n var next = [];\n if (records.hasOwnProperty(asyncid1)) {\n var rcd = records[asyncid1];\n for (var causal_type in rcd.links) {\n if(filterLinkType && typeof filterLinkType == 'function' && !filterLinkType(causal_type))\n continue;\n Array.prototype.push.apply(next, rcd.links[causal_type]);\n }\n for (var i = 0; i < next.length; i++) {\n if (!visited.hasOwnProperty(next[i])) {\n if (_reachable(records, next[i], asyncid2, path, visited))\n return true;\n }\n }\n }\n path.pop();\n return false;\n }", "function checkValidStart(point) {\n var valid = true;\n var payload = {\n msg: \"INVALID_START_NODE\",\n body: {\n newLine: null,\n heading: \"Player \"+gameState.player,\n message: \"You must start on either end of the path!\"\n }\n };\n\n // Valid if grid is empty or if clicked point is an endpoint\n if (gameState.startSegment.inner.x === -1) {\n gameState.firstPoint = point;\n }\n else if (isEqual(gameState.startSegment.outer, point)) {\n gameState.firstPoint = gameState.startSegment.outer;\n gameState.endPoint = \"start\";\n }\n else if (isEqual(gameState.endSegment.outer, point)) {\n gameState.firstPoint = gameState.endSegment.outer;\n gameState.endPoint = \"end\";\n }\n else {\n valid = false;\n }\n\n // Valid Start Node\n if (valid) {\n payload = {\n msg: \"VALID_START_NODE\",\n body: {\n newLine: null,\n heading: \"Player \"+gameState.player,\n message: \"Select a second node to complete the line\"\n }\n };\n gameState.click = 2;\n }\n\n return payload;\n}", "function canConnect(source, target) {\n return rules.allowed('connection.create', {\n source: source,\n target: target\n });\n }", "hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false\n }\n return (\n this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) {\n return sc == null\n })\n )\n }", "isCyclic() {\n return !this.isEnd && this.descendants.every(desc => desc == this);\n }", "function isConnection(element) {\n return element.waypoints;\n}", "function isConnection(element) {\n return element.waypoints;\n}", "function isConnection(element) {\n return element.waypoints;\n}", "exists() {\n const source = internal(this).source;\n const model = internal(source).model;\n return internal(model).connections.contains(this);\n }", "addEdge(e){\n\t\tif (e.getEnd() !== undefined){\n\t\t\treturn true\n\t\t}\n\t\telse return false\n }", "addEdge(e){\n\t\tif (e.getEnd() !== undefined){\n\t\t\treturn true\n\t\t}\n\t\telse return false\n }", "function network__NO__SOURCE_ques_(networkState) /* (networkState : networkState) -> bool */ {\n return (networkState === 4);\n}", "function enQueue1(cell){\nvar queue = [];\nvar outboundLinks = App.graph.getConnectedLinks(cell, {outbound: true});\nvar inboundLinks = App.graph.getConnectedLinks(cell, {inbound: true});\nfor (var i = inboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = inboundLinks[i].attr('.link-type')\n\tif (linkType == 'Dependency' || linkType == 'Actor'){\n\t\tvar sourceCell = inboundLinks[i].getSourceElement();\n\t\tqueue.push(sourceCell);\n\t}\n}\n\nfor (var i = outboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = outboundLinks[i].attr('.link-type')\n\tif (linkType != 'Error' && linkType != 'Dependency' && linkType != 'Actor' && linkType != 'Qualification'){\n\t\tvar targetCell = outboundLinks[i].getTargetElement();\n\t\tqueue.push(targetCell);\n\t}\n}\nreturn queue;\n\n}", "function checkStopRequest(client, message, convo)\n{\n\tif (convo.step > 0 && convo.step < convo.selCmdFlow.steps.length) // if within collection steps\n\t{\n\t\tif (convo.selCmdFlow.steps[convo.step].ignoreAltCmdsCheck) {return false}\n\t}\n\treturn checkIfPass(client, message, convo, flow.stopFlow.steps[0]);\n}", "function checkATEconnections() {\n\n // reset array\n pathToATE.length = 0;\n\n // find an ATI module\n ate = firstOfType('ATE');\n\n // check if ate exists\n if (ate != -1) {\n\n // add nodes and path\n for (var i = 0, n = nodes.length; i < n; i++) {\n if (getTipoNo(nodes[i]) == 'CC') {\n pathToATE.push({\n startNode: i,\n endNode: ati,\n path: findPath(ate, i, neighbourNodes(ate, []), []).reverse()\n })\n }\n }\n }\n}", "function updateLinkPorts(items, request) {\n\tfor (var i = 0; i < items.length; i++) {\n\t var shapeItem = items[i];\n\t \n\t var sourcePort = shapeItem.source[0];\n var sinkPort = shapeItem.sink[0];\n\t \n\t var sourceNode = sourcePort.parent[0];\n\t var sinkNode = sinkPort.parent[0];\n\t \n\t var sourcePoint = [topoStore.getValue(sourceNode, 'x', ''),\n\t\t\t topoStore.getValue(sourceNode, 'y', '')\n\t\t\t ];\n\t var sinkPoint = [topoStore.getValue(sinkNode, 'x', ''),\n\t\t\t topoStore.getValue(sinkNode, 'y', '')\n\t\t\t ];\n\n\t var sourceWidth = sourceNode.width[0];\n var sinkWidth = sinkNode.width[0];\n\n\t // let's get 20 points around each node...\n\t var source_points = pointsOnCircle(sourcePoint, sourceWidth, 20);\n\t var sink_points = pointsOnCircle(sinkPoint, sinkWidth, 20);\n\t \n\t // now find the closest points for the link\n\t var m_points = closestPoints(source_points, sink_points);\n\n\t topoStore.setValue(sourcePort, 'x', source_points[m_points[0]][0]);\n\t topoStore.setValue(sourcePort, 'y', source_points[m_points[0]][1]);\n\t topoStore.setValue(sinkPort, 'x', sink_points[m_points[1]][0]);\n topoStore.setValue(sinkPort, 'y', sink_points[m_points[1]][1]);\n\t \n\t node_ports[topoStore.getValue(sourceNode, 'id', '')][m_points[0]] = 1;\n\t node_ports[topoStore.getValue(sinkNode, 'id', '')][m_points[1]] = 1;\n\n\t positioned[topoStore.getValue(sourcePort, 'id', '')] = 1;\n\t positioned[topoStore.getValue(sinkPort, 'id', '')] = 1;\n\t}\n }", "filterMatchingItems(item) {\n if (this.state.shelf_life === 'All' && this.state.type === 'All') {\n return true;\n } else if (this.state.shelf_life === 'All' && this.state.type === item.type) {\n return true;\n } else if (this.state.shelf_life === item.shelf_life && this.state.type === \"All\") {\n return true;\n } else if (this.state.shelf_life === item.shelf_life && this.state.type === item.type) {\n return true;\n } else {\n return false;\n }\n\n }", "function handleConnections(connections) {\n groupConnectionsIDFroms = new Array();\n groupConnectionsIDTos = new Array();\n\n var idFroms = getIDFroms(connections);\n for (var i = 0; i < idFroms.length; i++) {\n var key = 0;\n var arr = new Array();\n while (key < connections.length) {\n var conn = connections[key];\n if (conn.from == idFroms[i]) {\n arr.push(conn);\n }\n key++;\n }\n groupConnectionsIDFroms.push({\n idfrom: idFroms[i],\n connections: arr\n });\n }\n //groupConnectionsIDTos = getIDTos(connections);\n groupConnectionsIDTos = new Array();\n var idTos = getIDTos(connections);\n for (var i = 0; i < idTos.length; i++) {\n var key = 0;\n var arr = new Array();\n while (key < connections.length) {\n var conn = connections[key];\n if (conn.to == idTos[i]) {\n arr.push(conn);\n }\n key++;\n }\n groupConnectionsIDTos.push({\n idto: idTos[i],\n connections: arr\n });\n }\n\n // get list id by connection form\n function getIDFroms(connections) {\n var arr = new Array();\n for (var i = 0; i < connections.length; i++) {\n var conn = connections[i];\n if (!checkIn(conn.from, arr)) {\n arr.push(conn.from);\n }\n }\n return arr;\n }\n\n // get list id by connection to\n function getIDTos(connections) {\n var arr = new Array();\n for (var i = 0; i < connections.length; i++) {\n var conn = connections[i];\n if (!checkIn(conn.to, arr)) {\n arr.push(conn.to);\n }\n }\n return arr;\n }\n\n // check existing of value in array\n function checkIn(value, arr) {\n for (var i = 0; i < arr.length; i++) {\n if (value == arr[i]) {\n return true;\n }\n }\n return false;\n }\n}", "addConnection(from, to){\n\n /********************************************************\n * As an improvement first search for the newly created *\n * connection in Neat.connections list and assign it a *\n * proper innovation number. Then check whether this * \n * innovation number is less than the innovation number *\n * of the last element of this.connections. If so, only *\n * then search new_connection in this.connections *\n * otherwise don't. *\n ********************************************************/\n \n if(from.x == to.x){\n // Invalid connection\n return false;\n }\n\n // swap if from's x coordinate is less than to's x coordinate\n if(from.x > to.x){\n let tmp = from;\n from = to;\n to = tmp;\n }\n\n let new_connection = new ConnectionGene(from, to, Neat.connections.length + 1, Math.random() * 2 - 1, true); //ConnectionGene(fromNode, toNode, innovationNumber, weight, isEnabled);\n\n // check whether the newly created link is already present in the genome to avoid redundant links\n for(let connection of this.connections){\n //Two connections are identical if they start and end in identical nodes\n //Two nodes are identical if they are present in the same layer and have same innovation number \n if(new_connection.from.innovation_number == connection.from.innovation_number && new_connection.from.x == connection.from.x && new_connection.to.innovation_number == connection.to.innovation_number && new_connection.to.x == connection.to.x){\n\n //connection already present\n return false;\n\n }\n }\n\n let connectionFound = false;\n\n //check whether this connection has already been made \n for(let connection of Neat.connections){\n\n //Two connections are identical if they start and end in identical nodes\n //Two nodes are identical if they are present in the same layer and have same innovation number \n if(new_connection.from.innovation_number == connection.from.innovation_number && new_connection.from.x == connection.from.x && new_connection.to.innovation_number == connection.to.innovation_number && new_connection.to.x == connection.to.x){\n\n new_connection.innovation_number = connection.innovation_number;\n\n //connection found\n connectionFound = true;\n break;\n\n }\n }\n\n //if this connection has never been made before add it to Neat.connections list\n if(!connectionFound){\n Neat.connections.push(new_connection);\n }\n\n // sort links according to innovation number and then add to connections list which is necessary for crossover\n\n if(this.connections.length == 0){\n\n this.connections.push(new_connection);\n // add the new connection to connections list of \"to\" node which will be used to calculate its data\n new_connection.to.connections.push(new_connection);\n\n } else {\n\n this.insert_link_sorted(new_connection);\n\n }\n\n return new_connection;\n }", "function isConnection$3(element) {\n return element.waypoints;\n}", "function traceSources(node, original) {\n\t\t\tvar i,\n\t\t\t\tsource,\n\t\t\t\tnodeSources;\n\n\t\t\tif (!(node instanceof EffectNode) && !(node instanceof TransformNode)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (node === original) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tnodeSources = node.sources;\n\n\t\t\tfor (i in nodeSources) {\n\t\t\t\tif (nodeSources.hasOwnProperty(i)) {\n\t\t\t\t\tsource = nodeSources[i];\n\n\t\t\t\t\tif (source === original || traceSources(source, original)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "checkNewCritterTargets (donations) { //confusing b/c critter.donations and donation message are objects with \"target\" \"amount\" \"total\"\n let targetA = donations[0].target;\n let targetB = donations[1].target;\n let newOrgA = true;\n let newOrgB = true;\n for (let org of this.donations) {\n if (org[\"target\"] == targetA) {\n newOrgA = false;\n }\n if (org[\"target\"] == targetB) {\n newOrgB = false;\n }\n }\n //new donation target\n if (newOrgA) {\n this.donations.push({\n target: targetA,\n funds: 0,\n link: null\n }) \n }\n if (newOrgB) {\n this.donations.push({\n target: targetB,\n funds: 0,\n link: null\n }) \n } \n if (newOrgA || newOrgB) {\n this.sortTargets();\n return true; //so ecosystem can emit fundsUpdate\n } else {\n return false;\n }\n }", "function process(){\n\t\tvar network_count = 0;\n\t\tgm$(\".query_network_checkbox\").each(function(){\n\t\t\tif(gm$(this).attr('organism') != organism_id){\n\t\t\t\tok(false, gm$(this).parent().children('label').text() + \" does not belong to \" + default_organisms[organism_id]);\n\t\t\t\treturn false; // break out of .each\n\t\t\t}\n\t\t\telse if (gm$(this).is(\":checked\")){\t// It is checked, so it should be a default network\n\t\t\t\tif (gm$(this).attr('default') != 'true'){\n\t\t\t\t\tok(false, gm$(this).parent().children('label').text() + \" is checked but it is not a default network\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnetwork_count++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\t// It is not checked, so it should not be a default network\n\t\t\t\tif(gm$(this).attr('default') != 'false' && gm$(this).parent().attr('id') > 0){ // TODO: Extra check is required for uploaded networks; for some reason they are not seen as checked?\n\t\t\t\t\tok(false, gm$(this).parent().children('label').text() + \" is a default network but it is not checked\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tok(network_count > 0, \"There are \" + network_count + \" networks that are checked by default for organism \" + default_organisms[organism_id]);\n\t}", "async checkSubItems() {\n if (this.processingState.canContinue && !this.processingState.isProcessedToConsensus)\n await this.checkSubItemsOf(this.item);\n }", "function selected_all_source() {\n return !window.selected_rows.some(is_not_source_sample)\n}", "function isSink (node, nodeName) {\n var result = true,\n nextNodeName = null;\n for (nextNodeName in node.edges) {\n if(nextNodeName != nodeName) {\n result = false;\n }\n }\n return result;\n }", "function enQueue2(cell){\nvar queue = [];\nvar outboundLinks = App.graph.getConnectedLinks(cell, {outbound: true});\nvar inboundLinks = App.graph.getConnectedLinks(cell, {inbound: true});\nfor (var i = outboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = outboundLinks[i].attr('.link-type')\n\tif (linkType == 'Dependency' || linkType == 'Actor'){\n\t\tvar targetCell = outboundLinks[i].getTargetElement();\n\t\tqueue.push(targetCell);\n\t}\n}\n\nfor (var i = inboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = inboundLinks[i].attr('.link-type')\n\tif (linkType != 'Error' && linkType != 'Dependency' && linkType != 'Actor' && linkType != 'Qualification'){\n\t\tvar sourceCell = inboundLinks[i].getSourceElement();\n\t\tqueue.push(sourceCell);\n\t}\n}\nreturn queue;\n\n}", "function isItem(opts, node) {\n return opts.typeItem.includes(node.type);\n}", "function processLinkedItem(item, event) {\n var $triggeredItem, thisSpecter, content;\n //if triggered item is SLICER then event.Source will be SLICER itself\n var selected = event.Selected; //if triggered item is chart event.Source will be SERIES of chart\n $triggeredItem = event.Source;\n thisSpecter = $triggeredItem.Parent;\n\n //if (event.SourceType == CHART) {\n // thisSpecter = $triggeredItem.ChartProvider.Parent;\n //}\n //else if (event.SourceType == SLICER) {\n // $triggeredItem = event.Source;\n // // source = $triggeredItem.Selected;//event.Selected; //will have array of Text and Value attribute\n //}\n\n\n //get the Specter and Chart instance\n //datapoint is valid only if the event is from chart, if action is from slicer datapoint will be undefined\n var dataPoint = event.point;\n var regx = fieldREGX;///{{\\s*[\\w\\.]+\\s*}}/g\n switch (item.Type) {\n case CHART:\n var chart = thisSpecter.getChart(item.Name);\n if (item.Action == ACTION.Slice) {\n //prepare the parameters to pass\n if (isDefined(item.Parameters)) {\n $.each(item.Parameters, function (i, parameter) {\n var targetchartprm = findAndGetObj(chart.Parameters, \"Name\", parameter.Name)\n //if target parameter is available then add the value from source node to target parametes values attribute\n if (isDefined(targetchartprm)) {\n var value = parameter.Value;\n //parse the values attribute for {{<name>}} and get the <name> from \"option\" and assign it to target charts parameter values\n var matches = value.match(regx);\n if (matches != null) {\n var refCache = matches.map(function (x) {\n return x.match(/[\\w\\.]+/)[0];\n });\n var placetosearch, attrname;\n targetchartprm.Value = [];\n\n $.each(refCache, function (i, r) {\n //example r will be series.Groupname or data.Groupname or just Groupname\n var arr = r.split('.');\n if (arr.length > 1) {\n placetosearch = \"$data\";//if u give anything before attributename like {{data.name}}.. consider it as $data by default...\n attrname = arr[1];\n }\n else {\n attrname = arr[0];\n }\n\n $.each(selected, function (index, selectedItem) {\n if (event.SourceType == CHART) {\n if (isDefined(placetosearch))\n selectedItem = selectedItem[placetosearch]; //placetosearch - either series/data\n targetchartprm.Value.push(value.replace(regx, selectedItem[attrname]));\n }\n else if (event.SourceType == SLICER || event.SourceType == RANGEPICKER) {\n targetchartprm.Value.push(value.replace(regx, selectedItem[attrname]));\n }\n });\n });\n }\n }\n });\n }\n //at any cost parameters passing should be there. So, CanRender=false should not affect parameters passing.\n //InDrillMode means currently chart has been drilledown to its DrillItem so if InDrillMode = true then dont render current chart\n if ((isUndefined(chart.CanRender) || chart.CanRender == true) && (isUndefined(chart.InDrillMode) || chart.InDrillMode == false)) {\n chart.Render();\n }\n }\n else if (item.Action == ACTION.Select) {\n }\n else if (item.Action == ACTION.Render) {\n //at any cost parameters passing should be there. So, CanRender=false should not affect parameters passing.\n //InDrillMode means currently chart has been drilledown to its DrillItem so if InDrillMode = true then dont render current chart\n if ((isUndefined(chart.CanRender) || chart.CanRender == true) && (isUndefined(chart.InDrillMode) || chart.InDrillMode == false)) {\n chart.Render();\n }\n }\n\n break;\n case SLICER:\n var slicer = thisSpecter.getSlicer(item.Name);\n if (item.Action == ACTION.Slice) {\n //prepare the parameters to pass\n if (isDefined(item.Parameters)) {\n $.each(item.Parameters, function (i, parameter) {\n var targetchartprm = findAndGetObj(slicer.Parameters, \"Name\", parameter.Name);\n //if target parameter is available then add the value from source node to target parametes values attribute\n if (isDefined(targetchartprm)) {\n var value = parameter.Value;\n //parse the values attribute for {{<name>}} and get the <name> from \"option\" and assign it to target charts parameter values\n var matches = value.match(regx);\n if (matches != null) {\n var refCache = matches.map(function (x) {\n return x.match(/[\\w\\.]+/)[0];\n });\n var placetosearch, attrname;\n targetchartprm.Value = [];\n $.each(refCache, function (i, r) {\n //example r will be series.Groupname or data.Groupname or just Groupname\n var arr = r.split('.');\n if (arr.length > 1) {\n placetosearch = \"$data\";\n attrname = arr[1];\n }\n else {\n attrname = arr[0];\n }\n //Log(event.point);\n\n // var loc = placetosearch.toLowerCase() == \"root\" ? source : dataPoint;\n $.each(selected, function (index, selectedItem) {\n\n if (event.SourceType == CHART) {\n if (isDefined(placetosearch))\n selectedItem = selectedItem[placetosearch]; //placetosearch - either series/data\n targetchartprm.Value.push(value.replace(regx, selectedItem[attrname]));\n }\n else if (event.SourceType == SLICER || event.SourceType == RANGEPICKER) {\n targetchartprm.Value.push(value.replace(regx, selectedItem[attrname]));\n }\n });\n });\n }\n }\n });\n }\n //at any cost parameters passing should be there. So, CanRender=false should not affect parameters passing.\n if (isUndefined(slicer.CanRender) || slicer.CanRender == true) {\n slicer.Render();\n }\n }\n else if (item.Action == ACTION.Select) {\n //not sure if we need to call Slicer.Select if CanRender is false on the Slicer object.\n if (isUndefined(slicer.CanRender) || slicer.CanRender == true) {\n var value;\n var matches = item.Value.match(regx);\n if (matches != null) {\n var refCache = matches.map(function (x) {\n return x.match(/[\\w\\.]+/)[0];\n });\n var placetosearch, attrname;\n $.each(refCache, function (i, r) {\n //example r will be series.Groupname or data.Groupname or just Groupname\n var arr = r.split('.');\n if (arr.length > 1) {\n placetosearch = \"$data\";\n attrname = arr[1];\n }\n else {\n attrname = arr[0];\n }\n //Log(event.point);\n\n var loc = placetosearch.toLowerCase() == \"root\" ? source : dataPoint;\n value = item.Value.replace(regx, loc[attrname]);\n });\n }\n slicer.Select(value);\n }\n }\n else if (item.Action == ACTION.Render) {\n //at any cost parameters passing should be there. So, CanRender=false should not affect parameters passing.\n if (isUndefined(slicer.CanRender) || slicer.CanRender == true) {\n slicer.Render();\n }\n }\n break;\n case RANGEPICKER:\n var rangepicker = thisSpecter.getRangePicker(item.Name);\n if (item.Action == ACTION.Slice) {\n //prepare the parameters to pass\n if (isDefined(item.Parameters)) {\n $.each(item.Parameters, function (i, parameter) {\n var targetprm = findAndGetObj(rangepicker.Parameters, \"Name\", parameter.Name);\n //if target parameter is available then add the value from source node to target parametes values attribute\n if (isDefined(targetprm)) {\n var value = parameter.Value;\n //parse the values attribute for {{<name>}} and get the <name> from \"option\" and assign it to target charts parameter values\n var matches = value.match(regx);\n if (matches != null) {\n var refCache = matches.map(function (x) {\n return x.match(/[\\w\\.]+/)[0];\n });\n var placetosearch, attrname;\n targetprm.Value = [];\n $.each(refCache, function (i, r) {\n //example r will be series.Groupname or data.Groupname or just Groupname\n var arr = r.split('.');\n if (arr.length > 1) {\n placetosearch = \"$data\";\n attrname = arr[1];\n }\n else {\n attrname = arr[0];\n }\n //Log(event.point);\n\n // var loc = placetosearch.toLowerCase() == \"root\" ? source : dataPoint;\n $.each(selected, function (index, selectedItem) {\n\n if (event.SourceType == CHART) {\n if (isDefined(placetosearch))\n selectedItem = selectedItem[placetosearch]; //placetosearch - either series/data\n targetprm.Value.push(value.replace(regx, selectedItem[attrname]));\n }\n else if (event.SourceType == SLICER || event.SourceType == RANGEPICKER) {\n targetprm.Value.push(value.replace(regx, selectedItem[attrname]));\n }\n });\n });\n }\n }\n });\n }\n //at any cost parameters passing should be there. So, CanRender=false should not affect parameters passing.\n if (isUndefined(rangepicker.CanRender) || rangepicker.CanRender == true) {\n rangepicker.Render();\n }\n }\n break;\n case DATASTUB:\n var datastub = thisSpecter.getDataStub(item.Name);\n if (item.Action == ACTION.Slice) {\n //prepare the parameters to pass\n if (isDefined(item.Parameters)) {\n $.each(item.Parameters, function (i, parameter) {\n var targetprm = findAndGetObj(datastub.Parameters, \"Name\", parameter.Name);\n //if target parameter is available then add the value from source node to target parametes values attribute\n if (isDefined(targetprm)) {\n var value = parameter.Value;\n //parse the values attribute for {{<name>}} and get the <name> from \"option\" and assign it to target charts parameter values\n var matches = value.match(regx);\n if (matches != null) {\n var refCache = matches.map(function (x) {\n return x.match(/[\\w\\.]+/)[0];\n });\n var placetosearch, attrname;\n targetprm.Value = [];\n $.each(refCache, function (i, r) {\n //example r will be series.Groupname or data.Groupname or just Groupname\n var arr = r.split('.');\n if (arr.length > 1) {\n placetosearch = \"$data\";\n attrname = arr[1];\n }\n else {\n attrname = arr[0];\n }\n //Log(event.point);\n\n // var loc = placetosearch.toLowerCase() == \"root\" ? source : dataPoint;\n $.each(selected, function (index, selectedItem) {\n\n if (event.SourceType == CHART) {\n if (isDefined(placetosearch))\n selectedItem = selectedItem[placetosearch]; //placetosearch - either series/data\n targetprm.Value.push(value.replace(regx, selectedItem[attrname]));\n }\n else if (event.SourceType == SLICER || event.SourceType == RANGEPICKER) {\n targetprm.Value.push(value.replace(regx, selectedItem[attrname]));\n }\n });\n });\n }\n }\n });\n }\n //at any cost parameters passing should be there. So, CanRender=false should not affect parameters passing.\n if (isUndefined(datastub.CanRender) || datastub.CanRender == true) {\n datastub.Render();\n }\n }\n break;\n }\n}", "function matchesSource(request) {\n console.log(\"matchesSource\")\n return (request.source === SOURCE);\n }", "function verifyTour(g,/* List<Edge> */tour, /* Vertex */start) {\n\n\tif (tour.length != g.numEdges)\n\t\treturn false;\n\tg.initialize();\n\tvar count = 0;\n\tfor (e in tour) {\n\n\t\tif ((tour[e].From.name != start.name && tour[e].To.name != start.name)\n\t\t\t\t|| tour[e].seen) {\n\t\t\tbreak;\n\t\t}\n\t\tcount++;\n\t\tstart = tour[e].otherEnd(start);\n\t\ttour[e].seen = true;\n\t}\n\treturn count == g.numEdges;\n}", "function traceSources(node, original) {\n\t\t\tvar i,\n\t\t\t\tsource,\n\t\t\t\tsources;\n\n\t\t\tif (!(node instanceof EffectNode) && !(node instanceof TransformNode)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tsources = node.sources;\n\n\t\t\tfor (i in sources) {\n\t\t\t\tif (sources.hasOwnProperty(i)) {\n\t\t\t\t\tsource = sources[i];\n\n\t\t\t\t\tif (source === original || traceSources(source, original)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "function validateTargetsForReservation(){\r\n\tvar returnFlag = true;\r\n\tif (\"Frequency Cap\" != $(\"#sosTarTypeId option:selected\").text()) {\r\n\t\t $(\"#geoTargetsummary tr\").each(function(){\r\n\t\t\tobjId = $(this).attr(\"id\");\r\n\t if (objId != \"geoTargetsummaryHeader\") {\t\t\t\r\n\t var targetType = $('#' + objId + \" td:nth-child(2)\").html();\r\n\t if ((\"Adx DMA\" == targetType || \"Countries\" == targetType || \"Target Region\" == targetType) && $('#sosTarTypeId').is(':disabled') != true) {\t\t \r\n\t\t\t\t\tif (targetType == $(\"#sosTarTypeId option:selected\").text()) {\r\n\t\t\t\t\t\tjQuery(\"#runtimeDialogDiv\").model({theme: 'Error', autofade: false, message: targetType + ' targeting cannot be added twice.'});\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tjQuery(\"#runtimeDialogDiv\").model({theme: 'Error', autofade: false, message: resourceBundle['error.adding.targeting.reservable']});\r\n\t\t\t\t\t}\r\n\t\t\t\t\tresetTargetingFields();\r\n\t\t\t\t\treturnFlag = false;\r\n\t }\r\n\t\t\t}\t \r\n\t });\r\n\t}\r\n\treturn returnFlag;\r\n}", "transfomationIsValid(trans, currentStep, r, begin) {\n if (trans.length === 0)\n return true;\n if (r.id <= 7)\n return true;\n /// LIST RESULT\n // console.log(\"\\n=====LIST RESULT:\");\n // console.log(\"CURRENT:\"+ExpressionToString(currentStep));\n if (r.id <= 6)\n return true;\n for (let i = begin; i < trans.length; i++) {\n let exp = trans[i].oldEXP;\n if (exp.id === currentStep.id || exp.id.includes(currentStep.id))\n return false;\n }\n // for (let i = 0; i < this.result.length; i++) {\n // if(this.result[i].detail[this.result[i].detail.length-1].exp.id === currentStep.id)return false;\n // }\n // console.log('====>END CHECK VALID TRANSFOMATION');\n return true;\n }", "hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources()\n })\n }", "isDependentConnection() {\n return !(this.drawToCenter === EConnectionCentered.NONE);\n }", "function isPathBetween(\n startNode, destNode,\n {nodes, models},\n {exclude, types} = {\n exclude: [],\n types: null\n }) {\n\n const visited = [],\n q = [];\n\n visited[startNode] = true;\n q.push(startNode);\n\n if (startNode === destNode) { return true; }\n\n while (q.length !== 0) {\n const n = q.shift();\n const tConnectors = nodes[n];\n\n for (let i = 0; i < tConnectors.length; i++) {\n const con = tConnectors[i];\n const id = con.viewID;\n\n if (R.contains(id, exclude)) {\n continue; // ignore paths through excluded models\n } else if (types && !R.contains(models[id].typeID, types)) {\n continue; // ignore paths that aren't through the given types\n }\n const connectedNodes = models[id].nodes;\n for (let j = 0; j < connectedNodes.length; j++) {\n const connectedNode = connectedNodes[j];\n if (connectedNode === destNode) {\n return true;\n }\n\n if (!visited[connectedNode]) {\n visited[connectedNode] = true;\n q.push(connectedNode);\n }\n }\n }\n }\n return false;\n}", "contains(item){\n if (item instanceof LinkItem){\n let contains = false;\n this.forEach((node) => {\n contains |= (node === item)\n })\n return contains\n }else if(item instanceof LinkList){\n let contains = false;\n item.forEach((node) => {\n contains |= this.contains(node)\n })\n return contains\n }else{\n throw `Error calling contains:\\nThe item given is not a LinkItem`\n return false\n }\n }", "hasCycleFrom(start) {\n const stack = [{ node: start, visited: new Set([start]), lastVisited: null }];\n while (stack.length) {\n const current = stack.pop();\n for (let node of current.node.adjacent.values()) {\n if (current.lastVisited != node) {\n if (current.visited.has(node)) return true;\n else {\n const visited = new Set([...current.visited]);\n visited.add(node);\n stack.push({ node: node, visited: visited, lastVisited: current.node });\n }\n }\n }\n }\n return false;\n }", "__addConnectionTargets(connection) {\n if (this.source !== null || this.source !== undefined) {\n connection.addConnectionTarget(this.source);\n }\n\n for (let i in this.sinks) {\n console.log(\"Sinks: \", this.sinks);\n connection.addConnectionTarget(this.sinks[i]);\n }\n }", "function isConnection$3(element) {\n return element.waypoints;\n }", "function isNetworkOperation(item) {\n return isTrapConditionMet(NETWORK_MAP, true, item);\n}", "function shouldTraverseEdge (source, href) {\n return includeExternalLinks ? source.indexOf(base) === 0 : href.indexOf(base) === 0;\n}", "_checkInputSourcesChange() {\n const added = [];\n const removed = [];\n const newInputSources = this.inputSources;\n const oldInputSources = this[PRIVATE].currentInputSources;\n\n for (const newInputSource of newInputSources) {\n if (!oldInputSources.includes(newInputSource)) {\n added.push(newInputSource);\n }\n }\n\n for (const oldInputSource of oldInputSources) {\n if (!newInputSources.includes(oldInputSource)) {\n removed.push(oldInputSource);\n }\n }\n\n if (added.length > 0 || removed.length > 0) {\n this.dispatchEvent('inputsourceschange', new XRInputSourcesChangeEvent('inputsourceschange', {\n session: this,\n added: added,\n removed: removed\n }));\n }\n\n this[PRIVATE].currentInputSources.length = 0;\n for (const newInputSource of newInputSources) {\n this[PRIVATE].currentInputSources.push(newInputSource);\n }\n }", "function setSrc(node, type) {\n if (type == 'single') {\n wss.sendEvent(srcMessage, {\n id: node.id\n });\n\n flash.flash('Source node: ' + node.id);\n\n } else {\n node.forEach( function (val, idx) {\n wss.sendEvent(srcMessage, {\n id: val\n });\n\n flash.flash('Source node: ' + val);\n } );\n }\n }", "isRule(type) { return this.rule(type)!=null }", "function findpath(u) {\n\tfor (let e = nextEdge[u]; e != 0; e = g.nextAt(u, e)) {\n\t\tsteps++;\n\t\tlet v = g.mate(u, e);\n\t\tif (g.res(e, u) == 0 || level[v] != level[u] + 1) continue;\n\t\tif (v == g.sink || findpath(v)) {\n\t\t\tlink[v] = e; nextEdge[u] = e; return true;\n\t\t}\n\t}\n\tnextEdge[u] = 0; return false;\n}", "function validateTargetsForEmailReservation(){\r\n\tvar returnFlag = true;\r\n\tif (\"Adx DMA\" == $(\"#sosTarTypeId option:selected\").text() || \"Countries\" == $(\"#sosTarTypeId option:selected\").text() || \"Target Region\" == $(\"#sosTarTypeId option:selected\").text()) {\r\n\t\t $(\"#geoTargetsummary tr\").each(function(){\r\n\t\t\tobjId = $(this).attr(\"id\");\r\n\t if (objId != \"geoTargetsummaryHeader\") {\t\t\t\r\n\t var targetType = $('#' + objId + \" td:nth-child(2)\").html();\r\n\t if ((\"Adx DMA\" == targetType || \"Countries\" == targetType || \"Target Region\" == targetType) && $('#sosTarTypeId').is(':disabled') != true) {\t\t \r\n\t\t\t\t\tif (targetType == $(\"#sosTarTypeId option:selected\").text()) {\r\n\t\t\t\t\t\tjQuery(\"#runtimeDialogDiv\").model({theme: 'Error', autofade: false, message: targetType + ' targeting cannot be added twice.'});\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tjQuery(\"#runtimeDialogDiv\").model({theme: 'Error', autofade: false, message: resourceBundle['error.adding.targeting.reservable']});\r\n\t\t\t\t\t}\r\n\t\t\t\t\tresetTargetingFields();\r\n\t\t\t\t\treturnFlag = false;\r\n\t }\r\n\t\t\t}\t \r\n\t });\r\n\t}\r\n\treturn returnFlag;\r\n}", "canPlace(cursor, items) {\n return (\n items.length === 1 &&\n [29, 30, 39, 40].includes(items[0].tile) &&\n cursor.dir === items[0].dir\n );\n }", "isValid() {\n // Valid if source and destination airports (Airport object, not code) are defined\n return this.sourceAirport != undefined && this.destinationAirport != undefined;\n }", "hasCycle() {\n const numOfNodes = this.nodes.size;\n const numOfEdges = this.getNumOfEdges();\n const numOfConnectedComponents = this.getNumOfConnectedComponents();\n return numOfEdges > numOfNodes - numOfConnectedComponents;\n }", "function finalDataFiltering() {\n //Reset the mappings\n node_by_id = {};\n edge_by_id = {};\n linked_to_id = {}; //Filter out nodes without any remaining connections\n\n nodes = nodes.filter(function (d) {\n return d.degree > 0;\n });\n nodes.forEach(function (d) {\n node_by_id[d.id] = d;\n }); // nodes.sort((a,b) => types.indexOf(b.type) - types.indexOf(a.type))\n //Only keep the edges that exist in the node list\n\n edges = edges.filter(function (d) {\n return node_by_id[d.source] && node_by_id[d.target];\n }); //Save all of the edges to a specific node\n\n edges.forEach(function (d) {\n edge_by_id[d.source + ',' + d.target] = true;\n if (!linked_to_id[d.source]) linked_to_id[d.source] = [];\n if (!linked_to_id[d.target]) linked_to_id[d.target] = [];\n linked_to_id[d.source].push(node_by_id[d.target]);\n linked_to_id[d.target].push(node_by_id[d.source]);\n }); //forEach\n } //function finalDataFiltering", "function finalDataFiltering() {\n //Reset the mappings\n node_by_id = {};\n edge_by_id = {};\n linked_to_id = {}; //Filter out nodes without any remaining connections\n\n nodes = nodes.filter(function (d) {\n return d.degree > 0;\n });\n nodes.forEach(function (d) {\n node_by_id[d.id] = d;\n }); // nodes.sort((a,b) => types.indexOf(b.type) - types.indexOf(a.type))\n //Only keep the edges that exist in the node list\n\n edges = edges.filter(function (d) {\n return node_by_id[d.source] && node_by_id[d.target];\n }); //Save all of the edges to a specific node\n\n edges.forEach(function (d) {\n edge_by_id[d.source + ',' + d.target] = true;\n if (!linked_to_id[d.source]) linked_to_id[d.source] = [];\n if (!linked_to_id[d.target]) linked_to_id[d.target] = [];\n linked_to_id[d.source].push(node_by_id[d.target]);\n linked_to_id[d.target].push(node_by_id[d.source]);\n }); //forEach\n } //function finalDataFiltering", "function checkValidEnd(point) {\n var valid = true;\n var payload = {\n msg: \"INVALID_END_NODE\",\n body: {\n newLine: null,\n heading: \"Player \"+gameState.player,\n message: \"Invalid Move!\"\n }\n };\n\n if (isEqual(point, gameState.firstPoint)) {\n gameState.click = 1;\n return payload;\n }\n\n if (gameState.startSegment.inner.x === -1) {\n var slope = Math.abs(getSlope(point, gameState.firstPoint));\n if (slope !== 0 && slope !== 1 && Number.isFinite(slope)) {\n gameState.click = 1;\n return payload;\n }\n }\n else if (gameState.endPoint === \"start\") {\n var slope = Math.abs(getSlope(point, gameState.startSegment.outer));\n if (slope !== 0 && slope !== 1 && Number.isFinite(slope)) {\n gameState.click = 1;\n return payload;\n }\n }\n else if (gameState.endPoint === \"end\") {\n var slope = Math.abs(getSlope(point, gameState.endSegment.outer));\n if (slope !== 0 && slope !== 1 && Number.isFinite(slope)) {\n gameState.click = 1;\n return payload;\n }\n }\n\n // Check for intersections with existing segments\n if (checkIntersection(point, gameState.endPoint, gameState)){\n gameState.click = 1;\n return payload;\n }\n\n // If new line is an extension of an existing line, update startSegment and endSegment\n // If new line is not an extension, push the old startSegment and endSegment to the segments array and replace startSegment and endSegment\n if (gameState.startSegment.inner.x !== -1 && gameState.endPoint === \"start\" && extension(point, gameState.startSegment)) {\n gameState.startSegment.outer = point;\n }\n else if (gameState.startSegment.inner.x !== -1 && gameState.endPoint === \"end\" && extension(point, gameState.endSegment)) {\n gameState.endSegment.outer = point;\n }\n else {\n // Checks if 1st line segment in game\n if (gameState.startSegment.inner.x === -1) {\n gameState.startSegment = {inner: gameState.firstPoint, outer: point};\n gameState.endSegment = {inner: gameState.firstPoint, outer: gameState.firstPoint};\n }\n else if (gameState.endPoint === \"start\") {\n gameState.segments.push(gameState.startSegment);\n gameState.startSegment = {inner: gameState.firstPoint, outer: point};\n }\n else if (gameState.endPoint === \"end\") {\n gameState.segments.push(gameState.endSegment);\n gameState.endSegment = {inner: gameState.firstPoint, outer: point};\n }\n }\n gameState.player = -1*gameState.player+3;\n\n payload = {\n msg: \"VALID_END_NODE\",\n body: {\n newLine: {\n start: gameState.firstPoint,\n end: point\n },\n heading: \"Player \"+gameState.player,\n message: \"Awaiting Player \"+gameState.player+\"'s Move\"\n }\n }\n gameState.click = 1;\n\n if (checkGameOver(gameState)) {\n payload.msg = \"GAME OVER\";\n payload.body.heading = \"Game Over\";\n payload.body.message = \"Player \"+(-1*gameState.player+3)+\" Wins\"\n }\n\n return payload;\n}", "checkSharing() {\n if(this.state.incomingPods.length !== 0 || this.state.outgoingPods.length !== 0 )\n return true;\n }", "isLayerEdge(layerId) {\n\n let domainNetworks = this.dataElement.domainNetworks;\n\n for (let i = 0; i < domainNetworks.length; i ++)\n {\n let domainNetwork = domainNetworks[i];\n \n for (let j = 0; j < domainNetwork.edgeSources.length; j ++)\n if (domainNetwork.edgeSources[j].layerId === layerId)\n return true;\n }\n\n return false;\n }", "isChainValid(){\n\n //not putting index in 0 cause GENESIS is the 0\n for(let i = 1; i <this.chain.length; i++){\n const currentBlock = this.chain[i];\n const previousBlock = this.chain[i -1];\n\n //check if the propely block are link together\n //1.- if the hash of the block still valid \n if(currentBlock.hash != currentBlock.calculateHash()){\n return false; \n }\n\n if(currentBlock.previousHash != previousBlock.hash){\n return false;\n }\n }\n return true;\n }", "checkDropItem (e) {\n if (e.dataTransfer.files.length) {\n let file = e.dataTransfer.files[0];\n let ext = LGraphCanvas.getFileExtension(file.name).toLowerCase();\n let nodetype = LiteGraph.node_types_by_file_extension[ext];\n if (nodetype) {\n let node = LiteGraph.createNode(nodetype.type);\n node.pos = [e.canvasX, e.canvasY];\n this.d_graph.add(node);\n if (node.onDropFile)\n node.onDropFile(file);\n }\n }\n }", "function checkConflicts() {\r\n // checks if a conflict exists\r\n var conflict = false;\r\n for (var i = 0; i < tempNodes.length; i++) {\r\n var tempNode = tempNodes[i];\r\n if (tempNode.checkIncomingLinks() === true) {\r\n conflict = true;\r\n }\r\n }\r\n if (conflict === true) {\r\n // todo conflict alert\r\n // actually conflicts are allowed to show problems\r\n confirmChanges(true);\r\n } else {\r\n confirmChanges(true);\r\n }\r\n }", "function cleanupTargetIds(model, logger, edgeConfig, availableTargets, srcId) {\n\n\t// if the edge does not exists we have nothing to check\n\tif (model.registry.edges[edgeConfig.name] && availableTargets) {\n\t\t// build a set of the available targets\n\t\tconst availSet = new Set();\n\t\tavailableTargets.forEach((val) => {\n\t\t\tavailSet.add(val);\n\t\t});\n\n\t\tavailableTargets = [];\n\n\t\tconst existingEdgeStatus = model.registry.edges[edgeConfig.name].time_shift_status;\n\t\tconst fields = ['active', 'removed', 'removed_by_src', 'removed_by_target'];\n\t\tfields.forEach((fieldName) => {\n\t\t\tif (srcId) {\n\t\t\t\tif (existingEdgeStatus[fieldName][srcId]) {\n\t\t\t\t\texistingEdgeStatus[fieldName][srcId].forEach((id) => {\n\t\t\t\t\t\t// Check if this id is in the set\n\t\t\t\t\t\tif (availSet.has(id)) {\n\t\t\t\t\t\t\tavailSet.delete(id);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tObject.keys(existingEdgeStatus[fieldName]).forEach((subSrcId) => {\n\t\t\t\t\tif (existingEdgeStatus[fieldName][subSrcId]) {\n\t\t\t\t\t\texistingEdgeStatus[fieldName][subSrcId].forEach((id) => {\n\t\t\t\t\t\t\t// Check if this id is in the set\n\t\t\t\t\t\t\tif (availSet.has(id)) {\n\t\t\t\t\t\t\t\tavailSet.delete(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tavailSet.forEach((val) => {\n\t\t\tavailableTargets.push(val);\n\t\t});\n\t}\n\treturn availableTargets;\n}", "repeats() {\n return this.rules.length > 0\n }", "function getIndexOfSourceAndTarget(link) {\r\n\t\tvar foundIndices={};\r\n\t\tif (graph!==undefined && graph.nodes!==undefined && graph.nodes.length) {\r\n\t\t\tvar nodesCount = graph.nodes.length;\r\n\t\t\tfor (var index=0; index<nodesCount; index++) {\r\n\t\t\t\tif (graph.nodes[index].id === link.inV) {\r\n\t\t\t\t\tfoundIndices.sourceIndex = index;\r\n\t\t\t\t}\r\n\t\t\t\tif (graph.nodes[index].id === link.outV) {\r\n\t\t\t\t\tfoundIndices.targetIndex = index;\r\n\t\t\t\t}\r\n\t\t\t\tif (foundIndices.sourceIndex!==undefined && foundIndices.targetIndex!==undefined) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn foundIndices;\r\n\t}", "function isEventGoal(item) {\n return (item.type_of_event === 'goal' || item.type_of_event === 'goal-penalty' || item.type_of_event === 'goal-own');\n}", "function checkNodesType(nodeList) {\n let approved = [];\n nodeList.forEach((nodeLocation) => {\n if (nodeLocation[0] == endCoordinates[0] && nodeLocation[1] == endCoordinates[1]) {\n foundEnd = true;\n console.log('Found final')\n } else {\n approved.push(nodeLocation)\n }\n });\n return approved;\n }", "addWayPoint(event, isManhatten) {\n let connectiontargettoadd;\n let point = MouseTool.getEventPosition(event);\n let isPointOnComponent = this.__isPointOnComponent(point);\n let isPointOnConnection = this.__isPointOnConnection(point);\n let target = ConnectionTool.getTarget(point);\n if (isManhatten && target) {\n //TODO: modify the target to find the orthogonal point\n let lastwaypoint = this.startPoint;\n if (this.wayPoints.length > 0) {\n lastwaypoint = this.wayPoints[this.wayPoints.length - 1];\n }\n target = this.getNextOrthogonalPoint(lastwaypoint, target);\n }\n if ((target.length == 2)) {\n this.wayPoints.push(target);\n }\n\n if (isPointOnComponent) {\n //Modify the waypoint to reflect closest port in the future\n let componentport = this.__getClosestComponentPort(isPointOnComponent, this.startPoint, target);\n if (componentport !== null) {\n let location = ComponentPort.calculateAbsolutePosition(componentport, isPointOnComponent);\n connectiontargettoadd = new ConnectionTarget(isPointOnComponent, componentport.label);\n this.wayPoints.pop();\n this.lastPoint = location;\n } else {\n connectiontargettoadd = new ConnectionTarget(isPointOnComponent, null);\n this.lastPoint = this.wayPoints.pop();\n }\n\n //Do this if we want to terminate the connection\n //Check if source is empty\n if (this.source === null) {\n //Set is as the source\n // console.log(\"isPointOnComponent\", isPointOnComponent);\n this.source = connectiontargettoadd;\n } else {\n //Add it to the sinks\n this.sinks.push(connectiontargettoadd);\n }\n this.__STATE = \"TARGET\";\n this.dragging = false;\n this.finishChannel();\n } else if (isPointOnConnection) {\n console.log(\"There is connection at the waypoint path\");\n if (this.__currentConnectionObject === null) {\n this.__currentConnectionObject = isPointOnConnection;\n } else {\n this.__currentConnectionObject.mergeConnection(isPointOnConnection);\n }\n this.__STATE = \"TARGET\";\n this.dragging = false;\n this.lastPoint = this.wayPoints.pop();\n this.finishChannel();\n }\n }", "function addEdges(items) {\n\tfor (i = 0; i < items.length; i++) {\n\t var sourceID = items[i].source[0].parent[0].id[0];\n\t var sinkID = items[i].sink[0].parent[0].id[0];\n\n\t if (!(sourceID && sinkID))\n\t\t continue;\n\n\t g.addEdge(sourceID, sinkID);\n\t}\n }", "function checkPath (g, source, destination){\n if(source === destination)\n return true;\n let visited = new Array(g.vertices).fill(false);\n visited[source] = true;\n let stack = new Stack();\n let found = false;\n stack.push(source);\n while(!stack.isEmpty()){\n let temp = stack.pop();\n let node = g.list[temp].getHead();\n while(node !== null){\n if(!visited[node.data]){\n if(node.data == destination){\n found = true;\n break;\n }\n stack.push(node.data);\n visited[node.data] = true;\n }\n node = node.nextElement;\n }\n }\n return found;\n\n}", "function isLinkInvalid(link){\nreturn (!link.prop('source/id') || !link.prop('target/id'));\n}", "function checkForExistingComm(application, aggregatedComm) {\n let drawableComms = application.get('drawableClazzCommunications');\n let possibleCommunication = { isExisting: false, communication: null };\n drawableComms.forEach((drawableComm) => {\n // check if drawableCommunication with reversed communication is already created\n if (aggregatedComm.get('sourceClazz.id') == drawableComm.get('targetClazz.id') &&\n aggregatedComm.get('targetClazz.id') == drawableComm.get('sourceClazz.id')) {\n possibleCommunication = { isExisting: true, communication: drawableComm };\n }\n });\n return possibleCommunication;\n }", "function check_equal_labels(element, the_label){\n\t\tfor(var j = 0; j< connections_array.length; j++){\n\t\t\tif(element.connect_id == connections_array[j].source){\n\t\t\t\tif(the_label == connections_array[j].label){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n \t}", "_isDragStartInSelection(ev) {\n const selectedElements = this.root.querySelectorAll('[data-is-selected]');\n for (let i = 0; i < selectedElements.length; i++) {\n const element = selectedElements[i];\n const itemRect = element.getBoundingClientRect();\n if (this._isPointInRectangle(itemRect, { left: ev.clientX, top: ev.clientY })) {\n return true;\n }\n }\n return false;\n }", "function isLeaf(cell){\nvar outboundLinks = App.graph.getConnectedLinks(cell, {outbound: true});\nvar inboundLinks = App.graph.getConnectedLinks(cell, {inbound: true});\nvar inboundQualificationCount = 0;\nvar outboundQualificationCount = 0;\n\n\nfor (var i = outboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = outboundLinks[i].attr('.link-type')\n\tif (linkType == 'Error' || linkType == 'Dependency' || linkType == 'Actor' ){\n\t\treturn false;\n\t}\n\tif (linkType == 'Qualification'){\n\t\toutboundQualificationCount = outboundQualificationCount + 1;\n\t}\n}\n\nfor (var i = inboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = inboundLinks[i].attr('.link-type')\n\tif (linkType == 'Error' || (linkType != 'Dependency' && linkType != 'Actor' && linkType != 'Qualification')){\n\t\treturn false;\n\t}\n\tif (linkType == 'Qualification'){\n\t\tinboundQualificationCount = inboundQualificationCount + 1;\n\t}\n}\n\n// If no outbound and inbound link, do not highlight anything\n// If all outbound links are qualification, and all inbound links are qualification, do not highlight anything\nif (outboundLinks.length == outboundQualificationCount && inboundLinks.length == inboundQualificationCount){\n\treturn false;\n}\n\nreturn true;\n}" ]
[ "0.5933772", "0.5715553", "0.56843007", "0.5162468", "0.5143154", "0.5106443", "0.5103366", "0.5038628", "0.4990879", "0.4868909", "0.48651686", "0.48592144", "0.4838532", "0.48267353", "0.48130965", "0.48036492", "0.4798051", "0.4791079", "0.47841564", "0.47574243", "0.47364628", "0.46954376", "0.46791944", "0.4659635", "0.46575946", "0.4646443", "0.46276766", "0.4625575", "0.46152097", "0.46034652", "0.45963085", "0.4586494", "0.4572862", "0.4569563", "0.4569563", "0.4569563", "0.45665133", "0.454904", "0.454904", "0.45320734", "0.45273224", "0.45225725", "0.45190787", "0.45147282", "0.45065963", "0.45018533", "0.4483381", "0.4468053", "0.44550475", "0.4447455", "0.4438794", "0.4430961", "0.44287363", "0.44259", "0.44156563", "0.43807918", "0.43677592", "0.43668967", "0.43655246", "0.43654752", "0.43652767", "0.43648866", "0.43633613", "0.43627873", "0.43589193", "0.4356416", "0.4350374", "0.43408665", "0.4338672", "0.43327934", "0.43324453", "0.43156067", "0.43092716", "0.43036819", "0.43001628", "0.42994875", "0.42911643", "0.42907587", "0.42788205", "0.42547545", "0.42547545", "0.42529264", "0.4241585", "0.42390803", "0.4238236", "0.42327547", "0.4227183", "0.4222612", "0.42198503", "0.42158762", "0.42148247", "0.42142594", "0.4213939", "0.42127657", "0.42050683", "0.42036635", "0.42034742", "0.41997573", "0.41993004", "0.41983616" ]
0.66712964
0
starting Listen to the stream
function startStreamListener() { var streamListenerParams = { ip: self.streamingSource.sourceIP, port: self.streamingSource.sourcePort }; return self.streamListener.startListen(streamListenerParams) .then(function() { self.streamStatusTimer.setInterval(function() { self.streamingSourceDAL.notifySourceListening(self.streamingSource.sourceID); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start () {\n listen()\n}", "function start() {\n listen();\n}", "startListening() {\n\t\tthis.server.listen(this.port, () => {\n\t\t\tconsole.log('Server started listening on port', this.port);\n\t\t});\n\t}", "start() {\n this._.on('request', this.onRequest.bind(this));\n this._.on('error', this.onError.bind(this));\n this._.on('listening', this.onListening.bind(this));\n\n this._.listen(this.config.port);\n }", "function startStream() {\n streamInterval = setInterval(working, msFrequency);\n}", "function startListening(){\n\trecord();\n}", "function startStream() {\n\n twitter.stream('statuses/filter', {\n track: config.me\n }, function(stream) {\n console.log(\"listening to stream for \" + config.me);\n stream.on('data', triageTweet);\n });\n}", "function handleListen() {\n console.log(\"Listening\");\n }", "function handleListen() {\n console.log(\"Listening\");\n }", "start() {\n if (!this.stopped && !this.stopping) {\n this.channel.on('close', () => {\n if (this.forcelyStop || (!this.pausing && !this.paused)) {\n if (!this.trapped)\n this.emit('done');\n this.emit('close');\n }\n this.stopped = false;\n });\n this.channel.on('stream', (packet) => {\n if (this.debounceSendingEmptyData)\n this.debounceSendingEmptyData.run();\n this.onStream(packet);\n });\n this.channel.once('trap', this.onTrap.bind(this));\n this.channel.once('done', this.onDone.bind(this));\n this.channel.write(this.params.slice(), true, false);\n this.emit('started');\n if (this.shouldDebounceEmptyData)\n this.prepareDebounceEmptyData();\n }\n }", "function onListening() {\n var addr = wss.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = Dich_vu.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "listen() {\n }", "onListening() {\n var addr = this.server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function startStream () {\n if (!isPeerConnectionCreated && localStream && isRemotePeerAvailble) {\n createPeerConnection();\n peerConnection.addStream(localStream);\n isPeerConnectionCreated = true;\n if (isRoomCreated) {\n createOffer();\n }\n }\n}", "function onListening() {\n var addr = this.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "function onListening() {\n CALLBACK();\n const addr = server.address();\n const bind = typeof addr === 'string' ?\n `pipe ${addr}` :\n `port ${addr.port}`;\n debug(`Listening on ${bind}`);\n }", "constructor() {\n this.#listen();\n }", "constructor() {\n this.#listen();\n }", "function onListening() {\n var addr = this.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n const addr = this.address()\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('Listening on ' + bind)\n}", "function handleListen() {\r\n console.log(\"Listening\"); //gibt Listening in der console aus \r\n }", "function onListening() {\n\t\tvar addr = server.address();\n\t\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\t\tvar fqdn = scheme+\"://\"+host;\n\t\tcrawl.init(fqdn,host,scheme);\n\t}", "start() {\n this.debug('starting listening to queue');\n this.running = true;\n // Using setTimeout instead of nextTick because we want this to happen\n // after all the other jazz in the event loop happens, rather than starving\n // it by always forcing it to happen before using nextTick\n setTimeout(async () => {\n this.emit('starting');\n await this.__receiveMsg();\n }, 0);\n }", "function listening(){\n\tconsole.log('listening');\n}", "function onListening() \n{\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('init - awesome server');\n // logger.info('init - awesome server');\n}", "function onListening() {\n let addr = this.address();\n let bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('Listening on', bind)\n }", "start (callback) {\n each(this.availableTransports(this._peerInfo), (ts, cb) => {\n // Listen on the given transport\n this.transport.listen(ts, {}, null, cb)\n }, callback)\n }", "start (callback) {\n each(this.availableTransports(this._peerInfo), (ts, cb) => {\n // Listen on the given transport\n this.transport.listen(ts, {}, null, cb)\n }, callback)\n }", "function startListening() {\n\tapp.listen(8080, function() {\n\t\tconsole.log(\"Sever started at http://localhost:8080 Start chatting!\");\n\t});\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "start() {\n process.on(\"message\", (message) => {\n if (typeof message !== \"object\" || !message.id) {\n return;\n }\n this.emit(message.id, message.data);\n });\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n var startMessage = 'Server listening on ' + bind;\n console.log(startMessage);\n\n // If the process is a child process (e.g. started in Gulp)\n // then inform the parent process that the server has started.\n if (process.send) {\n process.send(startMessage);\n }\n}", "function onListening() {\n\n var addr = this.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log(\"API Listening on port : \" + addr.port);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n console.log(\"Listening on \" + bind);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n\n console.log(\"----- onListening\");\n}", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "listen()\n\t{\n\t\t//Starts the server/\n\t\tconst server = new Websocket.Server({port: P2P_PORT});\n\t\tserver.on('connection', socket => this.connectSocket(socket));\n\t\t\n\t\t//connects to peers.\n\t\tthis.connectToPeers();\n\n\t\tconsole.log(`Listening for peer-to-peer connections on: ${P2P_PORT}`);\n\t}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n\t\t\t'pipe ' + addr : 'port ' + addr.port;\n\t\n debug('Listening on ' + bind);\n}", "function onListening() {\n const addr = server.address()\n const bind = typeof addr === 'string' ? `pipe ${addr}` : `port ${addr.port}`\n process.stdout.write(`Listening on ${bind}`)\n }", "start() {\n if (this.listening_) {\n return;\n }\n\n this.listening_ = true;\n this.chromeEvent_.addListener(this.callback_);\n }", "function listening(){console.log(\"listening. . .\");}", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n\tdebug(\"Listening on \" + bind);\n}", "started() {\n\n\t\tthis.app.listen(Number(this.settings.port), err => {\n\t\t\tif (err)\n\t\t\t\treturn this.broker.fatal(err);\n\t\t\tthis.logger.info(`API Server started on port ${this.settings.port}`);\n\t\t});\n\n\t}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n //debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\n debug('Listening on ' + port);\n }", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n \tvar addr = server.address();\n \tvar bind = typeof addr === 'string'\n \t? 'pipe ' + addr\n \t: 'port ' + addr.port;\n \tdebug('Listening on ' + bind);\n }", "function onListening() {\nvar addr = server.address();\nvar bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\ndebug('Listening on ' + bind);\n}", "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string' ?\r\n 'pipe ' + addr :\r\n 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug( 'Listening on ' + bind );\n}", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('Listening on ' + bind)\n}", "function onListening() {\n\tconst addr = server.address();\n\tconst bind = typeof addr === 'string' ? `pipe ${addr}` : `port ${addr.port}`;\n\tdebug(`Listening on ${bind}`);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening()\n{\n\tvar addr\t= server.address();\n\tvar bind\t= ('string' === typeof addr) ? 'pipe ' + addr : 'port ' + addr.port;\n\n\tdebug('Listening on ' + bind);\n}", "start() {\n\t\tthis.registerListeners();\n\t}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.info('Listening on ' + bind);\n}", "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string'\r\n ? 'pipe ' + addr\r\n : 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening()\n{\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n //debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "start() {\n\t\t// Is OBS Studio connected?\n\t\tif (!this.obs.connected()) {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\treject(new Error(\"OBS Studio is not connected.\".lox()));\n\t\t\t});\n\t\t}\n\n\t\t// Is it already active?\n\t\tif (this.active) {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tresolve(true);\n\t\t\t});\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.obs.call(\"obs.frontend.streaming.start\", (result, error) => {\n\t\t\t\tif (result !== undefined) {\n\t\t\t\t\tthis._active = result;\n\t\t\t\t\tthis._event_status();\n\t\t\t\t\tresolve(result);\n\t\t\t\t} else {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function onListening() {\n var addr = server.address();\n var bind = (typeof addr === 'string') ? 'pipe ' + addr : 'port ' + addr.port;\n logger.info('>> LISTENING ON ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening () {\n const addr = server.address()\n const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port\n console.log('Server Listening on ' + bind)\n}", "function onListening() {\n const addr = server.address()\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n // debug('Listening on ' + bind) idk\n console.log('Listening on ' + bind)\n}", "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string'\r\n ? 'pipe ' + addr\r\n : 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "function onListening () {\n var addr = server.address ();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug ('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "function start() {\n\tlog(\"Requesting local stream\");\n\n\t// just disable the Start button on the page\n\tstartButton.disabled = true;\n\n\t// Get ready to deal with different browser vendors...\n\tinitGetUserMedia();\n\n\t// Now, call getUserMedia()\n\tnavigator.mediaDevices.getUserMedia(constraints).then(successCallback).catch(errorCallback);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n // debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\n\tconst addr = server.address();\n\tconst bind = typeof addr === 'string'\n\t\t? 'pipe ' + addr\n\t\t: 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug_info('Listening on ' + bind);\n}", "function onListening() {\n var addr = io.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n let addr = server.address();\n let bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n log('Listening on ' + bind);\n}", "function onListening() {\n let addr = server.address();\n let bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n //debug('Listening on ' + bind);\n console.log('Http server is listening on ' + bind);\n}", "function onListening() {\n var addr = http.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n log.debug('HTTP server listening on ' + bind);\n }" ]
[ "0.7836865", "0.77568483", "0.74000734", "0.73328316", "0.7128523", "0.6870402", "0.68618375", "0.6771315", "0.6771315", "0.6764348", "0.6750333", "0.6674343", "0.6624101", "0.66183174", "0.6602114", "0.66013116", "0.65961766", "0.65927386", "0.65927386", "0.6592643", "0.6564655", "0.6560283", "0.65569615", "0.65413296", "0.652792", "0.65229386", "0.6507546", "0.6492235", "0.64891386", "0.64891386", "0.64770657", "0.64717424", "0.64493454", "0.64291143", "0.64245987", "0.64209986", "0.64086974", "0.64057475", "0.64019865", "0.639845", "0.6384044", "0.6371471", "0.637", "0.63653016", "0.6362688", "0.63598174", "0.63559943", "0.63537467", "0.6353111", "0.634747", "0.6345061", "0.63411206", "0.6340282", "0.6337844", "0.6334736", "0.6317419", "0.6312492", "0.63117415", "0.6310315", "0.6309662", "0.63046104", "0.6303876", "0.63028085", "0.63023347", "0.6301136", "0.6300778", "0.6300501", "0.6300501", "0.6300501", "0.6300501", "0.6300501", "0.6300501", "0.6300501", "0.6300501", "0.6298925", "0.629663", "0.6296113", "0.6296113", "0.6296113", "0.6295895", "0.62937206", "0.62936276", "0.6292307", "0.6291524", "0.6291524", "0.6291524", "0.6289663", "0.6289663", "0.6289663", "0.6289663", "0.6289663", "0.6289015", "0.6284398", "0.6283536", "0.62833905", "0.6282016", "0.62810737", "0.6280618", "0.627628", "0.62705004" ]
0.76290655
2
/ Helper Methods / Sets a keep alive status notifier
function StatusTimer() { var self = this; self.timer = undefined; self.setInterval = function(logic) { clearInterval(self.timer); self.timer = setInterval(function() { console.log(PROCESS_NAME + ' updating status....' + moment().format()); logic(); }, process.env.INTERVAL_TIME || 5000); }; self.clearInterval = function() { clearInterval(self.timer); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "keepAlive () {\n this._debug('keep-alive')\n this._push(MESSAGE_KEEP_ALIVE)\n }", "keepAlive () {\n this._debug('keep-alive')\n this._push(MESSAGE_KEEP_ALIVE)\n }", "function keepAlive(){\n if(config.goPro.states.btIsConnected){\n if(config.goPro.debug){\n writeLog(`Send Keep alive message`, false, true);\n }\n writeToChildProcess(cmdProcess, KEEPALIVEMSG);\n }\n }", "onKeepAliveInterval() {\n let update_difference = Date.now() - this.keepalive_timestamp_;\n\n // The valid threshold value is 3 to 7 seconds.\n // A value greater than 7 seconds is considered as a previous session\n // or other garbage value.\n if( update_difference > 4000 && update_difference < 7000) {\n logger.error('Sending bye command triggered by KeepAlive timeout : ' + update_difference);\n\n // send bye message to device\n this.websocketClient_.doSendMessage(JSON.stringify({ \n what: \"hangup\"\n }));\n\n // reset the connection state\n this.deactivateSession_();\n }\n }", "_startHardbeat() {\n var timeout = this.get('heartbeatTimeout');\n this.storage.setItem('singleton:heartbeat', Date.now());\n return setInterval(() => {\n this.storage.setItem('singleton:heartbeat', Date.now());\n }, timeout);\n }", "function startNotificationWatcher() {\n notificationCheck(true);\n notificationWatcher = setInterval(notificationCheck, 5000);\n}", "function keepConectionAlive() {\n GLOBAL.conectionIntervalID = setInterval(() => {\n GLOBAL.api.post(\"/status\", { name: GLOBAL.username }).catch(error => {\n console.log(\"Falha na conexão\");\n console.log(error.toJSON());\n history.go();\n })\n }, 5000)\n}", "function keepAlive() {\n\tconsole.log('XMPP keepAlive');\n\tsetTimeout(keepAlive, 60000);\n\tcl.send(new xmpp.Element('message',\n { to: username,\n type: 'chat'}).\n c('body').\n t('keepAlive'));\n\n}", "function setCheckTimer() {\n\t\tcheckTimer = setTimeout(\"$.fn.messengerStatus.getStatus()\", settings.checkInterval);\n\t}", "$keepalive() {\n const { interval } = this.options;\n if ( !this.$i ) {\n this.$i = window.setInterval(this.$oncheck, interval);\n }\n }", "function heartbeat () { this.isAlive = true }", "function checkstatus()\n\t{\n\t\tif(disconnectwarned || !AjaxLife.Network.Connected) return;\n\t\tvar now = new Date();\n\t\tif(!now.getTime() - lastmessage.getTime() > 60000)\n\t\t{\n\t\t\tdisconnectwarned = true;\n\t\t\talert(\"No data has been received for over a minute. You may have been disconnected.\");\n\t\t}\n\t}", "heartbeat () {\n }", "_keepAlive() {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, () => `[CLIENT] _keepAlive() ${this._state}/${this._currentConnectionStartTime}`);\n if (this._state === exports.ClientState.ACTIVE && this._currentConnectionStartTime) {\n const now = Date.now();\n const lastPacketDuration = now - (this._lastPacketTime || this._currentConnectionStartTime);\n const lastStatePacketDuration = now - (this._lastStatePacketTime || this._currentConnectionStartTime);\n if (lastPacketDuration > this._options.silenceTimeout\n || (this._choseToLogIn && lastStatePacketDuration > this._options.stateSilenceTimeout)) {\n if (this._client !== undefined) {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, () => `[CLIENT] _keepAlive silence tripped, lastPacket: ${lastPacketDuration}, lastStatePacket: ${lastStatePacketDuration}`);\n const msg = `Server has not responded for too long, forcing disconnect`;\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.INFO, msg);\n this._disconnected(msg);\n }\n }\n else {\n this.TxCmd(constants.FCTYPE.NULL, 0, 0, 0);\n }\n }\n }", "function keepAlive(){\n testChannel.postMessage(JSON.stringify({type: \"add-client\", clientId}));\n timer = setTimeout(keepAlive, 3000);\n }", "getKeepAlive(){return this.__keepAlive}", "constructor($status) {\n this.socket = null;\n this.path = '/service';\n this.$status = $status;\n this.reconnect = true;\n this.interval = false;\n this.reconnect_interval = 3000;\n }", "heartbeat() {\n const now = Date.now();\n if (now - this.lastHeartbeat >= this.heartbeatInterval) {\n util.promisify(fs.writeFile)(this.heartbeatPath, \"\").catch((error) => {\n this.services.get(log_1.ILogService).warn(error.message);\n });\n this.lastHeartbeat = now;\n clearTimeout(this.heartbeatTimer); // We can clear undefined so ! is fine.\n this.heartbeatTimer = setTimeout(() => {\n if (this.onlineConnections.length > 0) {\n this.heartbeat();\n }\n }, this.heartbeatInterval);\n }\n }", "function startPing()\n{\n var heartbeat = 90;\n heartbeatTimerId = window.setInterval(opPing, heartbeat*1000);\n}", "function resetTimeout () {\n if (timeoutWarning !== undefined) {\n clearTimeout(timeoutWarning);\n }\n timeoutWarning = setTimeout(function () {\n noty.update('warning',\n 'The server has not sent updates in the last ' +\n SECONDS + ' seconds.');\n }, 1000 * SECONDS);\n }", "function heartbeat() {\n this.isAlive = true;\n}", "function keepConnectionAlive(OrderAPI, binanceAPI) {\n //console.log(\"keepConnectionAlive\", OrderAPI, binanceAPI);\n ListenKey(\"KEEPALIVE\", OrderAPI, binanceAPI)\n .then(() => {\n setTimeout(() => {\n console.log(\"keepalive sent\");\n keepConnectionAlive(OrderAPI, binanceAPI);\n }, 45 * 60 * 1000);\n })\n .catch((err) => {\n console.log(err.message);\n });\n}", "function heartBeat() {\n httpRequest('GET', SERVER_PATH, 'heartbeat', 'gid=' + gid + '&pid=' + pid + \"&count=\" + count);\n}", "status()\n\t{\n\t\twindow.addEventListener('online', this.changueStatus);\n\t\twindow.addEventListener('offline', this.changueStatus);\n\t}", "activateHealthCheckUp() {\n setInterval(() => {\n if (this.master.masterActivated) {\n let totalWorkers = this.master.totWorker();\n let workersOnline = this.master.onlineWorkers();\n\n if (totalWorkers == workersOnline)\n console.log(`Cluster Health: ${chalk.green.bold.italic(this.health[1])}`);\n else if (workersOnline > 0) {\n console.log(`Cluster Health: ${chalk.yellow.bold.italic(this.health[0])}`);\n winston.warn('Cluster health: YELLOW')\n }\n else if (workersOnline == 0) {\n console.log(`Cluster Health: ${chalk.red.bold.italic(this.health[-1])}`);\n winston.error('Cluster health: RED');\n }\n let workerStats = this.master.workerStats()\n winston.info(`Engaged: ${workerStats.engaged} Idle: ${workerStats.idle}`);\n // Log the worker stats\n }\n }, 20000);\n }", "function Notification(){}", "function keepAlive()\n{\n\t//debugLog(\"Calling keepalive \" );\n\tvar listIPs = tokenRing.getRing();\n\tcount++;\n\tfor( var i = 0; i < listIPs.length; i++) \n\t{\n\t\tvar post_data = { myIP : i };\n\t\tif (listIPs[i] != tokenRing.getMyIP())\n\t\t{\n\t\t\tgeneralPOST ( listIPs[i], '/do_keepalive', post_data );\n\t\t}\n\t}\n\t\n\tsetTimeout( keepAlive, keepAliveTimeout );\n}", "function keepAlive() {\n\t\tif(!server || !websockets || !connected)\n\t\t\treturn;\n\t\twsKeepaliveTimeoutId = setTimeout(keepAlive, keepAlivePeriod);\n\t\tvar request = { \"janus\": \"keepalive\", \"session_id\": sessionId, \"transaction\": Janus.randomString(12) };\n\t\tif(token)\n\t\t\trequest[\"token\"] = token;\n\t\tif(apisecret)\n\t\t\trequest[\"apisecret\"] = apisecret;\n\t\tws.send(JSON.stringify(request));\n\t}", "function statusSocket()\n{\n console.log('attempting status socket');\n try {\n Status.replaceData(noReq, '/status/get');\n } catch (e) {\n console.error(e);\n console.log('FAILED STATUS CONNECTION');\n setTimeout(statusSocket, 10000);\n }\n}", "checkAlive(){\n if (this.lifeTime > 1000){\n this.alive = false;\n this.lifeTime = 0;\n }\n\n }", "function sendStatusUpdate() {\n var queryParamString = \"type=heartbeat\";\n queryParamString += \"&username=\" + AccountServices.username;\n queryParamString += \"&displayName=\" + MyAvatar.displayName;\n queryParamString += \"&status=\";\n queryParamString += currentStatus;\n\n var uri = REQUEST_URL + \"?\" + queryParamString;\n\n if (DEBUG) {\n console.log(\"sendStatusUpdate: \" + uri);\n }\n\n request({\n uri: uri\n }, function (error, response) {\n startHeartbeatTimer();\n\n if (error || !response || response.status !== \"success\") {\n console.error(\"Error with updateStatus: \" + JSON.stringify(response));\n return;\n }\n });\n }", "keepAlive() {\n\t\tif (this.portalId === undefined) {\n\t\t\treturn\n\t\t}\n\t\tthis.client.send(`R/${this.portalId}/system/0/Serial`, '')\n\t}", "function heartbeat(){\n this.isAlive = true;\n}", "queueHeartbeat() {\n\t\t\tif (this.options.ignoreHeartbeat) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!(this.hasHandshook && this.open)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.heartbeatTimeout !== undefined) {\n\t\t\t\tclearTimeout(this.heartbeatTimeout);\n\t\t\t}\n\n\t\t\tthis.heartbeatTimeout = setTimeout(\n\t\t\t\t() => {\n\t\t\t\t\tthis.sendMessage([\n\t\t\t\t\t\t___R$project$rome$$internal$events$types_ts$BridgeMessageCodes.HEARTBEAT,\n\t\t\t\t\t]);\n\t\t\t\t},\n\t\t\t\t1_000,\n\t\t\t);\n\t\t}", "function check_iconnection() {\n\n\n\n\n function updateOfflineStatus() {\n toaster(\"Your Browser is offline\", 15000)\n return false;\n }\n\n window.addEventListener('offline', updateOfflineStatus);\n}", "schedule_heartbeat() {\n\t\tclearTimeout(this.heartbeat_timer);\n\t\tif (this.heartbeat_period > 0) {\n\t\t\tthis.heartbeat_timer = setTimeout(() => this.ws.ping(), this.heartbeat_period);\n\t\t}\n\t}", "function keepSessionalive() {\n\t\t\tdailyMailScanDataService.keepSessionalive()\n\t\t\t\t.then(function (response) { });\n\t\t}", "function fn_showstatus(text) {\r\n\twindow.status = text;\r\n\tsetTimeout(\"window.status=''\", 5000);\r\n}", "start() {\n\t\tthis._stopped = false;\n\t\tthis.heartbeatTimeout.restart();\n\t}", "__init2() {this._heartbeatCounter = 0;}", "__init2() {this._heartbeatCounter = 0;}", "__init2() {this._heartbeatCounter = 0;}", "_onlineExpiring() {\n logger.info('OnlineStateManager: Online State Expiring; pinging to verify');\n this._isOnlineExpiring = true;\n this.checkOnlineStatus((result) => {\n if (!result && this._isOnlineExpiring) this._onlineExpired();\n this._isOnlineExpiring = false;\n });\n }", "function initiateStatusInterval(){\r\n\tcheckStatus();\r\n\twindow.setInterval('checkStatus()', statusInterval);\r\n\tloginGreeting();\r\n}", "function notificationCheck(force = false) {\n notificationUpdateTic = notificationUpdateTic + 1;\n\n // refresh if forced or\n // if in focus and was not refreshed in the last 5 seconds\n if (force || (document.hasFocus() && notificationUpdateTic >= 5)) {\n notificationUpdateTic = 0;\n inventreeGet(\n '/api/notifications/',\n {\n read: false,\n },\n {\n success: function(response) {\n updateNotificationIndicator(response.length);\n },\n error: function(xhr) {\n console.warn('Could not access server: /api/notifications');\n }\n }\n );\n }\n}", "function initGrowlStatus() {\n grunt.util.hooker.hook(grunt.log, 'write', function(msg){\n if( grunt.log.uncolor(msg).match(/Waiting.../) ) { flushMessages('ok'); }\n });\n\n grunt.util.hooker.hook(grunt.log, 'header', function(msg){\n msg = grunt.log.uncolor(msg);\n\n if( ignoreWatch && msg.match(/\"watch\" task/) ) { return; }\n\n if( msg.match(/\".+:.+\"/) ) { return; }\n\n if( !ignoreWatch && msg.match(/\"watch\" task/) ) {\n msg += ' for ' + path.basename(process.cwd());\n ignoreWatch = true;\n }\n\n messages.push(msg);\n });\n\n grunt.util.hooker.hook(grunt.log, 'ok', function(msg){\n if( typeof msg === 'string' ) {\n messages.push(grunt.log.uncolor(msg));\n }\n });\n\n grunt.util.hooker.hook(grunt, 'warn', function(error){\n var warning = [];\n\n if( typeof error !== 'undefined' ) {\n warning.push(messages[0]);\n warning.push(messages[messages.length-1]);\n warning.push(String(error.message || error));\n messages = warning;\n flushMessages('error');\n }\n });\n\n grunt.util.hooker.hook(grunt.log, 'error', function(msg){\n if( typeof msg === 'string' ) {\n messages.push(grunt.log.uncolor(msg));\n flushMessages('error');\n }\n });\n }", "_heartbeatTimeoutFired() {\n this._heartbeatTimeoutHandle = null;\n\n this._onTimeout();\n }", "function set_badge(on) {\n $('#server_status_badge').removeClass();\n $('#server_status_badge').addClass('badge');\n $('#server_status_badge').addClass('badge-pill');\n if (on) {\n $('#server_status_badge').addClass('badge-success');\n $('#server_status_badge').text('Online');\n\n // Now that it's online, enable the new project button!\n // (Only if the check isn't shown.)\n if ($('#success_check').is(':hidden')) {\n $('#new_proj_btn').css('pointer-events', 'auto');\n $('#new_proj_btn').prop('disabled', false);\n }\n\n // remove popover\n $('#new_proj_btn_span').popover('hide');\n $('#new_proj_btn_span').popover('disable');\n $('#new_proj_btn_span').popover('dispose');\n\n } else {\n $('#server_status_badge').addClass('badge-danger');\n $('#server_status_badge').text('Offline');\n }\n}", "function updateServiceStatus(note, newStatus){\r\n\t\t\t//update Trello with the new status\r\n\t\t\tTrello\r\n\t\t\t\t.put(\r\n\t\t\t\t\t//send the note id\r\n\t\t\t\t\t'notifications/' + note.id,\r\n\r\n\t\t\t\t\t//update this field\r\n\t\t\t\t\t{ unread: newStatus },\r\n\r\n\t\t\t\t\t//on success\r\n\t\t\t\t\tfunction(){\r\n\t\t\t\t\t\t//update the badge\r\n\t\t\t\t\t\tbkg.update_badge();\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t}", "function setStatus(msg)\n{\n\tisStatusIdle = 0;\n\tif(msg == '' || msg == null || msg == undefined)\n\t{\n\t\tisStatusIdle = 1;\n\t\tmsg = \"Idle.\";\n\t}\n\tdocument.getElementById('statusMessage').innerHTML = msg;\n}", "function keepAlive()\n{\n //if (debug) debugLog(\"Calling keepalive \" );\n var listIPs = tokenRing;\n for( var i = 0; i < listIPs.length; i++) \n {\n var post_data = { myIP : i, role: node_functionality };\n if (listIPs[i] != getMyIP())\n {\n generalPOST ( listIPs[i], '/do_keepalive', post_data, tokeRingPort );\n }\n }\n \n setTimeout( keepAlive, keepAliveTimeout );\n}", "function startStatusInterval () {\n statusInterval = setInterval(function () {\n var device = getDevice()\n if (device) {\n device.status()\n }\n }, 1000)\n}", "function keepSessionAliveTimeoutHandler() {\r\n // Confirm with user if keep session alive if promptForSessionKeepAlive is set to true\r\n if (promptForSessionKeepAlive.toUpperCase() == \"TRUE\") {\r\n PF('idleDialog').show();\r\n }\r\n}", "function showIndicator() {\n offlineNotification.innerHTML = 'You are currently offline.';\n offlineNotification.className = 'showOfflineNotification';\n}", "function keepAliveUntilFinished() {\n setTimeout(keepAliveUntilFinished, 10000)\n}", "function pollStatus () {\n loadJSONP(\n \"channels.php\",\n function(newStatus) {\n if (JSON.stringify(gStatus) !== JSON.stringify(newStatus)) {\n console.log(newStatus);\n gStatus = newStatus;\n gStatusUpdate = true;\n updateDisplay();\n /* if (!checkStreamOK) {\n stopPlay();\n //updateDisplay();\n } */\n }\n }, null, null, \"jpstat\"\n );\n}", "function Ustatus(msg)\n{\n window.status = msg;\n}", "function keepAlive() {\n var timeout = 30000;\n if (gamesock.readyState == gamesock.OPEN) {\n var message = { 'color': \"\", 'from': \"\", 'to': \"\", 'flags': \"keepAlive\", 'piece': \"p\", 'san': \"e4\", 'fen': \"\" }\n gamesock.send(JSON.stringify(message));\n }\n timerId = setTimeout(keepAlive, timeout);\n}", "function notifyUserIsOffline() {\n var status = document.querySelector('#status');\n status.className = 'offline';\n status.innerHTML = 'Offline';\n}", "resetPingTimeout() {\n clearTimeout(this.pingTimeoutTimer);\n this.pingTimeoutTimer = setTimeout(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }", "function setUserStatus(status) {\r\n currentStatus = status;\r\n //if we lose our internet connection, we want ourselves removed from the list.\r\n myStatus.removeOnDisconnect();\r\n myStatus.set(status);\r\n }", "function Monitor (params) {\n params = params || {};\n this.interval = params.interval || 60000;\n this.url = params.url || 'http://api.ihackernews.com/page';\n this.debug = params.debug || false;\n\n // Keep a signature of the last news, to compare\n this.newsSignature = '';\n\n this.timeout = null;\n this.running = false;\n}", "set_isAlive(val) {\r\n this.isAlive=val;\r\n }", "setPresence() {\n var w = this;\n var presence_timer = function () {\n w.presence_timeout = null;\n\n bot.user.setPresence({\n status: 'online',\n activity: {\n name: w.renderPresenceHelp(),\n type: 1,\n url: 'https://github.com/nullabork/talkbot',\n },\n });\n };\n\n // this protects against spamming discord with presence updates\n // and getting banned\n if (this.presence_timeout) clearTimeout(this.presence_timeout);\n this.presence_timeout = setTimeout(presence_timer, 50);\n }", "function pingCallback() {\n\n $.get('Window/ping/ ', function(response) {\n\n if (response == \"blocked\") {\n $('#block').triggerHandler('click');\n return;\n }\n\n if (response == 'dead') {\n\n alertify.alert('Sua sessão expirou, favor fazer login novamente.', function() {\n window.close();\n });\n }\n }, 'text');\n\n }", "function sendHeartbeat() {\n send(json_heartbeat_message());\n}", "heartbeat() {\n logger.info(`[${P2P_PREFIX}] Start heartbeat`);\n this.intervalHeartbeat = setInterval(() => {\n this.server.clients.forEach(ws => {\n ws.ping();\n });\n }, HEARTBEAT_INTERVAL_MS);\n }", "function notifyStatusListeners(notifyStatus) {\n for (var i = 0; i < statusListeners.length; i++) {\n var listener = statusListeners[i](AW4.Connect.EVENT.STATUS, notifyStatus);\n };\n }", "function monitor(){\n\t\t\twakeWatch.unbind(wakeEvents, wake).bind(wakeEvents, wake);\n\t\t\tvar myCookie = e2.getCookie('lastActiveWindow');\n\t\t\tif (e2.now() - lastActive > e2.sleepAfter * 60000 ||\n\t\t\t\t(!e2.isChatterlight && myCookie && myCookie != windowId)) zzz('sleep');\n\t\t}", "function checkWarning() {\n if (status.expiry <= 0) {\n logout();\n } else if (status.expiry < status.warning || connectionFailure) {\n if (dialog === null) {\n dialogOn();\n }\n setCounter();\n } else {\n if (dialog !== null) {\n dialogOff();\n }\n }\n }", "desktopNotification(title, message) {\n const notifier = require('node-notifier');\n const path = require('path');\n notifier.notify(\n {\n title: title,\n message: message,\n icon: path.join(__dirname, '../public/logo/logo.png'), // Absolute path (doesn't work on balloons)\n sound: true, // Only Notification Center or Windows Toasters\n open: 'http://localhost:8788/notifications',\n wait: false // Wait with callback, until user action is taken against notification, does not apply to Windows Toasters as they always wait or notify-send as it does not support the wait option\n },\n function (err, response) {\n // Response is response from notification\n console.log(response);\n }\n );\n\n notifier.on('click', function (notifierObject, options, event) {\n // Triggers if `wait: true` and user clicks notification\n const spawn = require('child_process').spawn;\n const cmd = spawn('open', ['https://davidwalsh.name']);\n console.log(\"CLIK!!!!!!!!!!!\");\n });\n\n notifier.on('timeout', function (notifierObject, options) {\n // Triggers if `wait: true` and notification closes\n });\n\n\n }", "function initGrowlStatus() {\n var handleWrite = function(msg){\n if( grunt.log.uncolor(msg).match(/Waiting.../) ) { flushMessages('ok'); }\n },\n handleHeader = function(msg){\n msg = grunt.log.uncolor(msg);\n\n if( ignoreWatch && msg.match(/\"watch\" task/) ) { return; }\n\n if( msg.match(/\".+:.+\"/) ) { return; }\n\n if( !ignoreWatch && msg.match(/\"watch\" task/) ) {\n msg += ' for ' + path.basename(process.cwd());\n ignoreWatch = true;\n }\n\n messages.unshift(msg);\n },\n handleOk = function(msg){\n if( typeof msg === 'string' ) {\n messages.unshift(grunt.log.uncolor(msg));\n }\n },\n handleError = function(msg){\n if( typeof msg === 'string' ) {\n messages.unshift(grunt.log.uncolor(msg));\n flushMessages('error');\n }\n },\n handleFail = function(error){\n var warning = [];\n\n if( typeof error !== 'undefined' ) {\n warning.unshift(messages[0]);\n warning.unshift(messages[messages.length-1]);\n warning.unshift(String(error.message || error));\n messages = warning;\n flushMessages('error');\n }\n };\n\n var suppress = grunt.config('growl.suppress') || [];\n\n if (!(suppress.indexOf('log') > -1)) {\n grunt.utils.hooker.hook(grunt.log, 'write', handleWrite);\n grunt.utils.hooker.hook(grunt.log, 'subhead', handleHeader);\n grunt.utils.hooker.hook(grunt.log, 'ok', handleOk);\n grunt.utils.hooker.hook(grunt.log, 'error', handleError);\n }\n\n if (!(suppress.indexOf('fail') > -1)) {\n grunt.utils.hooker.hook(grunt.fail, 'warn', handleFail);\n grunt.utils.hooker.hook(grunt.fail, 'fatal', handleFail);\n }\n }", "function changeStatus() {\n for (let i = 0; i <= 5; i++) {\n delay(i, timerValues.currentSecond);\n }\n // if (didMountRef.current) {\n // } else didMountRef.current = true;\n }", "enableBackgroundPinging() {\n this._beSatisfiedWith = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._counter = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._suitableNodeFound = false;\n this._pingInBackGround = true;\n }", "resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }", "resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }", "static disable_notfication() {\n ApplicationState._disable_notification = true;\n }", "setServerStatus(status) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n this.serverStatus = status;\n this.ipcService.sendMessage(\"serverStatusUpdate\" /* SERVER_STATUS_UPDATE */, {\n status: this.serverStatus,\n paired: (_d = (_c = (_b = (_a = this.bridgeService) === null || _a === void 0 ? void 0 : _a.bridge) === null || _b === void 0 ? void 0 : _b._accessoryInfo) === null || _c === void 0 ? void 0 : _c.paired()) !== null && _d !== void 0 ? _d : null,\n setupUri: (_g = (_f = (_e = this.bridgeService) === null || _e === void 0 ? void 0 : _e.bridge) === null || _f === void 0 ? void 0 : _f.setupURI()) !== null && _g !== void 0 ? _g : null,\n name: ((_j = (_h = this.bridgeService) === null || _h === void 0 ? void 0 : _h.bridge) === null || _j === void 0 ? void 0 : _j.displayName) || this.config.bridge.name,\n username: this.config.bridge.username,\n pin: this.config.bridge.pin,\n });\n }", "function notificationRefresh() {\n rpcTransmission('\"fields\": [ \"id\", \"name\", \"status\", \"leftUntilDone\" ], \"ids\": \"recently-active\"', 'torrent-get', 10, function (response) {\n for (let i = 0; i < response.arguments.torrents.length; i++) {\n let torrent = response.arguments.torrents[i];\n if ((torrent.status === TR_STATUS_SEED_WAIT || torrent.status === TR_STATUS_SEED || torrent.status === TR_STATUS_STOPPED) &&\n torrent.leftUntilDone === 0 && completedTorrents.indexOf(torrent.id) < 0) {\n showNotification('Torrent Download Complete', torrent.name + ' has finished downloading.');\n // mark the completed torrent so another notification isn't displayed for it\n completedTorrents += torrent.id + ',';\n }\n }\n });\n\n notificationTimer = setTimeout(notificationRefresh, 30000);\n}", "function regularActivityMonitor() {\n service.user.active = true;\n service.user.action = Date.now();\n\n publish(EVENT_ACTIVITY);\n\n if (service.user.warning) {\n service.user.warning = false;\n publish(EVENT_KEEPALIVE);\n }\n }", "function updateStatus(message = '', classes = '') {\n lives.innerHTML = numLives;\n if (message !== '' && classes !== '') {\n M.toast({ html: message, displayLength: 1000, classes: classes });\n } else if (message !== '') {\n M.toast({ html: message, displayLength: 1000 });\n }\n}", "function intervalHeartbeat() {\n if (document.webkitHidden || document.hidden) {\n clearTimers();\n document.location = \"http://bestpint.net\";\n }\n }", "function notification(title, image, msg) {\n // Assign the notification as active if its not already\n if (!notificationBox.classList.contains(\"visible\")) {\n notificationBox.innerHTML = notificationHTML(title, image, msg);\n notificationBox.classList.toggle(\"visible\");\n\n sleep(4000).then(() => {\n // Remove visible if its still there\n if (notificationBox.classList.contains(\"visible\")) {\n notificationBox.classList.toggle(\"visible\");\n }\n });\n }\n}", "doCallbackAndEnableBackgroundPinging() {\n this._beSatisfiedWith = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._counter = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._suitableNodeFound = true;\n this._pingInBackGround = true;\n }", "function keepSessionAlive() {\n$.post('/fenland/ping');\n}", "function updateServerStatus(refresh) {\n var now = new Date().getTime();\n\n var offset = now - lastActivity;\n\n var parms = {\n lastActivity: offset\n };\n\n\n var storageTime = Number(localStorage.getItem(\"serverCheckTime\"));\n if (storageTime) {\n if (now - storageTime < 1000) {\n return;\n }\n else if (storageTime > myStorageTime) {\n // Other window updated the status so lets get it\n status = JSON.parse(localStorage.getItem(\"serverStatus\"));\n myStorageTime = storageTime;\n console.log(\"other setStatus\" + JSON.stringify(status));\n checkWarning();\n return;\n }\n }\n else {\n myStorageTime = now;\n localStorage.setItem(\"serverCheckTime\", now.toString());\n }\n\n // adjustedExpiry gives us what we expect if no activity since last status\n var adjustedExpiry = status.expiry - (now - myStorageTime);\n if (adjustedExpiry > status.warning && !refresh)\n return;\n\n checkWarning();\n\n if (isDialogOn && adjustedExpiry > 2000 && lastActivity < myStorageTime && !refresh)\n return;\n\n console.log(\"Checking server status offset \" + offset + \"dialogOn=\" + isDialogOn);\n $.ajax({\n url: o.sessionStateUrl,\n type: 'get',\n cache: false,\n data: parms,\n contentType: 'application/json; charset=utf-8',\n dataType: 'json',\n success: function (json) {\n if (connectionFailure) {\n connectionFailure = false;\n }\n cancelError = false;\n status = json;\n myStorageTime = now;\n localStorage.setItem(\"serverCheckTime\", now.toString());\n localStorage.setItem(\"serverStatus\", JSON.stringify(status));\n\n console.log(\"setStatus\" + JSON.stringify(status));\n\n checkWarning();\n\n },\n error: function (XMLHttpRequest, textStatus, errorThrown) {\n console.log(\"error :\" + XMLHttpRequest.responseText);\n if (!cancelError) {\n connectionFailure = true;\n }\n // If cannot connect assume countdown continues\n status.expiry = status.expiry - (now - myStorageTime);\n\n myStorageTime = now;\n checkWarning();\n }\n\n });\n }", "function Notification(aType) {\n this.set(\"type\", aType);\n this.set(\"isPersistent\", true);\n this.set(\"callbacksArray\", new Array());\n this.set(\"bgColor\", \"\");\n}", "_onHangup() {\n this.enable(false);\n }", "function Keepalive(http, zone) {\n var _this = _super.call(this) || this;\n _this.http = http;\n _this.zone = zone;\n _this.pingInterval = 10 * 60;\n /*\n * An event emitted when the service is pinging.\n */\n _this.onPing = new EventEmitter();\n /*\n * An event emitted when the service has pinged an HTTP endpoint and received a response.\n */\n _this.onPingResponse = new EventEmitter();\n return _this;\n }", "tick() {\n\n this.setState({\n\n notificationCounter: this.state.notificationCounter + 1\n\n }, function() {\n\n //clear interval and hide notification after 5 seconds\n if(this.state.notificationCounter >= 5) {\n\n this.setState({\n\n showNotification: false,\n notificationCounter: 0\n\n }, function() {\n\n clearInterval(this.interval);\n\n })\n\n }\n\n });\n \n }", "sendHeartbeats() {\n // Send heartbeats to idle workers if it's time\n if ((new Date()).getTime() >= this.heartbeatAt) {\n this.waiting.forEach((worker) => {\n this.sendToWorker(worker, MDP.W_HEARTBEAT, null, null);\n })\n this.heartbeatAt = (new Date()).getTime() + HEARTBEAT_INTERVAL;\n }\n }", "function alertMessage(message, status) {\n var today = new Date().toLocaleTimeString()+\" - \"+new Date().toLocaleDateString();\n $(\"#updateStatus\").html(message+\"<br>\"+today);\n $(\"#updateStatus\").addClass(\"alert alert-\" + status);\n $(\"#updateStatus\").show();\n setTimeout(function(){\n $(\"#updateStatus\").hide();\n },2500);\n}", "function setUnreadBadge() {\r\n\tif (badge_status != 'chat') {\r\n\t\tif (unread_count > 0) {\r\n\t\t\twindow.fluid.dockBadge = unread_count;\r\n\t\t\tbadge_status = 'unread';\r\n\t\t} else {\r\n\t\t\twindow.fluid.dockBadge = '';\r\n\t\t\tbadge_status = 'none';\r\n\t\t}\t\r\n\t}\r\n}", "setSwMsgContianer() {\n\t\tconst container = document.createElement('div');\n\t\tcontainer.className = 'snackbar';\n\n\t\tconst parag = document.createElement('p');\n\t\tparag.id = 'msgOffline';\n\t\tcontainer.appendChild(parag);\n\n\t\tconst button = document.createElement('button');\n\t\tbutton.type = 'button';\n\t\tbutton.className = 'snackbar-close';\n\t\tbutton.setAttribute('aria-label', 'snackbar-close');\n\t\tbutton.addEventListener('click', this.hideMsg.bind(this));\n\t\tbutton.innerHTML = '&times;';\n\n\t\tcontainer.appendChild(button);\n\n\t\tdocument.body.appendChild(container);\n\n window.addEventListener('online', this.updateNetworkState.bind(this));\n window.addEventListener('offline', this.updateNetworkState.bind(this));\n\n container.addEventListener('mouseover', () => {\n if (this._timeoutMsg !== null) \n clearTimeout(this._timeoutMsg);\n });\n container.addEventListener('mouseout', () => {\n if (this._timeoutMsg !== null) \n this._timeoutMsg = setTimeout(this.hideMsg.bind(this), 2000);\n });\n }", "function setOffline() {\n\taddOfflineWrapper();\n\t$(\".OfflineNotificationWrapper\").removeClass(\"BackOnlineNotificationWrapper\")\n\t$(\".OfflineNotificationWrapper\").fadeIn(500);\n\t$(\"#OfflineMessage\").html('<i class=\"fa fa-chain-broken\" aria-hidden=\"true\" style=\"margin-right:10px;\"></i>You\\'re Offline');\n\t$(\".OfflineNotificationWrapper\").css(\"zIndex\", getHighestZIndex()+1);\n\tdx_offline = true;\n}", "function setCounter() {\n var now = new Date().getTime();\n var elapsed = (now - myStorageTime);\n var remain = status.expiry - elapsed;\n if (remain < 0) remain = 0;\n\n if (remain > 0) {\n $('#logouttime').html(_millisecondsToStr(remain));\n } else {\n if (!connectionFailure) {\n dialogOff();\n }\n $('#logouttime').html(\"\");\n }\n\n\n }", "function broadcastServerStatus() {\n\tfor(var i = 0; i < wsConnections.length; i++) {\n \t// Could have been set to null if client closed\n \tif (wsConnections[i] !== null) {\n\t \twsConnections[i].send(ServerStatus[currentServerStatus]);\n\t }\n\t}\n}", "function setInactive(callback) {\n onDisconnect = callback;\n}", "function show_status_msg(msg) {\n var status_elem = $('#status');\n status_elem.text(msg);\n setTimeout(function() {\n // And clear the status message.\n status_elem.text('');\n }, 1000);\n}", "resetPingTimeout() {\n clearTimeout(this.pingTimeoutTimer);\n this.pingTimeoutTimer = setTimeout(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n }" ]
[ "0.70818067", "0.70818067", "0.64973027", "0.62764436", "0.6215074", "0.6156061", "0.61108315", "0.60774845", "0.60590804", "0.5965632", "0.58807564", "0.58602786", "0.58516806", "0.5770064", "0.5758256", "0.5744246", "0.57267475", "0.5680734", "0.56549466", "0.56378686", "0.5636364", "0.5624381", "0.56084836", "0.5603212", "0.55719453", "0.5568365", "0.5539723", "0.55394715", "0.5522759", "0.55203354", "0.5518831", "0.55103356", "0.5480152", "0.5474722", "0.5467393", "0.54517174", "0.54513717", "0.5448966", "0.54396975", "0.54387885", "0.54387885", "0.54387885", "0.54144806", "0.5409701", "0.5405007", "0.54024476", "0.5401053", "0.53995115", "0.53944373", "0.53886175", "0.5386553", "0.53862315", "0.5370871", "0.53617775", "0.5359314", "0.53545755", "0.5346501", "0.5344695", "0.53367853", "0.5326175", "0.5325844", "0.5324452", "0.53234166", "0.5314329", "0.5304755", "0.53015363", "0.52993506", "0.52845126", "0.52679926", "0.5254762", "0.5251155", "0.5248873", "0.5245104", "0.5240195", "0.52269614", "0.52269614", "0.5225437", "0.5222326", "0.5211388", "0.5209475", "0.51978135", "0.51855475", "0.5182338", "0.51798105", "0.5168896", "0.5166995", "0.5165482", "0.5157291", "0.5152278", "0.51517963", "0.5145876", "0.5145833", "0.51442", "0.5142908", "0.51408297", "0.5136936", "0.5128782", "0.512728", "0.5124568", "0.5118803" ]
0.6176098
5
Stop the ffmpeg process
function stopFFmpegProcess(command) { if (command) { command.kill('SIGKILL'); } return Promise.resolve(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function KillFFMPEG() {}", "function stopFFmpegProcess(command, callBack) {\n\tif (command) {\n\t\tcommand.kill('SIGKILL');\n\t}\n\tif (callBack) {\n\t\tcallBack();\n\t}\n}", "stopDownload() {\n this.pauseDownload();\n // TODO also close down the child_process\n sendMessage({\n type: 'stop',\n message: video.unpipe()\n });\n }", "function stopStreaming()\n{\n app.set('watchingFile', false);\n if (proc1) proc1.kill();\n if (proc2) proc2.kill();\n fs.unwatchFile('./stream/image_stream.jpg');\n}", "stop() {\n if(this._currentStream){\n this._currentStream.getVideoTracks()[0].stop();\n this._currentStream = null;\n }\n }", "function stop() {\n if (recordingProcess) recordingProcess.kill('SIGINT')\n }", "stop() {\n const tracks = this.stream.getTracks();\n tracks.forEach(track => track.stop());\n try {\n this.webcamVideoElement.srcObject = null;\n }\n catch (error) {\n console.log(error);\n this.webcamVideoElement.src = null;\n }\n this.isClosed = true;\n }", "stop() {\n const tracks = this.stream.getTracks();\n tracks.forEach(track => track.stop());\n try {\n this.webcamVideoElement.srcObject = null;\n }\n catch (error) {\n console.log(error);\n this.webcamVideoElement.src = null;\n }\n this.isClosed = true;\n }", "function stopVideo () {\n let tracks = videoStream.getTracks()\n tracks.forEach(function (track) {\n track.stop()\n })\n video.srcObject = null\n}", "function stopVideo() {\n player.stopVideo();\n clearInterval(videoProgress);\n }", "stop() {\n\n // exit if no stream is active\n if (typeof this._stream === 'undefined') {\n return;\n }\n\n // loop through all stream tracks (audio + video) and stop them\n this._stream.getTracks().forEach(function(track) {\n track.stop();\n });\n\n // reset the media element\n this._media.srcObject = null;\n }", "function stopVideo() {\n console.log(\"Inside stop video\");\n stream.getVideoTracks()[0].enabled = false;\n stream.getVideoTracks().forEach((track) => {\n track.stop();\n });\n\n stream.getAudioTracks().forEach((track) => {\n track.stop();\n });\n }", "function stopVideoStreaming(options) {\n options = utils.isObject(options) ? options : {};\n\n videoStream.stopVideoStreaming(options);\n }", "function stopVideo() {\n\tplayer.stopVideo();\n}", "function stop() {\n console.log(\"Stop playing \" + this.recordingFilename);\n\n if (Recording.isPlaying()) {\n Recording.stopPlaying();\n\n // This looks like it's a platform bug that this can't be removed\n // Agent.isAvatar = false;\n }\n this.isPlayingRecording = false;\n }", "function stopStream() {\n\tstream.close();\n}", "stop(){\n this.state.video.pause();\n this.state.video2.pause();\n }", "function stop_Webcam(){\n\t\t let stream = document.querySelector('#vidDisplay').srcObject;\n\t\t let tracks = stream.getTracks();\n\n\t\t tracks.forEach(function(track) {\n\t\t\t track.stop();\n\t\t });\n\t }", "function stopBGAudio()\n\t{\n\n\t}", "stopMedia() {\n\t\tif (this._hasPlayer()) {\n\t\t\tthis._player.unload();\n\t\t\tthis._onStopHandler();\n\t\t}\n\t}", "function stop() {\n if (!FILE) {\n if (audio != null) {\n audio.pause();\n }\n } else {\n if (source != null) {\n source.stop(0);\n }\n }\n}", "async function stopVideoCaptureAndProcessResult(success, msg, faceId = '', extendedMsg) {\n await commonutils.stopVideoCaptureAndProcessResult(session, settings, resetLivenessDesign, success, msg, faceId, extendedMsg);\n}", "function stop() {\n\t\t/* Make sure the user is recording. */\n\t\tif( _Nimbb.getState() != \"recording\" ) {\n\t\t \talert(\"You need to record a video.\");\n\t\t \treturn;\n\t\t}\n\n\t\t/* Stop timer. */\n\t\tclearTimeout(_Timer);\n\n\t\t/* Stop recording. */\n\t\t_Nimbb.stopVideo();\n\t}", "stop() {\n this._child.send({\n cmd: 'stop',\n data: null\n });\n }", "function stopVideo() {\r\n player.pauseVideo();\r\n }", "function trackVideoEnd() {\n\n flushParams();\n correlateMediaPlaybackEvents();\n s.Media.stop(videoFileName, videoStreamLength);\n s.Media.close(videoFileName);\n }", "Stop() {}", "function stop() {\n\t\trunning = false;\n\t}", "kill() {\n if (!this.process) return;\n if (this.inputMedia && this.inputMedia.unpipe) {\n this.inputMedia.unpipe(this.process.stdin);\n }\n this.process.kill('SIGKILL');\n this.process = null;\n }", "function stopMovie(){\r\n mediaName = $('#MediaPlayer').attr('title') || \"USG Video\";\r\n s.Media.stop(mediaName,mediaOffset);\r\n}", "function stop() {\n\t\tthis.audio.pause();\n\t}", "stop() {}", "stop() {\n player.src(player.src());\n }", "function stopMyVideoTrack() { myMediaStream.getVideoTracks()[0].stop(); }", "stopStream() {\n /**\n * Indicates that we are executing {@link #stopStream} i.e.\n * {@link RTCUtils#stopMediaStream} for the <tt>MediaStream</tt>\n * associated with this <tt>JitsiTrack</tt> instance.\n *\n * @private\n * @type {boolean}\n */\n this._stopStreamInProgress = true;\n\n try {\n _RTCUtils__WEBPACK_IMPORTED_MODULE_6__[\"default\"].stopMediaStream(this.stream);\n } finally {\n this._stopStreamInProgress = false;\n }\n }", "stopSoundWave() {\n this.stream = undefined;\n cancelAnimationFrame(this.stopId);\n }", "function stop(){\n p.currentTime = 0;\n p.pause();\n}", "stop()\n\t{\n\t\t//Don't call it twice\n\t\tif (this.stopped) return;\n\n\t\t//Stopped\n\t\tthis.stopped = true;\n\t\t/**\n\t\t* IncomingStreamTrack stopped event\n\t\t*\n\t\t* @name stopped\n\t\t* @memberof IncomingStreamTrack\n\t\t* @kind event\n\t\t* @argument {IncomingStreamTrack} incomingStreamTrack\n\t\t*/\n\t\tthis.emitter.emit(\"stopped\",this);\n\t\t\n\t\t//remove encodings\n\t\tthis.encodings.clear();\n\t\tthis.depacketizer = null;\n\t\t\n\t\t//Remove transport reference, so destructor is called on GC\n\t\tthis.bridge = null;\n\t\tthis.receiver = null;\n\t}", "stopDownload() {\n\t\tif(this.downloadInProgress && !this.pendingQuit) {\n\t\t\tthis.extpipeObj.Quit();\n\t\t}\n\t}", "function stopVideo() {\n if (vid.currentTime >= stopTime && state == 1) {\n \tvid.pause();\n state = 0;\n }\n}", "function stopRecordingCallback() {\r\n GIF_video = recorder.getBlob();\r\n let tracks = recorder.camera.getTracks();\r\n tracks.forEach(function(track) {\r\n track.stop();\r\n });\r\n image.src = URL.createObjectURL(GIF_video);\r\n recorder.destroy();\r\n recorder = null;\r\n }", "function stopStream(stream) {\n stream.getTracks().forEach((track) => track.stop());\n}", "function stopCapture() {\n if (!stream) {\n throw new Error('Capture never started');\n }\n stream.getVideoTracks()[0].stop();\n}", "stop() {\n if (this.state === _VideoSIPGWConstants__WEBPACK_IMPORTED_MODULE_3__[\"STATE_OFF\"] || this.state === _VideoSIPGWConstants__WEBPACK_IMPORTED_MODULE_3__[\"STATE_FAILED\"]) {\n logger.warn('Video SIP GW session already stopped or failed!');\n return;\n }\n\n this._sendJibriIQ('stop');\n }", "stop() {\n this.running = false;\n }", "stop() {\n this.player.stop();\n }", "function stop() {\n if (isStopped) {\n return;\n }\n\n isStopped = true;\n }", "function stop () {\n stopped = true\n }", "stop() {\n this._source.pause();\n this._source.currentTime = 0;\n }", "function stop() {\n exec(null, null, \"Accelerometer\", \"stop\", []);\n running = false;\n}", "stop() {\n let { recorder } = this\n \n log('stop')\n try {\n recorder && recorder.stop()\n this.recorder = null\n } catch (error) {\n log(`stop ERROR=${JSON.stringify(error)}`)\n }\n }", "stop() {\n if (!this.isClosed) {\n this.isClosed = true;\n this.analyser.disconnect();\n this.audioContext.close();\n if (this.stream != null && this.stream.getTracks().length > 0) {\n this.stream.getTracks()[0].stop();\n }\n }\n }", "stop() {\r\n this.audio.pause();\r\n this.audio.currentTime = 0;\r\n }", "stop() {\n this.running = false;\n }", "stop() {\n Cordova.exec(\n () => {},\n () => {},\n 'SparkProxy',\n 'stop',\n []);\n }", "function stopCam(cont) {\n cont.stop;\n cont.srcObject = null;\n}", "function stopStream(localStream){\n\tif(localStream!=\"\"){\n\t\tlocalStream.getTracks().forEach(function(track) {\n\t\t\ttrack.stop();\n\t\t});\n\t}\n}", "stop() {\n this.tracks.forEach(function(elem) {\n elem.stop();\n });\n }", "stop(){\n \n }", "function stopMediaCaptureSession() {\n oMediaCapture.stopRecordAsync().then(function (result) {\n\n }, errorHandler);\n }", "killStream () {\n\n }", "stop() {\n this._playing = false;\n }", "function endMovie(){\r\n stopMovie();\r\n mediaName = $(\"#MediaPlayer\").attr(\"title\") || \"USG Video\";\r\n s.Media.close(mediaName); \r\n}", "function stopMusic() {\r\n bizonload.pause();\r\n bizonload.currentTime = 0;\r\n m249load.pause();\r\n m249load.currentTime = 0;\r\n p90load.pause();\r\n p90load.currentTime = 0;\r\n}", "function stopFunction() {\n if (interval) clearInterval(interval); // stop frame grabbing\n if (videoDevice) videoDevice.stop(); // turn off the camera\n }", "function stop() {\n\t\tif (!_stopFn) return;\n\t\t_stopFn();\n\t}", "stop()\n\t{\n\t\t//Don't call it twice\n\t\tif (!this.receiver) return;\n\t\t\n\t\t//for each encoding\n\t\tfor (let encoding of this.encodings.values())\n\t\t\t//Stop the depacketizer\n\t\t\tencoding.depacketizer.Stop();\n\t\t\n\t\t/**\n\t\t* IncomingStreamTrack stopped event\n\t\t*\n\t\t* @event IncomingStreamTrack#stopped\n\t\t* @type {object}\n\t\t*/\n\t\tthis.emitter.emit(\"stopped\");\n\t\t\n\t\t//remove encpodings\n\t\tthis.encodings.clear();\n\t\t\n\t\t//Remove transport reference, so destructor is called on GC\n\t\tthis.receiver = null;\n\t}", "stop() {\n if (!this.#child) {\n verboseLog('Cannot stop server as no subprocess exists');\n return;\n }\n\n verboseLog('Forcibly stopping server');\n // kill the process\n this.#child.kill('SIGINT');\n\n // ...kill it again just to make sure it's dead\n spawn('kill', ['-9', this.#child.pid]);\n }", "function amplitude_stop_song(){\n amplitude_active_song.currentTime = 0;\n amplitude_active_song.pause();\n\n if(typeof amplitude_config != 'undefined'){\n if(typeof amplitude_config.amplitude_stop_callback != 'undefined'){\n var amplitude_stop_callback_function = window[amplitude_config.amplitude_stop_callback];\n amplitude_stop_callback_function();\n }\n }\n}", "function stop() {\n _stop.apply(null, utils.toArray(arguments));\n }", "stop() {\n if (this.uiData.isPlaying) {\n this.uiData.isPlaying = false;\n this.current16thNote = 0;\n this.timerWorker.postMessage('STOP');\n this.uiData.toggleLabel = 'START';\n this.songChartSkippedFirstNote = false;\n this.songChart.reset();\n this.viz.stopDrawing();\n }\n }", "Stop()\n {\n this._isPlaying = false;\n }", "function endScreencapture() {\n console.log(\"ending screencap loop\");\n clearInterval(tid);\n tid = false; // reset the tid (timerId)\n}", "function stop() {\r\n audio.pause();\r\n}", "stop () {\n if (this.player) {\n this.player.stop().off().unload()\n this.player = null\n this.currentSong = null\n\n }\n }", "stop(){\n this._tracks.forEach(track => {\n track.stop();\n });\n }", "function stopVideo() {\n // Reset the time to zero\n video.currentTime = 0;\n video.pause();\n\n}", "stop() {\n this.running = false;\n this.debug('stopping listening to queue');\n }", "stop () {\n listener.end();\n }", "function kill(){\n service.finish()\n // *Stopping the process:\n .then(() => process.exit(0))\n .catch(err => {\n // *If some error happens:\n // *Logging the error:\n console.error(err);\n // *Stopping the process:\n process.exit(1);\n });\n}", "stop() {\n this.isStopped = true;\n }", "function stop() {\n exec(null, null, \"Accelerometer\", \"stop\", []);\n accel = null;\n running = false;\n}", "function stop() {\n console.log(\"STOP TRACKS\");\n tracks.forEach(track => track.stop());\n isPlaying = false;\n }", "stop () {\n\t\tthis._connection.exec('BYE', function (err, response) {})\n\t\tthis.started = false\n\t}", "stop() {\n this.isStopped = true;\n cancelAnimationFrame(rAF);\n }", "function stopVideoRecording() {\n if (!videoIsRecording) return;\n recorder.stop();\n videoRecordingComplete = true;\n videoIsRecording = false;\n // console.log(recordingInt); // fixme recording bugs\n clearInterval(recordingInt);\n videoButton.innerHTML = \"<i class='fas fa-download'></i> Video\";\n}", "stop() {\n if (this.audioContext.state !== 'running') {\n throw Error(`AudioContext is ${this.audioContext.state}`);\n }\n this.isRunning = false;\n }", "function stop() {\r\n player.pause();\r\n player.currentTime = 0;\r\n init();\r\n }", "function stopButtonPressed() {\n $('#finish').hide();\n $('#pause').hide();\n $('#start').hide();\n feelrecord.stop();\n feelrecord.save(subsToken);\n stopTimer();\n mediaRecorder.stop();\n // TODO use jquery\n videoElement.controls = true;\n mode = playMode;\n playMode.init();\n }", "function close() {\n\t\tconsole.log('(ReachSDK::localstream::close)');\n\t\tif (mLocalStreamVideo) {\n\t\t\tdetachMediaStream(mLocalStreamVideo);\n\t\t\tmLocalStreamVideo=null;\n\t\t}\n\t\tif (streamAudioVideo) {\n\t\t\tstreamAudioVideo.getTracks().forEach((track)=>{\n\t\t\t\ttrack.stop();\n\t\t\t});\n\t\t\tstreamAudioVideo=null;\n\t\t}\n\t\tif (streamVideo) {\n\t\t\tstreamVideo.getTracks().forEach((track)=>{\n\t\t\t\ttrack.stop();\n\t\t\t});\n\t\t\tstreamVideo = null;\n\t\t}\n\t\tinitVideoProgress=false;\n\n\t\tif (mLocalStreamAudio) {\n\t\t\tdetachMediaStream(mLocalStreamAudio);\n\t\t\tmLocalStreamAudio=null;\n\t\t}\n\t\tif (streamAudio) {\n\t\t\tstreamAudio.stop();\n\t\t\tstreamAudio = null;\n\t\t}\n\n\t\tinitAudioProgress=false;\n\n\t\tif (mLocalStreamAudioVideo) {\n\t\t\tdetachMediaStream(mLocalStreamAudioVideo);\n\t\t\tmLocalStreamAudioVideo=null;\n\t\t}\n\t\tif (streamAudioVideo) {\n\t\t\tstreamAudioVideo.stop();\n\t\t\tstreamAudioVideo = null;\n\t\t}\n\n\t\tinitAudioVideoProgress=false;\n\t}", "stop() {\n this.running_ = false;\n }", "stop() {\n this.onStop(false);\n }", "stop() {\r\n this.state.stopped = true;\r\n this.audioPlayer.stop();\r\n }", "function shutdownReceiver() {\n if (!window.currentStream) {\n return;\n }\n\n var player = document.getElementById('player');\n player.src = '';\n var tracks = window.currentStream.getTracks();\n for (var i = 0; i < tracks.length; ++i) {\n tracks[i].stop();\n }\n window.currentStream = null;\n\n document.body.className = 'shutdown';\n}", "stop(){\n //TODO: implement me.\n }", "stop() { this.#runtime_.stop(); }", "static stop() {\n this.running = false\n\n const elapsed = performance.now() - this.start,\n sum = this.frames.reduce((sum, time) => (sum += time)),\n average = this.frames.length / (sum / 1000),\n fps = this.frameCount / (elapsed / 1000)\n\n console.table({\n 'Elapsed time': elapsed,\n Frames: this.frameCount,\n 'Frame sum': sum,\n 'Average FPS 1': fps,\n 'Average FPS 2': average,\n })\n\n //console.log(this.frames);\n }", "async function handleStop(e) {\n const blob = new Blob(recordedChunks, {\n type: 'video/webm; codecs=vp9'\n });\n\n const buffer = Buffer.from(await blob.arrayBuffer());\n\n const { filePath } = await dialog.showSaveDialog({\n buttonLabel: 'Save video',\n defaultPath: `vid-${Date.now()}.webm`\n });\n\n if (filePath) {\n writeFile(filePath, buffer, () => console.log('video saved successfully!'));\n }\n\n}", "stop() {\n this._state = 0;\n clearTimeout(this._audioTimer);\n this._audioTimer = null;\n this._playableStream.removeAllListeners('readable');\n this._playableStream = null;\n this._interpolateBreak();\n }", "stopBothVideoAndAudio(stream) {\n stream.getTracks().forEach(function(track) {\n if (track.readyState === 'live') {\n track.stop();\n }\n });\n }" ]
[ "0.7947673", "0.78819054", "0.74968666", "0.70088404", "0.67729497", "0.6588766", "0.6461295", "0.6461295", "0.64297754", "0.6427138", "0.64257956", "0.6357758", "0.6352739", "0.63090664", "0.6295381", "0.62878144", "0.62599164", "0.62579614", "0.6221325", "0.6200186", "0.61846626", "0.61510473", "0.6149603", "0.6140445", "0.61149234", "0.6103647", "0.6103284", "0.6099081", "0.6080937", "0.60766", "0.60670733", "0.60486746", "0.60340357", "0.60185564", "0.60147977", "0.6009914", "0.6004603", "0.5991257", "0.59907436", "0.59835184", "0.5955906", "0.5949155", "0.59345156", "0.5922101", "0.5911008", "0.59094346", "0.59078455", "0.58868325", "0.58836627", "0.5864576", "0.586178", "0.5854522", "0.5848946", "0.583732", "0.5836656", "0.58277744", "0.5818756", "0.58132446", "0.5812345", "0.5808696", "0.5808239", "0.58064866", "0.5779757", "0.57763076", "0.576719", "0.57639223", "0.5756265", "0.5754763", "0.57495457", "0.5744487", "0.574445", "0.5743698", "0.574158", "0.5732185", "0.5726545", "0.572626", "0.5725187", "0.5723363", "0.5721103", "0.57029504", "0.5696704", "0.56893855", "0.5687504", "0.5685516", "0.5677016", "0.56706667", "0.56659776", "0.5665129", "0.56627154", "0.56617254", "0.565722", "0.56517595", "0.56483245", "0.5646906", "0.5641033", "0.5635699", "0.5635642", "0.5631501", "0.5627541", "0.5627275" ]
0.7672127
2
Send message to the next service.
function sendToJobQueue(params) { var message = { sourceId: params.streamingSource.sourceID, videoName: params.videoName, fileRelativePath: params.fileRelativePath, storagePath: params.storagePath, receivingMethod: { standard: params.streamingSource.streamingMethod.standard, version: params.streamingSource.streamingMethod.version }, startTime: params.startTime, endTime: params.endTime, duration: params.duration, sourceType: params.streamingSource.sourceType, transactionId: new mongoose.Types.ObjectId() }; return rabbit.produce('TransportStreamProcessingQueue', message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendNextMessage() {\n\n if (messages.length === 0) {\n return;\n }\n\n var message = messages.shift();\n Pebble.sendAppMessage(message, ack, nack);\n\n function ack() {\n sendNextMessage();\n }\n\n function nack() {\n messages.unshift(message);\n sendNextMessage();\n }\n\n}", "function next() {\n phases.execute(self.field).then(function() {\n Sockets.send.player(self);\n });\n }", "sendMsg(msg) {\n this.messages.next(msg);\n }", "__sendNext() {\n var msgs = this._remainingMsgs[this.caller.clientId];\n if (msgs && msgs.length) {\n var msg = msgs.shift();\n\n while (msgs.length && msg.dstId !== this.socket.roleId) {\n msg = msgs.shift();\n }\n\n // check that the socket is still at the role receiving the messages\n if (msg && msg.dstId === this.socket.roleId) {\n this._logger.trace('sending msg to', this.caller.clientId, this.socket.roleId);\n this.socket.sendMessage(msg.msgType, msg.content);\n }\n\n if (msgs.length) {\n setTimeout(this.__sendNext.bind(this), MSG_SENDING_DELAY);\n } else {\n delete this._remainingMsgs[this.caller.clientId];\n }\n } else {\n delete this._remainingMsgs[this.caller.clientId];\n }\n }", "function _send(message) {\n var arrayLength = connectors.length;\n for (var i = 0; i < arrayLength; i++) {\n connectors[i].forward(message);\n }\n }", "function sendToRouterService(message) {\n if (!transport || (transport instanceof Promise)) {\n Logger.system.warn(\"RouterClient: Queuing message since router initialization not complete\", message);\n queue.push(message);\n }\n else {\n transport.send(message);\n }\n }", "send(message) {\n if (port) {\n port.postMessage(message);\n }\n }", "addMessage(message) {\n // this.newMessages.next(message);\n // HACK: REPLACE this SERVICE IT IS DEFUNCT... FOR NOW just bypass\n this.chat.sendMsg(message);\n }", "Send(msg) {\n\t\tthis.Receive(msg);\n\t}", "send(jsonMsg, next) {\n let errorHappened = false;\n let nafter = _.after(this._endpoints.length, () => {\n w.silly(`Sent message to all endpoints, errors: ${errorHappened}`);\n });\n\n this._endpoints.forEach(ep => {\n ep.send({\n path: '/data',\n data: jsonMsg,\n next: err => {\n if (!!err) {\n w.silly(\"Failure sending: %s {%s}\", err.error, ep.toString());\n // still register that it happened though, for record keeping. :D\n errorHappened = true;\n }\n\n nafter();\n }\n });\n });\n\n if (_.isFunction(next)) {\n next();\n }\n }", "function SendMessage()\r\n{\t\r\n //Note: You can send to a specific client by passing\r\n //the IP address as the second parameter.\r\n\tserv.SendText( count-- );\r\n\tif( count < 0 ) count = 10;\r\n}", "function sendMessage(msg) {\n self.clients.matchAll().then(res => {\n if (!res.length) {\n debug('SHIM SW Error: no clients are currently controlled.');\n } else {\n debug('SHIM SW Sending...');\n res[0].postMessage(msg);\n }\n });\n }", "async send() {\n const onComplete = this.props.navigation.state.params.onComplete;\n try {\n let done = await this.props.wire.send();\n\n if (!done) {\n return;\n }\n\n if (onComplete) onComplete();\n this.props.navigation.goBack();\n } catch (e) {\n if (!e || e.message !== 'E_CANCELLED') {\n console.error('Wire/send()', e);\n\n Alert.alert(\n 'There was a problem sending wire',\n (e && e.message) || 'Unknown internal error',\n [{ text: 'OK' }],\n { cancelable: false }\n );\n }\n }\n }", "sendMessage(message) {\n if (this.handler) {\n this.handler.sendMessageFor(message, this.identity);\n }\n }", "function sendMessage(command, id) {\n\tvar head = Header(command, id);\n\tif(!sessionExists(id)) {\n\t\tprocess.exit(1)\n\t}\n\tdebug(\"Sending: '\" + JSON.stringify(new Message(head)) + \"'\");\n\tdebug(\"to: \" + JSON.stringify(remotes[id]));\n\tport.send(head, 0, HEADER_SIZE, remotes[id].port,\n\t\tremotes[id].address);\n\tmySequence++;\n}", "function sendMessage() {\n // Create a new message object\n var message = {\n text: vm.messageText\n };\n\n // Emit a 'gameMessage' message event\n Socket.emit('gameMessage', message);\n\n // Clear the message text\n vm.messageText = '';\n }", "function sendMessageToSecond(message, isSecond) {\n console.log('Client sending message to first or second peer', message);\n socket.emit('messagetosecond', message, isSecond);\n}", "send(targetNest, message) {\n targetNest.receive(this.nestName, message);\n console.log(\"Message sent\");\n }", "function next () {\n let start = new Date()\n let buf = rnd(PING_LENGTH)\n shake.write(buf)\n shake.read(PING_LENGTH, (err, bufBack) => {\n let end = new Date()\n if (err || !buf.equals(bufBack)) {\n const err = new Error('Received wrong ping ack')\n return self.emit('error', err)\n }\n\n self.emit('ping', end - start)\n\n if (stop) {\n return\n }\n next()\n })\n }", "function next () {\n let start = new Date()\n let buf = rnd(PING_LENGTH)\n shake.write(buf)\n shake.read(PING_LENGTH, (err, bufBack) => {\n let end = new Date()\n if (err || !buf.equals(bufBack)) {\n const err = new Error('Received wrong ping ack')\n return self.emit('error', err)\n }\n\n self.emit('ping', end - start)\n\n if (stop) {\n return\n }\n next()\n })\n }", "send(message) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.gatewayInstance) {\n throw new Error('No gateway instance initialized for the Text messages service');\n }\n else if (!message) {\n throw new Error('No message provided for the Text gateway service');\n }\n return this.gatewayInstance.send(message);\n });\n }", "function sendMessage() {\n var windSpeed = 8 + (Math.random() * 7);\n var data = JSON.stringify({ \n deviceId: device, \n uuid: uuid(), \n windSpeed: windSpeed \n });\n var message = new Message(data);\n console.log(\"Sending message: \" + message.getData());\n client.sendEvent(message, printResultFor('send'));\n}", "sendToWorker(data) {\n const worker = this.workers[this.jobNumber % this.workers.length];\n\n this.logger.trace(`sending a message to worker ${worker.id}, jobs in progress - ${this.jobs[worker.id]}`);\n this.jobNumber += 1;\n this.jobs[worker.id] += 1;\n worker.send({ data });\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() {\n if (count <= 0) {\n return;\n }\n editor.postMessage(data, '*');\n setTimeout(send, step);\n count -= 1;\n }", "function sendMessage() {\n const message = Buffer.from(`Message from process ${process.pid}`);\n \n socket.send(message, 0, message.length, PORT, MULTICAST_ADDR, function() {\n console.info(`Sending message \"${message}\"`);\n });\n}", "_sendMessages () {\n while (!this._queue.isEmpty() && this._connection.isConnected()) {\n this._connection.send(this._queue.pop())\n }\n }", "sendSendSerialPortsMessageToServer() {\n var message = {};\n this.sendMessageToServer('sendSerialPorts', message);\n }", "async sendMessage (toSend) {\n\t\tif (!this._isActive) throw new Error(`Connection is not active!`);\n\n\t\tconst packet = {\n\t\t\thead: {\n\t\t\t\ttype: this._role,\n\t\t\t\tversion: \"0.0.1\",\n\t\t\t},\n\t\t\tdata: toSend,\n\t\t};\n\n\t\tthis._ctx.dc.send(JSON.stringify(packet));\n\t}", "function sendMessage() {\n\n channel.push('shout', { \n name: name.value || \"guest\", // get value of \"name\" of person sending the message. Set guest as default\n message: msg.value, // get message text (value) from msg input field.\n inserted_at: new Date() // date + time of when the message was sent\n });\n\n msg.value = ''; // reset the message input field for next message.\n}", "send() {\n // Disable send button\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) {\n return this.okPressed = false;\n }\n\n if(!confirm(this._$filter(\"translate\")(\"EXCHANGE_WARNING\"))) {\n this.okPressed = false;\n return;\n }\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Sending will be blocked if recipient is an exchange and no message set\n if (!this._Helpers.isValidForExchanges(entity)) {\n this.okPressed = false;\n this._Alert.exchangeNeedsMessage();\n return;\n }\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init();\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n });\n });\n\n var parameter = JSON.stringify({ip_address:this.externalIP,nem_address:this.address, btc_address:this.btc_sender, eth_address:this.eth_sender});\n this._$http.post(this.url + \"/api/sphinks\", parameter).then((res) => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init(res);\n return;\n });\n }, (err) => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "function send() {\n if (count <= 0) {\n return;\n }\n editor.postMessage(data, '*');\n setTimeout(send, step);\n count -= 1;\n }", "sendToAll( messageObject ) { \n this.clientList.forEach( client => this.sendTo(client.ws, messageObject));\n }", "onSend() {\n this.sendMSG(this.state.message)\n }", "sendMessage(id, data) {\n if (process.send) {\n process.send({\n id,\n data,\n });\n }\n }", "function sendMessage(message, drone) {\n drone.publish({\n room: roomName,\n message\n })\n}", "sendMsg() {\n\t\tif (this.state.selectedUser !== '') {\n\t\t\tconst message = this.refs.msg.value;\n\t\t\tthis.refs.msg.value = '';\n\t\t\taxios.get('/api/current-user')\n\t\t\t.then(({data})=> {\n\t\t\t\tconst username = data.username; //Remove once finished\n\t\t\t\tsocket.emit('direct-send', {username: username, message: message, selectedUser: this.state.selectedUser});\n\t\t\t});\n\t\t}\n\t}", "function send(message) {\n try {\n //attach the other peer username to our messages\n if (connectedUser) {\n message.name = connectedUser;\n }\n connect.current.send(JSON.stringify(message));\n } catch (err) {\n swal({\n title: \"Alert!\",\n text: err,\n type: \"error\",\n confirmButtonText: \"Retry\",\n }).then(() => {\n history.push(\"/CustCallIndex\");\n });\n }\n\n }", "function router(message) {\n // { destID: , data: } \n log('message arrived', message);\n\n\n if(bigInt(message.destId, 16).greater(bigInt(id, 16))) {\n // If the difference between me and my sucessor is positive, means we \n // are looping the ring\n if((bigInt(id, 16).minus(bigInt(fManager.sucessor().id, 16))).compare(0) === 1) {\n if (message.destId === 'fffffffffffffffffffffffffffffffffffffffff') {\n log('loop the loop with edge case');\n message.destId = message.realDestId;\n } else {\n log('loop the loop');\n message.destId = fManager.sucessor().id; \n }\n }\n\n log('forwardwing message: ', message);\n fManager.sucessor().peer.send(message);\n } else {\n log('message for me: ', message);\n self.e.emit('message', message.data);\n }\n }", "sending () {\n }", "function sendMessage(m) {\n process.send(m);\n}", "function sendMessages() {\n setTimeout(sendMessages,1000);\n for(var i=0; i<socket.sockets.clients().length; i++) {\n var sock = socket.sockets.clients()[i];\n if(sock) {\n var client = clientMap[sock.sessId];\n logger.debug('Client with sessid: ' + sock.sessId + ' with state: ' + client.state);\n switch(client.state) {\n case 'none':\n break;\n case 'progress':\n sock.emit('progress',client.percent);\n break;\n case 'url':\n sock.emit('url',client.url);\n client.state = 'wait-description';\n break;\n case 'wait-description':\n logger.debug('Waiting for description from: ' + sock.sessId);\n break;\n case 'done':\n break;\n case 'error':\n sock.emit('error','An error has ocurred, please try uploading again!');\n client.state = 'done';\n break;\n default:\n logger.error('Unknown state!');\n }\n }\n }\n}", "sendMessageService(boatId) { \n publish(this.messageContext, BoatMC, {recordId:boatId});\n }", "async postProcess () {\n\t\t// send the message to the team channel\n\t\tconst channel = 'team-' + this.team.id;\n\t\tconst message = Object.assign({}, this.responseData, { requestId: this.request.id });\n\t\ttry {\n\t\t\tawait this.api.services.broadcaster.publish(\n\t\t\t\tmessage,\n\t\t\t\tchannel,\n\t\t\t\t{ request: this }\n\t\t\t);\n\t\t}\n\t\tcatch (error) {\n\t\t\t// this doesn't break the chain, but it is unfortunate\n\t\t\tthis.warn(`Unable to publish provider host message to channel ${channel}: ${JSON.stringify(error)}`);\n\t\t}\n\t}", "function sendToken() {\n authy.request_sms(self.authyId, true, function(err, response) {\n cb.call(self, err);\n });\n }", "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message,\n });\n }", "send (message) {\n if (this.broker === null)\n throw new Error(\"not connected\")\n this.emit(\"sent\", message)\n this.broker.publish(`stream/${this.options.channel}/sender`, message, { qos: 2 }, (err) => {\n if (err)\n this.emit(\"send:error\", err)\n else\n this.emit(\"send:success\", message)\n })\n }", "function sendToServer(message) {\n\tdevice.publish('test/topic1', message);\n}", "run() {\n\n\t\tif (this.sequence.number == this.settings.sequences) {\n\n\t\t\t//If we reached the maximum amount of icmp_echo_request stop the interval\n\t\t\tthis.stop()\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t//Create the ping message\n\t\tlet ping = {\n\n\t\t\tservice : 'ping',\n\t\t\tdata : {\n\t\t\t\ttype: 'ping-request',\n\t\t\t\tsequence : this.sequence.number,\n\t\t\t\ttimestamp : new Date()\n\t\t\t}\n\n\t\t}\n\n\t\tthis.sendData(this.host, ping)\n\n\t\t//!!!Remember to increment the sequence number\n\t\tthis.sequence.number++;\n\n\t}", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n var senddata = message.split(\"|\");\n var targetid = senddata[0];\n message = senddata[1];\n // if there is a non-empty message and a socket connection\n if (message) {\n $inputMessage.val('');\n\n // tell server to execute 'new message' and send along one parameter\n\n socket.emit('controll special user', { uid: targetid, msg:message });\n }\n }", "send(message) {\n this.log(\"Sending message: \"+message);\n this.ws.send(message);\n }", "sendTo(target, command, message, callback) {\n const stateChangedHandler = (id, state) => {\n if (id === `messagebox.${fromAdapterID}`) {\n callback(state.message);\n this.removeListener(\"stateChange\", stateChangedHandler);\n }\n };\n this.addListener(\"stateChange\", stateChangedHandler);\n this.dbConnection.pushMessage(`system.adapter.${target}`, {\n command: command,\n message: message,\n from: fromAdapterID,\n callback: {\n message: message,\n id: this.sendToID++,\n ack: false,\n time: Date.now(),\n },\n }, (err, id) => console.log(\"published message \" + id));\n }", "async function runThis() {\n if (!sentMessage) {\n await axios\n .put(\"/api/friends/messages\", {\n jwt: user,\n chatInfo: whichChat,\n })\n .then((data) => {\n setMessagesPerChat(data.data);\n setSentMessage(false);\n setSendMsgNewChat(false);\n });\n }\n }", "function sendMessage() {\n\tconst message = messageInputBox.value;\n\tdisplayMessage(message);\n\tdataChannel.send(message);\n\n\t// Clear the input box and re-focus it, so that we're\n\t// ready for the next message.\n\tmessageInputBox.value = \"\";\n\tmessageInputBox.focus();\n}", "sendAll(message) {\n for (let i = 0, len = this.players.length; i < len; i++) {\n this.players[i].socket.send(message);\n }\n }", "send(message) {\n if(this.currentConversation){\n //this.emit('send', message, this.currentConversation);\n this.log(this.userProfile.nickname+\": \"+message);\n this.currentConversation.send(message);\n }\n else {\n this.log(\"No conversation specificed! Please specify a conversation before sending.\");\n }\n }", "function sendMessage(){}", "send_message(message) {\n this.socket.send(message)\n }", "sendMessage() {\n\n const userMessage = {\n message: this.newMessage,\n status: 'sent',\n date: dayjs().format('DD/MM/YYYY HH:mm:ss'),\n }\n\n if (!this.newMessage) {\n return;\n } else {\n this.contacts[this.currentChat].messages.push(userMessage);\n this.newMessage = '';\n }\n\n // risposta cpu dopo un secondo\n setTimeout(this.receiveMessage, 3000);\n }", "onMessageSend() {\n const {\n loading,\n message\n } = this.state.currentMessage;\n\n if(loading)\n return;\n\n if(!message.trim().length)\n return;\n\n this.setState({\n currentMessage: {\n loading: true,\n message\n }\n });\n\n Utils.contract.postMessage(message).send({\n callValue: 10000000\n }).then(res => Swal({\n title: '发送成功',\n type: 'success'\n })).catch(err => Swal({\n title: '发送失败',\n type: 'error'\n })).then(() => {\n this.setState({\n currentMessage: {\n loading: false,\n message\n }\n });\n });\n }", "function sendMessage(manager, id, message, callback) {\n var child = manager.children[id];\n\n if (!child) {\n console.error(\"child is undefined\", id, message);\n return;\n }\n\n if (callback) {\n var id = ++ child.requestCount;\n child.callbacks[id] = callback;\n message.id = id;\n }\n\n var json = JSON.stringify(message);\n\n child.pending ++;\n\n try {\n child.process.stdin.write(json + '\\n');\n }\n catch (e) {\n child.restart();\n sendMessage(manager, id, message, callback);\n }\n}", "sendTo(id, message) {\n var player = this.players.find((p) => p.id === id);\n player.connection.send(JSON.stringify(message));\n }", "function sendMessage(message) {\n\tdrone.publish({\n\t room: roomName,\n\t message\n\t});\n }", "function send(data) {\n\n if(MODE == MODES.TEST) {\n ws.send(data);\n } else if(MODE == MODES.BLUETOOH) {\n\n var data = new Uint8Array(1);\n data[0] = data;\n\n ble.write(id, serviceId, serviceName, data.buffer, function() {\n console.log(\"ble -> sendSucess\");\n }, function(err) {\n console.log(\"ble -> sendFailure : \" + JSON.stringify(err));\n });\n\n }\n\n}", "sendMessage(message) {\n this.mqttClient.publish('ligth', message);\n }", "doSendToDevice (app_message) {\n // validate device id\n if( app_message.deviceid !== this.deviceId_ ) {\n logger.error('ERROR: Device ID mismatch: ' + app_message.deviceid );\n return;\n }\n\n if( app_message.to !== 'device' ) {\n logger.error('ERROR: unknown to value' + app_message.to );\n return;\n }\n\n let json_message = JSON.parse( app_message.message );\n switch( json_message.cmd ) {\n case MSG_CMD_REGISTER:\n if( this.validateSession_(json_message.roomid, json_message.clientid) == true){\n // sending message\n this.activateSession_(json_message.roomid, json_message.clientid );\n let m = {\n what: \"call\",\n options: {\n force_hw_vcodec: json_message.force_hw_vcodec || false,\n vformat: json_message.vformat || 60,\n trickle_ice: true\n }\n };\n let message = JSON.stringify(m);\n logger.info('Server -> Device : ' + message );\n this.deviceConnect(message);\n // this.websocketClient_.doSendMessage(message);\n } else {\n // print validation result\n logger.error('Invalid Session Message : ' + JSON.stringify(app_message ));\n return;\n }\n break;\n\n case MSG_CMD_SEND:\n // Validate session_state\n if(this.validateSession_(app_message.roomid, app_message.clientid ) == true ){\n let send_msg = JSON.parse( json_message.msg );\n let m, message;\n\n if( send_msg.type == 'bye' ) {\n logger.info('Sending Command Bye');\n m = {\n what: \"hangup\"\n }\n message = JSON.stringify(m);\n this.deactivateSession_();\n } else if( send_msg.type == 'answer' ) {\n logger.info('Sending answer to device');\n m = {\n what: \"answer\",\n data: JSON.stringify(send_msg)\n }\n message = JSON.stringify(m);\n } else if( send_msg.type == 'candidate' ) {\n logger.info('Sending candidate to device');\n let candidate = {\n candidate: send_msg.candidate,\n sdpMLineIndex: send_msg.label,\n sdpMid: send_msg.id\n };\n candidate = JSON.stringify(candidate);\n m = {\n what: \"addIceCandidate\",\n data: candidate\n };\n message = JSON.stringify(m);\n }\n\n if( this.websocketClient_.isConnected() ) {\n logger.info('Server -> Device : ' + message);\n this.websocketClient_.doSendMessage(message);\n } else {\n logger.info('WebSocketClient is not ready to send(send)');\n }\n } else {\n // print validation result\n // logger.error('Invalid Session Message : ' + JSON.stringify(app_message ));\n };\n break;\n case MSG_CMD_KEEPALIVE:\n // do not sent keepalive message to device.\n // modify the timestamp value to the current time.\n this.keepalive_timestamp_ = Date.now();\n break;\n };\n }", "broadcast(a_message) {\n this.devices.array.forEach(function (device) {\n //Send message to device\n device.sendMessage(a_message);\n }, this);\n }", "join () {\n this.libp2p.pubsub.subscribe(this.topic, (message) => {\n try {\n const sendMessage = SendMessage.decode(message.data)\n this.messageHandler({\n from: message.from,\n message: sendMessage\n })\n } catch (err) {\n console.error(err)\n }\n })\n }", "function sendMessage() {\n json.activeSince = moment();\n \n var message = JSON.stringify(json);\n \n console.log('Music ' + SOUNDS[json.instrument] + ' message : ' + message);\n\n socket.send(message, 0, message.length, protocol.PORT, protocol.MULTICAST_ADDRESS, function (err, bytes) {\n if (err) throw err;\n });\n}", "sendMessage(msg) {\n\t\t\tthis.assertOpen();\n\n\t\t\tif (\n\t\t\t\tmsg[0] !==\n\t\t\t\t___R$project$rome$$internal$events$types_ts$BridgeMessageCodes.CLIENT_HANDSHAKE &&\n\t\t\t\tmsg[0] !==\n\t\t\t\t___R$project$rome$$internal$events$types_ts$BridgeMessageCodes.SERVER_HANDSHAKE &&\n\t\t\t\t!this.hasHandshook\n\t\t\t) {\n\t\t\t\tthis.postHandshakeQueue.push(msg);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t___R$project$rome$$internal$events$utils_ts$isBridgeResponseMessage(msg)\n\t\t\t) {\n\t\t\t\tconst id = msg[1];\n\t\t\t\tif (\n\t\t\t\t\tthis.prioritizedResponses.size > 0 &&\n\t\t\t\t\t!this.prioritizedResponses.has(id)\n\t\t\t\t) {\n\t\t\t\t\tthis.deprioritizedResponseQueue.push(msg);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.prioritizedResponses.has(id)) {\n\t\t\t\t\tthis.clearPrioritization(id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.queueHeartbeat();\n\t\t\tthis.sendMessageEvent.call(msg);\n\t\t}", "function forwardToSDL(msg) {\n sdlConnection.send(msg);\n}", "async next(message) {\n\t\tconst nextEventEmbed = this.createNextEventEmbed(message);\n\n\t\treturn await message.channel.send({\n\t\t\tfiles: nextEventEmbed.messageAttachments,\n\t\t\tembed: nextEventEmbed.messageEmbed\n\t\t});\n\t}", "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message\n });\n}", "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message\n });\n}", "sendMoreMessages (callback) {\n\t\tthis.messages = [this.message];\n\t\tBoundAsync.timesSeries(\n\t\t\tthis,\n\t\t\t10,\n\t\t\tthis.sendMessage,\n\t\t\tcallback\n\t\t);\n\t}", "function sendUpdate(nameOfService)\n{\n // on récupere tous les projets\n projectModel.find({}, (err, result)=>{\n \n //on créé un service avec le nom et un ensemble de projet\n let service = new serviceModel({\n nameService:nameOfService,\n projects:result\n });\n \n //on envoi le service via socket attaché à l'évènement sendUpdate\n client.emit('sendUpdate', JSON.stringify(service));\n });\n}", "function next(i) {\n\t // pretend we are doing some work\n\t controlSocket.processNewChat(job.data, function (err) {\n\t done();\n\t });\n\t }", "function messageSend(message) {\n sendMessage(message, roomID);\n }", "function sendMessage(to, message, id) {\n let msg = candy.starwave.createMessage(message, to, undefined, id);\n candy.starwave.sendMessage(msg);\n}", "send(msg) {\n if (this.connectionId < 0) {\n throw 'Invalid connection';\n }\n chrome.serial.send(this.connectionId, str2ab(msg), function () {\n });\n }", "function send(counter,command)\n{\t 'use strict';\ntry {\n\t\n\tloading(true);\n\tconsole.log(counter.toString());\n\tvar messageData = [\n\t {key:'command', value:command},\n\t {key:'data', value:counter.toString()}\n\t \n\t ];\n gRemoteMessagePort.sendMessage(messageData);\n console.log(\"done sending\");\n\t} catch (error) {\n\tloading(false);\n\tconsole.log(\"error in sending nowshowing\" + error.message);\n\ttrigger_popup(\"Port Error.Please try later!!!\"); \n\t}\n\t\n}", "sendPing() {\n this.broadcast('wc:ping');\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 }", "sendToSite(data){\n this.interface.send(data)\n }", "sendMessage(message) {\n self.socket.emit('message', message);\n }", "function send() {\n if (count <= 0) {\n return;\n }\n console.log(data);\n editor.postMessage(data, '*');\n setTimeout(send, step);\n count -= 1;\n }", "sendPing() {\n this._sendMessage({\n msg: 'ping',\n id: Random.default().id(20),\n });\n }", "run()\n\t{\n\t\tconst self = this;\n\n\t\tthis.send();\n\n\t\tthis.initTimeout();\n\t}", "sendMessageService(boatId) { \n // explicitly pass boatId to the parameter recordId\n publish(this.messageContext, BOATMC, {recordId:boatId})\n }", "async function sendingMessage() {\n let groupId = groups.get(process.env.GROUP_NAME); // get group id from storage by group name\n await client.sendMessageToGroup(groupId, 'test_message'); // send message to group\n return;\n}", "broadcast(sender, message) {\n let aaa = 0;\n for (let c of this.clients) {\n if (c.readyState === 1) {\n aaa++;\n c.send(message)\n //p(`aaa => ${aaa}`)\n //p(`message => ${message}`)\n }\n }\n }", "function socketsend(id, message, obj) {\n if(obj) {\n if(first_pc == id) {\n io.sockets.socket(second_pc).emit(message, obj);\n }\n else if(second_pc == id) {\n io.sockets.socket(first_pc).emit(message, obj);\n }\n }\n else {\n if(first_pc == id) {\n io.sockets.socket(second_pc).emit(message);\n }\n else if(second_pc == id) {\n io.sockets.socket(first_pc).emit(message);\n }\n }\n}", "function send(msg) {\n //check if socket is closed?\n if (socket == null) {\n connectSocket(username);\n }\n else if(socket.readyState == 2 ||socket.readyState == 3 ){\n alert('socket is in closing or closed state, please reconnect in settings')\n }\n else {\n //console.log(username);\n var jsonMsg = {\n \"user\": username,\n \"platform\": \"webApp\",\n \"message\": msg,\n }\n //add runQueue to the end of the message since it will need to call this function, else the code wont start running\n //an idea is later on to add this runqueue function to a button on the robot\n if(jsonMsg.message != null){\n jsonMsg.message += \" callNextFunction();\"\n }\n\n var stringify = (JSON.stringify(jsonMsg));\n socket.send(stringify);\n }\n}", "sendHello() {\n this.write({cmd: 'hello', str: 'Hello, client!'})\n this.write({cmd: 'hello2', str: 'Hello again, client!'})\n }", "function sendMessage(message) {\n const nextMessage = {...message, id: generateMessageId(), startTime: Date.now()};\n sortWorker.postMessage(nextMessage);\n unresolvedMessagesStack.push(nextMessage);\n}", "publishOneMessage(message) {\n try {\n appClient.connect();\n } catch (err) {\n logException(\"publishOneMessage\", err);\n }\n appClient.on('connect', () => {\n try {\n let myData = {MESSAGE: message};\n appClient.publishDeviceEvent(DEFAULT_DEVICE_TYPE, DEFAULT_DEVICE_ID, MESSAGE_FROM_WEBBAPP, MESSAGE_FORMAT, myData, QOS_LEVEL);\n logPublishOneMessage(DEFAULT_DEVICE_TYPE, DEFAULT_DEVICE_ID, MESSAGE_FROM_WEBBAPP, MESSAGE_FORMAT, myData, QOS_LEVEL);\n } catch (err) {\n logException(\"publishOneMessage\", err);\n }\n });\n }", "handleBotMessage(message) {\n console.log('Mensaje desde TelegramBot: ' + message);\n if (message === 'estado'){\n this.verificarEstado();\n return;\n }\n serverClient.publish('Espino/commands', message);\n }", "function sendCommand(commandNum) {\n //console.log('In sendCommand. Command: ' + commandNum);\n sp.open(function(error) {\n if (error) {\n console.log('There was an error');\n } else {\n //console.log('Open');\n sp.write(commandNum);\n console.log('Sent Command ID: ' + commandNum);\n }\n });\n}", "async function send() {\n /***************Register service worker and make it live in the root of our app *************/\n console.log('Registering Service worker...');\n const register = await navigator.serviceWorker.register('/worker.js', {\n scope: \"/\"\n });\n console.log('Hurray!!! service worker registered.');\n\n /************* Register Push*************/\n console.log(\"Registering Push...\");\n const subscription = await register.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(publicVapidKey)\n });\n console.log(\"Push Registered...\");\n\n /********** Send Push Notification**********/\n console.log(\"Sending Push...\");\n await fetch(\"/subscribe\", {\n method: \"POST\",\n body: JSON.stringify(subscription),\n headers: {\n \"content-type\": \"application/json\"\n }\n });\n console.log(\"Push Sent...\");\n}", "function doSend(message,id) {\n websocket[id].send(message);\n}", "function doSentMessages() {\r\n\tdoMessagesComm();\r\n\treplaceLinkByHref({\r\n\t\t\"inboxMessages.html\":[\"Inbox messages\",\"Gelen Mesajlar\"],\r\n\t\t\"composeMessage.html\":[\"Compose Message\",\"Mesaj yaz\"]\r\n\t});\r\n}" ]
[ "0.6442721", "0.6365403", "0.6322822", "0.62296045", "0.6013765", "0.58336097", "0.5808982", "0.5791974", "0.57835656", "0.57725286", "0.575897", "0.5624304", "0.56158185", "0.5615164", "0.5578212", "0.5565591", "0.55626184", "0.5545951", "0.5539238", "0.5539238", "0.55251294", "0.5507891", "0.54970944", "0.5484715", "0.54632103", "0.5452645", "0.54471457", "0.54334277", "0.5426974", "0.5406439", "0.5405617", "0.5403137", "0.53882927", "0.5366951", "0.536574", "0.5362744", "0.5360104", "0.5350064", "0.53433347", "0.5336399", "0.5335599", "0.532885", "0.5317909", "0.5306761", "0.5303315", "0.53011805", "0.5294136", "0.5291618", "0.528221", "0.5280457", "0.52667457", "0.5258028", "0.5250256", "0.52488744", "0.52435213", "0.5240792", "0.52336514", "0.52335125", "0.5232491", "0.52299017", "0.5228211", "0.5227636", "0.52248484", "0.5224626", "0.52223504", "0.5215872", "0.52150214", "0.5194097", "0.5192201", "0.51857746", "0.5181679", "0.51797485", "0.51740795", "0.51740795", "0.51718646", "0.51704234", "0.51703066", "0.5170271", "0.51697505", "0.51696956", "0.5166437", "0.51661044", "0.51620996", "0.5161713", "0.515832", "0.5156524", "0.515181", "0.5149313", "0.5144165", "0.514117", "0.5136702", "0.5130012", "0.51266384", "0.51255584", "0.5123827", "0.5115533", "0.51126266", "0.51072675", "0.51046854", "0.51015025", "0.50994474" ]
0.0
-1
getText() function definition. This is the pdf reader function.
function getText(typedarray) { //PDFJS should be able to read this typedarray content var pdf = PDFJS.getDocument(typedarray); return pdf.then(function(pdf) { // get all pages text var maxPages = pdf.pdfInfo.numPages; var countPromises = []; // collecting all page promises for (var j = 1; j <= maxPages; j++) { var page = pdf.getPage(j); var txt = ""; countPromises.push(page.then(function(page) { // add page promise var textContent = page.getTextContent(); return textContent.then(function(text) { // return content promise return text.items.map(function(s) { return s.str; }).join(''); // value page text }); })); } // Wait for all pages and join text return Promise.all(countPromises).then(function(texts) { return texts.join(''); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTextContent() {}", "get text() {}", "get text() {}", "get richText() {}", "getText() { return this.text; }", "getText() {\r\n return this.getParsed(new TextParser());\r\n }", "retriveText() {\n let exactText;\n let currentElement;\n if (!isNullOrUndefined(this.currentContextInfo) && this.currentContextInfo.element) {\n currentElement = this.currentContextInfo.element;\n exactText = this.currentContextInfo.element.text;\n this.viewer.selection.start = currentElement.start;\n this.viewer.selection.end = currentElement.end;\n }\n else {\n let startPosition = this.viewer.selection.start;\n let offset = startPosition.offset;\n let startIndex = 0;\n let startInlineObj = startPosition.currentWidget.getInline(offset, startIndex);\n currentElement = startInlineObj.element;\n exactText = startInlineObj.element.text;\n }\n return { 'text': exactText, 'element': currentElement };\n }", "getText() {\n return this._text;\n }", "getText() {\n return this.text;\n }", "getText(name = null) {\n if (name == null) {\n return this._text;\n } else {\n const el = this.getElement(name);\n if (! el) return undefined;\n return el._text;\n }\n }", "get textContent() {\n return this.text.toString();\n }", "get text () {\n\t\treturn this._text;\n\t}", "get textContent () {\n return textContent(this._data);\n }", "GetText()\n\t{\n\t\treturn this.textContent;\n\t}", "function getText()\n {\n return cssText;\n }", "get text() {\n return this.instance.getText();\n }", "function TextData() { }", "function TextData() { }", "get text() {\n\t\treturn this.__text;\n\t}", "get text() {\n return this.content();\n }", "text() {\n\t\treturn consumeBody$1.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "function getText () {\n var someText = \"Nice weatjer.\";\n return someText; \n}", "getText() {\r\n return this.clone(File, \"$value\", false).get(new TextParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\r\n }", "getDirectText() {\n return this._executeAfterInitialWait(() => this.currently.getDirectText());\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}", "getDirectText() {\n const html = this.getHTML();\n if (html.length === 0) {\n return '';\n }\n let text = '';\n const constructorName = this._node.constructor.name;\n const handler = new htmlParser.DomHandler(function (error, dom) {\n if (error) {\n throw new Error(`Error creating dom for direct text in ${constructorName}: ${error}\\n( ${this._pageElement.getSelector()} )`);\n }\n else {\n dom.forEach(node => {\n if (node.type === 'text') {\n text += node.data;\n }\n });\n }\n });\n const parser = new htmlParser.Parser(handler);\n parser.write(html);\n parser.end();\n return text;\n }", "function setText(prefix, info, li, pdfUrl){\n\tPDFJS.getDocument(pdfUrl)\n\t.then( pdf => pdf.getPage(1)) // pages start at 1\n\t.then( page => page.getTextContent())\n\t.then( joinTextData )\n\t.then( data => {\n\t\tinfo.innerHTML = prefix + data;\n\t\tli.appendChild(info)\n\t})\n\t.catch( function(err) {\n\t\tconsole.log('Get Text Error: ', err)\n\t})\n}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "getText() {\n return this.find('Text')[0];\n }", "function TextData() {}", "function TextData() {}", "function TextData() {}", "getText () {\n const textArr = this.getHeader();\n [...textArr, ...this.lines].join('\\n')\n }", "function getText(){\n return document.body.innerText\n }", "function readPdf(arrayBuffer) {\r\n\treturn new Promise((resolve, reject) => \r\n\t\tpdfjsLib.getDocument(arrayBuffer).promise.then(function (fullPdf) {\r\n\t\t\tfullPdf.getPage(1).then(function (pdfPage) { \r\n\t\t\t\tpdfPage.getTextContent().then(function (textContent) {\r\n\t\t\t\t\tvar textItems = textContent.items;\r\n\t\t\t\t\tvar fullText = [];\r\n\r\n\t\t\t\t\tvar n = textItems.length;\r\n\r\n\t\t\t\t\tfor (var i = 0; i < n; i+=1) {\r\n\t\t\t\t\t\tfullText.push(textItems[i].str);\r\n\t\t\t\t\t};\r\n\t\t\t\t\tresolve (fullText);\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t}))\r\n}", "function readText(text) {\n return new Promise((resolve, reject) => {\n resolve(text);\n }).then(text => {\n return text;\n });\n}", "getText() {\n return this._executeAfterInitialWait(() => this.currently.getText());\n }", "function getTextById (id) {\n return document.getElementById(id).textContent;\n}", "get textContent() {\n return this.isLeaf && this.type.spec.leafText ? this.type.spec.leafText(this) : this.textBetween(0, this.content.size, \"\");\n }", "function getText(t) {\n if (t._children.length === 0)\n return undefined;\n var n = t._children[0];\n if (n._fTextNode)\n return n._text;\n throw new Error(\"Not a text node\");\n }", "get text () { return this.DOM_element.textContent; }", "getText() {\n return this._codeMirror.getValue();\n }", "get _text() {\n let text = '';\n for (const part of this._parts) {\n text += part instanceof Blob ? part._text : String(part);\n }\n return text;\n }", "get text() {\n return this.content.text || '';\n }", "function getText() {\n let editor = vscode.window.activeTextEditor;\n if (!editor) {\n return;\n }\n\n let selection = editor.selection;\n return editor.document.getText(selection.isEmpty ? undefined : selection);\n}", "function getText(obj) {\n if (typeof (obj.innerText) != \"undefined\")\n return trimAll(obj.innerText);\n else\n return trimAll(obj.textContent);\n}", "function getText( control ) {\n if ( control == null ) {\n return '';\n }\n if (document.all){\n return control.innerText;\n } else {\n return trimStr(control.textContent);\n } \n}", "function ontext (text) {\n return text;\n}", "get text() {\n\t\treturn this.__Internal__Dont__Modify__.text;\n\t}", "function getTextToEdit(){\n console.log(\"getting text to edit\");\n editFctry.showText ($routeParams.id, function (response){\n console.log(\"response from editFctry.show\", response.data)\n $scope.textToEdit = response.data\n })\n }", "function _getText(node) {\n\n if (node.nodeType === 3) {\n return node.data;\n }\n\n var txt = '';\n\n if (!!(node = node.firstChild)) do {\n txt += _getText(node);\n } while (!!(node = node.nextSibling));\n\n return txt;\n\n }", "function getTextContent(id) {\n return document.getElementById(id).textContent;\n}", "function TextData(){}", "function get_text(elemento){\n\treturn elemento.textContent\n}", "function getReadText() {\n let loremipsum = \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum\";\n readBox.innerText = loremipsum\n}", "getText() {\n return this._node.__execute(() => this.element.getText());\n }", "function GetText(Tag) {\n\n\t// Make sure the text CSV file is loaded\n\tif (CurrentText != null) {\n\n\t\t// Cycle the text to find a matching tag and returns the text content\n\t\tTag = Tag.trim().toUpperCase();\n\t\tfor (var T = 0; T < CurrentText.length; T++)\n\t\t\tif (CurrentText[T][TextTag].trim().toUpperCase() == Tag)\n\t\t\t\treturn CurrentText[T][TextContent].trim();\n\n\t\t// Returns an error message\n\t\treturn \"MISSING TEXT FOR TAG: \" + Tag.trim();\n\n\t} else return \"\";\n\n}", "getText() {\n return this._editor ? this._editor.getText() : this._value;\n }", "function getText(jqObject){\r\n\treturn encodeURIComponent(\r\n\t\tunescape(\r\n\t\t\tjqObject.text().replace(/\\s\\(\\d+\\)$/,\"\").replace(/^[\\s(]+/,\"\").replace(/[\\s)]+$/,\"\")\r\n\t\t)\r\n\t);\r\n}", "text() {\n return this.#text;\n }", "async function getText(source) {\n // initialize cheerio obj\n const $ = cheerio.load(source, CHEERIO_OPTIONS);\n\n // todo -> encode/decode methods? utf8/ascii?\n\n // find all text data and remove white spaces\n // var page_text = $.text().trim().replace(/\\s+/g, \" \");\n // var page_text = $.html();\n \n var page_text = he.decode($.html(), HE_OPTIONS);\n page_text = page_text.trim().replace(/\\s+/g, \" \");\n\n\n return page_text;\n}", "function getPlainText(e)\n{\n\tvar text = \"\";\n\tif(e.innerText)\n\t\ttext = e.innerText;\n\telse if(e.textContent)\n\t\ttext = e.textContent;\n\treturn text;\n}", "function getText() {\n let txtIn = document.getElementById(\"textInput\");\n return txtIn.value;\n}", "function getText() {\n\t$(\"button\").click(function (event) {\n\t\tevent.preventDefault();\n\t\tdoResults($(\"textarea\").val());\n\t\tremoveHidden();\n\t\t\n\t})\n}", "function generatePDFText(pdf, callback) {\n\t//appends each pdf line to a string...\n\t//currently looking for an easier method since the iteration is VERY slow\n\tpdfText = '';\n\tfor(i=1;i<=pdf.pdfInfo.numPages;i++){\n\t\tpdf.getPage(i).then(function(page) {\n\t\t\t//indexing each pdf page \n\t\t\ti -= 1\n\t\t\tconsole.log('next page ' + i) \n\t\t\tif (page.getTextContent()._data.bidiTexts){\n\t\t\t\t//indexing each pdf page line\n\t\t\t\tfor(ii=0;ii<page.getTextContent()._data.bidiTexts.length;ii++){\n\t\t\t\t\t//finally appending to the string\n\t\t\t\t\tpdfText += page.getTextContent()._data.bidiTexts[ii].str+'\\n';\n\t\t\t\t\t//if statement is used to finalize the fuction and initialize the callback.\n\t\t\t\t\tif (i == pdf.pdfInfo.numPages && ii == page.getTextContent()._data.bidiTexts.length-1) {\n\t\t\t\t\t\tend_response = \"done: %d page\"\n\t\t\t\t\t\tif (i == 1) console.log(\"done: \"+i+\" page\");\n\t\t\t\t\t\telse console.log(\"done: \"+i+\" pages\")\n\t\t\t\t\t\tcallback(); //running the callback\n\t\t\t\t\t}\n\t\t\t\t}\n\t } \n\t });\n\t}\n\t\n}", "function myFunction() {\n\n var PDF_URL = document.getElementById(\"uploadBox\").files[0].path;\n document.getElementById('myform').reset();\n\n PDFJS.workerSrc = 'assets/js/pdf.worker.js';\n\n\n function getPageText(pageNum, PDFDocumentInstance) {\n // Return a Promise that is solved once the text of the page is retrieven\n return new Promise(function (resolve, reject) {\n PDFDocumentInstance.getPage(pageNum).then(function (pdfPage) {\n // The main trick to obtain the text of the PDF page, use the getTextContent method\n pdfPage.getTextContent().then(function (textContent) {\n var textItems = textContent.items;\n var finalString = \"\";\n\n // Concatenate the string of the item to the final string\n for (var i = 0; i < textItems.length; i++) {\n var item = textItems[i];\n\n finalString += item.str + \" \";\n }\n\n // Solve promise with the text retrieven from the page\n resolve(finalString);\n });\n });\n });\n }\n //var file_name = document.getElementById(\"uploadBox\").value ;\n\n PDFJS.getDocument(PDF_URL).then(function (pdf) {\n\n var pdfDocument = pdf;\n // Create an array that will contain our promises \n var pagesPromises = [];\n //console.log(pdf.pdfInfo.numPages);\n for (var i = 0; i < pdf.pdfInfo.numPages; i++) {\n // Required to prevent that i is always the total of pages\n (function (pageNumber) {\n // Store the promise of getPageText that returns the text of a page\n pagesPromises.push(getPageText(pageNumber, pdfDocument));\n })(i + 1);\n }\n\n // Execute all the promises\n Promise.all(pagesPromises).then(function (pagesText) {\n\n // Display text of all the pages in the console\n // e.g [\"Text content page 1\", \"Text content page 2\", \"Text content page 3\" ... ]\n var str = [];\n for (i = 0; i < pagesText.length; i++) {\n //console.log(pagesText[i]);\n str = str.concat(pagesText[i]);\n }\n //console.log(pagesText);\n var st = str.toString();\n //for(i = 0; i <pagesText.length;i++){\n //var s = pagesText[i];\n //Array of all elements\n var info = [\"Name\", \"Gender\", \"Age\", \"Contact Number\", \"Height\", \"Weight\", \"BMI\", \"Address\", \"Color of Eyes\", \"Email\"];\n var section1 = [\"(a)\", \"(b)\", \"(c)\", \"(d)\", \"(e)\", \"(f)\", \"(g)\", \"(h)\"];\n var s1_p9 = [\"(i)\", \"(j)\", \"(k)\", \"(l)\"];\n var all = [\"Biotin\", \"Calcium\", \"Chromium\", \"Copper\", \"EssentialFattyAcids\",\n \"Protein\", \"Carbohydrates\", \"FolicAcid\", \"Iodine\", \"Iron\", \"Magnesium\", \"Manganese\",\n \"Niacin\", \"PantothenicAcid(B6)\", \"Potassium\", \"Pyridoxine(B6)\", \"Riboavin\",\n \"Selenium\", \"Thiamin\", \"VitaminA\", \"VitaminB-12\", \"VitaminC\", \"CoQ10\",\n \"VitaminD\", \"VitaminE\", \"VitaminK\", \"Zinc\"];\n array_b = [\"I.\", \"II.\", \"III.\", \"IV.\", \"V.\", \"VI.\", \"VII.\", \"VIII\", \"IX\", \"X.\", \"XI.\", \"XII.\"];\n var p_info = [];\n for (j = 0; j < info.length; j++) {\n if (st.indexOf(info[j]) >= 0) {\n p_info.push(info[j]);\n }\n }\n //console.log(i);\n //console.log(p_info); // things that are filled in the form\n\n if (p_info.length > 0) {\n for (j = 0; j < p_info.length; j++) {\n if (j < p_info.length - 1) {\n var index1 = st.indexOf(p_info[j]);\n var index2 = st.indexOf(p_info[j + 1]);\n var temp = st.substring(index1, index2);\n } else { //last member of array\n var index1 = st.indexOf(p_info[j]);\n var index2;\n for (j1 = 0; j1 < section1.length; j1++) {\n index2 = st.indexOf(section1[j1]);\n if (index2 >= 0) {\n break;\n }\n }\n if (index2 < 0) {\n for (j1 = 0; j1 < s1_p9.length; j1++) {\n index2 = st.indexOf(s1_p9[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n }\n if (index2 < 0) {\n for (j1 = 0; j1 < all.length; j1++) {\n index2 = st.indexOf(all[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n }\n if (index2 < 0) {\n for (j1 = 0; j1 < array_b.length; j1++) {\n index2 = st.indexOf(array_b[j1]);\n if (index2 >= 0) {\n break;\n }\n }\n }\n\n if (index2 < 0) {\n index2 = pagesText.length;\n }\n\n var temp = st.substring(index1, index2);\n }\n if (p_info[j].localeCompare(\"Name\") == 0) {\n document.getElementById(\"name\").value = temp.replace(\"Name\", \"\");\n } else if (p_info[j].localeCompare(\"Gender\") == 0) {\n if (temp.indexOf(\"F\") >= 0) {\n document.getElementById(\"gender\").value = \"Female\";\n } else {\n document.getElementById(\"gender\").value = \"Male\";\n }\n } else if (p_info[j].localeCompare(\"Age\") == 0) {\n document.getElementById(\"age\").value = temp.replace(\"Age\", \"\");\n } else if (p_info[j].localeCompare(\"Contact Number\") == 0) {\n document.getElementById(\"contact\").value = temp.replace(\"Contact Number\", \"\");\n } else if (p_info[j].localeCompare(\"Height\") == 0) {\n document.getElementById(\"height\").value = temp.replace(\"Height\", \"\");\n } else if (p_info[j].localeCompare(\"Weight\") == 0) {\n document.getElementById(\"weight\").value = temp.replace(\"Weight\", \"\");\n } else if (p_info[j].localeCompare(\"BMI\") == 0) {\n document.getElementById(\"bmi\").value = temp.replace(\"BMI\", \"\");\n } else if (p_info[j].localeCompare(\"Color of Eyes\") == 0) {\n document.getElementById(\"eyes\").value = temp.replace(\"Color of Eyes\", \"\");\n } else if (p_info[j].localeCompare(\"Email\") == 0) {\n document.getElementById(\"email\").value = temp.replace(\"Email\", \"\");\n } else {\n\n }\n }\n\n\n }\n // Section I \n var s = st.toString().replace(/ /g, '').replace(/[^ -~]+/g, \"\");\n\n var array_p1 = [\"Fear\", \"Anger\", \"Bitterness\", \"Grief\", \"Gossip\", \"Helplessness\", \"Hopelessness\",\n \"Guilt\", \"Betrayal\", \"Envy\", \"Jealousy\", \"Insecurity\", \"Impatient\", \"Arrogance\",\n \"Pride\", \"Hatred\", \"Rage\", \"Resentment\", \"Revenge\", \"Shame\", \"Sorrow\", \"Regret\",\n \"Passivity\", \"Slander\", \"Possessiveness\", \"Rebellion\", \" Unforgiveness\", \"Gambling\",\n \"Addictions\", \"Other\"];\n var array_p2 = [\"Always Indoors\", \" Do not regularly change home air lter\", \"Home has mold\", \"Home has an air ionizer\",\n \"Have plenty of green plants in my living space\", \"Practice deep breathing exercises regularly, especially outdoors\",\n \" I live away from city smog\", \" Dizziness\", \"Headaches\", \" WateryEyes\", \"Sneezing\", \"Cough Regularly\",\n \"Fatigue\", \"Smoke cigarettes regulary\"];\n var array_p3 = [\"Dry mouth, dry eyes, dry nasal membranes\", \"Dry or leathery skin\", \"Dry or chapped lips\",\n \"Stools hard & Dry\", \"Low volume of urine, urinate infrequently\", \"Dark urine (dark yellow or orange)\",\n \"Poor skin turgor (loss of elasticity of skin)\", \"Headaches\", \"Leg and arm cramps\", \"Weakness\",\n \"Drink less than eight 8 ounce glasses of water daily\"];\n var array_p4 = [\"Depression\", \"Poor Bone Health\", \"Low Vitamin D levels\", \"Outdoors at least 30 minutes a day\"];\n var array_p5 = [\"Headaches\", \"Nausea\", \"Brain fog\", \"Sleep disorders\", \"Loss of memory\", \"Sensitive skin\", \"Dizziness\",\n \"Burning sensation\", \"Rash\", \"Vision problems\", \"Chest pains\", \"Swollen lymph nodes\", \"Live near electrical towers\",\n \"Teeth & jaw pain\", \"Constantly having cellphone to the ears\", \"On computer more than six hours\", \"Aching muscles\",\n \"Fatigue\", \"Bouts of unexplained fear or anxiety\", \"Tingling or prickly sensation across face or other parts of body\",\n \"Feeling of impeding inuenza but never quite breaks out\"];\n var array_p6 = [\"Exercise regularly at least twice a week\", \"Fatigue\", \"Weight gain\", \"Weakness\", \"Muscle atrophy\",\n \"Depression\", \"Lack of exibility and good balance\", \"Heart problems\"];\n var array_p7 = [\"Painful or hard bowel movements\", \"Constipated, less than 1 bowel movement a day\", \"Varicose veins\",\n \"Hemorrhoids or rectal ssures\", \"Use lots of toilet paper to clean yourself\",\n \"Stools are pencil size and drop to the bottom of the toilet\"];\n var array_p8 = [\"Consume six types of vegetables daily\", \"Eat at least two types of fruit daily\", \"Consume at least an ounce of raw nuts daily\",\n \"50% of my diet is made up of raw foods\", \"I do not consume dairy, wheat or gluten containing foods\",\n \"I consume very little dairy or gluten (2 to 3 meals a week)\", \"Eat fresh and/or organic foods as much as possible\",\n \"Vegetarian\", \"Vegan\", \"Eat white sh two to three times a week\"];\n var array_p9a = [\"Allergies\", \"Chronic Headaches/migraines\", \"Chronic skin problems\", \"Digestive problems\", \"Diabetes\", \"Autoimmune disease\", \"Diculty sleeping\",\n \"Depression/poor mood\", \"Low energy\", \"Liver dysfunction\", \"Overweight\", \"Sore muscles or sti joints\", \"Unhealthy cravings\", \"Chemical sensitivities/Environmental illness\",\n \"Sleepy after meals\", \"Food Allergies\"];\n var array_p9b = [\"High Blood Pressure\", \"Numbness and tingling in extremity\", \"Twitching of face and other muscles\", \"Tremors or shakes of hands, feet, head, etc.\", \"Jumpy, jittery, nervous\",\n \"Unexplained chest pains\", \"Heartbeat over 100 per minute\", \"Unexplained rashes or skin irritations\", \"Excessive itching\", \"Bloated feeling most of the time\", \"Frequent or re-occurring heartburn\",\n \"Constipated on regular basis\", \"Frequent diarrhea\", \"Depression\", \"Unexplained irritability\", \"Sudden, unexplained or unsolicited anger\", \"Constant death wish or suicidal intent\",\n \"Diculty in making simple decisions\", \"Cold hands or feet, even in warm or moderate weather\", \"Out of breath easily\", \"Headaches after eating\", \"Frequent leg cramps\",\n \"Frequent metallic taste in mouth\", \"Burning sensation on the tongue\", \"Constant or frequent ringing in the ears\", \"Frequent urination during the night\", \"Unexplained chronic fatigue\",\n \"Poor or failing memory\", \"Constant or frequent pain in joins\", \"Frequent insomnia \", \"Unexplained uid retention\"];\n var array_p10 = [\"Gas\", \"Bloating\", \"Abdominal fullness\", \"Nausea\", \"Constipation\", \"Diarrhea\", \"Abdominal cramps or pain\", \"Fatigue\", \"Hives\", \"Allergies, especially foods\", \"History of parasitic infections\",\n \"History of traveler's diarrhea\", \"Diculty overcoming intestinal yeast growth\"];\n var array_p11 = [\"Gas\", \"Bloating\", \"Constipation and/or diarrhea\", \"Spastic/irritable colon\", \"Chron's Disease, Colitis\", \"Intestinal cramping\", \"Heart Burn\", \"Itchy anus\",\n \"Continuous sinus problems\", \"Chronic or re-occurring sore throat, colds, bronchitis, ear infection\", \"Premenstrual symptoms\", \"Menstrual cramps and problems\", \"Fatigue\",\n \"Depression\", \"Irritability or chronic vaginal yeast infections\", \"Infertility\", \"Chronic rashes\", \"Recurrent bladder infections or irritation\", \"Recurrent staph infections\",\n \"Itchy ears or ringing in the ears\", \"General itching\", \"Multiple allergies\", \"Weight problems\", \"Craving for sweets, alcohol, bread, cheese\", \"Feel drunk without having ingested alcohol\",\n \"Chemical and fume intolerance\", \"Worsening of any of the above symptoms within six to twelve months after a pregnancy\",\n \"Multiple pregnancies\", \"Antibiotic use\", \"Birth control pill (oral contraceptives) use\", \"Cortisone or steroid use\", \"Chemotherpy or radiation therpy\"];\n var s1 = [];\n var count_a = 0;\n var count_b = 0;\n var count_c = 0;\n var count_d = 0;\n var count_e = 0;\n var count_f = 0;\n var count_g = 0;\n var count_h = 0;\n var count_i = 0;\n var count_j = 0;\n var count_k = 0;\n var count_l = 0;\n\n for (k = 0; k < section1.length; k++) {\n if (s.indexOf(section1[k]) >= 0) {\n s1.push(section1[k].replace(/ /g, ''));\n }\n }\n if (s1.length > 0) {\n for (n = 0; n < s1.length; n++) {\n\n if (n < (s1.length - 1)) {\n var index1 = s.indexOf(s1[n]);\n var index2 = s.indexOf(s1[n + 1]);\n var temp = s.substring(index1, index2);\n } else { //last member of array\n var index1 = s.indexOf(s1[n]);\n var index2;\n\n for (j1 = 0; j1 < s1_p9.length; j1++) {\n index2 = s.indexOf(s1_p9[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n\n if (index2 < 0) {\n for (j1 = 0; j1 < all.length; j1++) {\n index2 = s.indexOf(all[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n }\n if (index2 < 0) {\n for (j1 = 0; j1 < array_b.length; j1++) {\n index2 = s.indexOf(array_b[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n }\n\n if (index2 < 0) {\n index2 = pagesText.length;\n }\n\n var temp = s.substring(index1, index2);\n }\n\n if (s1[n].localeCompare(\"(a)\") == 0) {\n for (j = 0; j < array_p1.length; j++) {\n if (temp.indexOf(array_p1[j].replace(/ /g, '')) >= 0) {\n count_a++;\n }\n }\n document.getElementById(\"part1\").value = count_a;\n if (count_a >= 1 & count_a <= 4) {\n document.getElementById(\"p_part1\").value = \"Low\";\n } else if (count_a >= 5 & count_a <= 7) {\n document.getElementById(\"p_part1\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part1\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(b)\") == 0) {\n for (j = 0; j < array_p2.length; j++) {\n if (temp.indexOf(array_p2[j].replace(/ /g, '')) >= 0) {\n count_b++;\n }\n }\n document.getElementById(\"part2\").value = count_b;\n if (count_b >= 1 & count_b <= 2) {\n document.getElementById(\"p_part2\").value = \"Low\";\n } else if (count_b >= 3 & count_b <= 5) {\n document.getElementById(\"p_part2\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part2\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(c)\") == 0) {\n for (j = 0; j < array_p3.length; j++) {\n if (temp.indexOf(array_p3[j].replace(/ /g, '')) >= 0) {\n count_c++;\n }\n }\n document.getElementById(\"part3\").value = count_c;\n if (count_c >= 1 & count_c <= 2) {\n document.getElementById(\"p_part3\").value = \"Low\";\n } else if (count_c >= 3 & count_c <= 5) {\n document.getElementById(\"p_part3\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part3\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(d)\") == 0) {\n for (j = 0; j < array_p4.length; j++) {\n if (temp.indexOf(array_p4[j].replace(/ /g, '')) >= 0) {\n count_d++;\n }\n }\n document.getElementById(\"part4\").value = count_d;\n if (count_d == 1) {\n document.getElementById(\"p_part4\").value = \"Low\";\n } else if (count_d == 2) {\n document.getElementById(\"p_part4\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part4\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(e)\") == 0) {\n for (j = 0; j < array_p5.length; j++) {\n if (temp.indexOf(array_p5[j].replace(/ /g, '')) >= 0) {\n count_e++;\n }\n }\n document.getElementById(\"part5\").value = count_e;\n if (count_e >= 1 & count_e <= 4) {\n document.getElementById(\"p_part5\").value = \"Low\";\n } else if (count_e >= 5 & count_e <= 10) {\n document.getElementById(\"p_part5\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part5\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(f)\") == 0) {\n for (j = 0; j < array_p6.length; j++) {\n if (temp.indexOf(array_p6[j].replace(/ /g, '')) >= 0) {\n count_f++;\n }\n }\n document.getElementById(\"part6\").value = count_f;\n if (count_f >= 1 & count_f <= 2) {\n document.getElementById(\"p_part6\").value = \"Low\";\n } else if (count_f >= 3 & count_f <= 4) {\n document.getElementById(\"p_part6\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part6\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(g)\") == 0) {\n for (j = 0; j < array_p7.length; j++) {\n if (temp.indexOf(array_p7[j].replace(/ /g, '')) >= 0) {\n count_g++;\n }\n }\n document.getElementById(\"part7\").value = count_g;\n if (count_g == 1) {\n document.getElementById(\"p_part7\").value = \"Low\";\n } else if (count_g >= 2 & count_g <= 3) {\n document.getElementById(\"p_part7\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part7\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(h)\") == 0) {\n for (j = 0; j < array_p8.length; j++) {\n if (temp.indexOf(array_p8[j].replace(/ /g, '')) >= 0) {\n count_h++;\n }\n }\n document.getElementById(\"part8\").value = count_h;\n if (count_h >= 1 & count_h <= 2) {\n document.getElementById(\"p_part8\").value = \"Low\";\n } else if (count_h >= 5 & count_h <= 4) {\n document.getElementById(\"p_part8\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part8\").value = \"High\";\n }\n } else {\n\n }\n }\n }\n\n var pos_9 = [];\n\n for (k = 0; k < s1_p9.length; k++) {\n if (s.indexOf(s1_p9[k]) >= 0) {\n pos_9.push(s1_p9[k].replace(/ /g, ''));\n }\n }\n\n if (pos_9.length > 0) {\n for (n = 0; n < pos_9.length; n++) {\n if (n < (pos_9.length - 1)) {\n var index1 = s.indexOf(pos_9[n]);\n var index2 = s.indexOf(pos_9[n + 1]);\n var temp = s.substring(index1, index2);\n } else { //last member of array\n var index1 = s.indexOf(pos_9[n]);\n var index2;\n for (j = 0; j < all.length; j++) {\n index2 = s.indexOf(all[j]);\n\n if (index2 >= 0) {\n break;\n }\n }\n if (index2 < 0) {\n for (j = 0; j < array_b.length; j++) {\n index2 = s.indexOf(array_b[j]);\n\n if (index2 >= 0) {\n break;\n }\n }\n }\n\n if (index2 < 0) {\n index2 = pagesText.length;\n }\n var temp = s.substring(index1, index2);\n\n }\n\n if (pos_9[n].localeCompare(\"(i)\") == 0) {\n for (j = 0; j < array_p9a.length; j++) {\n if (temp.indexOf(array_p9a[j].replace(/ /g, '')) >= 0) {\n count_i++;\n }\n }\n document.getElementById(\"part9a\").value = count_i;\n if (count_i >= 1 & count_i <= 4) {\n document.getElementById(\"p_part9a\").value = \"Low\";\n } else if (count_i >= 5 & count_i <= 8) {\n document.getElementById(\"p_part9a\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part9a\").value = \"High\";\n }\n } else if (pos_9[n].localeCompare(\"(j)\") == 0) {\n for (j = 0; j < array_p9b.length; j++) {\n if (temp.indexOf(array_p9b[j].replace(/ /g, '')) >= 0) {\n count_j++;\n }\n }\n document.getElementById(\"part9b\").value = count_j;\n if (count_j >= 1 & count_j <= 8) {\n document.getElementById(\"p_part9b\").value = \"Low\";\n } else if (count_j >= 9 & count_j <= 15) {\n document.getElementById(\"p_part9b\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part9b\").value = \"High\";\n }\n } else if (pos_9[n].localeCompare(\"(k)\") == 0) {\n for (j = 0; j < array_p10.length; j++) {\n if (temp.indexOf(array_p10[j].replace(/ /g, '')) >= 0) {\n count_k++;\n }\n }\n document.getElementById(\"part10\").value = count_k;\n if (count_k >= 1 & count_k <= 3) {\n document.getElementById(\"p_part10\").value = \"Low\";\n } else if (count_k >= 4 & count_k <= 6) {\n document.getElementById(\"p_part10\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part10\").value = \"High\";\n }\n } else if (pos_9[n].localeCompare(\"(l)\") == 0) {\n for (j = 0; j < array_p11.length; j++) {\n if (temp.indexOf(array_p11[j].replace(/ /g, '')) >= 0) {\n count_l++;\n }\n }\n document.getElementById(\"part11\").value = count_l;\n if (count_l >= 1 & count_l <= 9) {\n document.getElementById(\"p_part11\").value = \"Low\";\n } else if (count_l >= 10 & count_l <= 17) {\n document.getElementById(\"p_part11\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part11\").value = \"High\";\n }\n } else {\n\n }\n }\n\n }\n\n //Array of all the sympots\n var a_biotin = [\"Dermatitis\", \"Eye inammation\", \"Hair loss\", \"Loss of muscle control\", \"Insomnia\", \"Muscle weakness\"];\n var a_cal = [\"Brittle nails\", \"Cramps\", \"Delusions\", \"Depression\", \"Insomnia\", \"Irritability\",\n \"Osteoporosis\", \"Palpitations\", \"Periodontal disease\", \"Rickets\", \"Tooth decay\"];\n var a_chrom = [\"Anxiety\", \"Fatigue\", \"Glucose intolerance\", \"Adult-onset diabetes\"];\n var a_copper = [\"Anemia\", \"Arterial Damage\", \"Depression\", \"Diarrhea\", \"Fatigue\", \"Fragile Bones\", \"Hair Loss\", \"Hyperthyroidism\", \"Weakness\"];\n var a_fatty = [\"Diarrhea\", \"Dry Skin & Hair Loss\", \"Hair Loss\", \"Immune Impairment\", \"Infertility\",\n \"Poor Wound Healing\", \"Premenstrual Syndrome\", \"Acne\", \"Eczema\", \"Gall Stones\", \"Liver Degeneration\",\n \"Headaches when out in the hot sun\", \"Sunburn easily or suer sun poisening\"];\n var a_protein = [\"Increased secretion from mouth/nose/eyes.\", \"Swelling in hands and feet\", \"Muscle cramps\",\n \"Menstrual cramps\", \"Low Exercise Tolerance\", \"Cold hands and feet\", \"Bleeding Gums\", \"Low Immunity\",\n \"Fatigue\", \"Muscles more abby than normal\", \"Hair loss\", \"Splitting hair and nails\", \"Low Heart Rate\", \"Hypoglycemia\"];\n var a_carbs = [\"Decreased secretions from mouth/nose/eyes\", \"Muscle weakness\", \"Inability to concentrate\",\n \"Easily startled\", \"Diculty swallowing\", \"Voice aected by stress\"];\n var a_folic = [\"Anemia\", \"Apathy\", \"Diarrhea\", \"Fatigue\", \"Headaches\", \"Insomnia\", \"Loss of Appetite\", \"Neural Tube Defects in Fetus\",\n \"Paranoia\", \"Shortness of Breath\", \"Weakness\"];//here\n var a_ion = [\"Cretinism\", \"Fatigue\", \"Hypothyroidism\", \"Weight Gain\"];\n var a_iron = [\"Anemia\", \"Brittle nails\", \"Confusion\", \"Constipation\", \"Depression\", \"Dizziness\", \"Fatigue\", \"Headaches\", \"Inamed tongue\", \"Mouth lesions\"];//here\n var a_mag = [\"Anxiety\", \"Confusion\", \"Heart Attack\", \"Hyperactivity\", \"Insomnia\", \"Nervousness\", \"Muscular irritability\", \"Restlessness\", \"Weakness\", \"Hypertension\"];\n var a_man = [\"Atherosclerosis\", \"Dizziness\", \" Elevated cholesterol\", \"Glucose intolerance\", \"Hearing loss\", \"Loss of muscle control\", \"Ringing in ears\"];\n var a_nia = [\"Bad breath\", \"Canker sores\", \"Confusion\", \"Depression\", \"Dermatitis\", \"Diarrhea\", \"Emotional Instability\", \"Fatigue\", \"Irritability\", \"Loss of Appetite\", \"Memory Impairment\",\n \"Muscle Weakness\", \"Nausea\", \"Skin Eruptions & Inammation\", \"High Cholesterol or Triglycerides\", \"Poor Circulation\"];\n var a_acid = [\"Abdominal Pains\", \"Burning Feet\", \"Depression\", \"Eczema\", \"Fatigue\", \"Hair Loss\", \"Immune Impairment\", \"Insomnia\", \"Irritability\", \"Low Blood Pressure\", \"Muscle Spasms\",\n \"Nausea\", \"Poor Coordination\"];\n var a_pot = [\"Acne\", \"Constipation\", \"Depression\", \"Edema\", \"Excessive Water Consumption\", \"Fatigue\", \"Glucose Intolerance\", \"High Cholesterol Levels\", \"Insomnia\", \"Mental Impairment\",\n \"Muscle Weakness\", \"Nervousness\", \"Poor Reexes\"];\n var a_pyr = [\"Acne\", \"Anemia\", \"Arthritis\", \"Eye Inammation\", \"Depression\", \"Dizziness\", \"Facial Oiliness\", \"Fatigue\", \"Impaired Wound Healing\", \"Irritability\", \"Loss of Appetite\",\n \"Loss of Hair\", \"Mouth Lesions\", \"Nausea\"];\n var a_ribo = [\"Blurred Vision\", \"Cataracts\", \"Depression\", \"Dermatitis\", \"Dizziness\", \"Hair Loss\", \"Inamed Eyes\", \"Mouth Lesions\", \"Nervousness\",\n \"Neurological Symptoms (Numbness/Loss Of Sensation/\\\"Electic Shock\\\" Sensations)\", \"Seizures\", \"Sensitivity to Light\", \"Sleepiness\", \"Weakness\"];\n var a_sel = [\"Growth Impairment\", \"High Cholesterol Levels\", \"Increased Incidence of Cancer\", \"Pancreatic Insuciency (Inability to secrete adequate amounts of digestive enzymes)\",\n \"Immune Impairment\", \"Liver Impairment\", \"Male Sterility\"];\n var a_thia = [\"Confusion\", \"Constipated\", \"Digestive Problems\", \"Irritability\", \"Loss of Appetite\", \"Memory Loss\", \"Nervousness\", \"Numbness of Hands & Feet\", \"Pain Sensitivity\",\n \"Poor Coordination\", \"Weakness\", \"Slow Heart Beat or Rapid Heartbeat\", \"Enlarged Heart\", \"Heart Palpitations\"];\n var a_vita = [\"Acne\", \"Dry Hair\", \"Fatigue\", \"Growth Impairment\", \"Insomnia\", \"Hyperkeratosis (Thickening & roughness of skin)\", \"Immune Impairment\", \"Night Blindness\", \"Weight Loss\"];\n var a_vitb12 = [\"Anemia\", \"Constipation\", \"Depression\", \"Dizziness\", \"Fatigue\", \"Intestinal Disturbances\", \"Headaches\", \"Irritability\", \"Loss of Vibration Sensation\", \"Low Stomach Acid\", \"Mental Disturbances\",\n \"Moodiness\", \"Mouth Lesions\", \"Numbness\", \"Spinal Cord Degeneration\"];\n var a_vitc = [\"Bleeding Gums\", \"Depression\", \"Easy Bruising\", \"Impaired Wound Healing\", \"Irritability\", \"Joint Pains\", \"Loose Teeth\", \"Malaise\", \"Tiredness\"];\n var a_coq = [\"Ataxia\", \"Cardiomyopathy\", \"Cerebellar Atrophy\", \"Muscle Weakness\", \"Fatigue\", \"Seizures\", \"Kidney Failure\", \"Encephalopathy\", \"Learning Disabilities\", \"Myoglobinuria\",\n \"Sensorineural Deafness\", \"Scoliosis\", \"Lactic Acidemia\",\n \"Spasticity\", \"Hyper-Reexes\", \"Weakened Eye Muscles\", \"Atrophying of Muscle Tissue\", \"Gum Disease\"];\n var a_vitd = [\"Burning Sensation in Mouth\", \"Diarrhea\", \"Insomnia\", \"Myopia\", \"Nervousness\", \"Osteomalacia\", \"Osteoporosis\", \"Rickets\", \"Scalp Sweating\", \"Poor Immunity\"];\n var a_vite = [\"Gait Disturbances\", \"Poor Reexes\", \"Loss of Position Sense\", \"Loss of Vibration Sense\", \"Shortened Red Blood Cell Life\"];\n var a_vitk = [\"Bleeding Disorders\", \"Arteriolosclerosis\", \"Spurs\", \"Calcium Deposits\"];\n var a_zinc = [\"Acne\", \"Amnesia\", \"Apathy\", \"Brittle Nails\", \"Delayed Sexual Maturity\", \"Depression\", \"Diarrhea\", \"Eczema\", \"Fatigue\", \"Growth Impairment\", \"Hair Loss\", \"High Cholesterol Levels\", \"Immune Impairment\", \"Impotence\", \"Irritability\", \"Lethargy\",\n \"Loss of Appetite\", \"Loss of Sense of Taste\", \"Low Stomach Acid\", \"Male Infertility\", \"Memory Impairment\", \"Night Blindness\", \"Paranoia\", \"White Spots on Nails\", \"Wound Healing Impairment\", \"Low Testosterone\"];\n var array_positive = [];\n\n //Counters\n var c_biotin = 0;\n var c_cal = 0;\n var c_chrom = 0;\n var c_copper = 0;\n var c_fatty = 0;\n var c_protein = 0;\n var c_carbs = 0;\n var c_folic = 0;\n var c_ion = 0;\n var c_iron = 0;\n var c_mag = 0;\n var c_man = 0;\n var c_nia = 0;\n var c_acid = 0;\n var c_pot = 0;\n var c_pyr = 0;\n var c_ribo = 0;\n var c_Sel = 0;\n var c_thia = 0;\n var c_vita = 0;\n var c_vitb12 = 0;\n var c_vitc = 0;\n var c_coq = 0;\n var c_vitd = 0;\n var c_vite = 0;\n var c_vitk = 0;\n var c_zinc = 0;\n\n for (k = 0; k < all.length; k++) {\n if (s.indexOf(all[k]) >= 0) {\n array_positive.push(all[k].replace(/ /g, ''));\n }\n }\n if (array_positive.length > 0) {\n for (n = 0; n < array_positive.length; n++) {\n\n if (n < (array_positive.length - 1)) {\n var index1 = s.indexOf(array_positive[n]);\n var index2 = s.indexOf(array_positive[n + 1]);\n if (index2 - index1 > 1) {\n var temp = s.substring(index1, index2);\n } else {\n index2 = s.lastIndexOf(array_positive[n + 1]);\n var temp = s.substring(index1, index2);\n }\n\n } else { //last member of array\n var index1 = s.indexOf(array_positive[n]);\n var index2;\n for (j1 = 0; j1 < array_b.length; j1++) {\n index2 = s.indexOf(array_b[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n if (index2 < 0) {\n index2 = pagesText.length;\n }\n var temp = s.substring(index1, index2);\n }\n\n if (array_positive[n].localeCompare(\"Biotin\") == 0) {\n for (j = 0; j < a_biotin.length; j++) {\n if (temp.indexOf(a_biotin[j].replace(/ /g, '')) >= 0) {\n c_biotin++;\n }\n }\n document.getElementById(\"biotin\").value = c_biotin;\n if (c_biotin == 1) {\n document.getElementById(\"p_biotin\").value = \"Low\";\n } else if (c_biotin >= 2 & c_biotin <= 3) {\n document.getElementById(\"p_biotin\").value = \"Medium\";\n } else {\n document.getElementById(\"p_biotin\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Calcium\") == 0) {\n for (j = 0; j < a_cal.length; j++) {\n if (temp.indexOf(a_cal[j].replace(/ /g, '')) >= 0) {\n c_cal++;\n }\n }\n document.getElementById(\"calc\").value = c_cal;\n if (c_cal >= 1 & c_cal <= 3) {\n document.getElementById(\"p_calc\").value = \"Low\";\n } else if (c_cal >= 4 & c_cal <= 5) {\n document.getElementById(\"p_calc\").value = \"Medium\";\n } else {\n document.getElementById(\"p_calc\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Chromium\") == 0) {\n for (j = 0; j < a_chrom.length; j++) {\n if (temp.indexOf(a_chrom[j].replace(/ /g, '')) >= 0) {\n c_chrom++;\n }\n }\n document.getElementById(\"chrom\").value = c_chrom;\n if (c_chrom == 1) {\n document.getElementById(\"p_chrom\").value = \"Low\";\n } else if (c_chrom == 2) {\n document.getElementById(\"p_chrom\").value = \"Medium\";\n } else {\n document.getElementById(\"p_chrom\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Copper\") == 0) {\n for (j = 0; j < a_copper.length; j++) {\n if (temp.indexOf(a_copper[j].replace(/ /g, '')) >= 0) {\n c_copper++;\n }\n }\n document.getElementById(\"copper\").value = c_copper;\n if (c_copper >= 1 & c_copper <= 2) {\n document.getElementById(\"p_copper\").value = \"Low\";\n } else if (c_copper >= 3 & c_copper <= 4) {\n document.getElementById(\"p_copper\").value = \"Medium\";\n } else {\n document.getElementById(\"p_copper\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"EssentialFattyAcids\") == 0) {\n for (j = 0; j < a_fatty.length; j++) {\n if (temp.indexOf(a_fatty[j].replace(/ /g, '')) >= 0) {\n c_fatty++;\n }\n }\n document.getElementById(\"fattyacid\").value = c_fatty;\n if (c_fatty >= 1 & c_fatty <= 3) {\n document.getElementById(\"p_fattyacid\").value = \"Low\";\n } else if (c_fatty >= 4 & c_fatty <= 6) {\n document.getElementById(\"p_fattyacid\").value = \"Medium\";\n } else {\n document.getElementById(\"p_fattyacid\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Protein\") == 0) {\n for (j = 0; j < a_protein.length; j++) {\n if (temp.indexOf(a_protein[j].replace(/ /g, '')) >= 0) {\n c_protein++;\n }\n }\n document.getElementById(\"protein\").value = c_protein;\n if (c_protein >= 1 & c_protein <= 4) {\n document.getElementById(\"p_protein\").value = \"Low\";\n } else if (c_protein >= 5 & c_protein <= 7) {\n document.getElementById(\"p_protein\").value = \"Medium\";\n } else {\n document.getElementById(\"p_protein\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Carbohydrates\") == 0) {\n for (j = 0; j < a_carbs.length; j++) {\n if (temp.indexOf(a_carbs[j].replace(/ /g, '')) >= 0) {\n c_carbs++;\n }\n }\n document.getElementById(\"carbs\").value = c_carbs;\n if (c_carbs == 1) {\n document.getElementById(\"p_carbs\").value = \"Low\";\n } else if (c_carbs >= 2 & c_carbs <= 3) {\n document.getElementById(\"p_carbs\").value = \"Medium\";\n } else {\n document.getElementById(\"p_carbs\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"FolicAcid\") == 0) {\n for (j = 0; j < a_folic.length; j++) {\n if (temp.indexOf(a_folic[j].replace(/ /g, '')) >= 0) {\n c_folic++;\n }\n }\n document.getElementById(\"folic\").value = c_folic;\n if (c_folic >= 1 & c_folic <= 3) {\n document.getElementById(\"p_folic\").value = \"Low\";\n } else if (c_folic >= 4 & c_folic <= 5) {\n document.getElementById(\"p_folic\").value = \"Medium\";\n } else {\n document.getElementById(\"p_folic\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Iodine\") == 0) {\n for (j = 0; j < a_ion.length; j++) {\n if (temp.indexOf(a_ion[j].replace(/ /g, '')) >= 0) {\n c_ion++;\n }\n }\n document.getElementById(\"iodine\").value = c_ion;\n if (c_ion == 1) {\n document.getElementById(\"p_iodine\").value = \"Low\";\n } else if (c_ion == 2) {\n document.getElementById(\"p_iodine\").value = \"Medium\";\n } else {\n document.getElementById(\"p_iodine\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Iron\") == 0) {\n for (j = 0; j < a_iron.length; j++) {\n if (temp.indexOf(a_iron[j].replace(/ /g, '')) >= 0) {\n c_iron++;\n }\n }\n document.getElementById(\"iron\").value = c_iron;\n if (c_iron >= 1 & c_iron <= 2) {\n document.getElementById(\"p_iron\").value = \"Low\";\n } else if (c_iron >= 3 & c_iron <= 5) {\n document.getElementById(\"p_iron\").value = \"Medium\";\n } else {\n document.getElementById(\"p_iron\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Magnesium\") == 0) {\n for (j = 0; j < a_mag.length; j++) {\n if (temp.indexOf(a_mag[j].replace(/ /g, '')) >= 0) {\n c_mag++;\n }\n }\n document.getElementById(\"mag\").value = c_mag;\n if (c_mag >= 1 & c_mag <= 2) {\n document.getElementById(\"p_mag\").value = \"Low\";\n } else if (c_mag >= 3 & c_mag <= 5) {\n document.getElementById(\"p_mag\").value = \"Medium\";\n } else {\n document.getElementById(\"p_mag\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Manganese\") == 0) {\n for (j = 0; j < a_man.length; j++) {\n if (temp.indexOf(a_man[j].replace(/ /g, '')) >= 0) {\n c_man++;\n }\n }\n document.getElementById(\"mana\").value = c_man;\n if (c_man == 1) {\n document.getElementById(\"p_mana\").value = \"Low\";\n } else if (c_man >= 2 & c_man <= 3) {\n document.getElementById(\"p_mana\").value = \"Medium\";\n } else {\n document.getElementById(\"p_mana\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Niacin\") == 0) {\n for (j = 0; j < a_nia.length; j++) {\n if (temp.indexOf(a_nia[j].replace(/ /g, '')) >= 0) {\n c_nia++;\n }\n }\n document.getElementById(\"nia\").value = c_nia;\n if (c_nia >= 1 & c_nia <= 4) {\n document.getElementById(\"p_nia\").value = \"Low\";\n } else if (c_nia >= 5 & c_nia <= 8) {\n document.getElementById(\"p_nia\").value = \"Medium\";\n } else {\n document.getElementById(\"p_nia\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"PantothenicAcid(B6)\") == 0) {\n for (j = 0; j < a_acid.length; j++) {\n if (temp.indexOf(a_acid[j].replace(/ /g, '')) >= 0) {\n c_acid++;\n }\n }\n document.getElementById(\"pana\").value = c_acid;\n if (c_acid >= 1 & c_acid <= 3) {\n document.getElementById(\"p_pana\").value = \"Low\";\n } else if (c_acid >= 4 & c_acid <= 6) {\n document.getElementById(\"p_pana\").value = \"Medium\";\n } else {\n document.getElementById(\"p_pana\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Potassium\") == 0) {\n for (j = 0; j < a_pot.length; j++) {\n if (temp.indexOf(a_pot[j].replace(/ /g, '')) >= 0) {\n c_pot++;\n }\n }\n document.getElementById(\"pot\").value = c_pot;\n if (c_pot >= 1 & c_pot <= 4) {\n document.getElementById(\"p_pot\").value = \"Low\";\n } else if (c_pot >= 5 & c_pot <= 7) {\n document.getElementById(\"p_pot\").value = \"Medium\";\n } else {\n document.getElementById(\"p_pot\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Pyridoxine(B6)\") == 0) {\n for (j = 0; j < a_pyr.length; j++) {\n if (temp.indexOf(a_pyr[j].replace(/ /g, '')) >= 0) {\n c_pyr++;\n }\n }\n document.getElementById(\"b6\").value = c_pyr;\n if (c_pyr >= 1 & c_pyr <= 4) {\n document.getElementById(\"p_b6\").value = \"Low\";\n } else if (c_pyr >= 5 & c_pyr <= 7) {\n document.getElementById(\"p_b6\").value = \"Medium\";\n } else {\n document.getElementById(\"p_b6\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Riboavin\") == 0) {\n for (j = 0; j < a_ribo.length; j++) {\n if (temp.indexOf(a_ribo[j].replace(/ /g, '')) >= 0) {\n c_ribo++;\n }\n }\n document.getElementById(\"ribo\").value = c_ribo;\n if (c_ribo >= 1 & c_ribo <= 4) {\n document.getElementById(\"p_ribo\").value = \"Low\";\n } else if (c_ribo >= 5 & c_ribo <= 8) {\n document.getElementById(\"p_ribo\").value = \"Medium\";\n } else {\n document.getElementById(\"p_ribo\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Selenium\") == 0) {\n for (j = 0; j < a_sel.length; j++) {\n if (temp.indexOf(a_sel[j].replace(/ /g, '')) >= 0) {\n c_Sel++;\n }\n }\n document.getElementById(\"sel\").value = c_Sel;\n if (c_Sel == 1) {\n document.getElementById(\"p_sel\").value = \"Low\";\n } else if (c_Sel >= 2 & c_Sel <= 3) {\n document.getElementById(\"p_sel\").value = \"Medium\";\n } else {\n document.getElementById(\"p_sel\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Thiamin\") == 0) {\n for (j = 0; j < a_thia.length; j++) {\n if (temp.indexOf(a_thia[j].replace(/ /g, '')) >= 0) {\n c_thia++;\n }\n }\n document.getElementById(\"thia\").value = c_thia;\n if (c_thia >= 1 & c_thia <= 3) {\n document.getElementById(\"p_thia\").value = \"Low\";\n } else if (c_thia >= 4 & c_thia <= 7) {\n document.getElementById(\"p_thia\").value = \"Medium\";\n } else {\n document.getElementById(\"p_thia\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminA\") == 0) {\n for (j = 0; j < a_vita.length; j++) {\n if (temp.indexOf(a_vita[j].replace(/ /g, '')) >= 0) {\n c_vita++;\n }\n }\n document.getElementById(\"vita\").value = c_vita;\n if (c_vita >= 1 & c_vita <= 2) {\n document.getElementById(\"p_vita\").value = \"Low\";\n } else if (c_vita >= 3 & c_vita <= 4) {\n document.getElementById(\"p_vita\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vita\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminB-12\") == 0) {\n for (j = 0; j < a_vitb12.length; j++) {\n if (temp.indexOf(a_vitb12[j].replace(/ /g, '')) >= 0) {\n c_vitb12++;\n }\n }\n document.getElementById(\"vitb12\").value = c_vitb12;\n if (c_vitb12 >= 1 & c_vitb12 <= 4) {\n document.getElementById(\"p_vitb12\").value = \"Low\";\n } else if (c_vitb12 >= 5 & c_vitb12 <= 7) {\n document.getElementById(\"p_vitb12\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vitb12\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminC\") == 0) {\n for (j = 0; j < a_vitc.length; j++) {\n if (temp.indexOf(a_vitc[j].replace(/ /g, '')) >= 0) {\n c_vitc++;\n }\n }\n document.getElementById(\"vitc\").value = c_vitc;\n if (c_vitc >= 1 & c_vitc <= 2) {\n document.getElementById(\"p_vitc\").value = \"Low\";\n } else if (c_vitc >= 3 & c_vitc <= 4) {\n document.getElementById(\"p_vitc\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vitc\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"CoQ10\") == 0) {\n for (j = 0; j < a_coq.length; j++) {\n if (temp.indexOf(a_coq[j].replace(/ /g, '')) >= 0) {\n c_coq++;\n }\n }\n document.getElementById(\"coq\").value = c_coq; //Larry\n if (c_coq >= 1 & c_coq <= 4) {\n document.getElementById(\"p_coq\").value = \"Low\";\n } else if (c_coq >= 5 & c_coq <= 9) {\n document.getElementById(\"p_coq\").value = \"Medium\";\n } else {\n document.getElementById(\"p_coq\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminD\") == 0) {\n for (j = 0; j < a_vitd.length; j++) {\n if (temp.indexOf(a_vitd[j].replace(/ /g, '')) >= 0) {\n c_vitd++;\n }\n }\n document.getElementById(\"vitd\").value = c_vitd;\n if (c_vitd >= 1 & c_vitd <= 2) {\n document.getElementById(\"p_vitd\").value = \"Low\";\n } else if (c_vitd >= 3 & c_vitd <= 5) {\n document.getElementById(\"p_vitd\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vitd\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminE\") == 0) {\n for (j = 0; j < a_vite.length; j++) {\n if (temp.indexOf(a_vite[j].replace(/ /g, '')) >= 0) {\n c_vite++;\n }\n }\n document.getElementById(\"vite\").value = c_vite;\n if (c_vite == 1) {\n document.getElementById(\"p_vite\").value = \"Low\";\n } else if (c_vite == 2) {\n document.getElementById(\"p_vite\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vite\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminK\") == 0) {\n for (j = 0; j < a_vitk.length; j++) {\n if (temp.indexOf(a_vitk[j].replace(/ /g, '')) >= 0) {\n c_vitk++;\n }\n }\n document.getElementById(\"vitk\").value = c_vitk;\n if (c_vitk == 1) {\n document.getElementById(\"p_vitk\").value = \"Low\";\n } else if (c_vitk == 2) {\n document.getElementById(\"p_vitk\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vitk\").value = \"High\";\n }\n }\n else {\n for (j = 0; j < a_zinc.length; j++) {\n if (temp.indexOf(a_zinc[j].replace(/ /g, '')) >= 0) {\n c_zinc++;\n }\n }\n document.getElementById(\"zinc\").value = c_zinc;\n if (c_zinc >= 1 & c_zinc <= 7) {\n document.getElementById(\"p_zinc\").value = \"Low\";\n } else if (c_zinc >= 8 & c_zinc <= 13) {\n document.getElementById(\"p_zinc\").value = \"Medium\";\n } else {\n document.getElementById(\"p_zinc\").value = \"High\";\n }\n }\n }\n }\n\n a_i = [\"Belching or gas within one hour after eating\", \"Heartburn or acid reux\", \"Bad breath\", \"Bloated within one hour after eating\", \"Loss of taste for meat\",//acid reflux\n \"Sweat has strong odor\", \"Stomach upset by taking vitamins\", \"Feel like skipping breakfast\", \"Sleepy after meals\", \"Feel better if you do not eat\",\n \"Fingernails chip, peel or break easily\", \"Anemia unresponsive to iron\", \"Stomach pains or cramps\", \"Chronic Diarrhea\", \"Diarrhea shortly after meals\",\n \"Black or tarry colored tools\", \"Undigested food in stool\"];\n a_ii = [\"Pain between shoulder blades\", \"History of morning sickness\", \"Bitter taste in mouth, especially after meals\", \"I am a recovering alcoholic\", \"Sensitive to tobacco smoke\",\n \"Sensitive to Nutrasweet (aspartame)\", \"Stomach upset by greasy foods\", \"Light or clay colored stools\", \"Become sick if you drink wine\", \" History of drug or alcohol abuse\",\n \"Pain under right side of rib cage\", \"Greasy or shinny stools\", \"Dry skin, itchy feet or skin peels on feet\", \"Easily intoxicated if you drink wine\", \" History of Hepatitis\",\n \"Hemorrhoids or varicose veins\", \"Nausea\", \"Headache over eyes\", \"Easily hung over if you drink wine\", \"Long term use of prescription or recreational drugs\",\n \"Chronic fatigue or bromyalgia\", \"Sea, car, airplane or motion sickness\", \"Gallbladder attack or removed\", //Chronic fatigue or fibromyalgia\n \"How much alcohol do you drink per week?\", \"Sensitive to chemicals\", \"Nutrasweet consumption\"];\n a_iii = [\"Food Allergies\", \"Abdominal bloating 1 to 2 hours after eating\", \"Pulse speeds after eating\", \"Specic foods make you tired or burdened\", \"Airborne allergies\",//specific \n \"Experience hives\", \"Sinus congestion\", \"Crave bread or noodles\", \"Alternating constipation and diarrhea\", \"Crohns disease\", \"Wheat or grain sensitivity\", //crohn's\n \"Asthma, sinus infections, stuy nose\", \"Dairy sensitivity\", \"Bizarre, vivid dreams, nightmares\", \"Feel spacy or unreal\", \"Use over the counter pain medications\"];//stuffy\n a_iv = [\"Anus itches\", \"Coated tongue\", \"Feel worse in moldy or dusty places\", \"Have taken antibiotics for long periods (2 to 3 months or more)\", \"Fungus or yeast infection\",\n \"Ringworm/Nail fungus\", \"Blood in stool\", \" Mucous in stool\", \"Painful to press on outer side of thighs\", \"Cramping in lower abdominal region\", \"Dark circles under eyes\",\n \"Excessive foul smelling lower bowel gas\", \"Irritable bowel or mucous colitis\", \"Strong body odors\", \"Less than 1 bowel movement daily\"];\n a_v = [\"Awaken a few hours after falling asleep, hard to get back to sleep\", \"Crave Sweets\", \"Bing or uncontrolled eating\", \"Excessive appetite\", \"Crave coee or sugar in afternoon\" //coffee\n , \"Sleepy in the afternoon\", \"Fatigue that is relieved by eating\", \"Headaches if meals are skipped\", \"Irritable before meals\", \"Shaky if meals are delayed\",\n \"Family members with diabetes\", \"Frequent thirst\", \"Frequent Urination\"];\n a_vi = [\"Tend to be a night person\", \"Diculty falling asleep\", \"Slow starter in the morning\", \"Keyed up, trouble calming down\", \"Blood pressure above 120/80\", //difficulty\n \"A headache after exercising\", \"Feeling wired or jittery after drinking coee\", \"Clench or grind teeth\", \"Calm on the outside, trouble on the inside\", //coffee\n \"Chronic low back pain, worse with fatigue\", \"Become dizzy when standing up suddenly\", \"Diculty maintaining manipulative correction\",\n \"Pain after manipulative correction\", \"Arthritic tendencies\", \"Crave salty foods\", \"Salt foods before tasting\", \"Perspire easily\",\n \"Chronic fatigue or get drowsy often\", \"Afternoon yawning\", \"After headaches\", \"Asthma, wheezing or diculty breathing\", \"Pain on the medial or inner side of the knee\",\n \"Tendency to sprain ankles or shin splints\", \"Tendency to need sunglasses\", \"Allergies and/or hives\", \"Weakness, dizziness\"];\n a_vii = [\"Sensitive/allergic to iodine\", \"Diculty gaining weight, even with large appetite\", \"Nervous, emotional, cant work under pressure\", \"Inward trembling\", \"Flush easily\",\n \"Fast pulse at rest\", \"Intolerant of high temperatures\", \"Diculty losing weight\", \"Mentally sluggish, reduced initiative\", \"Easily fatigued, sleepy during the day\",\n \"Sensitive to cold, poor circulation (cold hands and feet)\", \"Chronic constipation\", \"Excessive hair loss and/or coarse hair\", \"Morning headaches, wear o during the day\",\n \"Seasonal sadness\", \"Loss of lateral 1/3 of eyebrow\"];\n a_viii = [\"Prostate problems\", \"Diculty with urination or dribbling\", \"Dicult to start or stop urine stream\", \"Pain or burning during urination\", \"Waking to urinate at night\",\n \"Interruption of stream during urination\", \"Pain on inside of legs or heels\", \"Feeling of incomplete bowel evacuation\", \"Decreased sexual function\"];\n a_ix = [\"Depression during periods\", \"Mood swings associated with periods (PMS)\", \"Crave chocolate around period\", \"Breast tenderness associated with cycle\", \"Excessive menstrual ow\",\n \"Scanty blood ow during periods\", \"Occasional skipped periods\", \"Variations in menstrual cycle\", \"Endometriosis\", \"Uterine broids\", \"Breast broids, benign masses\",\n \"Painful intercourse\", \"Vaginal discharge\", \"Vaginal itchiness\", \"Vaginal dryness\", \"Weight gain around hips, thighs, and buttocks\", \"Excessive facial or body hair\",\n \"Thinning skin\", \"Hotashes\", \"Night sweats (in menopausal women)\"];\n a_x = [\"Aware of heavy or irregular breathing\", \"Discomfort at high altitudes\", \"Air hunger or sigh frequently\", \"Compelled to open windows in a closed room\", \"Shortness of breath with moderate exertion\",\n \"Ankles swell, especially at end of day\", \"Cough at night\", \"Blush or face turns red for no reason\", \"Muscle cramps with exertion\", \"Cold hands and feet , even in the warm season\",\n \"Dull pain or tightness in chest and/or radiate into right arm, worse with exertion\", \"Numbness in certain parts of the body\", \"Dry skin despite regular consumption of water\", \"Frequent dizziness\",\n \"Memory loss\", \"Lack of energy or frequent exhaustion\", \"Skin discoloration blemishes, or spots\", \"Weakened immune system\", \"Unexplained digestive problems\", \"Low libido (sex drive)\",\n \"Decreased cognitive ability\", \"Brittle hair and nails\", \"Hair loss\", \"Headaches\", \"Dark circles under eyes\", \"Problems with sleep\", \"Chronic pain or muscular and joint stiness\",\n \"Problems with leg ulcers or bed sores\", \"Varicose veins\"];\n a_xi = [\"Pain in mid-back region\", \"Puy around the eyes, dark circles under eyes\", \"History of kidney stones\", \"Cloudy, bloody or darkened urine\", \"Urine has a strong odor\"];\n a_xii = [\"Runny or drippy nose\", \"Catch colds at the beginning of winter\", \"Adult acne\", \"Itchy skin\", \"Cysts, boils, rashes\", \"History of Epstein Bar\", \"Frequent colds or u\",\n \"Frequent infections\", \"Mucous-producing cough\", \"History of Mono, Herpes\", \"History of Shingles, Chronic fatigue, Hepatitis or other chronic viral condition\"];\n b_pos = [];\n\n var c_i = 0;\n var c_ii = 0;\n var c_iii = 0;\n var c_iv = 0;\n var c_v = 0;\n var c_vi = 0;\n var c_vii = 0;\n var c_viii = 0;\n var c_ix = 0;\n var c_x = 0;\n var c_xi = 0;\n var c_xii = 0;\n\n for (k = 0; k < array_b.length; k++) {\n if (s.indexOf(array_b[k]) >= 0) {\n var first = s.indexOf(array_b[k]); //first occurence\n if (array_b[k] == \"V.\") {\n first = s.lastIndexOf(array_b[k]);\n }\n var previous = first - 1;\n var seconddot = first + 1;\n var thirddot = first + 2;\n var fourthdot = first + 3;/*\n console.log(\"================================\");\n console.log(\"previous :\", s.charAt(previous) , previous);\n console.log(\"firstchar :\", s.charAt(first), first);\n console.log(\"seconddot \", s.charAt(seconddot) , seconddot);\n console.log(\"thirddot :\", s.charAt(thirddot));\n console.log(\"fourthdot :\", s.charAt(fourthdot));*/\n\n if (array_b[k] == \"I.\" && s.charAt(seconddot) == \".\" && s.charAt(previous) != \"I\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"II.\" && s.charAt(thirddot) == \".\" && s.charAt(previous) != \"I\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"III.\" && s.charAt(fourthdot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"IV.\" && s.charAt(thirddot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"V.\" && s.charAt(seconddot) == \".\" && s.charAt(previous) != \"I\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"VI.\" && s.charAt(thirddot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"VII.\" && s.charAt(fourthdot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"X.\" && s.charAt(seconddot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"XI.\" && s.charAt(thirddot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"XII.\" && s.charAt(fourthdot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"VIII\" || array_b[k] == \"IX\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n }\n }\n }\n //console.log(b_pos);\n if (b_pos.length > 0) {\n for (x = 0; x < b_pos.length; x++) {\n\n if (x < (b_pos.length - 1)) {\n var index1 = s.indexOf(b_pos[x]);\n var index2 = s.indexOf(b_pos[x + 1]);\n if (index2 - index1 > 1) {\n var temp = s.substring(index1, index2);\n } else {\n index2 = s.lastIndexOf(b_pos[x + 1]);\n var temp = s.substring(index1, index2);\n }\n } else { //last member of array\n var index1 = s.indexOf(b_pos[x]);\n var index2 = s.indexOf(\"List\");\n if (index2 < 0) {\n var temp = s.substring(index1, s.length);\n } else {\n var temp = s.substring(index1, index2);\n }\n }\n if (b_pos[x].localeCompare(\"I.\") == 0) {\n for (j = 0; j < a_i.length; j++) {\n if (temp.indexOf(a_i[j].replace(/ /g, '')) >= 0) {\n c_i++;\n }\n }\n document.getElementById(\"u_i\").value = c_i;\n if (c_i >= 1 & c_i <= 4) {\n document.getElementById(\"p_i\").value = \"Low\";\n } else if (c_i >= 5 & c_i <= 8) {\n document.getElementById(\"p_i\").value = \"Medium\";\n } else {\n document.getElementById(\"p_i\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"II.\") == 0) {\n for (j = 0; j < a_ii.length; j++) {\n if (temp.indexOf(a_ii[j].replace(/ /g, '')) >= 0) {\n c_ii++;\n }\n }\n document.getElementById(\"ii\").value = c_ii;\n if (c_ii >= 1 & c_ii <= 6) {\n document.getElementById(\"p_ii\").value = \"Low\";\n } else if (c_ii >= 7 & c_ii <= 12) {\n document.getElementById(\"p_ii\").value = \"Medium\";\n } else {\n document.getElementById(\"p_ii\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"III.\") == 0) {\n for (j = 0; j < a_iii.length; j++) {\n if (temp.indexOf(a_iii[j].replace(/ /g, '')) >= 0) {\n c_iii++;\n }\n }\n document.getElementById(\"iii\").value = c_iii;\n if (c_iii >= 1 & c_iii <= 4) {\n document.getElementById(\"p_iii\").value = \"Low\";\n } else if (c_iii >= 5 & c_iii <= 8) {\n document.getElementById(\"p_iii\").value = \"Medium\";\n } else {\n document.getElementById(\"p_iii\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"IV.\") == 0) {\n for (j = 0; j < a_iv.length; j++) {\n if (temp.indexOf(a_iv[j].replace(/ /g, '')) >= 0) {\n c_iv++;\n }\n }\n document.getElementById(\"iv\").value = c_iv;\n if (c_iv >= 1 & c_iv <= 4) {\n document.getElementById(\"p_iv\").value = \"Low\";\n } else if (c_iv >= 5 & c_iv <= 7) { //Larry\n document.getElementById(\"p_iv\").value = \"Medium\";\n } else {\n document.getElementById(\"p_iv\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"V.\") == 0) {\n for (j = 0; j < a_v.length; j++) {\n if (temp.indexOf(a_v[j].replace(/ /g, '')) >= 0) {\n c_v++;\n }\n }\n document.getElementById(\"v\").value = c_v;\n if (c_v >= 1 & c_v <= 3) {\n document.getElementById(\"p_v\").value = \"Low\";\n } else if (c_v >= 4 & c_v <= 6) {\n document.getElementById(\"p_v\").value = \"Medium\";\n } else {\n document.getElementById(\"p_v\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"VI.\") == 0) {\n for (j = 0; j < a_vi.length; j++) {\n if (temp.indexOf(a_vi[j].replace(/ /g, '')) >= 0) {\n c_vi++;\n }\n }\n document.getElementById(\"vi\").value = c_vi;\n if (c_vi >= 1 & c_vi <= 6) {\n document.getElementById(\"p_vi\").value = \"Low\";\n } else if (c_vi >= 7 & c_vi <= 13) {\n document.getElementById(\"p_vi\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vi\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"VII.\") == 0) {\n for (j = 0; j < a_vii.length; j++) {\n if (temp.indexOf(a_vii[j].replace(/ /g, '')) >= 0) {\n c_vii++;\n }\n }\n document.getElementById(\"vii\").value = c_vii;\n if (c_vii >= 1 & c_vii <= 4) {\n document.getElementById(\"p_vii\").value = \"Low\";\n } else if (c_vii >= 5 & c_vii <= 8) {\n document.getElementById(\"p_vii\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vii\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"VIII\") == 0) {\n for (j = 0; j < a_viii.length; j++) {\n if (temp.indexOf(a_viii[j].replace(/ /g, '')) >= 0) {\n c_viii++;\n }\n }\n document.getElementById(\"viii\").value = c_viii;\n if (c_viii >= 1 & c_viii <= 2) {\n document.getElementById(\"p_viii\").value = \"Low\";\n } else if (c_viii >= 3 & c_viii <= 4) {\n document.getElementById(\"p_viii\").value = \"Medium\";\n } else {\n document.getElementById(\"p_viii\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"IX\") == 0) {\n for (j = 0; j < a_ix.length; j++) {\n if (temp.indexOf(a_ix[j].replace(/ /g, '')) >= 0) {\n c_ix++;\n }\n }\n document.getElementById(\"ix\").value = c_ix;\n if (c_ix >= 1 & c_ix <= 5) {\n document.getElementById(\"p_ix\").value = \"Low\";\n } else if (c_ix >= 6 & c_ix <= 10) {\n document.getElementById(\"p_ix\").value = \"Medium\";\n } else {\n document.getElementById(\"p_ix\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"X.\") == 0) {\n for (j = 0; j < a_x.length; j++) {\n if (temp.indexOf(a_x[j].replace(/ /g, '')) >= 0) {\n c_x++;\n }\n }\n document.getElementById(\"x\").value = c_x;\n if (c_x >= 1 & c_x <= 3) {\n document.getElementById(\"p_x\").value = \"Low\";\n } else if (c_x >= 4 & c_x <= 6) {\n document.getElementById(\"p_x\").value = \"Medium\";\n } else {\n document.getElementById(\"p_x\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"XI.\") == 0) {\n for (j = 0; j < a_xi.length; j++) {\n if (temp.indexOf(a_xi[j].replace(/ /g, '')) >= 0) {\n c_xi++;\n }\n }\n document.getElementById(\"xi\").value = c_xi;\n if (c_xi == 1) {\n document.getElementById(\"p_xi\").value = \"Low\";\n } else if (c_xi = 2) {\n document.getElementById(\"p_xi\").value = \"Medium\";\n } else {\n document.getElementById(\"p_xi\").value = \"High\";\n }\n } else {\n for (j = 0; j < a_xii.length; j++) {\n if (temp.indexOf(a_xii[j].replace(/ /g, '')) >= 0) {\n c_xii++;\n }\n }\n document.getElementById(\"xii\").value = c_xii;\n if (c_xii >= 1 & c_xii <= 3) {\n document.getElementById(\"p_xii\").value = \"Low\";\n } else if (c_xii >= 4 & c_xii <= 5) {\n document.getElementById(\"p_xii\").value = \"Medium\";\n } else {\n document.getElementById(\"p_xii\").value = \"High\";\n }\n }\n }\n }\n //}\n });\n }, function (reason) {\n // PDF loading error\n console.log(\"Error loading pdf\");\n console.error(reason);\n });\n}", "function getText_DataIndex() {\n\treturn 0;\n}", "function takeDataIn(text) {\n\n console.log(text);\n}", "function getText$1(node) {\n if (Array.isArray(node))\n return node.map(getText$1).join(\"\");\n if (domhandler_1$5.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText$1(node.children);\n if (domhandler_1$5.isCDATA(node))\n return getText$1(node.children);\n if (domhandler_1$5.isText(node))\n return node.data;\n return \"\";\n}", "get textContent() {\n const cached = this.cacheGet(TEXT_CONTENT);\n if (cached) {\n return cached;\n }\n const text = this.childNodes.map((node) => node.textContent).join(\"\");\n this.cacheSet(TEXT_CONTENT, text);\n return text;\n }" ]
[ "0.7546426", "0.7202497", "0.7202497", "0.69531816", "0.68463546", "0.68114513", "0.67314905", "0.6698512", "0.6619906", "0.6591739", "0.65905195", "0.65711683", "0.6474766", "0.64540803", "0.64246804", "0.6400987", "0.6400413", "0.6400413", "0.63825047", "0.6376834", "0.6367872", "0.6367833", "0.63666993", "0.635849", "0.63495076", "0.6348172", "0.63460034", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.63439953", "0.6343082", "0.6318426", "0.6318426", "0.6318426", "0.62847257", "0.6276612", "0.62763184", "0.6262895", "0.6225003", "0.6216032", "0.62012386", "0.6194125", "0.61914927", "0.6165061", "0.6147562", "0.6142034", "0.61404896", "0.6134833", "0.6124772", "0.6108349", "0.6104025", "0.60857314", "0.60857105", "0.60806626", "0.6066682", "0.60481715", "0.60383576", "0.60181296", "0.601698", "0.60036635", "0.6002938", "0.6001426", "0.59948033", "0.59858304", "0.5954705", "0.5939639", "0.593565", "0.5935403", "0.59067035", "0.58972734", "0.5889147", "0.58887357" ]
0.7144465
3
Obtener los elementos del DOM
function sendMsg(e) { var event = e.originalEvent; console.log(event.keyCode); if (event.keyCode == 13) { if (!myName) { myName = $("#input").val(); socket.send(myName); } else { var txt = $("#input").val(); socket.send(myName, txt, myColor, new Date()); } $("#input").val(""); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getElementsFromHTML() {\n toRight = document.querySelectorAll(\".to-right\");\n toLeft = document.querySelectorAll(\".to-left\");\n toTop = document.querySelectorAll(\".to-top\");\n toBottom = document.querySelectorAll(\".to-bottom\");\n }", "get elements() {\n return browser.elements(this._selector);\n }", "findElements() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const es = [];\r\n const ids = yield this.findElementIds();\r\n ids.forEach(id => {\r\n const e = new Element(this.http.newClient(''), id);\r\n es.push(e);\r\n });\r\n return es;\r\n });\r\n }", "function _gatherElements() {\n return jQuery('*[id]')\n .toArray()\n // use jQuery instances\n .map(function(oElement) {\n return jQuery(oElement);\n })\n .filter(function($element) {\n // is at least part of a control\n return $element.control().length > 0 &&\n // is the root of a control\n $element.attr('id') === $element.control()[0].getId();\n });\n }", "function getDOMElements(){\r\n return {\r\n squares: Array.from(document.querySelectorAll(\".grid div\")),\r\n firstSquare: function(){ return this.squares[30] },\r\n squaresInActiveGameplace: Array.from(grid.querySelectorAll(\".activegameplace\")),\r\n firstSquareInRow: document.querySelectorAll(\".first-in-row\"),\r\n lastSquareInRow: document.querySelectorAll(\".last-in-row\"),\r\n music: document.getElementById(\"myAudio\")\r\n }\r\n}", "initDOMElements() {\n this.DOMElement = this.app.el.querySelector('#homepage');\n\n this.characterSelector = this.DOMElement.querySelector('#character-selector');\n\n this.charactersList = this.characterSelector.querySelectorAll('.character');\n \n this.buttonStartGame = this.DOMElement.querySelector('#start-game');\n\n this.character_01 = this.characterSelector.querySelectorAll('.character_01'); \n this.character_02 = this.characterSelector.querySelectorAll('.character_02');\n this.character_03 = this.characterSelector.querySelectorAll('.character_03');\n this.character_04 = this.characterSelector.querySelectorAll('.character_04');\n\n this.character_vs_01 = this.DOMElement.querySelector('#character_vs_01');\n this.character_vs_02 = this.DOMElement.querySelector('#character_vs_02');\n }", "getElements(){\n return this.elements;\n }", "function getEls() {\n // We're cheating a bit on styles.\n let preStyleEl = document.createElement('style');\n preStyleEl.textContent = preStyles;\n document.head.insertBefore(preStyleEl, document.getElementsByTagName('style')[0]);\n\n // El refs\n style = document.getElementById('style-tag');\n styleEl = document.getElementById('style-text');\n workEl = document.getElementById('work-text');\n pgpEl = document.getElementById('heart');\n skipAnimationEl = document.getElementById('skip-animation');\n pauseEl = document.getElementById('pause-resume');\n}", "function __(elm) { return document.querySelectorAll(elm) }", "function read_dom(){\n google_eles = [\n document.getElementById('viewport'),\n document.getElementById('body'),\n document.getElementById('footer'),\n document.getElementById('fbar')\n ];\n}", "function listDomElements() {\n\t var children = document.body.childNodes;\n\t var i;\n\n\t for (i = 0; i < children.length; i = i + 1) {\n\t console.log(children[i]);\n\t }\n\t}", "function getAllElements() {\n return Array.from($(`.${ELEMENT_CLASS}`)).sort(function (a, b) { return getENumber(a) - getENumber(b) })\n}", "function gatherElements () {\n\n var snapWrap = gatherSnapWrap();\n\n elements = {\n main: $element[0],\n scrollContainer: $element[0].querySelector('.md-virtual-repeat-container, .md-standard-list-container'),\n scroller: $element[0].querySelector('.md-virtual-repeat-scroller, .md-standard-list-scroller'),\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: snapWrap.wrap,\n snap: snapWrap.snap,\n root: document.body,\n };\n\n elements.li = elements.ul.getElementsByTagName('li');\n elements.$ = getAngularElements(elements);\n mode = elements.scrollContainer.classList.contains('md-standard-list-container') ? MODE_STANDARD : MODE_VIRTUAL;\n inputModelCtrl = elements.$.input.controller('ngModel');\n }", "function gatherElements () {\n elements = {\n main: $element[0],\n scrollContainer: $element[0].getElementsByClassName('md-virtual-repeat-container')[0],\n scroller: $element[0].getElementsByClassName('md-virtual-repeat-scroller')[0],\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: $element.find('md-autocomplete-wrap')[0],\n root: document.body\n };\n elements.li = elements.ul.getElementsByTagName('li');\n elements.snap = getSnapTarget();\n elements.$ = getAngularElements(elements);\n }", "function gatherElements () {\n elements = {\n main: $element[0],\n scrollContainer: $element[0].getElementsByClassName('md-virtual-repeat-container')[0],\n scroller: $element[0].getElementsByClassName('md-virtual-repeat-scroller')[0],\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: $element.find('md-autocomplete-wrap')[0],\n root: document.body\n };\n elements.li = elements.ul.getElementsByTagName('li');\n elements.snap = getSnapTarget();\n elements.$ = getAngularElements(elements);\n }", "getElements(){\n const thisWidget = this; \n \n thisWidget.dom.input = thisWidget.dom.wrapper.querySelector(select.widgets.amount.input);\n thisWidget.dom.linkDecrease = thisWidget.dom.wrapper.querySelector(select.widgets.amount.linkDecrease);\n thisWidget.dom.linkIncrease = thisWidget.dom.wrapper.querySelector(select.widgets.amount.linkIncrease);\n }", "function getElements(id) {\n let element = document.getElementById(id);\n return element;\n}//End of getElement function", "loadElements()\n {\n\n this.el = {};\n\n document.querySelectorAll('[id]').forEach(element => \n {\n this.el[Format.getCamelCase(element.id)] = element\n });\n }", "get all() {\n const _elements = [];\n try {\n const value = this.elements.value;\n if (value && value.length) {\n // create list elements\n for (let i = 0; i < value.length; i++) {\n // make each list element individually selectable via xpath\n const selector = `(${this._selector})[${i + 1}]`;\n const listElement = this._elementStoreFunc.apply(this._store, [selector, this._elementOpts]);\n _elements.push(listElement);\n }\n }\n return _elements;\n }\n catch (error) {\n // this.elements will throw error if no elements were found\n return _elements;\n }\n }", "getDOMElement(){\n return document.getElementById(this.getElementId());\n }", "function __( el )\n{\n return document.querySelectorAll( el );\n}", "function Elements() {\n // [html, head, …]\n this.query();\n // { 'iframe-label': [html, head, …], … }\n this.queryNestedDocuments();\n // NOTE: this.documents may differ from window.nestedDocuments\n // { 'shadow-label': [html, head, …] }\n this.queryShadowHosts();\n // [html, head, … iframe, html, head, … shadowed-element, …]\n this.allElements = this.mergeElements();\n // the set we're actually working with\n this.relevantElements = this.allElements\n .filter(utils.filterLabeledElements)\n .filter(utils.removeIgnoredAttribute);\n // the elements we can actually focus from script\n this.scriptFocusableElements = this.relevantElements\n .filter(utils.filterFocusMethod);\n\n // lookup table for ident -> element,\n // also log duplicate ident use\n this.idents = this.listToMap(this.relevantElements);\n }", "function cashElements() {\n form = global.document.querySelector(\"#todo-form\");\n input = global.document.querySelector(\"#todo-input\");\n todoList = global.document.querySelector(\"#todo-list\");\n allButton = global.document.querySelector(\"#all\");\n pendingButton = global.document.querySelector(\"#pending\");\n doneButton = global.document.querySelector(\"#done\");\n clearButton = global.document.querySelector(\"#clear-all-todos\");\n }", "function getElements(ids, isParent) {\n var elems = [];\n if (\n Array.isArray(ids) &&\n ids[0] != \"CONTAINER\" &&\n ids[0] != \"WINDOW\" &&\n ids[0] != \"DOCUMENT\" &&\n ids[0] != \"BODY\" &&\n ids[0] != \"QUERYSELECTOR\"\n ) {\n for (var i = 0; i < ids.length; i++)\n elems.push(getElement(ids[i], isParent));\n } else {\n elems.push(getElement(ids, isParent));\n }\n return elems;\n }", "function getElements(ids, isParent) {\n var elems = [];\n if (\n Array.isArray(ids) &&\n ids[0] != \"CONTAINER\" &&\n ids[0] != \"WINDOW\" &&\n ids[0] != \"DOCUMENT\" &&\n ids[0] != \"BODY\" &&\n ids[0] != \"QUERYSELECTOR\"\n ) {\n for (var i = 0; i < ids.length; i++)\n elems.push(getElement(ids[i], isParent));\n } else {\n elems.push(getElement(ids, isParent));\n }\n return elems;\n }", "getElements() {\n return this.#elements;\n }", "function generaAforoDOMSegunArrayAsientos() {\n // Añade los asientos al DOM a partir de la variable asientos\n let contenidoHTML = \"\";\n let clase = \"\";\n \n asientos.forEach((asiento, indice) => {\n switch (asiento) {\n case LIBRE:\n clase = valorClassDeAsientoLIBRE;\n break;\n case OCUPADO:\n clase = valorClassDeAsientoOCUPADO;\n break;\n case SELECCIONADO:\n clase = valorClassDeAsientoSELECCIONADO;\n break;\n }\n contenidoHTML += `<div class=\"${clase}\" data-index=\"${indice}\"></div>`;\n });\n aforo.innerHTML = contenidoHTML;\n }", "getElements(selector) {\n let elements = Array.from(\n document.querySelectorAll('bolt-image'),\n ).map(elem =>\n elem.renderRoot\n ? elem.renderRoot.querySelector(selector)\n : elem.querySelector(selector),\n );\n elements = elements.filter(function(el) {\n return el != null;\n });\n return elements;\n }", "function GetElements(win, id) {\n return win.document.getElementsByName(id);\n}", "function Elements() {\n}", "function gatherElements () {\n elements = {\n main: $element[0],\n scrollContainer: $element[0].querySelector('.md-virtual-repeat-container'),\n scroller: $element[0].querySelector('.md-virtual-repeat-scroller'),\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: $element.find('md-autocomplete-wrap')[0],\n root: document.body\n };\n\n elements.li = elements.ul.getElementsByTagName('li');\n elements.snap = getSnapTarget();\n elements.$ = getAngularElements(elements);\n\n inputModelCtrl = elements.$.input.controller('ngModel');\n }", "function _findElements(domRoot) {\n\t\tlet items = Array.from(domRoot.querySelectorAll(`[${DOM_SELECTOR}]`));\n\t\tif (domRoot.hasAttribute(DOM_SELECTOR)) {\n\t\t\titems.push(domRoot);\n\t\t}\n\n\t\titems.forEach(function (item) {\n\t\t\tif (!item[DOM_ATTRIBUTE]) {\n\t\t\t\titem[DOM_ATTRIBUTE] = new _constructor(item);\n\t\t\t}\n\t\t});\n\t}", "function createElements() {\n if( document.getElementById(\"ratk\") == null ) {\n let s0 = document.createElement(\"br\");\n let s1 = document.createElement(\"span\");\n s1.id=\"wiki\"\n let s2 = document.createElement(\"span\")\n s2.id=\"ratk\"\n let s3 = document.createElement(\"span\")\n s3.id=\"wikt\"\n let s4 = document.createElement(\"span\")\n s4.id=\"bing\"\n let s5 = document.createElement(\"span\")\n s5.id=\"syno\"\n document.getElementById(\"ratkaistuja\").appendChild(s0)\n document.getElementById(\"ratkaistuja\").appendChild(s1)\n document.getElementById(\"ratkaistuja\").appendChild(s2)\n document.getElementById(\"ratkaistuja\").appendChild(s3)\n document.getElementById(\"ratkaistuja\").appendChild(s4)\n document.getElementById(\"ratkaistuja\").appendChild(s5)\n }\n}", "function prendiElementoDaId(id_elemento) \r\n{\r\n\tvar elemento;\r\n\tif(document.getElementById)\r\n\t{\r\n\t\telemento = document.getElementById(id_elemento);\r\n\t}\r\n\telse\r\n\t{\r\n\t\telemento = document.all[id_elemento];\r\n\t}\r\n\treturn elemento;\r\n}", "function 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}", "static getElements(els) {\r\n if (typeof els === 'string') {\r\n let list = document.querySelectorAll(els);\r\n if (!list.length && els[0] !== '.' && els[0] !== '#') {\r\n list = document.querySelectorAll('.' + els);\r\n if (!list.length) {\r\n list = document.querySelectorAll('#' + els);\r\n }\r\n }\r\n return Array.from(list);\r\n }\r\n return [els];\r\n }", "function getElements(ids, isParent) {\n var elems = [];\n if (Array.isArray(ids) && ids[0] != 'CONTAINER' && ids[0] != 'WINDOW' &&\n ids[0] != 'DOCUMENT' && ids[0] != 'BODY' && ids[0] != 'QUERYSELECTOR') {\n for (var i = 0; i < ids.length; i++)\n elems.push(getElement(ids[i], isParent));\n } else {\n elems.push(getElement(ids, isParent));\n }\n return elems;\n}", "function getDomElement() {\n return getElement();\n } // ========================== Motion End ==========================", "static getChildren(el, klass) {\n const results = [];\n if (el == null)\n return results;\n for (let node = el.firstElementChild; node != null; node = node === null || node === void 0 ? void 0 : node.nextElementSibling) {\n if (Dom.hasClass(node, klass))\n results.push(node);\n }\n return results;\n }", "function borraElemento() {\r\n\r\n\r\n var lista = document.getElementById(\"lista ordenada\");\r\n\r\n\t//El truco es ver cuales elementos de \"lista\", (en nuestro HTML \"lista ordenada\") tienen asociada la clase \"borrable\"\r\n var elementoMarcado = lista.getElementsByClassName(\"borrable\");\r\n\r\n//Los borramos uno a uno, siempre el \"primer elemento\" será borrado y luego se continua hasta quedar sin elementos.\r\n\r\n while (elementoMarcado.length > 0) {\r\n elementoMarcado.item(0).remove();\r\n }\r\n}", "function getElements(x) {\n var theElement = document.getElementById(x);\n return theElement;\n }", "function getElements() {\n\tvar re = new RegExp('(^| )'+'niceform'+'( |$)');\n\tfor (var nf = 0; nf < document.getElementsByTagName('form').length; nf++) {\n\t\tif(re.test(niceforms[nf].className)) {\n\t\t\tfor(var nfi = 0; nfi < document.forms[nf].getElementsByTagName('input').length; nfi++) {inputs.push(document.forms[nf].getElementsByTagName('input')[nfi]);}\n\t\t\tfor(var nfl = 0; nfl < document.forms[nf].getElementsByTagName('label').length; nfl++) {labels.push(document.forms[nf].getElementsByTagName('label')[nfl]);}\n\t\t\tfor(var nft = 0; nft < document.forms[nf].getElementsByTagName('textarea').length; nft++) {textareas.push(document.forms[nf].getElementsByTagName('textarea')[nft]);}\n\t\t\tfor(var nfs = 0; nfs < document.forms[nf].getElementsByTagName('select').length; nfs++) {selects.push(document.forms[nf].getElementsByTagName('select')[nfs]);}\n\t\t}\n\t}\n}", "function obtenerBotones(){\n\tbotones = document.querySelectorAll(\".verMas\");\n\treturn botones;\n}", "get listOfCardElements() { return $$(\".card\"); }", "function getDom(el) {\n return document.querySelector(el)\n}", "function $() {\n var elements = new Array();\n for (var i = 0; i < arguments.length; i++) {\n var element = arguments[i];\n if (typeof element == 'string')\n element = document.getElementById(element);\n if (arguments.length == 1)\n return element;\n elements.push(element);\n }\n return elements;\n}", "function cargarDatosDOM(){\n let platoLS;\n platoLS = obtenerLocalStorage()\n\n platoLS.forEach(function(platos){\n const rowCarrito = document.createElement('tr');\n\n //agregar la fila al carrito\n\n rowCarrito.innerHTML = `\n <td>${platos.nombre}</td>\n <td>${platos.precio}</td>\n <td><a href=\"#\" id=\\\"${platos.id}\\\" class=\"borrar\">X<a></td>\n `\n DomCarrito.appendChild(rowCarrito)\n });\n}", "function $() {\n var elements = new Array();\n for (var i = 0; i < arguments.length; i++) {\n var element = arguments[i];\n if (typeof element == 'string')\n element = document.getElementById(element);\n elements.push(element);\n }\n return elements;\n}", "function getElement(names) {\n if (typeof names === 'string') {\n names = names.split('.');\n }\n if (names.length === 0) {\n return container;\n }\n const selector = names\n .map((name) => {\n return '[data-element=\"' + name + '\"]';\n })\n .join(' ');\n\n return container.querySelector(selector);\n }", "function getElements(root) {\n\t\tvar elems = [],\n\t\t\tlist,\n\t\t\tel;\n\n\t\t// add all associated form elements which sit outside form\n\t\tif (root.nodeName.toLowerCase() == 'form' && root.id) {\n\t\t\tlist = document.querySelectorAll('[form=\"' + root.id + '\"]');\n\n\t\t\tfor (var i = 0, count = list.length; i < count; i++) {\n\t\t\t\tel = list[i];\n\t\t\t\tif (!root.contains(el)) {\n\t\t\t\t\telems.push(el);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add all form elements which are not buttons\n\t\tlist = root.getElementsByTagName('*');\n\t\tfor (var i = 0, count = list.length; i < count; i++) {\n\t\t\tel = list[i];\n\t\t\tif (!Dom.matches(el, nonSubmittable)) {\n\t\t\t\telems.push(el);\n\t\t\t}\n\t\t}\n\n\t\treturn elems;\n\t}", "_load_html_elements_by_id(...ids){\n const html_elements = [];\n for (const id of ids){\n if (typeof id !== \"string\") throw new Error('ids must be a string');\n const element = document.getElementById(id);\n if (element === null ) throw new Error(`Cannot find html element with id ${id}`);\n html_elements.push(element);\n }\n return html_elements;\n }", "function GetAllElements(element) {\n var elements = [];\n\n if (element && element.hasChildNodes()) {\n elements.push(element);\n\n var childs = element.childNodes;\n\n for (var i = 0; i < childs.length; i++) {\n if (childs[i].hasChildNodes()) {\n elements = elements.concat(GetAllElements(childs[i]));\n } else if (childs[i].nodeType === 1) {\n elements.push(childs[i]);\n }\n }\n }\n return elements;\n}", "function Elements() {\n this._elements = [];\n this._currentIndex = 0;\n }", "function getNodesFromDom(selector) {\n\t const elementList = document.querySelectorAll(selector);\n\t const nodesArray = Array.from(elementList);\n\t return new DomNodeColection(nodesArray);\n\t}", "function getNodesFromDom(selector) {\n const elementList = document.querySelectorAll(selector);\n const nodesArray = Array.from(elementList);\n return new DomNodeColection(nodesArray);\n}", "function findNodes(body, parent)\n{\n let newUl = document.createElement('ul');\n \n //maji se zpracovavat Dokumentove, Elementove a Textove uzly, pokud je ale dokument formatovany,\n //tak za textove uzly jsou povaovany i ty formatovaci prazdne radky, mezery, tabulatory....\n // ty se asi jako textove uzly tisknou nemaji a tak je budeme ignorovat... ASI\n for (let node of body.childNodes)\n {\n if (node.nodeType === Node.TEXT_NODE) \n {\n if (isEmpty(node)) //je to prazdne, netiskneme\n continue;\n else \n {\n let newLi = document.createElement('li');\n newLi.textContent = \"Text\";\n newLi.title = node.textContent;\n newUl.appendChild(newLi);\n all.push(node);\n allLi.push(newLi);\n \n findNodes(node, newLi);\n }\n }\n else if (node.nodeType === Node.ELEMENT_NODE)\n {\n if (node.tagName.toLowerCase() === 'script') //SCRIPT tag asi ignorovat\n continue;\n \n let newLi = document.createElement('li');\n newLi.textContent = node.tagName;\n newUl.appendChild(newLi);\n all.push(node);\n allLi.push(newLi);\n \n findNodes(node, newUl);\n }\n else\n alert(\"IDK\");\n \n \n }\n \n parent.appendChild(newUl);\n}", "function ocultaLetrasEHinarios() {\r\n\t\r\n\t//recupera lista de elementos com a classe 'oculta-hinario'\r\n\tvar hinarios = document.getElementsByClassName('oculta-hinario');\r\n\t\r\n\t//oculta os elementos da lista acima\r\n\tfor(var i = 0; i < hinarios.length; i++) {\r\n\t\thinarios[i].style.display = \"none\";\r\n\t}\r\n\t\r\n\t//recupera lista de elementos com a classe 'oculta-letra'\r\n\tvar letras = document.getElementsByClassName('oculta-letra');\r\n\t\r\n\t//oculta os elementos da lista acima\t\r\n\tfor(var i = 0; i < letras.length; i++) {\r\n\t\tletras[i].style.display = \"none\";\r\n\t}\r\n\t\r\n\t//seta a visibilidade dos elementos pelo nome da classe\r\n\tvisibilidadeElementoPorClasse('separador',false);\r\n\tvisibilidadeElementoPorClasse('paragrafo-letra',false);\r\n}", "function Dom(seletor) {\n this.element = function() {\n return document.querySelector(seletor);\n }\n this.ativo = function(classe) {\n this.element().classList.add(classe);\n }\n}", "function _selectElements(){\n\t\t//Fill in variables wil selected elements\n\t\t$header = $('#header');\n\t\t$content = $('#main');\n\t\t$areaBegin = $(\"#begin-area\");\n\t\t$areaDisplay = $(\"#display-area\");\n\t\t$dropMore = $(\"#drop-area-more\");\n\t\t$output = $(\"#output\")\n\t\t$parserErrorDisplay = $('#parser-error-display');\n\t\t$donationNag = $(\"#many-songs-please-donate\");\n\t\t$totalSongCountDisplay = $(\"#total-song-count\");\n\t}", "function divElementsWithTagName (){\n\tvar divElements = document.getElementsByTagName(\"div\");\n\tvar result = [];\n\tfor (var i = 0; i < divElements.length; i++){\n\t\tif (divElements[i].parentNode && divElements[i].parentNode.tagName === 'DIV'){\n\t\t\tresult.push(divElements[i]);\n\t\t}\n\t}\n\treturn result;\n}", "function getElements() {\r\n\t// remove prevously created elements\r\n\tif(window.inputs) {\r\n\t\tfor(var i = 0; i < inputs.length; i++) {\r\n\t\t\tinputs[i].className = inputs[i].className.replace('outtaHere','');\r\n\t\t\tif(inputs[i]._ca) inputs[i]._ca.parentNode.removeChild(inputs[i]._ca);\r\n\t\t\telse if(inputs[i]._ra) inputs[i]._ra.parentNode.removeChild(inputs[i]._ra);\r\n\t\t}\r\n\t\tfor(i = 0; i < selects.length; i++) {\r\n\t\t\tselects[i].replaced = null;\r\n\t\t\tselects[i].className = selects[i].className.replace('outtaHere','');\r\n\t\t\tselects[i]._optionsDiv._parent.parentNode.removeChild(selects[i]._optionsDiv._parent);\r\n\t\t\tselects[i]._optionsDiv.parentNode.removeChild(selects[i]._optionsDiv);\r\n\t\t}\r\n\t}\r\n\r\n\t// reset state\r\n\tinputs = new Array();\r\n\tselects = new Array();\r\n\tlabels = new Array();\r\n\tradios = new Array();\r\n\tradioLabels = new Array();\r\n\tcheckboxes = new Array();\r\n\tcheckboxLabels = new Array();\r\n\tfor (var nf = 0; nf < document.getElementsByTagName(\"form\").length; nf++) {\r\n\t\tif(document.forms[nf].className.indexOf(\"default\") < 0) {\r\n\t\t\tfor(var nfi = 0; nfi < document.forms[nf].getElementsByTagName(\"input\").length; nfi++) {inputs.push(document.forms[nf].getElementsByTagName(\"input\")[nfi]);}\r\n\t\t\tfor(var nfl = 0; nfl < document.forms[nf].getElementsByTagName(\"label\").length; nfl++) {labels.push(document.forms[nf].getElementsByTagName(\"label\")[nfl]);}\r\n\t\t\tfor(var nfs = 0; nfs < document.forms[nf].getElementsByTagName(\"select\").length; nfs++) {selects.push(document.forms[nf].getElementsByTagName(\"select\")[nfs]);}\r\n\t\t}\r\n\t}\r\n}", "static getEle(id) {\n return document.getElementById(id);\n }", "getChildren(): Array<Element>{\n return this._elements;\n }", "function $$(selectedElements){\n\n const elements = document.querySelectorAll(selectedElements);\n\n function hide() {\n elements.forEach(element => {\n element.style.display = 'none';\n });\n // ENCADIANDO OS ELEMENTOS ABAIXO, VOU TRAZER NOVAMENTE OS BTNS\n return $$(selectedElements);\n }\n function show() {\n elements.forEach(element => {\n element.style.display = 'initial';\n });\n // ENCADIANDO OS ELEMENTOS ABAIXO, VOU TRAZER NOVAMENTE OS BTNS\n return $$(selectedElements);\n }\n function on(onEvent, callback){\n elements.forEach(element => {\n element.addEventListener(onEvent, callback);\n });\n return $$(selectedElements);\n }\n function addClass(className) {\n elements.forEach(element => {\n element.classList.add(className);\n });\n return $$(selectedElements);\n\n }\n function removeClass(className) {\n elements.forEach(element => {\n element.classList.remove(className);\n });\n return $$(selectedElements);\n\n }\n\n\n\n return {\n elements,\n hide,\n show,\n on,\n addClass,\n removeClass,\n }\n\n}", "function addEventsEntrega(){\r\n let btnsEntrega = document.querySelectorAll(\".entrega\"); \r\n for(let i=0; i<btnsEntrega.length; i++){\r\n const element = btnsEntrega[i];\r\n element.addEventListener(\"click\", realizarEntrega);\r\n }\r\n}", "_createDOMElements() {\n\t\tthis.$control = $( this.template( this.controlOptions ) );\n\t\tthis.$sliderGroup = this.$control.find( '.slider-group' );\n\t\tthis.$units = this.$control.find( '.unit' );\n\t\tthis.$revert = this.$control.find( '.undo' );\n\t\tthis.$deleteSaved = this.$control.find( '.delete-saved .remove' );\n\t}", "function gerarDom() {\n\tvar tabuleiro = document.getElementById(\"tabuleiro\");\n\tvar corpo = document.getElementsByTagName(\"body\")[0];\n\tvar cabecalho = document.createElement(\"div\");\n\tcabecalho.setAttribute(\"id\", \"cabecalho\");\n\n\tvar lateral = document.createElement(\"div\");\n\tlateral.id = \"lateral\";\n\n\tvar score = document.createElement(\"div\");\n\tscore.id = \"score\";\n\n\tvar botoes = document.createElement(\"div\");\n\tbotoes.id = \"botoes\";\n\n\tvar popup = document.createElement(\"div\");\n\tpopup.id = \"pop\";\n\n\tvar botaoX = document.createElement(\"button\");\n\tbotaoX.id = \"botaoX\";\n\n\tvar botaoO = document.createElement(\"button\");\n\tbotaoO.id = \"botaoO\";\n\n\tvar fundo = document.createElement(\"div\");\n\tfundo.id = \"fundo\";\n\n\tcorpo.appendChild(cabecalho);\n\tcorpo.appendChild(lateral);\n\tcorpo.appendChild(score);\n\tcorpo.appendChild(botoes);\n\tpopup.appendChild(botaoX);\n\tpopup.appendChild(botaoO);\n\tcorpo.appendChild(popup);\n\tcorpo.appendChild(fundo);\n\n\n\n\tvar tbl = document.createElement(\"table\");\n\tfor (var i = 0; i < 3; i++) {\n\t\tvar row = document.createElement(\"tr\");\n\t\tfor (var j = 0; j < 3; j++) {\n\t\t\tvar cell = document.createElement(\"td\");\n\t\t\tcell.setAttribute(\"id\", \"b\" + i + j);\n\t\t\tcell.setAttribute(\"onClick\", \"marcar(this.id);\");\n\t\t\trow.appendChild(cell);\n\t\t}\n\t\ttbl.appendChild(row);\n\t}\n\ttabuleiro.appendChild(tbl);\n\n}", "function intercambiarPosicionesDOM(idPieza1, idPieza2) {\n // Intercambio posiciones en el DOM\n var elementoPieza1 = document.getElementById(idPieza1);\n var elementoPieza2 = document.getElementById(idPieza2);\n\n var padre = elementoPieza1.parentNode;\n\n var clonElemento1 = elementoPieza1.cloneNode(true);\n var clonElemento2 = elementoPieza2.cloneNode(true);\n\n padre.replaceChild(clonElemento1, elementoPieza2);\n padre.replaceChild(clonElemento2, elementoPieza1);\n}", "get $elements() {\n if (this.#cached$elements === undefined) {\n this.#cached$elements = $(this.elements);\n }\n return this.#cached$elements;\n }", "function Dom(seletor) {\n this.element = document.querySelector(seletor);\n}", "function _getElements() {\n\tif(_store){\n if (_isSubpageOpened()) {\n return _store.getState().secondLevelPage.elements;\n }\n return _store.getState().elements;\n\t}\n }", "buildDomElement() {\n return this.addCanonicalTags(this.buildDomElementInner());\n }", "getElement(){return this.__element}", "function getElm(id) {\n return document.getElementById(id);\n}", "function imgElements() {\n\t return Array.prototype.slice.call(node.querySelectorAll('img'));\n\t }", "function getAllElements() {\n var deferred = $q.defer();\n\n\n if (elements !== null) { // Check if we already retrieved the data\n\n deferred.resolve(elements);\n\n } else { // We need to fetch the data from the api\n\n $http.get('/api/dataElements.json?fields=*&paging=false')\n .success(function (data) {\n elements = data;\n deferred.resolve(elements);\n }).error(function (msg, code) {\n $log.error(msg, code);\n deferred.reject(msg);\n });\n\n }\n\n return deferred.promise;\n }", "constructElements() {\n const htmlElements = this.getFormElements();\n const formElements = [];\n\n htmlElements.forEach(htmlElement => {\n formElements.push(new __WEBPACK_IMPORTED_MODULE_0__FormElement__[\"a\" /* default */](htmlElement));\n });\n\n return formElements;\n }", "function getElements() {\r\n\tvar re = new RegExp('(^| )'+'niceform'+'( |$)');\r\n\tfor (var nf = 0; nf < document.getElementsByTagName('form').length; nf++) {\r\n\t\tif(re.test(niceforms[nf].className)) {\r\n\t\t\tfor(var nfi = 0; nfi < document.forms[nf].getElementsByTagName('input').length; nfi++) {inputs.push(document.forms[nf].getElementsByTagName('input')[nfi]);}\r\n\t\t\tfor(var nfl = 0; nfl < document.forms[nf].getElementsByTagName('label').length; nfl++) {labels.push(document.forms[nf].getElementsByTagName('label')[nfl]);}\r\n\t\t\tfor(var nft = 0; nft < document.forms[nf].getElementsByTagName('textarea').length; nft++) {textareas.push(document.forms[nf].getElementsByTagName('textarea')[nft]);}\r\n\t\t\tfor(var nfs = 0; nfs < document.forms[nf].getElementsByTagName('select').length; nfs++) {selects.push(document.forms[nf].getElementsByTagName('select')[nfs]);}\r\n\t\t}\r\n\t}\r\n}", "function muestraCliente(ventas){\n let productosDesc=document.querySelector('.productosDesc');\n ventas.forEach(element => {\n let divProductos=document.createElement('div');\n divProductos.className=\"producto\";\n divProductos.innerHTML=`\n <img src=\"${element.imagen}\" width=100>\n <p class=\"name\">${element.titulo}</p>\n <p>$${element.precio}</p>\n <input type=\"number\" class=\"cantidad\" name=\"cant\" min=\"0\" max=\"999\" value=\"${element.cant}\">\n <button class=\"deleteItem\"> X </button>\n `\n productosDesc.appendChild(divProductos);\n });\n actualizaMonto();\n}", "function imagenes(xml){\n var arrImagenes=document.getElementsByTagName(\"img\");\n var imagenesDiv=document.getElementById(\"imag\");\n if(document.getElementsByClassName(\"contenedor\").length>0 ){ //si existe el div \"contenedor\"\n \n while(document.getElementsByClassName(\"contenedor\").length>0){ //mientras sea mayor a 0\n \n document.getElementsByClassName(\"contenedor\")[0].remove(); //borrame todos los div que haya\n }\n\n }\n \n var arrGaleria=[];\n var imagen=xml.getElementsByTagName(\"image\"); //etiqueta imagen\n \n //variables \n var imagenURL;\n \n for(var i=0; i<imagen.length; i++){ //se recorren las imagenes\n\n imagenURL=imagen[i].getElementsByTagName(\"url\")[0].childNodes[0].nodeValue; //coger url imagenes\n arrGaleria.push(imagenURL);\n }\n return arrGaleria; //array con las URL de las imagenes\n}", "function gatherElements(){elements={main:$element[0],scrollContainer:$element[0].querySelector('.md-virtual-repeat-container'),scroller:$element[0].querySelector('.md-virtual-repeat-scroller'),ul:$element.find('ul')[0],input:$element.find('input')[0],wrap:$element.find('md-autocomplete-wrap')[0],root:document.body};elements.li=elements.ul.getElementsByTagName('li');elements.snap=getSnapTarget();elements.$=getAngularElements(elements);inputModelCtrl=elements.$.input.controller('ngModel');}", "function cargarPeliculas(){\n movies.movies.forEach(movie => { \n cargarElementosAlHtml(movie);\n });\n}", "function search_elements() {\n\tlet poster = elementMaker(\"img\", false, \"poster\");\n\tlet title = elementMaker(\"h3\", false, \"title\");\n\tlet year = elementMaker(\"h4\", false, \"year\");\n\tlet genre = elementMaker(\"div\", false, \"genre\");\n\tlet type = elementMaker(\"div\", false, \"type\");\n\tlet director = elementMaker(\"div\", false, \"director\");\n\tlet actors = elementMaker(\"div\", false, \"actors\");\n\tlet awards = elementMaker(\"div\", false, \"awards\");\n\tlet plot = elementMaker(\"div\", false, \"plot\");\n\tlet info_container = elementMaker(\"div\", false, \"info_container_search\");\n\n\tlet search_element_array = new Array(\n\t\tposter, title, year, genre, \n\t\ttype, director, actors, \n\t\tawards, plot, info_container);\n\treturn search_element_array;\n}", "adicionarElementos() {\n let tabelaPacientes = document.querySelector(\"#tabela-pacientes\");\n const linhaTabela = document.createElement(\"tr\");\n linhaTabela.classList.add(\"paciente\");\n\n let montarTabela = `\n <td class=\"info-nome\">${this.nome}</td>\n <td class=\"info-peso\">${this.peso} Kg</td>\n <td class=\"info-altura\">${this.altura} M</td>\n <td class=\"info-imc\">${this.imc}</td>\n `;\n if (!this.deletarPaciente) {\n montarTabela += `<td class=\"info-resultado\">${this.resultado}</td>`;\n } else {\n montarTabela += `\n <td class=\"info-resultado\">\n <span style=\"display: block;\">${this.resultado}</span>\n <img src=\"./src/img/delete.png\" onclick=\"`+ \"`${Bpacientes.deletarPacientes(event)}`\" + `\" alt=\"\" style=\"display: block;\">\n </td>\n `;\n }\n\n linhaTabela.innerHTML = montarTabela;\n tabelaPacientes.appendChild(linhaTabela);\n }", "getAllElements(name) {\n return this._elements[name] || this._makeElements(name);\n }", "function childNodesOfElement(element) {\n let children = [];\n let child = element.firstChild;\n while (child) {\n children.push(child);\n child = child.nextSibling;\n }\n return children;\n }", "function _resolveElements(elements) {\n // No input is just an empty array\n if (!elements) {\n return [];\n }\n\n // Make sure it's in array form.\n if (typeof elements === \"string\" || !elements || !elements.length) {\n elements = [elements];\n }\n\n // Make sure we have a DOM element for each one, (could be string id name or toolkit object)\n var i,\n realElements = [];\n for (i = 0; i < elements.length; i++) {\n if (elements[i]) {\n if (typeof elements[i] === \"string\") {\n var element = _Global.document.getElementById(elements[i]);\n if (element) {\n realElements.push(element);\n }\n } else if (elements[i].element) {\n realElements.push(elements[i].element);\n } else {\n realElements.push(elements[i]);\n }\n }\n }\n\n return realElements;\n }", "function iniciaListener() {\n //Creo un listener para cada div (u otro elemento) de la pagina\n var lista_divs = document.querySelectorAll(\"div\");\n for (var i = 0; i < lista_divs.length; i++) {\n lista_divs[i].addEventListener('click', elementoOnclick);\n }\n }", "function Dom2(lista) {\n this.elements = document.querySelectorAll(lista)\n\n this.addClass = function(classe) {\n this.elements.forEach((item)=>{\n item.classList.add(classe)\n })\n }\n this.removeClass = function(classe) {\n this.elements.forEach((item)=>{\n item.classList.remove(classe)\n })\n }\n}", "function webPageElements() { \n \t pageElements.input = document.getElementById('input');\n \t pageElements.output = document.getElementById('output');\n \t pageElements.linksCount = document.getElementById('linksCount');\n \t pageElements.alertText = document.getElementById('alertText');\n \t pageElements.authorSelect = document.getElementById('authorSelect');\n \t pageElements.tagSelect = document.getElementById('tagSelect');\n \t pageElements.saveBtn = document.getElementById('saveBtn');\n \t pageElements.addBtn = document.getElementById('addBtn');\n \t pageElements.getAllBtn = document.getElementById('getAllBtn');\n \t pageElements.deleteBtn = document.getElementById('deleteBtn');\n\n \t assignEventListeners() \n }", "function populateDOMElementVariables() {\n //_testControl.setInputElement(document.getElementById(\"TestSelect\") as HTMLSelectElement);\n //_testControl.setOutputElement(document.getElementById(\"Output\") as HTMLDivElement);\n players.push(new Player_1.Player(document.getElementById(\"Player1\"), \"Player1\"));\n players.push(new Player_1.Player(document.getElementById(\"Player2\"), \"Player2\"));\n players.push(new Player_1.Player(document.getElementById(\"Player3\"), \"Player3\"));\n players.push(new Player_1.Player(document.getElementById(\"Player4\"), \"Player4\"));\n players.push(new Player_1.Player(document.getElementById(\"Player5\"), \"Player5\"));\n players.push(new Player_1.Player(document.getElementById(\"Player6\"), \"Player6\"));\n players.push(new Player_1.Player(document.getElementById(\"Player7\"), \"Player7\"));\n players.push(new Player_1.Player(document.getElementById(\"Player8\"), \"Player8\"));\n return;\n}", "function ElementNodes(nodelist) {\n\tvar eNodes = []; // return array is defined\n\n\tfor (var i=0, j=nodelist.length; i < j; i++) {\n\t\tif (nodelist[i].nodeType == 1) { // if nodelist is real element\n\t\t\teNodes.push(nodelist[i]); // push the nodelist into our eNodes array\n\t\t}\n\t}\n\n\treturn eNodes;\n}", "function dibujarElementos(elementos) {\n let elementosHtml = \"\"\n elementos.forEach(elemento => {\n elementosHtml += `<div class=\"d-flex\"><h4>${elemento.nombre}</h4>\n <div style=\"margin:5px 0px 0px 10px\">${getPuntaje(elemento.puntaje)}</div></div>`\n })\n return elementosHtml;\n}", "_getAllTextElementsForChangingColorScheme() {\n let tagNames = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'label']\n let allItems = [];\n\n for (let tagname of tagNames) {\n allitems = Array.prototype.concat.apply(allitems, x.getElementsByTagName(tagname));\n }\n // allitems = Array.prototype.concat.apply(allitems, x.getElementsByTagName(\"h1\"));\n\n return allItems;\n }", "function returnElementArray($container) {\n var nsp = '[data-' + ns + ']',\n // if an $el was given, then we scope our query to just look within the element\n DOM = $container ? $container.find(nsp) : $(nsp);\n\n return DOM;\n }", "getElementsBySelector(selector) {\n const ele = this.element ? this.element : this.element;\n return ele.querySelectorAll(`.${selector}`);\n }", "constructor() {\n this.ubicacion = document.getElementById(\"c-ubicacion\");\n this.descripcion = document.getElementById(\"c-desc\");\n this.temp = document.getElementById(\"c-temp\");\n this.tempMin = document.getElementById(\"c-tempMin\");\n this.tempMax = document.getElementById(\"c-tempMax\");\n this.img = document.getElementById(\"c-img\");\n this.senTermica = document.getElementById(\"c-senTermica\");\n this.humedad = document.getElementById(\"c-humedad\");\n this.presion = document.getElementById(\"c-presion\");\n this.viento = document.getElementById(\"c-viento\");\n this.visibilidad = document.getElementById(\"c-visibilidad\");\n }", "function creaElem(){\n\t//generar id unico\n\tvar id = 0;\n\tid = generaId();\n\t//crea el elemento\n\tvar div = document.createElement(\"div\");\n\t//class\n\tdiv.setAttribute(\"class\", \"rand\")\n\t//id\n\tdiv.setAttribute(\"id\", \"r\")\n\t//img\n\tvar img = document.createElement(\"IMG\");\n\timg.setAttribute(\"src\", \"https://cdn3.iconfinder.com/data/icons/back-to-the-future/512/delorean-02-128.png\");\n\t//button\n\tvar bot = document.createElement(\"BUTTON\");\n\tvar t = document.createTextNode(\"x\");\n\tdiv.setAttribute(\"onclick\", \"elimina(this)\");\n\t//aniades los nodos\n\tbot.appendChild(t);\n\tdiv.appendChild(bot);\n\tdiv.appendChild(img);\n\t//agregar id unico al elemento\n\tvar p = document.createElement(\"p\");\n\tp.setAttribute(\"class\",\"p\")\n\tp.setAttribute(\"id\",\"_\"+id);\n\tdiv.appendChild(p);\n\tdocument.body.appendChild(div);\n\tdocument.getElementById(\"_\"+id).innerHTML = id;\n\t//busca el elemnto creado\n\t\n\t//agregas elemento al arreglo\n\t//a.push(div);\n}", "function ElementScroll (elementPadre,navElement){\n c(elementPadre)\n c(navElement)\n w.addEventListener(\"scroll\",function(ev){\n let x = w.scrollX\n let y = w.scrollY\n let resul; \n Object.values(elementPadre.childNodes).forEach(ev => { \n let evY = Number.parseInt( ev.offsetTop - (ev.scrollHeight/2))\n let evX = ev.offsetLeft\n let maxY = Number.parseInt( ev.offsetTop + ev.scrollHeight)\n let maxX = Number.parseInt( ev.offsetLeft + ev.scrollWidth)\n if( y >= evY & y <= maxY ){\n EliminateActive(elementPadre)\n EliminateActive(navElement)\n //c(ev.id)\n let VarA = ev.id//El valor de esta variable se captura con respecto al scroll\n let selecElement = navElement.querySelector('[href=\"#'+ VarA +'\"]').parentElement\n let selectElementParent = elementPadre.querySelector('[id = \"' +VarA+'\" ]')\n //c(\"Elecmento Seleccionado :\")\n //c(selecElement)\n selecElement.className = \"active\"\n selectElementParent.className += \" active\"\n selectElementParent.className.co\n }\n })\n })\n }", "function contents(element) {\n var res = [];\n var nodes;\n for (var i=0; i<element.length; i++) {\n nodes = element[i].childNodes;\n for (var j=0; j<nodes.length; j++) {\n res.push(nodes.item(j));\n }\n }\n return $(res);\n }", "function DOMImplementation() {}" ]
[ "0.6786884", "0.6704521", "0.65489024", "0.6393473", "0.63381106", "0.63148445", "0.62871164", "0.6268687", "0.62674445", "0.62099886", "0.6190549", "0.61761427", "0.6168426", "0.616649", "0.616649", "0.6152311", "0.61339843", "0.61271375", "0.6087979", "0.6082071", "0.6064065", "0.60531044", "0.6009473", "0.6007563", "0.6007563", "0.5960812", "0.5927265", "0.5914776", "0.59086245", "0.5902951", "0.5895732", "0.5873671", "0.5872086", "0.5861619", "0.5855755", "0.58554965", "0.58476615", "0.5837593", "0.58167547", "0.5810154", "0.57917625", "0.57879215", "0.5773875", "0.57720256", "0.57702714", "0.57631224", "0.575354", "0.5723334", "0.57222843", "0.5716047", "0.57108086", "0.57001245", "0.5681542", "0.5676393", "0.5668214", "0.5666053", "0.5662837", "0.56588024", "0.5658316", "0.56577015", "0.5656802", "0.565575", "0.56521493", "0.5646259", "0.5645491", "0.56432", "0.5640511", "0.5640225", "0.5632668", "0.5620542", "0.5618806", "0.55955285", "0.5588313", "0.558635", "0.55820274", "0.55816156", "0.5579294", "0.5570896", "0.5566057", "0.55646056", "0.55563015", "0.5550014", "0.55497134", "0.55483866", "0.5548262", "0.5545995", "0.55341744", "0.553274", "0.5530149", "0.5523382", "0.5515601", "0.5513345", "0.55059695", "0.5498316", "0.54980844", "0.5497076", "0.5496173", "0.5495414", "0.5494238", "0.54857033", "0.54804635" ]
0.0
-1
permite somente valores numericos
function valCPF(e,campo){ var tecla=(window.event)?event.keyCode:e.which; if((tecla > 47 && tecla < 58 )){ mascara(campo, '###.###.###-##'); return true; } else{ if (tecla != 8 ) return false; else return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformInt() {\n for (let i = 0; i < ctmc.length; i++) {\n for (let j = 0; j < ctmc[i].length; j++) {\n ctmc[i][j] = parseFloat(ctmc[i][j]);\n }\n }\n}", "function number(numbers) { }", "function toNum(result) {\n var numResult = [];\n result.forEach(function (perm) {\n numResult.push(parseInt(perm));\n });\n return numResult.sort(function (a, b) { return a - b; });\n }", "function process_data_numeric(datas) {\n for (var i in datas){\n for(var j in datas[i]){\n if (typeof(datas[i][j]) === typeof(12)){\n if(datas[i][j] > 0 && datas[i][j] <1){\n datas[i][j] = (Math.trunc(datas[i][j] *10000))/100\n }\n }\n }\n }\n return datas\n\n }", "function doubleValues(num) {\n // console.log(num);\n num.forEach((element) => {\n element += element;\n return element;\n });\n \n}", "static numerals() {\n return [\n { numeral: 'M', value: 1000 },\n { numeral: 'CM', value: 900 },\n { numeral: 'D', value: 500 },\n { numeral: 'CD', value: 400 },\n { numeral: 'C', value: 100 },\n { numeral: 'XC', value: 90 },\n { numeral: 'L', value: 50 },\n { numeral: 'XL', value: 40 },\n { numeral: 'X', value: 10 },\n { numeral: 'IX', value: 9 },\n { numeral: 'V', value: 5 },\n { numeral: 'IV', value: 4 },\n { numeral: 'I', value: 1 },\n ];\n }", "function productOfOtherNumbers(arg){\n\n}", "function valFor(c) {\n\tswitch(c) {\n\t\tcase 0:\n\t\treturn [10,0.1,9,0.07];\n\t\tcase 1:\n\t\treturn [100,0,20,0]\n\t\tcase 2:\n\t\tcase 3:\n\t\tcase 4:\n\t\treturn [40,0.1,9,0.1]\n\t}\n}", "function multiplicar (){\n return numeroUno * numeroDos\n}", "convertInputValuesToNumbers() {\n this.currentRange = !isNaN(parseFloat(this.currentRange))\n ? parseFloat(this.currentRange)\n : 0;\n\n this.plannedRange = !isNaN(parseFloat(this.plannedRange))\n ? parseFloat(this.plannedRange)\n : 0;\n\n this.priority = !isNaN(parseFloat(this.priority))\n ? parseFloat(this.priority)\n : 0;\n }", "function MultiplicarPorDois(valor){\n return valor * 2;\n}", "function narcissistic(value) {\n let sum = 0;\n // console.log(value);\n // console.log(value.toString())\n // console.log(value.toString().split(''));\n\n let valueArray = Array.from(value.toString()).map(Number)\n console.log(valueArray);\n valueArray.forEach((val) => {\n sum += (val ** (valueArray.length))\n })\n console.log(value, sum);\n if (value === sum){\n return true\n } else {\n return false\n }\n }", "function ejercicio1 (a) {\r\n var numeros = \"\",\r\n i;\r\n //This \"for\" is responsible for going through the list to multiply the other values.\r\n for (i = 0; i < a.length; i++) {\r\n var multiplicando = 1;\r\n //This \"for\" searches for the other values other than the position to multiply and add them to the result.\r\n for (j = 0; j < a.length; j++) { \r\n //This \"if\" prevents the same value that we are in from multiplying\r\n if (i != j) \r\n multiplicando = multiplicando * a[j];\r\n }\r\n //This “if” is in charge of concatenating the texts, and if it is the last one, it gives it a different format.\r\n if (i == a.length - 1){\r\n numeros = numeros + multiplicando;\r\n } else {\r\n numeros = numeros + multiplicando + \", \";\r\n } \r\n }\r\n return numeros;\r\n}", "function NumReal(fld, milSep, decSep, e,tipo) {\nif (fld.value.length > 12){ \nreturn false; }\nvar sep = 0;\nvar key = '';\nvar i = j = 0;\nvar len = len2 = 0;\nvar strCheck = '0123456789-';\nvar aux = aux2 = '';\nif (tipo){\nvar whichCode = (window.Event) ? e.which : e.keyCode;\nif (whichCode == 13) return true; // Enter\nvar key = String.fromCharCode(whichCode); // Get key value from key code\nif (strCheck.indexOf(key) == -1) return false; // Not a valid key\n}\nlen = fld.value.length;\nfor(i = 0; i < len; i++)\nif ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;\naux = '';\nfor(; i < len; i++)\nif (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);\naux += key;\nlen = aux.length;\nif (len == 0) fld.value = '';\nif (len == 1) fld.value = '0'+ decSep + '0' + aux;\nif (len == 2) fld.value = '0'+ decSep + aux;\nif (len > 2) {\naux2 = '';\nfor (j = 0, i = len - 3; i >= 0; i--) {\nif (j == 3) {\naux2 += milSep;\nj = 0;\n}\naux2 += aux.charAt(i);\nj++;\n}\nfld.value = '';\nlen2 = aux2.length;\nfor (i = len2 - 1; i >= 0; i--)\nfld.value += aux2.charAt(i);\nfld.value += decSep + aux.substr(len - 2, len);\n}\nreturn false;\n}", "function real(partes, ...valores) {\n const resultado = []\n valores.forEach((valor, indice) => {\n valor = isNaN(valor) ? valor : `R$${valor.toFixed(2)}`\n resultado.push(partes[indice], valor)\n\n })\n return resultado.join('')\n}", "static get NUMBERS() {\n return {\n \"0\": Calc.VALID,\n \"1\": Calc.VALID,\n \"2\": Calc.VALID,\n \"3\": Calc.VALID,\n \"4\": Calc.VALID,\n \"5\": Calc.VALID,\n \"6\": Calc.VALID,\n \"7\": Calc.VALID,\n \"8\": Calc.VALID,\n \"9\": Calc.VALID,\n \".\": Calc.VALID\n };\n }", "function numbers (){\n memory.map((each,index)=>{\n \n if(d.test(each) && d.test(memory[index+1])){\n memory.splice(index,1)\n memory[index]= each+memory[index];\n numbers()\n }\n })\n }", "function numarray(x) {\n for (var j = 0, o = []; j < x.length; j++) o[j] = parseFloat(x[j]);\n return o;\n }", "_toNumberArray(t) {\n if (!Array.isArray(t))\n throw TypeError();\n if (t.some(function(t) {\n return \"number\" != typeof t;\n }))\n throw TypeError();\n return t;\n }", "function multiplicar(array) {\n\t\t\tlet multiplicar = 1;\n\t\t\tfor(i=0; i<array.length; i++) {\n\t\t\t\tmultiplicar = multiplicar * parseInt(array[i])\n\t\t\t};\n\t\t\treturn multiplicar;\n\t\t}", "multiply() {\n\n let result=1;\n let digit;\n \n for (let i = 0; i < arguments.length; i++) \n \n if(arguments[i]===\"LAST\"){\n result *= parseInt(this.last());\n }\n else \n if(arguments[i]!==\"LAST\"&&typeof(arguments[i])=='string'){\n \n digit = arguments[i].match(this.regex)\n result *= this.memory[parseInt(digit) - 1]\n \n \n }else{\n result *= arguments[i];\n \n }\n this.total = result;\n return parseInt(this.total);\n }", "function getDigits(d) {\r\n switch (d) {\r\n case '0':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '1':\r\n return [0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n case '2':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '3':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '4':\r\n return [0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n case '5':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '6':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '7':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n case '8':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '9':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n default:\r\n return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0];\r\n }\r\n}", "function calcular (oper,...nums){\n let res\n switch (oper){\n case '+':\n //res = 0\n //for(let n of nums) soma +=n\n res = somaTudo(...nums)\n break\n\n case '*':\n res = 1\n for(let n of nums) res *=n\n }\n return res\n}", "function convert(num) {\n\n\n}", "function parseNumAr(data){\n\tvar result = [];\n\t\n\tif(typeof data == 'string'){ data = [data]; }\n\t\n\tfor (var i=0; i < data.length; i++){\n\t\t//console.log(data[i]);\n\t\tresult.push(parseFloat(data[i]));\n\t}\n\treturn result;\n}", "function numarray(x) {\n for (var j = 0, o = []; j < x.length; j++) o[j] = parseFloat(x[j]);\n return o;\n }", "function promedio(input){\n\t\tvar numeros = input;\n\t\tvar resultado;\n\t\tresultado = numeros.reduce(function(a,b){ return a + b;}, 0);\n\t\tresultado /= input.length;\n\t\tconsole.log(resultado);\n\t\t\n\n\t\treturn resultado;\n\t}", "limitsToNumber() {\n const { target, lowerLimit, upperLimit } = this.props;\n const L = lowerLimit !== null ? 1 : 0;\n const T = target !== null ? 2 : 0;\n const U = upperLimit !== null ? 4 : 0;\n return L + T + U;\n }", "function aTonosDeGris(data) {\n for (let i = 0; i < data.length; i += 4) {\n let gris = (data[i] + data[i + 1] + data[i + 2]) / 3;\n data[i] = gris;\n data[i+1] = gris;\n data[i+2] = gris;\n }\n}", "σ_perm() {\n\n let σ_perm = [];\n\n for (let x = 0; x <= this.L; x += 2) {\n if (x <= 0.1 * this.L) {\n σ_perm.push(new loadsArray(x, 130 / this.material.k));\n } else {\n if (x < 0.3 * this.L) {\n σ_perm.push(new loadsArray(x, 275 * x / (this.material.k * this.L) + 102.5 / this.material.k));\n } else {\n if (x <= 0.7 * this.L) {\n σ_perm.push(new loadsArray(x, 185 / this.material.k));\n } else {\n if (x < 0.9 * this.L) {\n σ_perm.push(new loadsArray(x, -275 * x / (this.material.k * this.L) + 377.5 / this.material.k));\n } else {\n if (x <= 1 * this.L) {\n σ_perm.push(new loadsArray(x, 130 / this.material.k));\n }\n }\n }\n }\n }\n }\n return σ_perm;\n }", "function productOfNgtvNums(arr){\r\n\r\n\tlet prdct = 1;\r\n\t\r\n\tlet bggstNgtvNum; \r\n\t\r\n\tfor (let i = 0; i < arr.length; i++){\r\n\t\t\r\n\t\tbggstNgtvNum = 1/-0;\r\n\r\n\t\tif(Array.isArray(arr[i])){\r\n\t\t\t\r\n\t\t\tfor (let j = 0; j < arr[i].length; j++){\r\n\t\r\n\t\t\t\tbggstNgtvNum = (arr[i][j] < 0 && bggstNgtvNum < arr[i][j] )\r\n\t\t\t\t\t\t\t\t? arr[i][j] \r\n\t\t\t\t\t\t\t\t: bggstNgtvNum;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\telse return 'Invalid Argument'\r\n\r\n\t\tprdct *= isFinite(bggstNgtvNum) ? bggstNgtvNum : 1;\r\n\r\n\t}\r\n\t\r\n\tif(!isFinite(bggstNgtvNum)) return 'No negatives';\r\n\t\r\n\treturn prdct;\r\n}", "function b2d() {\r\n\t var sum = 0,\r\n\t tmp = 0,\r\n\t b = 1;\r\n // var ui = Array.from(document.getElementById('b2d').value.toString());\r\n\t var ui = document.getElementById('b2d').value.toString();\r\n\t if (!isNaN(ui)) {\r\n\t\t ui = Array.from(ui);\r\n\t\t for (let a=0; a < ui.length; a++) {\r\n\t\t\t sum += parseInt(ui[a]) * Math.pow(2, ui.length - b);\r\n\t\t\t b+=1;\r\n\t\t\t}\r\n\t\tdocument.getElementById('display1').innerHTML = \"Your Decimal value is: \" + \"&nbsp;&nbsp;&nbsp;&nbsp;\" + sum.toString();\r\n\t } else {\r\n\t\t alert(\"not number.\");\r\n\t }\r\n }", "function calculate(numeros){\n let valores = document.getElementsByName(numeros);\n soma(parseInt(valores[0].value),parseInt(valores[1].value));\n}", "function productArray(numbers){\n let result = []\n numbers.forEach((number, index) => {\n let res = 1;\n numbers.forEach((subNumber, subIndex) => {\n if(index !== subIndex) {\n res *= subNumber\n }\n })\n result.push(res)\n })\n return result\n }", "promedio(){\n let promedio = 0;\n let i =0;\n for(let x of this._data){\n i = i++;\n promedio = promedio + x;\n }\n return promedio/i;\n }", "function NumPar(data) {\n // name\n // min\n // max\n // step\n // value\n this.data = data;\n this.data.rem = this.data.rem || \"\";\n NumPar.pars[data.name] = this;\n NumPar.names.push(data.name);\n Par.all[data.name] = \"numeric\";\n //console.log(\"setting \",data.name, \" to \", +data.value);\n window.glob[data.name] = +data.value;\n}", "function trumps2numbers(trumps) {\n var numbers = [];\n trumps.forEach(function (element, index) {\n switch (element) {\n case TRUMP.A:\n numbers.push(1);\n break;\n case TRUMP.J:\n numbers.push(1, 1);\n break;\n case TRUMP.Q:\n numbers.push(1, 2);\n break;\n case TRUMP.K:\n numbers.push(1, 3);\n break;\n default:\n numbers.push(parseInt(element, 10));\n }\n });\n return numbers;\n}", "function mul (...all) {\n let newArr = all.filter(function(number){\n if (typeof number == \"number\"){\n return number;\t\t\n };\n });\n let res = 1;\n if (typeof newArr[0] == \"number\"){\n function mult (value) {\n return res *= value;\n };\n newArr.forEach(mult);\n return res;\n } else if (typeof newArr[0] != \"number\"){\n return res = 0;\n };\n}", "function Numeric() {}", "function ingresarNumeros(numbers,ingreso){\n\t\t\tnumbers.push(Number(ingreso));\n\n\t\tvar resultado = numbers;\n\n\t\tconsole.log(resultado);\n\t\treturn resultado;\n\t}", "function Multiplicar(valor){\n return valor * 2;\n}", "data() {\n return{\n numbers: [-5, 0, 2, -1, 1, 0.5]\n }\n \n }", "function muldiv(){\n memory.map((each, index)=>{\n switch(each){\n \n case \"*\":\n var memres = memory[index-1] * memory[index+1]\n return memory.splice(index-1,3,memres)\n break;\n case \"/\":\n var memres = memory[index-1] / memory[index+1]\n return memory.splice(index-1,3,memres)\n break;\n default:\n\n }\n })\n }", "function calculadora() {\n for (let i = 0; i < resultados.length; i++) {\n if (num.length > 1) {\n switch (i) {\n case 0:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 + num[j] * 1;\n }\n // Suma\n console.log(`El valor de la suma es: ${resultados[i]}`);\n break;\n case 1:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 - num[j] * 1;\n }\n // Resta\n console.log(`El valor de la resta es ${resultados[i]}`);\n break;\n case 2:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] *= num[j];\n }\n // Multiplicación\n console.log(`El valor de la multiplicación es ${resultados[i]}`);\n break;\n case 3:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] /= num[j];\n }\n // División\n console.log(`El valor de la división es ${resultados[i].toFixed(2)}`);\n break;\n case 4:\n resultados[i] = \"Sin Raiz cuadrada.\";\n // Sin raiz cuadrada\n console.log(\n `Al introducir dos o más valores numericos correctos la Raiz cuadrada no se ha calculado`\n );\n break;\n default:\n break;\n }\n } else if (num.length === 1) {\n resultados[4] = Math.sqrt(num[0]);\n // Raiz cuadrada\n console.log(`Solo se ha introducido un valor valido.`);\n console.log(\n `El valor de la raiz cuadrada es ${resultados[4].toFixed(2)}`\n );\n\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n } else {\n console.log(`No se han introducido numeros validos`);\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n }\n }\n}", "function fieldToNumber(a, b) {\n\t\t\t $.each(a, function (index, item) {\n\t\t\t $.each(item, function (key, value) {\n\t\t\t $.each(b, function (index_1, item_1) {\n\t\t\t if (key == item_1) {\n\t\t\t a[index][key] = parseFloat(a[index][key]);\n\t\t\t }\n\t\t\t });\n\t\t\t });\n\t\t\t });\n\t\t\t}//fieldToNumber", "normalize(item) {\n return item.map(x => parseInt(x));\n }", "numberGenerator(arr1, arr2, type) {\n var str1 = \"\";\n var str2 = \"\";\n // Getting first number\n for (let i = 0; i < arr1.length; i++) {\n str1 = str1.concat(arr1[i]);\n }\n let firstFloatNumber = parseFloat(str1);\n // Getting second number\n for (let i = 0; i < arr2.length; i++) {\n str2 = str2.concat(arr2[i]);\n }\n let secondFloatNumber = parseFloat(str2);\n // Type of operation selection\n switch (type) {\n case \"+\": {\n let result = firstFloatNumber + secondFloatNumber;\n return result;\n break;\n }\n case \"-\": {\n let result = firstFloatNumber - secondFloatNumber;\n return result;\n break;\n }\n case \"*\": {\n let result = firstFloatNumber * secondFloatNumber;\n return result;\n break;\n }\n case \"/\": {\n let result = firstFloatNumber / secondFloatNumber;\n return result;\n break;\n }\n case \"%\": {\n let result = (firstFloatNumber * secondFloatNumber) / 100;\n return result;\n break;\n }\n }\n }", "function multiplyNumericPropertiesBy2() {\n // before the call\n let menu = {\n width: 200,\n height: 300,\n title: \"My menu\"\n };\n console.log(menu);\n\n multiplyNumeric(menu);\n\n // after the call\n console.log(menu);\n // menu = {\n // width: 400,\n // height: 600,\n // title: \"My menu\"\n // };\n\n function multiplyNumeric(obj) {\n for (let key in obj) {\n if (isNumeric(obj[key])) {\n obj[key] = parseFloat(obj[key]) * 2;\n }\n }\n }\n\n function isNumeric(value) {\n return !isNaN(parseFloat(value));\n }\n}", "multiply() {\n\t\treturn this.numbers.map((number) => number * this.mulitplyBy);\n\t}", "_calculateExponentAndMantissa(float){\n let integral2 = toBinaryX(parseInt(float, 10), EXP, '0');//on prends uniquement le chiffre avant la virgule en base 2\n let fractional10 = this._getDecimal(float);//on prends uniquement les chiffres après la virgule en base 10\n let fractional2 = ''; //contient les chiffres apres la virgule en base 2\n\n //la fraction est multiplié par 2 tant qu'elle n'est pas egal à 0 et que 23 itération ne se sont pas écoulé\n // si la fraction est plus grande que 1 on enleve le chiffre avant la virgule\n let i = 0;\n //127 + 23 permet de ne perdre aucune précision, en effet si on prends le cas extreme qui serait un nombre entre -1 et 1 tres tres petit, le nombre de décalage maximum\n //serait de 127 etant donné que l'exposant = 127 + décalge, apres 127 décalge il faut encore récupérer la valeur de mantisse donc 23 bit.\n //(cette exemple est pour la version 32 bit mais marche avec les autres version)\n while(fractional10 != 0 && i < D_ + MAN)\n {\n fractional10 = fractional10 * 2;\n if(fractional10 >= 1)\n {\n fractional2 += '1';\n }\n else\n {\n fractional2 += '0';\n }\n fractional10 = this._getDecimal(fractional10);\n i++;\n }\n\n let number2 = (integral2 + '.' + fractional2).split('');//nombre en binaire avec la notation scientifique mais non somplifié (2^0)\n\n let pointIndex = integral2.length;//index du point dans le chiffre\n\n //on itere dans le nombre jusqu'a trouver un 1, on effectue encore une fois j++ pour se placer juste apres le 1, car c'est ici que l'on veut placer la virgule\n let j = 0;\n while(number2[j] != 1)\n {\n j++;\n }\n j++;\n\n let power = 0;\n this.mantissa = (integral2 + fractional2).split('');\n //si le nombre n'est pas compris entre -1 et 1, on regarde de combien on a décalé la virgule,\n //pour la mantisse on enleve les 0 inutile et le 1er 1\n if(float <= -1 || float >= 1)\n {\n power = pointIndex - j;\n this.mantissa.splice(0,j);\n }\n //si le nombre est compris entre -1 et 1, on regarde de combien on a decalé la virgule\n //(+1 car si le nombre est comrpis entre - 1 et 1 on a compté la virgule dans le calcul et il faut enlever)\n //pour la mantisse on enleve les 0 inutile et le 1er 1\n else\n {\n power = pointIndex - j + 1;\n this.mantissa.splice(0, j - 1);\n }\n this.exponent = toBinaryX(D_ + power, EXP, '0');//on calcule l'exposant qu'on converti en binaire\n this.mantissa = fillWithX(this.mantissa.splice(0, MAN).join(\"\"), '0');//on prends les 23 premier bit de la mantisse[splice()], on converti le tableau en string[join()], on remplie la droite de la mantisse avec des 0[fillWith0()]\n }", "function potencia(b,e) {//b = base, e = expoente\n return b ** e\n}", "puntosCartas() {\n\t\tlet dicCartaValor = {\n\t\t\t2: 2,\n\t\t\t3: 3,\n\t\t\t4: 4,\n\t\t\t5: 5,\n\t\t\t6: 6,\n\t\t\t7: 7,\n\t\t\t8: 8,\n\t\t\t9: 9,\n\t\t\tT: 10,\n\t\t\tJ: 11,\n\t\t\tQ: 12,\n\t\t\tK: 13,\n\t\t\tA: 14\n\t\t};\n\t\treturn dicCartaValor[this.valor];\n\t}", "function flatten(number) {\n\n}", "function number(val) {\n\t return +val;\n\t}", "function number(val) {\n\t return +val;\n\t}", "convertirViento(viento) {\n return Math.round(viento * 3.6 * 10) / 10;\n }", "function numshr(x)\n{\n if (x instanceof Value) return x.shr();\n if (typeof(x) == 'number') return [x&1, x>>1];\n if (typeof(x) == 'bigint') return [x&1n, x>>1n];\n console.log(typeof(x)=='object'?x.constructor.name:typeof(x), x);\n throw \"unsupported number\";\n}", "multiply() {\n return this.numbers.map((multiplied) => this.multiplyBy * multiplied);\n }", "function multiplyNumeric(obj) {\n for (let key in obj) {\n if (typeof obj[key] === \"number\") {\n obj[key] *= 2;\n }\n }\n return obj;\n}", "function toNumeric(n) {\r\n if (!isNaN(parseFloat(n)) && isFinite(n)) {\r\n\treturn n;\r\n }\r\n else\r\n {\treturn 0;\r\n }\r\n}", "function calcular(oper, ...nums){\n let res\n switch(oper) {\n case '+':\n //res = 0\n //for(let n of nums) soma += n\n res = somaTudo(...nums)\n break\n\n case '*':\n res = 1\n for(let n of nums) res *= n\n }\n return res\n}", "function elevar_al_cuadrado(numero)\n{\n return numero * numero;\n}", "static tritsValue(trits) {\n let value = 0;\n for (let i = trits.length - 1; i >= 0; i--) {\n value = (value * 3) + trits[i];\n }\n return value;\n }", "factorizar(numero){\n let total = 1\n for (let i = 1; i <= numero; i++){\n total = total * i\n }\n return total;\n }", "function numericStringToNumber_(values){\n for (var i = 0; i < values.length; i++){\n for(var j = 0; j < values[i].length; j++){\n if (!isNaN(values[i][j])){\n values[i][j] = Number(values[i][j], 10);\n }\n }\n }\n return values;\n}", "function prix() {\n return 50 * (nbMultiplicateur * nbMultiplicateur * 0.2);\n}", "function convertsStringToNumbers(arr) {\n    var newArr = [];\n \n    for (var i = 0; i < arr.length; i++) {\n \nvar convert = parseFloat(arr[i]);\n\nif (isFinite(convert)) { //proverava da li je sve brojiev i da nisu undefined, NaN, uklanja nepotrebne\nnewArr[newArr.length] = convert;\n}\n}\n    return newArr;\n}", "function plusMinus(arr) {\n let length = arr.length\n let newArr;\n const positiveLength = arr.filter(number => number > 0).length;\n const negativeLength = arr.filter(number => number < 0).length\n const zeroLength = arr.filter(number => number === 0).length\n\n let posFrac = (positiveLength / length).toFixed(6)\n let negFrac = (negativeLength / length).toFixed(6)\n let zeroFrac = (zeroLength / length).toFixed(6)\n\n newArr = [posFrac, negFrac, zeroFrac]\n console.log(newArr.join('\\n'))\n}", "function sortNumeric(val1, val2)\n{\n return val1 - val2;\n}", "function multiple(){\n results.value = Number(a.value) * Number(b.value);\n }", "function NumbersOnly(elem,e,whole,positive){\n\tvar num,text = elem.value;\n\tif(text=='-'||text=='.') return;\n\ttry{num=parseFloat(text);}catch(err){elem.value = '';return;}\n\tif(whole&&num!=Math.round(num)) num = Math.round(num);\n\tif(positive&&num<0) num = '';\n\tif(num!=text) elem.value = isNaN(num)?'':num;\n}", "function transmorgify(num1, num2, num3){\n\treturn Math.pow(num1 * num2, num3); \n}", "function expandedForm(num) {\n \n return (num).toString().split(\"\").map((a,i,arr) =>{\n return a*Math.pow(10, arr.length-i-1);\n }).filter(n => n>0).join(\" + \");\n\n}", "function plusMinus(arr) {\n var result = [];\n var a1 = 0, a2 = 0, a3 = 0;\n for (var i = 0; i < arr.length; i++){\n if (arr[i] > 0) {\n a1++;\n }\n if (arr[i] < 0) {\n a2++;\n }\n if (arr[i] == 0) {\n a3++;\n }\n // console.log(a1);\n }\n result[0] = parseFloat(a1 / arr.length).toFixed(6);\n console.log(result[0]);\n // console.log(typeof result[0]);\n result[1] = parseFloat(a2 / arr.length).toFixed(6);\n console.log(result[1]);\n result[2] = parseFloat(a3 / arr.length).toFixed(6);\n console.log(result[2]);\n}", "function ejercicio3(){\n let numero4=prompt(\"Ingresa una cantidad\")\n let result=0\n if (numero4>0){\n for (let x=0;x<numero4.length;x++){\n result+=parseInt(numero4[x])\n }\n console.log(`Cantidad Ingresada: ${numero4}`)\n console.log(`La suma de los digitos en la cantidad es: ${result}`)\n }\n else\n console.log(\"La cantidad debe ser mayor que 0\")\n}", "function convertNumbers(data) {\n data.forEach(element => {\n element.id = parseInt(element.id, 10)\n element.votes = parseInt(element.votes, 10)\n });\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 getPermutations(counter, digitsNum) {\n var denominator = 1\n counter.forEach((value) => { denominator *= rFact(value) })\n var permutations = rFact(digitsNum)/denominator\n return permutations \n}", "function addAll(...num){\n\n let total = 0;\n\n\n num.forEach(digit => total += digit\n )\n\n return total\n\n\n}", "function calcPerim() {\n\tthis.perimetr=0;\n\tfor(key in this){\n\t\tif(checkisNum(this[key])&&key!=='perimetr'){\n\t\t\tthis.perimetr+=this[key];\n\t\t}\n\t}\n\treturn this.perimetr;\n}", "function calcular(){\r\n num1 = parseFloat(num1);\r\n num2 = parseFloat(num2);\r\n switch(operador){\r\n case operacion.SUMAR:\r\n num1+=num2;\r\n break;\r\n case operacion.RESTAR:\r\n num1 = num1-num2;\r\n break;\r\n case operacion.MULTIPLICAR:\r\n num1*=num2;\r\n break;\r\n case operacion.DIVIDIR:\r\n num1 = (num1/num2);\r\n break;\r\n case operacion.PORTENCIA:\r\n num1 = Math.pow(num1,num2);\r\n break;\r\n }\r\n actualizarValor1();\r\n num2 = 0;\r\n actualizarValor2();\r\n}", "function product(numbers){\n\n let total = numbers.reduce((a,b) => a * b);\n\n let answer = [];\n\n numbers.forEach(val => answer.push(total/val));\n\n return answer;\n\n}", "function soal(angka, kuadrat) {\r\n var range = kuadrat;\r\n var start = angka;\r\n var value = angka;\r\n var arr1 = [];\r\n\r\n for (var n = 1; n < range; n++) {\r\n start = start * angka;\r\n value = start;\r\n }\r\n var sNumber = value.toString();\r\n for (var i = 0, len = sNumber.length; i < len; i += 1) {\r\n arr1.push(+sNumber.charAt(i));\r\n }\r\n\r\n for (var a = 0, sum = 0; a < arr1.length; sum += arr1[a++]);\r\n\r\n console.log(arr1);\r\n console.log(value);\r\n console.log(sum);\r\n}", "function digitsProduct(product) {\n if (product === 0) return 10;\n else if (product === 1) return 1;\n\n var list = [];\n for (var d = 9; d > 1; d--) {\n while (product % d === 0) {\n product /= d;\n list.push(d);\n }\n }\n // console.log(list);\n if (product !== 1) {\n return -1;\n } else {\n list = list.reverse();\n var str = list.join('');\n // console.log(str);\n return parseInt(str);\n }\n}", "function Numeral(number){this._value=number;}", "multiply(n) {\n let newDigits = [];\n let carry = 0;\n for (const digit of this.digits) {\n const sum = digit * n + carry;\n newDigits.push(sum % 10);\n carry = Math.floor(sum / 10);\n }\n if (carry > 0)\n newDigits.push(carry);\n return new Uint(newDigits);\n }", "function TrupleNum(num) {\n return num * 3;\n}", "function digitize(n) {\n //code here\n return Array.from(String(n)).map(Number).reverse();\n}", "function digits(num){\n var final = []\n var tableau = String(num).split('')\n var data = tableau.map(element => parseInt(element));\n for ( var i = 0; i < data.length ; i++ ) {\n for ( var j = 1 ; j < data.length ; j++ ) {\n final.push(data[i] + data[j]);\n } \n data.splice(0,1);\n i = -1;\n }\n return final\n }", "function multiplyByNumber(num, x, base) {\n if (num < 0)\n return null;\n if (num == 0)\n return [];\n\n var result = [];\n var power = x;\n while (true) {\n if (num & 1) {\n result = add(result, power, base);\n }\n num = num >> 1;\n if (num === 0)\n break;\n power = add(power, power, base);\n }\n\n return result;\n }", "function persistence(num) {\n let points = String(num)\n let result = 0\n let arrForAddAtPoints = []\n let newNumber = 1\n for (let i = 0; i < 10; i++) {\n arrForAddAtPoints = points.split('')\n if (arrForAddAtPoints.length > 1) {\n result++\n for (let j = 0; j < arrForAddAtPoints.length; j++) {\n arrForAddAtPoints = arrForAddAtPoints.map(n => +n)\n newNumber += arrForAddAtPoints[i]\n console.log(newNumber)\n }\n }\n console.log(arrForAddAtPoints)\n }\n\n\n }", "function digitize(val) {\n return Array.from('' + val, Number);\n}", "function numeric(value) {\r\n return !isNaN(value - parseFloat(value));\r\n }", "function double() {\n var carry = 0;\n for (let i = num.length - 1; i >= 0; i--) {\n var newDigit = num[i] * 2 + carry;\n num[i] = newDigit % 10;\n carry = Math.floor(newDigit / 10);\n }\n if (carry > 0) {\n num.unshift(carry);\n carry = 0;\n }\n }", "toNumber() {\n let m = this.if('#TextValue')\n m.forEach(val => {\n let obj = parse(val)\n if (obj.num === null) {\n return\n }\n let fmt = val.has('#Ordinal') ? 'Ordinal' : 'Cardinal'\n let str = format(obj, fmt)\n val.replaceWith(str, { tags: true })\n val.tag('NumericValue')\n })\n return this\n }", "function sum() {\r\n\tvar items = sum.arguments.length;\r\n\tvar thissum = 0;\r\n\tvar thisnum;\r\n\tvar usedNums = false;\r\n\tfor (i = 0; i < items; i++) {\r\n\t\tthisnum = sum.arguments[i];\r\n\t\tif (isFloat(thisnum) && thisnum != 'NaN') {\r\n\t\t\tthissum += parseFloat(thisnum);\r\n\t\t\tusedNums = true;\r\n\t\t} else if (thisnum != null && thisnum != \"undefined\" && thisnum != \"\" && thisnum != 'NaN') {\r\n\t\t\treturn 'NaN';\r\n\t\t}\r\n\t}\r\n\treturn (usedNums ? thissum : 'NaN');\t\r\n}", "function products(arr) {\n let product=1;\n for (let i=0; i<arr.length; i++){\n product*=arr[i];\n }\n for (let j=1; j<arr.length; j++){\n arr[j]=product/arr[j];\n }\n return arr;\n}", "function parseFloatList(a) {\n\tfor (let i = 0; i < a.length; i++) {\n\t\ta[i] = parseFloat(a[i]);\n\t}\n\treturn a;\n}", "restrictValue(values) {\n if (values[1].constructor === JQX.Utilities.BigNumber) {\n if (values[1].compare(values[0]) === -1) {\n values[1].set(values[0]);\n }\n }\n else {\n if (values[1] < values[0]) {\n values[1] = values[0];\n }\n }\n }", "function addValues(num1,num2){\r\n return num1 + num2;\r\n}", "function getNumbers (val1, val2) {\n const val1Numeric = Number(val1)\n if (isNaN(val1Numeric)) {\n throw new TypeError(`val1 is not a valid number: ${val1}`)\n }\n const val2Numeric = Number(val2)\n if (isNaN(val2Numeric)) {\n throw new TypeError(`val2 is not a valid number: ${val2}`)\n }\n return [val1Numeric, val2Numeric]\n}" ]
[ "0.5909197", "0.5904456", "0.5852405", "0.584672", "0.57996047", "0.573682", "0.5629319", "0.56083274", "0.55588317", "0.55496305", "0.55267036", "0.5480462", "0.54790115", "0.546418", "0.5455055", "0.5451508", "0.54338056", "0.5421527", "0.5399548", "0.5389518", "0.5387216", "0.5378139", "0.5366004", "0.53655636", "0.5365356", "0.5355779", "0.5345228", "0.5333743", "0.5332947", "0.5325194", "0.5318064", "0.53156966", "0.5307859", "0.53072774", "0.5284957", "0.5283258", "0.528207", "0.5272385", "0.5270751", "0.52699316", "0.5262669", "0.52502596", "0.52495205", "0.52486324", "0.524649", "0.52464205", "0.5238408", "0.5233795", "0.5230954", "0.5188988", "0.51880205", "0.5186392", "0.51831806", "0.51741785", "0.51741785", "0.51721346", "0.5171534", "0.5167993", "0.51665276", "0.5161088", "0.51599807", "0.5159328", "0.51521224", "0.51509315", "0.5150648", "0.5141939", "0.5140119", "0.5137216", "0.51357865", "0.5135786", "0.51339746", "0.5132094", "0.5128883", "0.51283497", "0.51259404", "0.51256377", "0.5123902", "0.51237845", "0.5119033", "0.5117027", "0.5116711", "0.51155597", "0.5115077", "0.511021", "0.51075095", "0.51009005", "0.5098603", "0.50979733", "0.5094157", "0.50938326", "0.5092795", "0.50901103", "0.5086341", "0.50829655", "0.50826514", "0.50822926", "0.5080942", "0.5076231", "0.5075868", "0.5074948", "0.50748456" ]
0.0
-1
permite somente valores numericos
function valPHONE(e,campo){ var tecla=(window.event)?event.keyCode:e.which; if((tecla > 47 && tecla < 58 )){ mascara(campo, '(##)####-####'); return true; } else{ if (tecla != 8 ) return false; else return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformInt() {\n for (let i = 0; i < ctmc.length; i++) {\n for (let j = 0; j < ctmc[i].length; j++) {\n ctmc[i][j] = parseFloat(ctmc[i][j]);\n }\n }\n}", "function number(numbers) { }", "function toNum(result) {\n var numResult = [];\n result.forEach(function (perm) {\n numResult.push(parseInt(perm));\n });\n return numResult.sort(function (a, b) { return a - b; });\n }", "function process_data_numeric(datas) {\n for (var i in datas){\n for(var j in datas[i]){\n if (typeof(datas[i][j]) === typeof(12)){\n if(datas[i][j] > 0 && datas[i][j] <1){\n datas[i][j] = (Math.trunc(datas[i][j] *10000))/100\n }\n }\n }\n }\n return datas\n\n }", "function doubleValues(num) {\n // console.log(num);\n num.forEach((element) => {\n element += element;\n return element;\n });\n \n}", "static numerals() {\n return [\n { numeral: 'M', value: 1000 },\n { numeral: 'CM', value: 900 },\n { numeral: 'D', value: 500 },\n { numeral: 'CD', value: 400 },\n { numeral: 'C', value: 100 },\n { numeral: 'XC', value: 90 },\n { numeral: 'L', value: 50 },\n { numeral: 'XL', value: 40 },\n { numeral: 'X', value: 10 },\n { numeral: 'IX', value: 9 },\n { numeral: 'V', value: 5 },\n { numeral: 'IV', value: 4 },\n { numeral: 'I', value: 1 },\n ];\n }", "function productOfOtherNumbers(arg){\n\n}", "function valFor(c) {\n\tswitch(c) {\n\t\tcase 0:\n\t\treturn [10,0.1,9,0.07];\n\t\tcase 1:\n\t\treturn [100,0,20,0]\n\t\tcase 2:\n\t\tcase 3:\n\t\tcase 4:\n\t\treturn [40,0.1,9,0.1]\n\t}\n}", "function multiplicar (){\n return numeroUno * numeroDos\n}", "convertInputValuesToNumbers() {\n this.currentRange = !isNaN(parseFloat(this.currentRange))\n ? parseFloat(this.currentRange)\n : 0;\n\n this.plannedRange = !isNaN(parseFloat(this.plannedRange))\n ? parseFloat(this.plannedRange)\n : 0;\n\n this.priority = !isNaN(parseFloat(this.priority))\n ? parseFloat(this.priority)\n : 0;\n }", "function MultiplicarPorDois(valor){\n return valor * 2;\n}", "function narcissistic(value) {\n let sum = 0;\n // console.log(value);\n // console.log(value.toString())\n // console.log(value.toString().split(''));\n\n let valueArray = Array.from(value.toString()).map(Number)\n console.log(valueArray);\n valueArray.forEach((val) => {\n sum += (val ** (valueArray.length))\n })\n console.log(value, sum);\n if (value === sum){\n return true\n } else {\n return false\n }\n }", "function ejercicio1 (a) {\r\n var numeros = \"\",\r\n i;\r\n //This \"for\" is responsible for going through the list to multiply the other values.\r\n for (i = 0; i < a.length; i++) {\r\n var multiplicando = 1;\r\n //This \"for\" searches for the other values other than the position to multiply and add them to the result.\r\n for (j = 0; j < a.length; j++) { \r\n //This \"if\" prevents the same value that we are in from multiplying\r\n if (i != j) \r\n multiplicando = multiplicando * a[j];\r\n }\r\n //This “if” is in charge of concatenating the texts, and if it is the last one, it gives it a different format.\r\n if (i == a.length - 1){\r\n numeros = numeros + multiplicando;\r\n } else {\r\n numeros = numeros + multiplicando + \", \";\r\n } \r\n }\r\n return numeros;\r\n}", "function NumReal(fld, milSep, decSep, e,tipo) {\nif (fld.value.length > 12){ \nreturn false; }\nvar sep = 0;\nvar key = '';\nvar i = j = 0;\nvar len = len2 = 0;\nvar strCheck = '0123456789-';\nvar aux = aux2 = '';\nif (tipo){\nvar whichCode = (window.Event) ? e.which : e.keyCode;\nif (whichCode == 13) return true; // Enter\nvar key = String.fromCharCode(whichCode); // Get key value from key code\nif (strCheck.indexOf(key) == -1) return false; // Not a valid key\n}\nlen = fld.value.length;\nfor(i = 0; i < len; i++)\nif ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;\naux = '';\nfor(; i < len; i++)\nif (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);\naux += key;\nlen = aux.length;\nif (len == 0) fld.value = '';\nif (len == 1) fld.value = '0'+ decSep + '0' + aux;\nif (len == 2) fld.value = '0'+ decSep + aux;\nif (len > 2) {\naux2 = '';\nfor (j = 0, i = len - 3; i >= 0; i--) {\nif (j == 3) {\naux2 += milSep;\nj = 0;\n}\naux2 += aux.charAt(i);\nj++;\n}\nfld.value = '';\nlen2 = aux2.length;\nfor (i = len2 - 1; i >= 0; i--)\nfld.value += aux2.charAt(i);\nfld.value += decSep + aux.substr(len - 2, len);\n}\nreturn false;\n}", "function real(partes, ...valores) {\n const resultado = []\n valores.forEach((valor, indice) => {\n valor = isNaN(valor) ? valor : `R$${valor.toFixed(2)}`\n resultado.push(partes[indice], valor)\n\n })\n return resultado.join('')\n}", "static get NUMBERS() {\n return {\n \"0\": Calc.VALID,\n \"1\": Calc.VALID,\n \"2\": Calc.VALID,\n \"3\": Calc.VALID,\n \"4\": Calc.VALID,\n \"5\": Calc.VALID,\n \"6\": Calc.VALID,\n \"7\": Calc.VALID,\n \"8\": Calc.VALID,\n \"9\": Calc.VALID,\n \".\": Calc.VALID\n };\n }", "function numbers (){\n memory.map((each,index)=>{\n \n if(d.test(each) && d.test(memory[index+1])){\n memory.splice(index,1)\n memory[index]= each+memory[index];\n numbers()\n }\n })\n }", "function numarray(x) {\n for (var j = 0, o = []; j < x.length; j++) o[j] = parseFloat(x[j]);\n return o;\n }", "_toNumberArray(t) {\n if (!Array.isArray(t))\n throw TypeError();\n if (t.some(function(t) {\n return \"number\" != typeof t;\n }))\n throw TypeError();\n return t;\n }", "function multiplicar(array) {\n\t\t\tlet multiplicar = 1;\n\t\t\tfor(i=0; i<array.length; i++) {\n\t\t\t\tmultiplicar = multiplicar * parseInt(array[i])\n\t\t\t};\n\t\t\treturn multiplicar;\n\t\t}", "multiply() {\n\n let result=1;\n let digit;\n \n for (let i = 0; i < arguments.length; i++) \n \n if(arguments[i]===\"LAST\"){\n result *= parseInt(this.last());\n }\n else \n if(arguments[i]!==\"LAST\"&&typeof(arguments[i])=='string'){\n \n digit = arguments[i].match(this.regex)\n result *= this.memory[parseInt(digit) - 1]\n \n \n }else{\n result *= arguments[i];\n \n }\n this.total = result;\n return parseInt(this.total);\n }", "function getDigits(d) {\r\n switch (d) {\r\n case '0':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '1':\r\n return [0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n case '2':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '3':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '4':\r\n return [0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n case '5':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '6':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '7':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n case '8':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '9':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n default:\r\n return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0];\r\n }\r\n}", "function convert(num) {\n\n\n}", "function calcular (oper,...nums){\n let res\n switch (oper){\n case '+':\n //res = 0\n //for(let n of nums) soma +=n\n res = somaTudo(...nums)\n break\n\n case '*':\n res = 1\n for(let n of nums) res *=n\n }\n return res\n}", "function parseNumAr(data){\n\tvar result = [];\n\t\n\tif(typeof data == 'string'){ data = [data]; }\n\t\n\tfor (var i=0; i < data.length; i++){\n\t\t//console.log(data[i]);\n\t\tresult.push(parseFloat(data[i]));\n\t}\n\treturn result;\n}", "function numarray(x) {\n for (var j = 0, o = []; j < x.length; j++) o[j] = parseFloat(x[j]);\n return o;\n }", "function promedio(input){\n\t\tvar numeros = input;\n\t\tvar resultado;\n\t\tresultado = numeros.reduce(function(a,b){ return a + b;}, 0);\n\t\tresultado /= input.length;\n\t\tconsole.log(resultado);\n\t\t\n\n\t\treturn resultado;\n\t}", "limitsToNumber() {\n const { target, lowerLimit, upperLimit } = this.props;\n const L = lowerLimit !== null ? 1 : 0;\n const T = target !== null ? 2 : 0;\n const U = upperLimit !== null ? 4 : 0;\n return L + T + U;\n }", "function aTonosDeGris(data) {\n for (let i = 0; i < data.length; i += 4) {\n let gris = (data[i] + data[i + 1] + data[i + 2]) / 3;\n data[i] = gris;\n data[i+1] = gris;\n data[i+2] = gris;\n }\n}", "σ_perm() {\n\n let σ_perm = [];\n\n for (let x = 0; x <= this.L; x += 2) {\n if (x <= 0.1 * this.L) {\n σ_perm.push(new loadsArray(x, 130 / this.material.k));\n } else {\n if (x < 0.3 * this.L) {\n σ_perm.push(new loadsArray(x, 275 * x / (this.material.k * this.L) + 102.5 / this.material.k));\n } else {\n if (x <= 0.7 * this.L) {\n σ_perm.push(new loadsArray(x, 185 / this.material.k));\n } else {\n if (x < 0.9 * this.L) {\n σ_perm.push(new loadsArray(x, -275 * x / (this.material.k * this.L) + 377.5 / this.material.k));\n } else {\n if (x <= 1 * this.L) {\n σ_perm.push(new loadsArray(x, 130 / this.material.k));\n }\n }\n }\n }\n }\n }\n return σ_perm;\n }", "function productOfNgtvNums(arr){\r\n\r\n\tlet prdct = 1;\r\n\t\r\n\tlet bggstNgtvNum; \r\n\t\r\n\tfor (let i = 0; i < arr.length; i++){\r\n\t\t\r\n\t\tbggstNgtvNum = 1/-0;\r\n\r\n\t\tif(Array.isArray(arr[i])){\r\n\t\t\t\r\n\t\t\tfor (let j = 0; j < arr[i].length; j++){\r\n\t\r\n\t\t\t\tbggstNgtvNum = (arr[i][j] < 0 && bggstNgtvNum < arr[i][j] )\r\n\t\t\t\t\t\t\t\t? arr[i][j] \r\n\t\t\t\t\t\t\t\t: bggstNgtvNum;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\telse return 'Invalid Argument'\r\n\r\n\t\tprdct *= isFinite(bggstNgtvNum) ? bggstNgtvNum : 1;\r\n\r\n\t}\r\n\t\r\n\tif(!isFinite(bggstNgtvNum)) return 'No negatives';\r\n\t\r\n\treturn prdct;\r\n}", "function b2d() {\r\n\t var sum = 0,\r\n\t tmp = 0,\r\n\t b = 1;\r\n // var ui = Array.from(document.getElementById('b2d').value.toString());\r\n\t var ui = document.getElementById('b2d').value.toString();\r\n\t if (!isNaN(ui)) {\r\n\t\t ui = Array.from(ui);\r\n\t\t for (let a=0; a < ui.length; a++) {\r\n\t\t\t sum += parseInt(ui[a]) * Math.pow(2, ui.length - b);\r\n\t\t\t b+=1;\r\n\t\t\t}\r\n\t\tdocument.getElementById('display1').innerHTML = \"Your Decimal value is: \" + \"&nbsp;&nbsp;&nbsp;&nbsp;\" + sum.toString();\r\n\t } else {\r\n\t\t alert(\"not number.\");\r\n\t }\r\n }", "function calculate(numeros){\n let valores = document.getElementsByName(numeros);\n soma(parseInt(valores[0].value),parseInt(valores[1].value));\n}", "function productArray(numbers){\n let result = []\n numbers.forEach((number, index) => {\n let res = 1;\n numbers.forEach((subNumber, subIndex) => {\n if(index !== subIndex) {\n res *= subNumber\n }\n })\n result.push(res)\n })\n return result\n }", "promedio(){\n let promedio = 0;\n let i =0;\n for(let x of this._data){\n i = i++;\n promedio = promedio + x;\n }\n return promedio/i;\n }", "function NumPar(data) {\n // name\n // min\n // max\n // step\n // value\n this.data = data;\n this.data.rem = this.data.rem || \"\";\n NumPar.pars[data.name] = this;\n NumPar.names.push(data.name);\n Par.all[data.name] = \"numeric\";\n //console.log(\"setting \",data.name, \" to \", +data.value);\n window.glob[data.name] = +data.value;\n}", "function trumps2numbers(trumps) {\n var numbers = [];\n trumps.forEach(function (element, index) {\n switch (element) {\n case TRUMP.A:\n numbers.push(1);\n break;\n case TRUMP.J:\n numbers.push(1, 1);\n break;\n case TRUMP.Q:\n numbers.push(1, 2);\n break;\n case TRUMP.K:\n numbers.push(1, 3);\n break;\n default:\n numbers.push(parseInt(element, 10));\n }\n });\n return numbers;\n}", "function ingresarNumeros(numbers,ingreso){\n\t\t\tnumbers.push(Number(ingreso));\n\n\t\tvar resultado = numbers;\n\n\t\tconsole.log(resultado);\n\t\treturn resultado;\n\t}", "function Numeric() {}", "function mul (...all) {\n let newArr = all.filter(function(number){\n if (typeof number == \"number\"){\n return number;\t\t\n };\n });\n let res = 1;\n if (typeof newArr[0] == \"number\"){\n function mult (value) {\n return res *= value;\n };\n newArr.forEach(mult);\n return res;\n } else if (typeof newArr[0] != \"number\"){\n return res = 0;\n };\n}", "function Multiplicar(valor){\n return valor * 2;\n}", "data() {\n return{\n numbers: [-5, 0, 2, -1, 1, 0.5]\n }\n \n }", "function calculadora() {\n for (let i = 0; i < resultados.length; i++) {\n if (num.length > 1) {\n switch (i) {\n case 0:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 + num[j] * 1;\n }\n // Suma\n console.log(`El valor de la suma es: ${resultados[i]}`);\n break;\n case 1:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 - num[j] * 1;\n }\n // Resta\n console.log(`El valor de la resta es ${resultados[i]}`);\n break;\n case 2:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] *= num[j];\n }\n // Multiplicación\n console.log(`El valor de la multiplicación es ${resultados[i]}`);\n break;\n case 3:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] /= num[j];\n }\n // División\n console.log(`El valor de la división es ${resultados[i].toFixed(2)}`);\n break;\n case 4:\n resultados[i] = \"Sin Raiz cuadrada.\";\n // Sin raiz cuadrada\n console.log(\n `Al introducir dos o más valores numericos correctos la Raiz cuadrada no se ha calculado`\n );\n break;\n default:\n break;\n }\n } else if (num.length === 1) {\n resultados[4] = Math.sqrt(num[0]);\n // Raiz cuadrada\n console.log(`Solo se ha introducido un valor valido.`);\n console.log(\n `El valor de la raiz cuadrada es ${resultados[4].toFixed(2)}`\n );\n\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n } else {\n console.log(`No se han introducido numeros validos`);\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n }\n }\n}", "function muldiv(){\n memory.map((each, index)=>{\n switch(each){\n \n case \"*\":\n var memres = memory[index-1] * memory[index+1]\n return memory.splice(index-1,3,memres)\n break;\n case \"/\":\n var memres = memory[index-1] / memory[index+1]\n return memory.splice(index-1,3,memres)\n break;\n default:\n\n }\n })\n }", "normalize(item) {\n return item.map(x => parseInt(x));\n }", "function fieldToNumber(a, b) {\n\t\t\t $.each(a, function (index, item) {\n\t\t\t $.each(item, function (key, value) {\n\t\t\t $.each(b, function (index_1, item_1) {\n\t\t\t if (key == item_1) {\n\t\t\t a[index][key] = parseFloat(a[index][key]);\n\t\t\t }\n\t\t\t });\n\t\t\t });\n\t\t\t });\n\t\t\t}//fieldToNumber", "numberGenerator(arr1, arr2, type) {\n var str1 = \"\";\n var str2 = \"\";\n // Getting first number\n for (let i = 0; i < arr1.length; i++) {\n str1 = str1.concat(arr1[i]);\n }\n let firstFloatNumber = parseFloat(str1);\n // Getting second number\n for (let i = 0; i < arr2.length; i++) {\n str2 = str2.concat(arr2[i]);\n }\n let secondFloatNumber = parseFloat(str2);\n // Type of operation selection\n switch (type) {\n case \"+\": {\n let result = firstFloatNumber + secondFloatNumber;\n return result;\n break;\n }\n case \"-\": {\n let result = firstFloatNumber - secondFloatNumber;\n return result;\n break;\n }\n case \"*\": {\n let result = firstFloatNumber * secondFloatNumber;\n return result;\n break;\n }\n case \"/\": {\n let result = firstFloatNumber / secondFloatNumber;\n return result;\n break;\n }\n case \"%\": {\n let result = (firstFloatNumber * secondFloatNumber) / 100;\n return result;\n break;\n }\n }\n }", "function multiplyNumericPropertiesBy2() {\n // before the call\n let menu = {\n width: 200,\n height: 300,\n title: \"My menu\"\n };\n console.log(menu);\n\n multiplyNumeric(menu);\n\n // after the call\n console.log(menu);\n // menu = {\n // width: 400,\n // height: 600,\n // title: \"My menu\"\n // };\n\n function multiplyNumeric(obj) {\n for (let key in obj) {\n if (isNumeric(obj[key])) {\n obj[key] = parseFloat(obj[key]) * 2;\n }\n }\n }\n\n function isNumeric(value) {\n return !isNaN(parseFloat(value));\n }\n}", "multiply() {\n\t\treturn this.numbers.map((number) => number * this.mulitplyBy);\n\t}", "_calculateExponentAndMantissa(float){\n let integral2 = toBinaryX(parseInt(float, 10), EXP, '0');//on prends uniquement le chiffre avant la virgule en base 2\n let fractional10 = this._getDecimal(float);//on prends uniquement les chiffres après la virgule en base 10\n let fractional2 = ''; //contient les chiffres apres la virgule en base 2\n\n //la fraction est multiplié par 2 tant qu'elle n'est pas egal à 0 et que 23 itération ne se sont pas écoulé\n // si la fraction est plus grande que 1 on enleve le chiffre avant la virgule\n let i = 0;\n //127 + 23 permet de ne perdre aucune précision, en effet si on prends le cas extreme qui serait un nombre entre -1 et 1 tres tres petit, le nombre de décalage maximum\n //serait de 127 etant donné que l'exposant = 127 + décalge, apres 127 décalge il faut encore récupérer la valeur de mantisse donc 23 bit.\n //(cette exemple est pour la version 32 bit mais marche avec les autres version)\n while(fractional10 != 0 && i < D_ + MAN)\n {\n fractional10 = fractional10 * 2;\n if(fractional10 >= 1)\n {\n fractional2 += '1';\n }\n else\n {\n fractional2 += '0';\n }\n fractional10 = this._getDecimal(fractional10);\n i++;\n }\n\n let number2 = (integral2 + '.' + fractional2).split('');//nombre en binaire avec la notation scientifique mais non somplifié (2^0)\n\n let pointIndex = integral2.length;//index du point dans le chiffre\n\n //on itere dans le nombre jusqu'a trouver un 1, on effectue encore une fois j++ pour se placer juste apres le 1, car c'est ici que l'on veut placer la virgule\n let j = 0;\n while(number2[j] != 1)\n {\n j++;\n }\n j++;\n\n let power = 0;\n this.mantissa = (integral2 + fractional2).split('');\n //si le nombre n'est pas compris entre -1 et 1, on regarde de combien on a décalé la virgule,\n //pour la mantisse on enleve les 0 inutile et le 1er 1\n if(float <= -1 || float >= 1)\n {\n power = pointIndex - j;\n this.mantissa.splice(0,j);\n }\n //si le nombre est compris entre -1 et 1, on regarde de combien on a decalé la virgule\n //(+1 car si le nombre est comrpis entre - 1 et 1 on a compté la virgule dans le calcul et il faut enlever)\n //pour la mantisse on enleve les 0 inutile et le 1er 1\n else\n {\n power = pointIndex - j + 1;\n this.mantissa.splice(0, j - 1);\n }\n this.exponent = toBinaryX(D_ + power, EXP, '0');//on calcule l'exposant qu'on converti en binaire\n this.mantissa = fillWithX(this.mantissa.splice(0, MAN).join(\"\"), '0');//on prends les 23 premier bit de la mantisse[splice()], on converti le tableau en string[join()], on remplie la droite de la mantisse avec des 0[fillWith0()]\n }", "function potencia(b,e) {//b = base, e = expoente\n return b ** e\n}", "puntosCartas() {\n\t\tlet dicCartaValor = {\n\t\t\t2: 2,\n\t\t\t3: 3,\n\t\t\t4: 4,\n\t\t\t5: 5,\n\t\t\t6: 6,\n\t\t\t7: 7,\n\t\t\t8: 8,\n\t\t\t9: 9,\n\t\t\tT: 10,\n\t\t\tJ: 11,\n\t\t\tQ: 12,\n\t\t\tK: 13,\n\t\t\tA: 14\n\t\t};\n\t\treturn dicCartaValor[this.valor];\n\t}", "function flatten(number) {\n\n}", "function number(val) {\n\t return +val;\n\t}", "function number(val) {\n\t return +val;\n\t}", "convertirViento(viento) {\n return Math.round(viento * 3.6 * 10) / 10;\n }", "function numshr(x)\n{\n if (x instanceof Value) return x.shr();\n if (typeof(x) == 'number') return [x&1, x>>1];\n if (typeof(x) == 'bigint') return [x&1n, x>>1n];\n console.log(typeof(x)=='object'?x.constructor.name:typeof(x), x);\n throw \"unsupported number\";\n}", "multiply() {\n return this.numbers.map((multiplied) => this.multiplyBy * multiplied);\n }", "function multiplyNumeric(obj) {\n for (let key in obj) {\n if (typeof obj[key] === \"number\") {\n obj[key] *= 2;\n }\n }\n return obj;\n}", "function calcular(oper, ...nums){\n let res\n switch(oper) {\n case '+':\n //res = 0\n //for(let n of nums) soma += n\n res = somaTudo(...nums)\n break\n\n case '*':\n res = 1\n for(let n of nums) res *= n\n }\n return res\n}", "function toNumeric(n) {\r\n if (!isNaN(parseFloat(n)) && isFinite(n)) {\r\n\treturn n;\r\n }\r\n else\r\n {\treturn 0;\r\n }\r\n}", "function elevar_al_cuadrado(numero)\n{\n return numero * numero;\n}", "function numericStringToNumber_(values){\n for (var i = 0; i < values.length; i++){\n for(var j = 0; j < values[i].length; j++){\n if (!isNaN(values[i][j])){\n values[i][j] = Number(values[i][j], 10);\n }\n }\n }\n return values;\n}", "static tritsValue(trits) {\n let value = 0;\n for (let i = trits.length - 1; i >= 0; i--) {\n value = (value * 3) + trits[i];\n }\n return value;\n }", "factorizar(numero){\n let total = 1\n for (let i = 1; i <= numero; i++){\n total = total * i\n }\n return total;\n }", "function prix() {\n return 50 * (nbMultiplicateur * nbMultiplicateur * 0.2);\n}", "function convertsStringToNumbers(arr) {\n    var newArr = [];\n \n    for (var i = 0; i < arr.length; i++) {\n \nvar convert = parseFloat(arr[i]);\n\nif (isFinite(convert)) { //proverava da li je sve brojiev i da nisu undefined, NaN, uklanja nepotrebne\nnewArr[newArr.length] = convert;\n}\n}\n    return newArr;\n}", "function plusMinus(arr) {\n let length = arr.length\n let newArr;\n const positiveLength = arr.filter(number => number > 0).length;\n const negativeLength = arr.filter(number => number < 0).length\n const zeroLength = arr.filter(number => number === 0).length\n\n let posFrac = (positiveLength / length).toFixed(6)\n let negFrac = (negativeLength / length).toFixed(6)\n let zeroFrac = (zeroLength / length).toFixed(6)\n\n newArr = [posFrac, negFrac, zeroFrac]\n console.log(newArr.join('\\n'))\n}", "function sortNumeric(val1, val2)\n{\n return val1 - val2;\n}", "function multiple(){\n results.value = Number(a.value) * Number(b.value);\n }", "function NumbersOnly(elem,e,whole,positive){\n\tvar num,text = elem.value;\n\tif(text=='-'||text=='.') return;\n\ttry{num=parseFloat(text);}catch(err){elem.value = '';return;}\n\tif(whole&&num!=Math.round(num)) num = Math.round(num);\n\tif(positive&&num<0) num = '';\n\tif(num!=text) elem.value = isNaN(num)?'':num;\n}", "function transmorgify(num1, num2, num3){\n\treturn Math.pow(num1 * num2, num3); \n}", "function expandedForm(num) {\n \n return (num).toString().split(\"\").map((a,i,arr) =>{\n return a*Math.pow(10, arr.length-i-1);\n }).filter(n => n>0).join(\" + \");\n\n}", "function plusMinus(arr) {\n var result = [];\n var a1 = 0, a2 = 0, a3 = 0;\n for (var i = 0; i < arr.length; i++){\n if (arr[i] > 0) {\n a1++;\n }\n if (arr[i] < 0) {\n a2++;\n }\n if (arr[i] == 0) {\n a3++;\n }\n // console.log(a1);\n }\n result[0] = parseFloat(a1 / arr.length).toFixed(6);\n console.log(result[0]);\n // console.log(typeof result[0]);\n result[1] = parseFloat(a2 / arr.length).toFixed(6);\n console.log(result[1]);\n result[2] = parseFloat(a3 / arr.length).toFixed(6);\n console.log(result[2]);\n}", "function ejercicio3(){\n let numero4=prompt(\"Ingresa una cantidad\")\n let result=0\n if (numero4>0){\n for (let x=0;x<numero4.length;x++){\n result+=parseInt(numero4[x])\n }\n console.log(`Cantidad Ingresada: ${numero4}`)\n console.log(`La suma de los digitos en la cantidad es: ${result}`)\n }\n else\n console.log(\"La cantidad debe ser mayor que 0\")\n}", "function convertNumbers(data) {\n data.forEach(element => {\n element.id = parseInt(element.id, 10)\n element.votes = parseInt(element.votes, 10)\n });\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 getPermutations(counter, digitsNum) {\n var denominator = 1\n counter.forEach((value) => { denominator *= rFact(value) })\n var permutations = rFact(digitsNum)/denominator\n return permutations \n}", "function addAll(...num){\n\n let total = 0;\n\n\n num.forEach(digit => total += digit\n )\n\n return total\n\n\n}", "function calcular(){\r\n num1 = parseFloat(num1);\r\n num2 = parseFloat(num2);\r\n switch(operador){\r\n case operacion.SUMAR:\r\n num1+=num2;\r\n break;\r\n case operacion.RESTAR:\r\n num1 = num1-num2;\r\n break;\r\n case operacion.MULTIPLICAR:\r\n num1*=num2;\r\n break;\r\n case operacion.DIVIDIR:\r\n num1 = (num1/num2);\r\n break;\r\n case operacion.PORTENCIA:\r\n num1 = Math.pow(num1,num2);\r\n break;\r\n }\r\n actualizarValor1();\r\n num2 = 0;\r\n actualizarValor2();\r\n}", "function soal(angka, kuadrat) {\r\n var range = kuadrat;\r\n var start = angka;\r\n var value = angka;\r\n var arr1 = [];\r\n\r\n for (var n = 1; n < range; n++) {\r\n start = start * angka;\r\n value = start;\r\n }\r\n var sNumber = value.toString();\r\n for (var i = 0, len = sNumber.length; i < len; i += 1) {\r\n arr1.push(+sNumber.charAt(i));\r\n }\r\n\r\n for (var a = 0, sum = 0; a < arr1.length; sum += arr1[a++]);\r\n\r\n console.log(arr1);\r\n console.log(value);\r\n console.log(sum);\r\n}", "function calcPerim() {\n\tthis.perimetr=0;\n\tfor(key in this){\n\t\tif(checkisNum(this[key])&&key!=='perimetr'){\n\t\t\tthis.perimetr+=this[key];\n\t\t}\n\t}\n\treturn this.perimetr;\n}", "function product(numbers){\n\n let total = numbers.reduce((a,b) => a * b);\n\n let answer = [];\n\n numbers.forEach(val => answer.push(total/val));\n\n return answer;\n\n}", "function digitsProduct(product) {\n if (product === 0) return 10;\n else if (product === 1) return 1;\n\n var list = [];\n for (var d = 9; d > 1; d--) {\n while (product % d === 0) {\n product /= d;\n list.push(d);\n }\n }\n // console.log(list);\n if (product !== 1) {\n return -1;\n } else {\n list = list.reverse();\n var str = list.join('');\n // console.log(str);\n return parseInt(str);\n }\n}", "function Numeral(number){this._value=number;}", "multiply(n) {\n let newDigits = [];\n let carry = 0;\n for (const digit of this.digits) {\n const sum = digit * n + carry;\n newDigits.push(sum % 10);\n carry = Math.floor(sum / 10);\n }\n if (carry > 0)\n newDigits.push(carry);\n return new Uint(newDigits);\n }", "function digitize(n) {\n //code here\n return Array.from(String(n)).map(Number).reverse();\n}", "function TrupleNum(num) {\n return num * 3;\n}", "function digits(num){\n var final = []\n var tableau = String(num).split('')\n var data = tableau.map(element => parseInt(element));\n for ( var i = 0; i < data.length ; i++ ) {\n for ( var j = 1 ; j < data.length ; j++ ) {\n final.push(data[i] + data[j]);\n } \n data.splice(0,1);\n i = -1;\n }\n return final\n }", "function persistence(num) {\n let points = String(num)\n let result = 0\n let arrForAddAtPoints = []\n let newNumber = 1\n for (let i = 0; i < 10; i++) {\n arrForAddAtPoints = points.split('')\n if (arrForAddAtPoints.length > 1) {\n result++\n for (let j = 0; j < arrForAddAtPoints.length; j++) {\n arrForAddAtPoints = arrForAddAtPoints.map(n => +n)\n newNumber += arrForAddAtPoints[i]\n console.log(newNumber)\n }\n }\n console.log(arrForAddAtPoints)\n }\n\n\n }", "function multiplyByNumber(num, x, base) {\n if (num < 0)\n return null;\n if (num == 0)\n return [];\n\n var result = [];\n var power = x;\n while (true) {\n if (num & 1) {\n result = add(result, power, base);\n }\n num = num >> 1;\n if (num === 0)\n break;\n power = add(power, power, base);\n }\n\n return result;\n }", "function digitize(val) {\n return Array.from('' + val, Number);\n}", "function numeric(value) {\r\n return !isNaN(value - parseFloat(value));\r\n }", "toNumber() {\n let m = this.if('#TextValue')\n m.forEach(val => {\n let obj = parse(val)\n if (obj.num === null) {\n return\n }\n let fmt = val.has('#Ordinal') ? 'Ordinal' : 'Cardinal'\n let str = format(obj, fmt)\n val.replaceWith(str, { tags: true })\n val.tag('NumericValue')\n })\n return this\n }", "function double() {\n var carry = 0;\n for (let i = num.length - 1; i >= 0; i--) {\n var newDigit = num[i] * 2 + carry;\n num[i] = newDigit % 10;\n carry = Math.floor(newDigit / 10);\n }\n if (carry > 0) {\n num.unshift(carry);\n carry = 0;\n }\n }", "function sum() {\r\n\tvar items = sum.arguments.length;\r\n\tvar thissum = 0;\r\n\tvar thisnum;\r\n\tvar usedNums = false;\r\n\tfor (i = 0; i < items; i++) {\r\n\t\tthisnum = sum.arguments[i];\r\n\t\tif (isFloat(thisnum) && thisnum != 'NaN') {\r\n\t\t\tthissum += parseFloat(thisnum);\r\n\t\t\tusedNums = true;\r\n\t\t} else if (thisnum != null && thisnum != \"undefined\" && thisnum != \"\" && thisnum != 'NaN') {\r\n\t\t\treturn 'NaN';\r\n\t\t}\r\n\t}\r\n\treturn (usedNums ? thissum : 'NaN');\t\r\n}", "function products(arr) {\n let product=1;\n for (let i=0; i<arr.length; i++){\n product*=arr[i];\n }\n for (let j=1; j<arr.length; j++){\n arr[j]=product/arr[j];\n }\n return arr;\n}", "restrictValue(values) {\n if (values[1].constructor === JQX.Utilities.BigNumber) {\n if (values[1].compare(values[0]) === -1) {\n values[1].set(values[0]);\n }\n }\n else {\n if (values[1] < values[0]) {\n values[1] = values[0];\n }\n }\n }", "function getNumbers (val1, val2) {\n const val1Numeric = Number(val1)\n if (isNaN(val1Numeric)) {\n throw new TypeError(`val1 is not a valid number: ${val1}`)\n }\n const val2Numeric = Number(val2)\n if (isNaN(val2Numeric)) {\n throw new TypeError(`val2 is not a valid number: ${val2}`)\n }\n return [val1Numeric, val2Numeric]\n}", "function parseFloatList(a) {\n\tfor (let i = 0; i < a.length; i++) {\n\t\ta[i] = parseFloat(a[i]);\n\t}\n\treturn a;\n}", "function addValues(num1,num2){\r\n return num1 + num2;\r\n}" ]
[ "0.59080625", "0.59049714", "0.5852714", "0.5846675", "0.5799497", "0.573698", "0.56282127", "0.5607934", "0.5558825", "0.5549639", "0.5525883", "0.54795027", "0.5478957", "0.54642093", "0.54571474", "0.5451614", "0.5434455", "0.5420768", "0.5399625", "0.5388181", "0.53860056", "0.5379789", "0.5366187", "0.5365956", "0.53648126", "0.53550047", "0.53450197", "0.5333978", "0.5332946", "0.5325", "0.5317372", "0.53146833", "0.5307732", "0.5305894", "0.5284757", "0.52836627", "0.5282386", "0.5272279", "0.52718097", "0.5270884", "0.52621406", "0.525014", "0.5248928", "0.52483046", "0.5245408", "0.52449197", "0.5238372", "0.5231534", "0.5229635", "0.5188607", "0.51873636", "0.5186486", "0.51843584", "0.51743734", "0.51743734", "0.5171528", "0.51710725", "0.51666653", "0.5164006", "0.5159695", "0.5159298", "0.51592755", "0.5150931", "0.5150006", "0.5149702", "0.5140544", "0.5140316", "0.5137912", "0.5135592", "0.5134171", "0.5133278", "0.5130464", "0.51293427", "0.5127765", "0.5126358", "0.51253873", "0.512499", "0.5123592", "0.5118445", "0.51164246", "0.51154333", "0.5115384", "0.5114586", "0.5109794", "0.5107056", "0.5100277", "0.5097897", "0.50971997", "0.50946087", "0.50936204", "0.50917", "0.5091121", "0.5084646", "0.5082815", "0.5082124", "0.50813705", "0.50794965", "0.50761026", "0.5075186", "0.5075098", "0.5074555" ]
0.0
-1
permite somente valores numericos
function valCEP(e,campo){ var tecla=(window.event)?event.keyCode:e.which; if((tecla > 47 && tecla < 58 )){ mascara(campo, '#####-###'); return true; } else{ if (tecla != 8 ) return false; else return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformInt() {\n for (let i = 0; i < ctmc.length; i++) {\n for (let j = 0; j < ctmc[i].length; j++) {\n ctmc[i][j] = parseFloat(ctmc[i][j]);\n }\n }\n}", "function number(numbers) { }", "function toNum(result) {\n var numResult = [];\n result.forEach(function (perm) {\n numResult.push(parseInt(perm));\n });\n return numResult.sort(function (a, b) { return a - b; });\n }", "function process_data_numeric(datas) {\n for (var i in datas){\n for(var j in datas[i]){\n if (typeof(datas[i][j]) === typeof(12)){\n if(datas[i][j] > 0 && datas[i][j] <1){\n datas[i][j] = (Math.trunc(datas[i][j] *10000))/100\n }\n }\n }\n }\n return datas\n\n }", "function doubleValues(num) {\n // console.log(num);\n num.forEach((element) => {\n element += element;\n return element;\n });\n \n}", "static numerals() {\n return [\n { numeral: 'M', value: 1000 },\n { numeral: 'CM', value: 900 },\n { numeral: 'D', value: 500 },\n { numeral: 'CD', value: 400 },\n { numeral: 'C', value: 100 },\n { numeral: 'XC', value: 90 },\n { numeral: 'L', value: 50 },\n { numeral: 'XL', value: 40 },\n { numeral: 'X', value: 10 },\n { numeral: 'IX', value: 9 },\n { numeral: 'V', value: 5 },\n { numeral: 'IV', value: 4 },\n { numeral: 'I', value: 1 },\n ];\n }", "function productOfOtherNumbers(arg){\n\n}", "function valFor(c) {\n\tswitch(c) {\n\t\tcase 0:\n\t\treturn [10,0.1,9,0.07];\n\t\tcase 1:\n\t\treturn [100,0,20,0]\n\t\tcase 2:\n\t\tcase 3:\n\t\tcase 4:\n\t\treturn [40,0.1,9,0.1]\n\t}\n}", "function multiplicar (){\n return numeroUno * numeroDos\n}", "convertInputValuesToNumbers() {\n this.currentRange = !isNaN(parseFloat(this.currentRange))\n ? parseFloat(this.currentRange)\n : 0;\n\n this.plannedRange = !isNaN(parseFloat(this.plannedRange))\n ? parseFloat(this.plannedRange)\n : 0;\n\n this.priority = !isNaN(parseFloat(this.priority))\n ? parseFloat(this.priority)\n : 0;\n }", "function MultiplicarPorDois(valor){\n return valor * 2;\n}", "function narcissistic(value) {\n let sum = 0;\n // console.log(value);\n // console.log(value.toString())\n // console.log(value.toString().split(''));\n\n let valueArray = Array.from(value.toString()).map(Number)\n console.log(valueArray);\n valueArray.forEach((val) => {\n sum += (val ** (valueArray.length))\n })\n console.log(value, sum);\n if (value === sum){\n return true\n } else {\n return false\n }\n }", "function ejercicio1 (a) {\r\n var numeros = \"\",\r\n i;\r\n //This \"for\" is responsible for going through the list to multiply the other values.\r\n for (i = 0; i < a.length; i++) {\r\n var multiplicando = 1;\r\n //This \"for\" searches for the other values other than the position to multiply and add them to the result.\r\n for (j = 0; j < a.length; j++) { \r\n //This \"if\" prevents the same value that we are in from multiplying\r\n if (i != j) \r\n multiplicando = multiplicando * a[j];\r\n }\r\n //This “if” is in charge of concatenating the texts, and if it is the last one, it gives it a different format.\r\n if (i == a.length - 1){\r\n numeros = numeros + multiplicando;\r\n } else {\r\n numeros = numeros + multiplicando + \", \";\r\n } \r\n }\r\n return numeros;\r\n}", "function NumReal(fld, milSep, decSep, e,tipo) {\nif (fld.value.length > 12){ \nreturn false; }\nvar sep = 0;\nvar key = '';\nvar i = j = 0;\nvar len = len2 = 0;\nvar strCheck = '0123456789-';\nvar aux = aux2 = '';\nif (tipo){\nvar whichCode = (window.Event) ? e.which : e.keyCode;\nif (whichCode == 13) return true; // Enter\nvar key = String.fromCharCode(whichCode); // Get key value from key code\nif (strCheck.indexOf(key) == -1) return false; // Not a valid key\n}\nlen = fld.value.length;\nfor(i = 0; i < len; i++)\nif ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;\naux = '';\nfor(; i < len; i++)\nif (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);\naux += key;\nlen = aux.length;\nif (len == 0) fld.value = '';\nif (len == 1) fld.value = '0'+ decSep + '0' + aux;\nif (len == 2) fld.value = '0'+ decSep + aux;\nif (len > 2) {\naux2 = '';\nfor (j = 0, i = len - 3; i >= 0; i--) {\nif (j == 3) {\naux2 += milSep;\nj = 0;\n}\naux2 += aux.charAt(i);\nj++;\n}\nfld.value = '';\nlen2 = aux2.length;\nfor (i = len2 - 1; i >= 0; i--)\nfld.value += aux2.charAt(i);\nfld.value += decSep + aux.substr(len - 2, len);\n}\nreturn false;\n}", "function real(partes, ...valores) {\n const resultado = []\n valores.forEach((valor, indice) => {\n valor = isNaN(valor) ? valor : `R$${valor.toFixed(2)}`\n resultado.push(partes[indice], valor)\n\n })\n return resultado.join('')\n}", "static get NUMBERS() {\n return {\n \"0\": Calc.VALID,\n \"1\": Calc.VALID,\n \"2\": Calc.VALID,\n \"3\": Calc.VALID,\n \"4\": Calc.VALID,\n \"5\": Calc.VALID,\n \"6\": Calc.VALID,\n \"7\": Calc.VALID,\n \"8\": Calc.VALID,\n \"9\": Calc.VALID,\n \".\": Calc.VALID\n };\n }", "function numbers (){\n memory.map((each,index)=>{\n \n if(d.test(each) && d.test(memory[index+1])){\n memory.splice(index,1)\n memory[index]= each+memory[index];\n numbers()\n }\n })\n }", "function numarray(x) {\n for (var j = 0, o = []; j < x.length; j++) o[j] = parseFloat(x[j]);\n return o;\n }", "_toNumberArray(t) {\n if (!Array.isArray(t))\n throw TypeError();\n if (t.some(function(t) {\n return \"number\" != typeof t;\n }))\n throw TypeError();\n return t;\n }", "function multiplicar(array) {\n\t\t\tlet multiplicar = 1;\n\t\t\tfor(i=0; i<array.length; i++) {\n\t\t\t\tmultiplicar = multiplicar * parseInt(array[i])\n\t\t\t};\n\t\t\treturn multiplicar;\n\t\t}", "multiply() {\n\n let result=1;\n let digit;\n \n for (let i = 0; i < arguments.length; i++) \n \n if(arguments[i]===\"LAST\"){\n result *= parseInt(this.last());\n }\n else \n if(arguments[i]!==\"LAST\"&&typeof(arguments[i])=='string'){\n \n digit = arguments[i].match(this.regex)\n result *= this.memory[parseInt(digit) - 1]\n \n \n }else{\n result *= arguments[i];\n \n }\n this.total = result;\n return parseInt(this.total);\n }", "function getDigits(d) {\r\n switch (d) {\r\n case '0':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '1':\r\n return [0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n case '2':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '3':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '4':\r\n return [0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n case '5':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '6':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '7':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n case '8':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1];\r\n case '9':\r\n return [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1];\r\n default:\r\n return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0];\r\n }\r\n}", "function convert(num) {\n\n\n}", "function calcular (oper,...nums){\n let res\n switch (oper){\n case '+':\n //res = 0\n //for(let n of nums) soma +=n\n res = somaTudo(...nums)\n break\n\n case '*':\n res = 1\n for(let n of nums) res *=n\n }\n return res\n}", "function parseNumAr(data){\n\tvar result = [];\n\t\n\tif(typeof data == 'string'){ data = [data]; }\n\t\n\tfor (var i=0; i < data.length; i++){\n\t\t//console.log(data[i]);\n\t\tresult.push(parseFloat(data[i]));\n\t}\n\treturn result;\n}", "function numarray(x) {\n for (var j = 0, o = []; j < x.length; j++) o[j] = parseFloat(x[j]);\n return o;\n }", "function promedio(input){\n\t\tvar numeros = input;\n\t\tvar resultado;\n\t\tresultado = numeros.reduce(function(a,b){ return a + b;}, 0);\n\t\tresultado /= input.length;\n\t\tconsole.log(resultado);\n\t\t\n\n\t\treturn resultado;\n\t}", "limitsToNumber() {\n const { target, lowerLimit, upperLimit } = this.props;\n const L = lowerLimit !== null ? 1 : 0;\n const T = target !== null ? 2 : 0;\n const U = upperLimit !== null ? 4 : 0;\n return L + T + U;\n }", "function aTonosDeGris(data) {\n for (let i = 0; i < data.length; i += 4) {\n let gris = (data[i] + data[i + 1] + data[i + 2]) / 3;\n data[i] = gris;\n data[i+1] = gris;\n data[i+2] = gris;\n }\n}", "σ_perm() {\n\n let σ_perm = [];\n\n for (let x = 0; x <= this.L; x += 2) {\n if (x <= 0.1 * this.L) {\n σ_perm.push(new loadsArray(x, 130 / this.material.k));\n } else {\n if (x < 0.3 * this.L) {\n σ_perm.push(new loadsArray(x, 275 * x / (this.material.k * this.L) + 102.5 / this.material.k));\n } else {\n if (x <= 0.7 * this.L) {\n σ_perm.push(new loadsArray(x, 185 / this.material.k));\n } else {\n if (x < 0.9 * this.L) {\n σ_perm.push(new loadsArray(x, -275 * x / (this.material.k * this.L) + 377.5 / this.material.k));\n } else {\n if (x <= 1 * this.L) {\n σ_perm.push(new loadsArray(x, 130 / this.material.k));\n }\n }\n }\n }\n }\n }\n return σ_perm;\n }", "function productOfNgtvNums(arr){\r\n\r\n\tlet prdct = 1;\r\n\t\r\n\tlet bggstNgtvNum; \r\n\t\r\n\tfor (let i = 0; i < arr.length; i++){\r\n\t\t\r\n\t\tbggstNgtvNum = 1/-0;\r\n\r\n\t\tif(Array.isArray(arr[i])){\r\n\t\t\t\r\n\t\t\tfor (let j = 0; j < arr[i].length; j++){\r\n\t\r\n\t\t\t\tbggstNgtvNum = (arr[i][j] < 0 && bggstNgtvNum < arr[i][j] )\r\n\t\t\t\t\t\t\t\t? arr[i][j] \r\n\t\t\t\t\t\t\t\t: bggstNgtvNum;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\telse return 'Invalid Argument'\r\n\r\n\t\tprdct *= isFinite(bggstNgtvNum) ? bggstNgtvNum : 1;\r\n\r\n\t}\r\n\t\r\n\tif(!isFinite(bggstNgtvNum)) return 'No negatives';\r\n\t\r\n\treturn prdct;\r\n}", "function b2d() {\r\n\t var sum = 0,\r\n\t tmp = 0,\r\n\t b = 1;\r\n // var ui = Array.from(document.getElementById('b2d').value.toString());\r\n\t var ui = document.getElementById('b2d').value.toString();\r\n\t if (!isNaN(ui)) {\r\n\t\t ui = Array.from(ui);\r\n\t\t for (let a=0; a < ui.length; a++) {\r\n\t\t\t sum += parseInt(ui[a]) * Math.pow(2, ui.length - b);\r\n\t\t\t b+=1;\r\n\t\t\t}\r\n\t\tdocument.getElementById('display1').innerHTML = \"Your Decimal value is: \" + \"&nbsp;&nbsp;&nbsp;&nbsp;\" + sum.toString();\r\n\t } else {\r\n\t\t alert(\"not number.\");\r\n\t }\r\n }", "function calculate(numeros){\n let valores = document.getElementsByName(numeros);\n soma(parseInt(valores[0].value),parseInt(valores[1].value));\n}", "function productArray(numbers){\n let result = []\n numbers.forEach((number, index) => {\n let res = 1;\n numbers.forEach((subNumber, subIndex) => {\n if(index !== subIndex) {\n res *= subNumber\n }\n })\n result.push(res)\n })\n return result\n }", "promedio(){\n let promedio = 0;\n let i =0;\n for(let x of this._data){\n i = i++;\n promedio = promedio + x;\n }\n return promedio/i;\n }", "function NumPar(data) {\n // name\n // min\n // max\n // step\n // value\n this.data = data;\n this.data.rem = this.data.rem || \"\";\n NumPar.pars[data.name] = this;\n NumPar.names.push(data.name);\n Par.all[data.name] = \"numeric\";\n //console.log(\"setting \",data.name, \" to \", +data.value);\n window.glob[data.name] = +data.value;\n}", "function trumps2numbers(trumps) {\n var numbers = [];\n trumps.forEach(function (element, index) {\n switch (element) {\n case TRUMP.A:\n numbers.push(1);\n break;\n case TRUMP.J:\n numbers.push(1, 1);\n break;\n case TRUMP.Q:\n numbers.push(1, 2);\n break;\n case TRUMP.K:\n numbers.push(1, 3);\n break;\n default:\n numbers.push(parseInt(element, 10));\n }\n });\n return numbers;\n}", "function ingresarNumeros(numbers,ingreso){\n\t\t\tnumbers.push(Number(ingreso));\n\n\t\tvar resultado = numbers;\n\n\t\tconsole.log(resultado);\n\t\treturn resultado;\n\t}", "function Numeric() {}", "function mul (...all) {\n let newArr = all.filter(function(number){\n if (typeof number == \"number\"){\n return number;\t\t\n };\n });\n let res = 1;\n if (typeof newArr[0] == \"number\"){\n function mult (value) {\n return res *= value;\n };\n newArr.forEach(mult);\n return res;\n } else if (typeof newArr[0] != \"number\"){\n return res = 0;\n };\n}", "function Multiplicar(valor){\n return valor * 2;\n}", "data() {\n return{\n numbers: [-5, 0, 2, -1, 1, 0.5]\n }\n \n }", "function calculadora() {\n for (let i = 0; i < resultados.length; i++) {\n if (num.length > 1) {\n switch (i) {\n case 0:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 + num[j] * 1;\n }\n // Suma\n console.log(`El valor de la suma es: ${resultados[i]}`);\n break;\n case 1:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 - num[j] * 1;\n }\n // Resta\n console.log(`El valor de la resta es ${resultados[i]}`);\n break;\n case 2:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] *= num[j];\n }\n // Multiplicación\n console.log(`El valor de la multiplicación es ${resultados[i]}`);\n break;\n case 3:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] /= num[j];\n }\n // División\n console.log(`El valor de la división es ${resultados[i].toFixed(2)}`);\n break;\n case 4:\n resultados[i] = \"Sin Raiz cuadrada.\";\n // Sin raiz cuadrada\n console.log(\n `Al introducir dos o más valores numericos correctos la Raiz cuadrada no se ha calculado`\n );\n break;\n default:\n break;\n }\n } else if (num.length === 1) {\n resultados[4] = Math.sqrt(num[0]);\n // Raiz cuadrada\n console.log(`Solo se ha introducido un valor valido.`);\n console.log(\n `El valor de la raiz cuadrada es ${resultados[4].toFixed(2)}`\n );\n\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n } else {\n console.log(`No se han introducido numeros validos`);\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n }\n }\n}", "function muldiv(){\n memory.map((each, index)=>{\n switch(each){\n \n case \"*\":\n var memres = memory[index-1] * memory[index+1]\n return memory.splice(index-1,3,memres)\n break;\n case \"/\":\n var memres = memory[index-1] / memory[index+1]\n return memory.splice(index-1,3,memres)\n break;\n default:\n\n }\n })\n }", "normalize(item) {\n return item.map(x => parseInt(x));\n }", "function fieldToNumber(a, b) {\n\t\t\t $.each(a, function (index, item) {\n\t\t\t $.each(item, function (key, value) {\n\t\t\t $.each(b, function (index_1, item_1) {\n\t\t\t if (key == item_1) {\n\t\t\t a[index][key] = parseFloat(a[index][key]);\n\t\t\t }\n\t\t\t });\n\t\t\t });\n\t\t\t });\n\t\t\t}//fieldToNumber", "numberGenerator(arr1, arr2, type) {\n var str1 = \"\";\n var str2 = \"\";\n // Getting first number\n for (let i = 0; i < arr1.length; i++) {\n str1 = str1.concat(arr1[i]);\n }\n let firstFloatNumber = parseFloat(str1);\n // Getting second number\n for (let i = 0; i < arr2.length; i++) {\n str2 = str2.concat(arr2[i]);\n }\n let secondFloatNumber = parseFloat(str2);\n // Type of operation selection\n switch (type) {\n case \"+\": {\n let result = firstFloatNumber + secondFloatNumber;\n return result;\n break;\n }\n case \"-\": {\n let result = firstFloatNumber - secondFloatNumber;\n return result;\n break;\n }\n case \"*\": {\n let result = firstFloatNumber * secondFloatNumber;\n return result;\n break;\n }\n case \"/\": {\n let result = firstFloatNumber / secondFloatNumber;\n return result;\n break;\n }\n case \"%\": {\n let result = (firstFloatNumber * secondFloatNumber) / 100;\n return result;\n break;\n }\n }\n }", "function multiplyNumericPropertiesBy2() {\n // before the call\n let menu = {\n width: 200,\n height: 300,\n title: \"My menu\"\n };\n console.log(menu);\n\n multiplyNumeric(menu);\n\n // after the call\n console.log(menu);\n // menu = {\n // width: 400,\n // height: 600,\n // title: \"My menu\"\n // };\n\n function multiplyNumeric(obj) {\n for (let key in obj) {\n if (isNumeric(obj[key])) {\n obj[key] = parseFloat(obj[key]) * 2;\n }\n }\n }\n\n function isNumeric(value) {\n return !isNaN(parseFloat(value));\n }\n}", "multiply() {\n\t\treturn this.numbers.map((number) => number * this.mulitplyBy);\n\t}", "_calculateExponentAndMantissa(float){\n let integral2 = toBinaryX(parseInt(float, 10), EXP, '0');//on prends uniquement le chiffre avant la virgule en base 2\n let fractional10 = this._getDecimal(float);//on prends uniquement les chiffres après la virgule en base 10\n let fractional2 = ''; //contient les chiffres apres la virgule en base 2\n\n //la fraction est multiplié par 2 tant qu'elle n'est pas egal à 0 et que 23 itération ne se sont pas écoulé\n // si la fraction est plus grande que 1 on enleve le chiffre avant la virgule\n let i = 0;\n //127 + 23 permet de ne perdre aucune précision, en effet si on prends le cas extreme qui serait un nombre entre -1 et 1 tres tres petit, le nombre de décalage maximum\n //serait de 127 etant donné que l'exposant = 127 + décalge, apres 127 décalge il faut encore récupérer la valeur de mantisse donc 23 bit.\n //(cette exemple est pour la version 32 bit mais marche avec les autres version)\n while(fractional10 != 0 && i < D_ + MAN)\n {\n fractional10 = fractional10 * 2;\n if(fractional10 >= 1)\n {\n fractional2 += '1';\n }\n else\n {\n fractional2 += '0';\n }\n fractional10 = this._getDecimal(fractional10);\n i++;\n }\n\n let number2 = (integral2 + '.' + fractional2).split('');//nombre en binaire avec la notation scientifique mais non somplifié (2^0)\n\n let pointIndex = integral2.length;//index du point dans le chiffre\n\n //on itere dans le nombre jusqu'a trouver un 1, on effectue encore une fois j++ pour se placer juste apres le 1, car c'est ici que l'on veut placer la virgule\n let j = 0;\n while(number2[j] != 1)\n {\n j++;\n }\n j++;\n\n let power = 0;\n this.mantissa = (integral2 + fractional2).split('');\n //si le nombre n'est pas compris entre -1 et 1, on regarde de combien on a décalé la virgule,\n //pour la mantisse on enleve les 0 inutile et le 1er 1\n if(float <= -1 || float >= 1)\n {\n power = pointIndex - j;\n this.mantissa.splice(0,j);\n }\n //si le nombre est compris entre -1 et 1, on regarde de combien on a decalé la virgule\n //(+1 car si le nombre est comrpis entre - 1 et 1 on a compté la virgule dans le calcul et il faut enlever)\n //pour la mantisse on enleve les 0 inutile et le 1er 1\n else\n {\n power = pointIndex - j + 1;\n this.mantissa.splice(0, j - 1);\n }\n this.exponent = toBinaryX(D_ + power, EXP, '0');//on calcule l'exposant qu'on converti en binaire\n this.mantissa = fillWithX(this.mantissa.splice(0, MAN).join(\"\"), '0');//on prends les 23 premier bit de la mantisse[splice()], on converti le tableau en string[join()], on remplie la droite de la mantisse avec des 0[fillWith0()]\n }", "function potencia(b,e) {//b = base, e = expoente\n return b ** e\n}", "puntosCartas() {\n\t\tlet dicCartaValor = {\n\t\t\t2: 2,\n\t\t\t3: 3,\n\t\t\t4: 4,\n\t\t\t5: 5,\n\t\t\t6: 6,\n\t\t\t7: 7,\n\t\t\t8: 8,\n\t\t\t9: 9,\n\t\t\tT: 10,\n\t\t\tJ: 11,\n\t\t\tQ: 12,\n\t\t\tK: 13,\n\t\t\tA: 14\n\t\t};\n\t\treturn dicCartaValor[this.valor];\n\t}", "function flatten(number) {\n\n}", "function number(val) {\n\t return +val;\n\t}", "function number(val) {\n\t return +val;\n\t}", "convertirViento(viento) {\n return Math.round(viento * 3.6 * 10) / 10;\n }", "function numshr(x)\n{\n if (x instanceof Value) return x.shr();\n if (typeof(x) == 'number') return [x&1, x>>1];\n if (typeof(x) == 'bigint') return [x&1n, x>>1n];\n console.log(typeof(x)=='object'?x.constructor.name:typeof(x), x);\n throw \"unsupported number\";\n}", "multiply() {\n return this.numbers.map((multiplied) => this.multiplyBy * multiplied);\n }", "function multiplyNumeric(obj) {\n for (let key in obj) {\n if (typeof obj[key] === \"number\") {\n obj[key] *= 2;\n }\n }\n return obj;\n}", "function calcular(oper, ...nums){\n let res\n switch(oper) {\n case '+':\n //res = 0\n //for(let n of nums) soma += n\n res = somaTudo(...nums)\n break\n\n case '*':\n res = 1\n for(let n of nums) res *= n\n }\n return res\n}", "function toNumeric(n) {\r\n if (!isNaN(parseFloat(n)) && isFinite(n)) {\r\n\treturn n;\r\n }\r\n else\r\n {\treturn 0;\r\n }\r\n}", "function elevar_al_cuadrado(numero)\n{\n return numero * numero;\n}", "function numericStringToNumber_(values){\n for (var i = 0; i < values.length; i++){\n for(var j = 0; j < values[i].length; j++){\n if (!isNaN(values[i][j])){\n values[i][j] = Number(values[i][j], 10);\n }\n }\n }\n return values;\n}", "static tritsValue(trits) {\n let value = 0;\n for (let i = trits.length - 1; i >= 0; i--) {\n value = (value * 3) + trits[i];\n }\n return value;\n }", "factorizar(numero){\n let total = 1\n for (let i = 1; i <= numero; i++){\n total = total * i\n }\n return total;\n }", "function prix() {\n return 50 * (nbMultiplicateur * nbMultiplicateur * 0.2);\n}", "function convertsStringToNumbers(arr) {\n    var newArr = [];\n \n    for (var i = 0; i < arr.length; i++) {\n \nvar convert = parseFloat(arr[i]);\n\nif (isFinite(convert)) { //proverava da li je sve brojiev i da nisu undefined, NaN, uklanja nepotrebne\nnewArr[newArr.length] = convert;\n}\n}\n    return newArr;\n}", "function plusMinus(arr) {\n let length = arr.length\n let newArr;\n const positiveLength = arr.filter(number => number > 0).length;\n const negativeLength = arr.filter(number => number < 0).length\n const zeroLength = arr.filter(number => number === 0).length\n\n let posFrac = (positiveLength / length).toFixed(6)\n let negFrac = (negativeLength / length).toFixed(6)\n let zeroFrac = (zeroLength / length).toFixed(6)\n\n newArr = [posFrac, negFrac, zeroFrac]\n console.log(newArr.join('\\n'))\n}", "function sortNumeric(val1, val2)\n{\n return val1 - val2;\n}", "function multiple(){\n results.value = Number(a.value) * Number(b.value);\n }", "function NumbersOnly(elem,e,whole,positive){\n\tvar num,text = elem.value;\n\tif(text=='-'||text=='.') return;\n\ttry{num=parseFloat(text);}catch(err){elem.value = '';return;}\n\tif(whole&&num!=Math.round(num)) num = Math.round(num);\n\tif(positive&&num<0) num = '';\n\tif(num!=text) elem.value = isNaN(num)?'':num;\n}", "function transmorgify(num1, num2, num3){\n\treturn Math.pow(num1 * num2, num3); \n}", "function expandedForm(num) {\n \n return (num).toString().split(\"\").map((a,i,arr) =>{\n return a*Math.pow(10, arr.length-i-1);\n }).filter(n => n>0).join(\" + \");\n\n}", "function plusMinus(arr) {\n var result = [];\n var a1 = 0, a2 = 0, a3 = 0;\n for (var i = 0; i < arr.length; i++){\n if (arr[i] > 0) {\n a1++;\n }\n if (arr[i] < 0) {\n a2++;\n }\n if (arr[i] == 0) {\n a3++;\n }\n // console.log(a1);\n }\n result[0] = parseFloat(a1 / arr.length).toFixed(6);\n console.log(result[0]);\n // console.log(typeof result[0]);\n result[1] = parseFloat(a2 / arr.length).toFixed(6);\n console.log(result[1]);\n result[2] = parseFloat(a3 / arr.length).toFixed(6);\n console.log(result[2]);\n}", "function ejercicio3(){\n let numero4=prompt(\"Ingresa una cantidad\")\n let result=0\n if (numero4>0){\n for (let x=0;x<numero4.length;x++){\n result+=parseInt(numero4[x])\n }\n console.log(`Cantidad Ingresada: ${numero4}`)\n console.log(`La suma de los digitos en la cantidad es: ${result}`)\n }\n else\n console.log(\"La cantidad debe ser mayor que 0\")\n}", "function convertNumbers(data) {\n data.forEach(element => {\n element.id = parseInt(element.id, 10)\n element.votes = parseInt(element.votes, 10)\n });\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 getPermutations(counter, digitsNum) {\n var denominator = 1\n counter.forEach((value) => { denominator *= rFact(value) })\n var permutations = rFact(digitsNum)/denominator\n return permutations \n}", "function addAll(...num){\n\n let total = 0;\n\n\n num.forEach(digit => total += digit\n )\n\n return total\n\n\n}", "function calcular(){\r\n num1 = parseFloat(num1);\r\n num2 = parseFloat(num2);\r\n switch(operador){\r\n case operacion.SUMAR:\r\n num1+=num2;\r\n break;\r\n case operacion.RESTAR:\r\n num1 = num1-num2;\r\n break;\r\n case operacion.MULTIPLICAR:\r\n num1*=num2;\r\n break;\r\n case operacion.DIVIDIR:\r\n num1 = (num1/num2);\r\n break;\r\n case operacion.PORTENCIA:\r\n num1 = Math.pow(num1,num2);\r\n break;\r\n }\r\n actualizarValor1();\r\n num2 = 0;\r\n actualizarValor2();\r\n}", "function soal(angka, kuadrat) {\r\n var range = kuadrat;\r\n var start = angka;\r\n var value = angka;\r\n var arr1 = [];\r\n\r\n for (var n = 1; n < range; n++) {\r\n start = start * angka;\r\n value = start;\r\n }\r\n var sNumber = value.toString();\r\n for (var i = 0, len = sNumber.length; i < len; i += 1) {\r\n arr1.push(+sNumber.charAt(i));\r\n }\r\n\r\n for (var a = 0, sum = 0; a < arr1.length; sum += arr1[a++]);\r\n\r\n console.log(arr1);\r\n console.log(value);\r\n console.log(sum);\r\n}", "function calcPerim() {\n\tthis.perimetr=0;\n\tfor(key in this){\n\t\tif(checkisNum(this[key])&&key!=='perimetr'){\n\t\t\tthis.perimetr+=this[key];\n\t\t}\n\t}\n\treturn this.perimetr;\n}", "function product(numbers){\n\n let total = numbers.reduce((a,b) => a * b);\n\n let answer = [];\n\n numbers.forEach(val => answer.push(total/val));\n\n return answer;\n\n}", "function digitsProduct(product) {\n if (product === 0) return 10;\n else if (product === 1) return 1;\n\n var list = [];\n for (var d = 9; d > 1; d--) {\n while (product % d === 0) {\n product /= d;\n list.push(d);\n }\n }\n // console.log(list);\n if (product !== 1) {\n return -1;\n } else {\n list = list.reverse();\n var str = list.join('');\n // console.log(str);\n return parseInt(str);\n }\n}", "function Numeral(number){this._value=number;}", "multiply(n) {\n let newDigits = [];\n let carry = 0;\n for (const digit of this.digits) {\n const sum = digit * n + carry;\n newDigits.push(sum % 10);\n carry = Math.floor(sum / 10);\n }\n if (carry > 0)\n newDigits.push(carry);\n return new Uint(newDigits);\n }", "function digitize(n) {\n //code here\n return Array.from(String(n)).map(Number).reverse();\n}", "function TrupleNum(num) {\n return num * 3;\n}", "function digits(num){\n var final = []\n var tableau = String(num).split('')\n var data = tableau.map(element => parseInt(element));\n for ( var i = 0; i < data.length ; i++ ) {\n for ( var j = 1 ; j < data.length ; j++ ) {\n final.push(data[i] + data[j]);\n } \n data.splice(0,1);\n i = -1;\n }\n return final\n }", "function persistence(num) {\n let points = String(num)\n let result = 0\n let arrForAddAtPoints = []\n let newNumber = 1\n for (let i = 0; i < 10; i++) {\n arrForAddAtPoints = points.split('')\n if (arrForAddAtPoints.length > 1) {\n result++\n for (let j = 0; j < arrForAddAtPoints.length; j++) {\n arrForAddAtPoints = arrForAddAtPoints.map(n => +n)\n newNumber += arrForAddAtPoints[i]\n console.log(newNumber)\n }\n }\n console.log(arrForAddAtPoints)\n }\n\n\n }", "function multiplyByNumber(num, x, base) {\n if (num < 0)\n return null;\n if (num == 0)\n return [];\n\n var result = [];\n var power = x;\n while (true) {\n if (num & 1) {\n result = add(result, power, base);\n }\n num = num >> 1;\n if (num === 0)\n break;\n power = add(power, power, base);\n }\n\n return result;\n }", "function digitize(val) {\n return Array.from('' + val, Number);\n}", "function numeric(value) {\r\n return !isNaN(value - parseFloat(value));\r\n }", "toNumber() {\n let m = this.if('#TextValue')\n m.forEach(val => {\n let obj = parse(val)\n if (obj.num === null) {\n return\n }\n let fmt = val.has('#Ordinal') ? 'Ordinal' : 'Cardinal'\n let str = format(obj, fmt)\n val.replaceWith(str, { tags: true })\n val.tag('NumericValue')\n })\n return this\n }", "function double() {\n var carry = 0;\n for (let i = num.length - 1; i >= 0; i--) {\n var newDigit = num[i] * 2 + carry;\n num[i] = newDigit % 10;\n carry = Math.floor(newDigit / 10);\n }\n if (carry > 0) {\n num.unshift(carry);\n carry = 0;\n }\n }", "function sum() {\r\n\tvar items = sum.arguments.length;\r\n\tvar thissum = 0;\r\n\tvar thisnum;\r\n\tvar usedNums = false;\r\n\tfor (i = 0; i < items; i++) {\r\n\t\tthisnum = sum.arguments[i];\r\n\t\tif (isFloat(thisnum) && thisnum != 'NaN') {\r\n\t\t\tthissum += parseFloat(thisnum);\r\n\t\t\tusedNums = true;\r\n\t\t} else if (thisnum != null && thisnum != \"undefined\" && thisnum != \"\" && thisnum != 'NaN') {\r\n\t\t\treturn 'NaN';\r\n\t\t}\r\n\t}\r\n\treturn (usedNums ? thissum : 'NaN');\t\r\n}", "function products(arr) {\n let product=1;\n for (let i=0; i<arr.length; i++){\n product*=arr[i];\n }\n for (let j=1; j<arr.length; j++){\n arr[j]=product/arr[j];\n }\n return arr;\n}", "restrictValue(values) {\n if (values[1].constructor === JQX.Utilities.BigNumber) {\n if (values[1].compare(values[0]) === -1) {\n values[1].set(values[0]);\n }\n }\n else {\n if (values[1] < values[0]) {\n values[1] = values[0];\n }\n }\n }", "function getNumbers (val1, val2) {\n const val1Numeric = Number(val1)\n if (isNaN(val1Numeric)) {\n throw new TypeError(`val1 is not a valid number: ${val1}`)\n }\n const val2Numeric = Number(val2)\n if (isNaN(val2Numeric)) {\n throw new TypeError(`val2 is not a valid number: ${val2}`)\n }\n return [val1Numeric, val2Numeric]\n}", "function parseFloatList(a) {\n\tfor (let i = 0; i < a.length; i++) {\n\t\ta[i] = parseFloat(a[i]);\n\t}\n\treturn a;\n}", "function addValues(num1,num2){\r\n return num1 + num2;\r\n}" ]
[ "0.59080625", "0.59049714", "0.5852714", "0.5846675", "0.5799497", "0.573698", "0.56282127", "0.5607934", "0.5558825", "0.5549639", "0.5525883", "0.54795027", "0.5478957", "0.54642093", "0.54571474", "0.5451614", "0.5434455", "0.5420768", "0.5399625", "0.5388181", "0.53860056", "0.5379789", "0.5366187", "0.5365956", "0.53648126", "0.53550047", "0.53450197", "0.5333978", "0.5332946", "0.5325", "0.5317372", "0.53146833", "0.5307732", "0.5305894", "0.5284757", "0.52836627", "0.5282386", "0.5272279", "0.52718097", "0.5270884", "0.52621406", "0.525014", "0.5248928", "0.52483046", "0.5245408", "0.52449197", "0.5238372", "0.5231534", "0.5229635", "0.5188607", "0.51873636", "0.5186486", "0.51843584", "0.51743734", "0.51743734", "0.5171528", "0.51710725", "0.51666653", "0.5164006", "0.5159695", "0.5159298", "0.51592755", "0.5150931", "0.5150006", "0.5149702", "0.5140544", "0.5140316", "0.5137912", "0.5135592", "0.5134171", "0.5133278", "0.5130464", "0.51293427", "0.5127765", "0.5126358", "0.51253873", "0.512499", "0.5123592", "0.5118445", "0.51164246", "0.51154333", "0.5115384", "0.5114586", "0.5109794", "0.5107056", "0.5100277", "0.5097897", "0.50971997", "0.50946087", "0.50936204", "0.50917", "0.5091121", "0.5084646", "0.5082815", "0.5082124", "0.50813705", "0.50794965", "0.50761026", "0.5075186", "0.5075098", "0.5074555" ]
0.0
-1
NOTE: we are using structure of active panel as template for new one, currently we are replicating the structure of metadata fields
getTemplateFromCurrentPanel() { const currentIndex = this.getCurrentPanelIndex(); const firstPanel = this.getPanels()[currentIndex]; return { metadata: firstPanel .resolve('metadata') .map(metadataField => ({ type: MetadataField.type, name: metadataField.name, value: '' })), }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fmdf_initComponentMeta() {\n\t\n\t//all containers wrapper\n\tfmdmeta_prop = {};\n\n\t//icon path\n\tfmdmeta_prop.iconpath = \"/images/designer/prop/\";\n\n\t//properties grid configuration\n\tfmdmeta_prop.gridconf = {};\n\tfmdmeta_prop.gridconf.isTreeGrid = true;\n\t//fmdmeta_prop.gridconf.treeIconPath = \"/images/designer/prop/\";\n\tfmdmeta_prop.gridconf.treeImagePath = \"/js/dhtmlx3/imgs/\";\n\tfmdmeta_prop.gridconf.extIconPath = \"/images/designer/prop/\";\n\tfmdmeta_prop.gridconf.header = [fmd_i18n_prop_prop,fmd_i18n_prop_value];\n\t//fmdmeta_prop.gridconf.subHeader;\n\tfmdmeta_prop.gridconf.colType=\"tree,ro\";\n\tfmdmeta_prop.gridconf.colIds=\"prop,value\";\n\tfmdmeta_prop.gridconf.colAlign=\"left,left\";\n\t//fmdmeta_prop.gridconf.colVAlign;\n\tfmdmeta_prop.gridconf.colSorting=\"na,na\";\n\t//fmdmeta_prop.gridconf.colMinWidth;\n\tfmdmeta_prop.gridconf.colInitWidth=\"160,120\";\n\tfmdmeta_prop.gridconf.colColor=\"#F8F8F8,white\";\n\t//fmdmeta_prop.gridconf.resize;\n\tfmdmeta_prop.gridconf.visibile=\"false,false\";\n\tfmdmeta_prop.gridconf.idx={};\n\tfmdmeta_prop.gridconf.idx.prop=0;\n\tfmdmeta_prop.gridconf.idx.value=1;\n\n\tfmdmeta_prop.common = {};\t//common properties settings for components\n\t//fmdmeta_prop.common.all = {};\t//common properties settings for all components\n\tfmdmeta_prop.common.layout = {};\t//common properties settings for all datacontrol components\n\t//fmdmeta_prop.common.datacontrol = {};\t//common properties settings for all datacontrol components\n\tfmdmeta_prop.common.usercontrol = {};\t//common properties settings for all usercontrol components\n\tfmdmeta_prop.layout = {};\t//properties settings for layout components\n\tfmdmeta_prop.control = {};\t//properties settings for all control components\n\t\n\t//predefined events\n\tfmdmeta_prop.gridPredefinedEvents = {\n\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t//alert((rId.indexOf('i18nname')!=-1)+\"==\"+rId+\"==\"+(!fmdc.grid_prop.cells(rId, fmdmeta_prop.gridconf.idx.value).getValue()));\n\t\t\tvar newv = fmdc.grid_prop.cells(rId, fmdmeta_prop.gridconf.idx.value).getValue();\n\t\t\tif (newv && cId==fmdmeta_prop.gridconf.idx.value) {\n\t\t\t\tif (rId=='valueValidation') {\n\t\t\t\t\tfmdpf_showConditionalSub(rId, newv, fmdmeta_prop.common.datacontrol.properties[rId]);\n\t\t\t\t} else if (rId=='contentType') {\n\t\t\t\t\tfmdpf_showConditionalSub(rId, newv, fmdmeta_prop.control.input.properties[rId]);\n\t\t\t\t}\n\t\t\t} else if (!fmdc.grid_prop.cells(rId, fmdmeta_prop.gridconf.idx.value).getValue() && rId.indexOf('i18nname')!=-1) {\n\t\t\t\tif ('i18nname-zh'==rId) {\n\t\t\t\t\tfmdc.grid_prop.cells(rId, fmdmeta_prop.gridconf.idx.value).setValue(fmd_i18n_untitled);\n\t\t\t\t} else {\n\t\t\t\t\tfmdc.grid_prop.cells(rId, fmdmeta_prop.gridconf.idx.value).setValue(\"Untitled\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t//available validators\n\tfmdmeta_prop.runtime_validators = [[\"\",\"\"],\n\t\t\t\t\t[\"NotEmpty\", fmd_i18n_vld_notempty],\n\t\t\t\t\t[\"ValidAplhaNumeric\", fmd_i18n_vld_alphanumeric],\n\t\t\t\t\t[\"ValidCurrency\", fmd_i18n_vld_currency],\n\t\t\t\t\t[\"ValidDate\", fmd_i18n_vld_date],\n\t\t\t\t\t[\"ValidDatetime\", fmd_i18n_vld_datetime],\n\t\t\t\t\t[\"ValidEmail\", fmd_i18n_vld_email],\n\t\t\t\t\t[\"ValidInteger\", fmd_i18n_vld_integer],\n\t\t\t\t\t[\"ValidIPv4\", fmd_i18n_vld_ipv4],\n\t\t\t\t\t[\"ValidNumeric\", fmd_i18n_vld_numeric],\n\t\t\t\t\t[\"ValidTime\", fmd_i18n_vld_time],\n\t\t\t\t\t[\"RegExp\", fmd_i18n_vld_regexp]\n\t ];\n\n\t/**\n\t * list of available controls\n\t */\n\t//all elements wrapper\n\t//fmdmeta_elem = {};\n\t//list all elements here with proper order\n\t//fmdmeta_elem.elemlist_basic = [\"input\",\"p\",\"textarea\",\"popupinput\",\"radio\",\"checkbox\",\"select\",\"multiselect\",\"dhxgrid\",\"customhtml\"];\n\n\n\t//==================== common ====================\n\n\t/**\n\t * common for all components\n\t */\n\tfmdmeta_prop.common.all = {\n\t\t\t\"properties\" : {\n\t\t\t\t\"id\" : {\n\t\t\t \t\"name\" : \"id\",\n\t\t\t \t\"img\" : \"id.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"fromattr\" : \"id\"},\n\t\t\t \t\"displayOnly\" : true\n\t\t\t },\n\t\t\t \"i18nname\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_i18nname,\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"img\" : \"locale.png\",\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"sub\" : {\n\t\t\t \t\t\"i18nname-zh\" : {\n\t\t\t \t\t\t\"name\" : fmd_i18n_prop_i18nname_zh,\n\t\t\t \t\t\t\"cellType\" : \"ed\",\n\t\t\t\t\t \t\"validator\" : \"NotEmpty\",\n\t\t\t\t\t \t\"img\" : \"zh.png\",\n\t\t\t\t\t \t\"value\" : {\"default\": fmd_i18n_untitled}\n\t\t\t \t\t},\n\t\t\t \t\t\"i18nname-en\" : {\n\t\t\t \t\t\t\"name\" : fmd_i18n_prop_i18nname_en,\n\t\t\t \t\t\t\"cellType\" : \"ed\",\n\t\t\t\t\t \t\"validator\" : \"NotEmpty\",\n\t\t\t\t\t \t\"img\" : \"en.png\",\n\t\t\t\t\t \t\"value\" : {\"default\": \"Untitled\"}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t },\n\t\t\t \"display\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_display,\n\t\t\t \t\"img\" : \"display.png\",\n\t\t\t \t\"cellType\" : {\"type\":\"coro\",\n\t\t\t\t\t\t\t \t\"options\":[[\"displayblock\",fmd_i18n_prop_displayblock],\n\t\t\t\t\t\t\t\t\t\t [\"displayblockinline\",fmd_i18n_prop_displayblockinline],\n\t\t\t\t\t\t\t\t\t\t [\"displaynone\",fmd_i18n_prop_displaynone],\n\t\t\t\t\t\t\t\t\t\t [\"visibilityhidden\",fmd_i18n_prop_visibilityhidden]\n\t\t\t\t\t\t\t\t\t\t\t \t]\n\t\t\t \t\t\t\t},\n\t\t\t\t\t\"value\" : {\"default\" : \"displayblock\"}\n\t\t\t },\n\t\t\t \"style\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_style,\n\t\t\t \t\"img\" : \"css.png\",\n\t\t\t \t\"cellType\" : \"ace_text\"\n\t\t\t }\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\"onload\" : {\"name\" : fmd_i18n_ev_onload,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onclick\" : {\"name\" : fmd_i18n_ev_onclick,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onmouseover\" : {\"name\" : fmd_i18n_ev_onmouseover,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onmouseout\" : {\"name\" : fmd_i18n_ev_onmouseout,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t/**\n\t * common for all datacontrol components\n\t */\n\tfmdmeta_prop.common.datacontrol = {\n\t\t\t\"properties\" : {\n\t\t\t\t/*\"label\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_label,\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"validator\" : \"Required\"\n\t\t\t },*/\n\t\t\t \"hideLabel\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_hidelabel,\n\t\t\t \t\"cellType\" : \"ch\",\n\t\t\t \t\"value\" : {\"default\":\"0\"}\n\t\t\t },\n\t\t\t \"labelPosition\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_labelposition,\n\t\t\t \t\"cellType\" : {\"type\":\"coro\", \n\t\t\t \t\t\t\t\"options\":[[\"left\",fmd_i18n_prop_left],\n\t [\"right\",fmd_i18n_prop_right],\n\t [\"top\",fmd_i18n_prop_top],\n\t [\"bottom\",fmd_i18n_prop_bottom]\n\t\t\t \t\t\t\t]\n\t\t\t \t},\n\t\t\t \t\"value\" : {\"default\":\"top\"}\n\t\t\t },\n\t\t\t \"valueValidation\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_valuevalidation,\n\t\t\t\t \"cellType\" : {\n\t\t\t\t\t\t\"type\" : \"coro\",\n\t\t\t\t\t\t\"options\":fmdmeta_prop.runtime_validators\n\t\t\t\t },\n\t\t\t\t\t\"conditional-sub\" : {\n\t\t\t\t\t\t\"RegExp\" : {\n\t\t\t\t\t\t\t\"valueValidation-RegExp\" : {\n\t\t\t\t\t\t\t\t\"name\" : fmd_i18n_prop_regexp,\n\t\t\t\t\t\t\t\t\"cellType\" : \"ed\",\n\t\t\t\t\t\t\t\t\"validator\" : \"NotEmpty\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t }\n\t\t\t\t\t},\n\t\t\t\t \"value\" : {\"default\":\"\"}\n\t\t\t },\n\t\t\t \"disabled\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_disabled,\n\t\t\t \t\"cellType\" : \"ch\",\n\t\t\t \t\"value\" : {\"default\":\"0\"}\n\t\t\t },\n\t\t\t \"keepOnDisabled\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_keepondisabled,\n\t\t\t \t\"cellType\" : \"ch\",\n\t\t\t \t\"value\" : {\"default\":\"0\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\"onchange\" : {\"name\" : fmd_i18n_ev_onchange,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onfocus\" : {\"name\" : fmd_i18n_ev_onfocus,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onblur\" : {\"name\" : fmd_i18n_ev_onblur,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n//\t\t\t\t\"onDisabled\" : {},\n//\t\t\t\t\"onEnabled\" : {}\n\t\t\t}\n\t\t};\n\n\t//==================== layout ====================\n\n\t//properties settings for tab\n\tfmdmeta_prop.layout.tab = {\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_l_fmcontainer_tab},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t }\n\t\t\t},\n\t\t\t\"abandon-properties\" : [\"tiprow_specific\"],//format is array\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\"onactive\" : {\"name\" : fmd_i18n_ev_onactive,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj,\n\t\t\t\t\t\t\"obj\" : fmd_i18n_ev_eventthis\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\tvar vals = fmdc.data.propconf[fmdf_getSelected().attr(\"id\")];\n\t\t\t\tfmdf_fmcontainer_tab_title(vals[\"i18nname-\"+fmd.lang]);\n\t\t\t}\n\t\t};\n\n\t//properties settings for block\n\tfmdmeta_prop.layout.block = {\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_l_fmcontainer_block},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"pattern\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_container_pattern,\n\t\t\t \t\"img\" : \"pattern.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"fromattr\":\"fmdpattern\"},\n\t\t\t \t\"afterProperty\" : \"i18ntype\"\n\t\t\t },\n\t\t\t\t\"margintop\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_container_margintop,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\" : \"0.7\"},\n\t\t\t \t\"validator\" : \"ValidNumeric\"\n\t\t\t },\n\t\t\t \"noheader\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_container_noheader,\n\t\t\t \t\"cellType\" : \"ch\",\n\t\t\t \t\"value\" : {\"default\":\"0\"}\n\t\t\t },\n\t\t\t \"fold\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_container_fold,\n\t\t\t \t\"cellType\" : \"ch\",\n\t\t\t \t\"value\" : {\"default\":\"0\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\"onCollapse\" : {\"name\" : fmd_i18n_ev_oncollapse,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj,\n\t\t\t\t\t\t\"obj\" : fmd_i18n_ev_eventthis\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onExpand\" : {\"name\" : fmd_i18n_ev_onexpand,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj,\n\t\t\t\t\t\t\"obj\" : fmd_i18n_ev_eventthis\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\tvar vals = fmdc.data.propconf[fmdf_getSelected().attr(\"id\")];\n\t\t\t\tfmdf_fmcontainer_block_title(vals[\"i18nname-\"+fmd.lang]);\n\t\t\t\tfmdc.selection.selectedobj.css('margin-top', vals[\"margintop\"]?vals[\"margintop\"]+'em':'0.7em');\n\t\t\t\tfmdf_fmcontainer_block_headerdisplay(vals[\"noheader\"]);\n\t\t\t}\n\t\t};\n\n\t//properties settings for cell\n\tfmdmeta_prop.layout.cell = {\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_l_fmcontainer_cell+\"(table td)\"},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t }/*,\n\t\t\t \"rowspan\" : {\n\t\t\t \t\"name\" : fmd_i18n_t_rowspan,\n\t\t\t \t\"img\" : \"rowspan.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"fromattr\":\"rowspan\", \"default\":\"1\"}\n\t\t\t },\n\t\t\t \"colspan\" : {\n\t\t\t \t\"name\" : fmd_i18n_t_colspan,\n\t\t\t \t\"img\" : \"colspan.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"fromattr\":\"colspan\", \"default\":\"1\"}\n\t\t\t }*/\n\t\t\t},\n\t\t\t\"abandon-properties\" : [\"i18nname\"],\t//format is array\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events\n\t\t\t},\n\t\t\t\"onApply\" : function() {}\n\t\t};\n\n\t//==================== control ====================\n\n\t\n\t\n\t//properties settings for text output\n\tfmdmeta_prop.control.p = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_p,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><p>Output Text</p>',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><p>Output Text</p>',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_p},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"abandon-events\" : [\"onchange\"],\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for text textarea\n\tfmdmeta_prop.control.textarea = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_textarea,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><textarea class=\"medium\" name=\"textarea\" cols=\"20\" rows=\"5\" ></textarea>',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><textarea class=\"medium\" name=\"textarea\" cols=\"20\" rows=\"5\" ></textarea>',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_textarea},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for text popupinput\n\tfmdmeta_prop.control.popupinput = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_popupinput,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><input class=\"large\" type=\"text\" name=\"input\" />',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><input class=\"large\" type=\"text\" name=\"input\" />',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_popupinput},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for dhxgrid\n\tfmdmeta_prop.control.dhxgrid = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"composite\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_dhxgrid,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : function() {\n\t\t\t\treturn '<table class=\"elem-grid\" style=\"width:300px;\"><tr><th>Column A</th><th>Column B</th></tr><tr><td>A</td><td>C</td></tr><tr><td>B</td><td>D</td></tr></table>';\n\t\t\t},\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : function() {\n\t\t\t\treturn '<table class=\"elem-grid\"><tr><th>Column A</th><th>Column B</th></tr><tr><td>A</td><td>C</td></tr><tr><td>B</td><td>D</td></tr></table>';\n\t\t\t},\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_dhxgrid},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for radio\n\tfmdmeta_prop.control.radio = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_radio,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"column column1\"><input type=\"radio\" name=\"radio\" value=\"options 1\" /><span>options 1</span><br/><input type=\"radio\" name=\"radio\" value=\"options 2\" /><span>options 2</span><br/><input type=\"radio\" name=\"radio\" value=\"options 3\" /><span>options 3</span><br/></div><span class=\"clearfix\"></span>',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"column column1\"><input type=\"radio\" name=\"radio\" value=\"options 1\" /><span>options 1</span><br/><input type=\"radio\" name=\"radio\" value=\"options 2\" /><span>options 2</span><br/><input type=\"radio\" name=\"radio\" value=\"options 3\" /><span>options 3</span><br/></div><span class=\"clearfix\"></span>',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_radio},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for radio\n\tfmdmeta_prop.control.checkbox = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_checkbox,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"column column1\"><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 1\"/ ><span>options 1</span><br/><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 2\"/ ><span>options 2</span><br/><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 3\"/ ><span>options 3</span><br/></div><span class=\"clearfix\"></span>',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"column column1\"><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 1\"/ ><span>options 1</span><br/><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 2\"/ ><span>options 2</span><br/><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 3\"/ ><span>options 3</span><br/></div><span class=\"clearfix\"></span>',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_checkbox},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for select\n\tfmdmeta_prop.control.select = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_select,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"large\"><span><select name=\"select\" >'+\n\t\t\t\t'<option value=\"options 1\">options 1</option><br/>'+\n\t\t\t\t'<option value=\"options 2\">options 2</option><br/>'+\n\t\t\t\t'<option value=\"options 3\">options 3</option><br/></select><i></i></span></div>',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"large\"><span><select name=\"select\" >'+\n\t\t\t\t'<option value=\"options 1\">options 1</option><br/>'+\n\t\t\t\t'<option value=\"options 2\">options 2</option><br/>'+\n\t\t\t\t'<option value=\"options 3\">options 3</option><br/></select><i></i></span></div>',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_select},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for custom html\n\tfmdmeta_prop.control.customhtml = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"extended\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_customhtml,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '&lt;div&gt;'+fmd_i18n_el_customhtml+'&lt;/div&gt;',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '&lt;div&gt;'+fmd_i18n_el_customhtml+'&lt;/div&gt;',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_customhtml},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"htmlcode\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_htmlcode,\n\t\t\t \t\"img\" : \"html5.png\",\n\t\t\t \t\"cellType\" : \"ace_html\"\n\t\t\t }\n\t\t\t},\n\t\t\t\"abandon-properties\" : [\"i18nname\", \"style\"], //format is array\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n}", "function ciniki_info_artists() {\n this.content_type = 20;\n this.init = function() {\n //\n // The panel to display the add form\n //\n this.edit = new M.panel('Artists',\n 'ciniki_info_artists', 'edit',\n 'mc', 'medium mediumaside', 'sectioned', 'ciniki.info.artists.edit');\n this.edit.data = {}; \n this.edit.content_id = 0;\n this.edit.sections = {\n '_image':{'label':'', 'aside':'yes', 'type':'imageform', 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', \n 'controls':'all', 'artists':'no'},\n }},\n '_image_caption':{'label':'', 'aside':'yes', 'fields':{\n 'primary_image_caption':{'label':'Caption', 'type':'text'},\n// 'primary_image_url':{'label':'URL', 'type':'text'},\n }},\n '_content':{'label':'Artists', 'fields':{\n 'content':{'label':'', 'type':'textarea', 'size':'large', 'hidelabel':'yes'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_info_artists.saveContent();'},\n }},\n };\n this.edit.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.info.contentHistory', 'args':{'tnid':M.curTenantID,\n 'content_id':this.content_id, 'field':i}};\n };\n this.edit.addDropImage = function(iid) {\n M.ciniki_info_artists.edit.setFieldValue('primary_image_id', iid, null, null);\n return true;\n };\n this.edit.deleteImage = function(fid) {\n this.setFieldValue(fid, 0, null, null);\n return true;\n };\n this.edit.sectionData = function(s) { \n return this.data[s];\n };\n this.edit.fieldValue = function(s, i, j, d) {\n return this.data[i];\n };\n this.edit.cellValue = function(s, i, j, d) {\n if( j == 0 ) { return d.file.name; }\n };\n this.edit.rowFn = function(s, i, d) {\n return 'M.ciniki_info_artists.showFileEdit(\\'M.ciniki_info_artists.updateFiles();\\',M.ciniki_info_artists.edit.content_id,\\'' + d.file.id + '\\');';\n };\n this.edit.addButton('save', 'Save', 'M.ciniki_info_artists.saveContent();');\n this.edit.addClose('Cancel');\n }\n\n this.start = function(cb, appPrefix, aG) {\n args = {};\n if( aG != null ) { args = eval(aG); }\n\n //\n // Create container\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_info_artists', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n }\n\n this.showEdit(cb);\n }\n\n this.showEdit = function(cb) {\n M.api.getJSONCb('ciniki.info.contentGet', {'tnid':M.curTenantID,\n 'content_type':this.content_type}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_info_artists.edit;\n p.data = rsp.content;\n p.content_id = rsp.content.id;\n p.refresh();\n p.show(cb);\n });\n };\n\n this.saveContent = function() {\n var c = this.edit.serializeFormData('no');\n if( c != null ) {\n M.api.postJSONFormData('ciniki.info.contentUpdate', \n {'tnid':M.curTenantID, 'content_id':this.edit.content_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_info_artists.edit.close();\n });\n } else {\n this.edit.close();\n }\n };\n}", "fieldsInfo () {\n return [\n {\n text: this.$t('fields.id'),\n name: 'id',\n details: false,\n table: false,\n },\n\n {\n type: 'input',\n column: 'order_nr',\n text: 'order No.',\n name: 'order_nr',\n multiedit: false,\n required: true,\n disabled: true,\n create: false,\n },\n {\n type: 'input',\n column: 'name',\n text: 'person name',\n name: 'name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'email',\n text: 'email',\n name: 'email',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'select',\n url: 'crm/people',\n list: {\n value: 'id',\n text: 'fullname',\n data: [],\n },\n column: 'user_id',\n text: this.$t('fields.person'),\n name: 'person',\n apiObject: {\n name: 'person.name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_points',\n text: 'package points',\n name: 'package_points',\n required: false,\n edit: false,\n create: false,\n },\n\n // package_points\n {\n type: 'select',\n url: 'crm/package',\n list: {\n value: 'id',\n text: 'full_name',\n data: [],\n },\n column: 'package_id',\n text: 'package name',\n name: 'package',\n apiObject: {\n name: 'package.package_name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_name',\n text: 'package name',\n name: 'package_name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'package_price',\n text: 'package price',\n name: 'package_price',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'pur_date',\n text: 'purche date',\n name: 'pur_date',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n ]\n }", "function ciniki_artcatalog_tracking() {\n //\n // The panel to display the edit tracking form\n //\n this.edit = new M.panel('Edit Exhibited',\n 'ciniki_artcatalog_tracking', 'edit',\n 'mc', 'medium', 'sectioned', 'ciniki.artcatalog.tracking.edit');\n this.edit.data = {};\n// this.edit.gstep = 1;\n this.edit.sections = {\n 'info':{'label':'Place', 'type':'simpleform', \n// 'gstep':1,\n// 'gtitle':'Where was the item exhibited?',\n 'fields':{\n 'name':{'label':'Name', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\n 'gtitle':'What is the name of the venue?',\n 'htext':'The place where you displayed your work.'\n + \" This can be a gallery, personal collection, show or anything else you want.\",\n },\n 'external_number':{'label':'Number', 'type':'text', 'size':'small',\n 'gtitle':'Did they give you an item number?',\n 'htext':'If the venue has their own item number, you can enter that here.'},\n 'start_date':{'label':'Start', 'type':'date',\n 'gtitle':'When was your item displayed?',\n 'htext':'The first day your item was on display.',\n },\n 'end_date':{'label':'End', 'type':'date',\n 'htext':'The last day your item was on display.'},\n }},\n '_notes':{'label':'Notes', 'type':'simpleform', \n// 'gstep':2,\n// 'gtitle':'Do you have any notes about the exhibition?',\n// 'gmore':'Any private notes you want to keep about showing this item at this venue.',\n 'fields':{\n 'notes':{'label':'', 'type':'textarea', 'size':'medium', 'hidelabel':'yes'},\n }},\n '_buttons':{'label':'', \n// 'gstep':3,\n// 'gtitle':'Save the exhibition information',\n// 'gtext-add':'Press the save button this exhibited place.',\n// 'gtext-edit':'Press the save button the changes.',\n// 'gmore-edit':'If you want to remove this exhibited place for your item, press the Remove button.',\n 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_artcatalog_tracking.edit.save();'},\n 'delete':{'label':'Remove', 'visible':'no', 'fn':'M.ciniki_artcatalog_tracking.edit.remove();'},\n }},\n };\n this.edit.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.artcatalog.trackingHistory', \n 'args':{'tnid':M.curTenantID, 'tracking_id':this.tracking_id, 'field':i}};\n \n };\n this.edit.fieldValue = function(s, i, d) { \n if( this.data[i] != null ) { return this.data[i]; } \n return ''; \n };\n this.edit.liveSearchCb = function(s, i, value) {\n if( i == 'name' ) {\n M.api.getJSONBgCb('ciniki.artcatalog.trackingSearch', \n {'tnid':M.curTenantID, 'field':i, 'start_needle':value, 'limit':15},\n function(rsp) {\n M.ciniki_artcatalog_tracking.edit.liveSearchShow(s, i, M.gE(M.ciniki_artcatalog_tracking.edit.panelUID + '_' + i), rsp.results);\n });\n }\n };\n this.edit.liveSearchResultClass = function(s, f, i, j, value) {\n return 'multiline';\n };\n this.edit.liveSearchResultValue = function(s, f, i, j, d) {\n if( (f == 'name' ) && d.result != null ) { return '<span class=\"maintext\">' + d.result.name + '</span><span class=\"subtext\">' + d.result.start_date + ' - ' + d.result.end_date + '</span>'; }\n return '';\n };\n this.edit.liveSearchResultRowFn = function(s, f, i, j, d) { \n if( (f == 'name') && d.result != null ) {\n return 'M.ciniki_artcatalog_tracking.edit.updateField(\\'' + s + '\\',\\'' + f + '\\',\\'' + escape(d.result.name) + '\\',\\'' + escape(d.result.start_date) + '\\',\\'' + escape(d.result.end_date) + '\\');';\n }\n };\n this.edit.updateField = function(s, fid, result, sd, ed) {\n M.gE(this.panelUID + '_' + fid).value = unescape(result);\n if( fid == 'name' ) {\n M.gE(this.panelUID + '_start_date').value = unescape(sd);\n M.gE(this.panelUID + '_end_date').value = unescape(ed);\n }\n this.removeLiveSearch(s, fid);\n };\n this.edit.sectionGuidedText = function(s) {\n if( s == '_buttons' ) {\n if( this.sections[s].buttons.delete.visible == 'yes' ) {\n return this.sections[s]['gtext-edit'];\n } else {\n return this.sections[s]['gtext-add'];\n }\n }\n if( this.sections[s] != null && this.sections[s].gtext != null ) { return this.sections[s].gtext; }\n return null;\n };\n this.edit.sectionGuidedMore = function(s) {\n if( s == '_buttons' ) {\n if( this.sections[s].buttons.delete.visible == 'yes' ) {\n return this.sections[s]['gmore-edit'];\n }\n }\n if( this.sections[s] != null && this.sections[s].gmore != null ) { return this.sections[s].gmore; }\n return null;\n };\n this.edit.open = function(cb, tid, aid, name) {\n if( tid != null ) { this.tracking_id = tid; }\n if( aid != null ) { this.artcatalog_id = aid; }\n if( this.tracking_id > 0 ) {\n this.sections._buttons.buttons.delete.visible = 'yes';\n M.api.getJSONCb('ciniki.artcatalog.trackingGet', \n {'tnid':M.curTenantID, 'tracking_id':this.tracking_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_artcatalog_tracking.edit;\n p.data = rsp.place;\n p.refresh();\n p.show(cb);\n });\n } else {\n this.reset();\n this.sections._buttons.buttons.delete.visible = 'no';\n this.data = {};\n this.refresh();\n this.show(cb);\n }\n }\n this.edit.save = function() {\n if( this.tracking_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.artcatalog.trackingUpdate', {'tnid':M.curTenantID, \n 'tracking_id':this.tracking_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } else {\n M.ciniki_artcatalog_tracking.edit.close();\n }\n });\n } else {\n this.close();\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.artcatalog.trackingAdd', \n {'tnid':M.curTenantID, 'artcatalog_id':this.artcatalog_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } else {\n M.ciniki_artcatalog_tracking.edit.close();\n }\n });\n }\n }\n this.edit.remove = function() {\n M.confirm('Are you sure you want to remove \\'' + this.data.artcatalog_name + '\\' from the exhibited list \\'' + this.data.name + '\\'?',null,function() {\n M.api.getJSONCb('ciniki.artcatalog.trackingDelete', {'tnid':M.curTenantID, \n 'tracking_id':M.ciniki_artcatalog_tracking.edit.tracking_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_artcatalog_tracking.edit.close();\n });\n });\n }\n this.edit.addButton('save', 'Save', 'M.ciniki_artcatalog_tracking.edit.save();');\n this.edit.addClose('Cancel');\n\n this.start = function(cb, appPrefix, aG) {\n args = {};\n if( aG != null ) {\n args = eval(aG);\n }\n\n //\n // Create container\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_artcatalog_tracking', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n }\n\n if( args.add != null && args.add == 'yes' ) {\n this.edit.open(cb, 0, args.artcatalog_id, unescape(args.name));\n } else if( args.tracking_id != null && args.tracking_id > 0 ) {\n this.edit.open(cb, args.tracking_id, unescape(args.name));\n }\n return false;\n }\n}", "function dynamicSummary(){\n fieldArray = [];\t//\tclear array so everytime this is called we update the data\n window.guideBridge.visit(function(cmp){\n var name = cmp.name;\n if(name && isVisible(cmp)){\n var grouped = isGrouped(cmp);\n var hideLabel = isHideLabel(cmp);\n var hideLink = isHideLink(cmp);\n\n if(name.indexOf(\"block_heading_\") == 0){//\tcheck if block heading (like for the address block fields)\n fieldArray.push({\"type\":\"block_heading\",\"size\":size(cmp),\"name\":cmp.name,\"value\":$(cmp.value).html(),\"grouped\":grouped, \"hideLink\":hideLink, \"className\":cmp.className, \"cssClassName\":cmp.cssClassName,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n else if(name.indexOf(\"block_\") == 0) {//\tcheck if object is a group panel\n fieldArray.push({\"type\":\"block\",\"size\":size(cmp),\"name\":cmp.name,\"title\":cmp.title, \"grouped\":grouped, \"className\":cmp.className, \"id\":cmp.id,\"som\":cmp.somExpression});\n }\n else if(name.indexOf(\"heading_\") == 0){//\tcheck if heading\n fieldArray.push({\"type\":\"heading\",\"size\":size(cmp),\"name\":cmp.name,\"value\":$(cmp.value).html(),\"grouped\":grouped, \"hideLink\":hideLink, \"className\":cmp.className, \"cssClassName\":cmp.cssClassName,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n else{\n //if(cmp.value != null){\n if(cmp.className == \"guideTextBox\"){\n fieldArray.push({\"type\":\"field\",\"name\":cmp.name,\"title\":cmp.title,\"grouped\":grouped,\"hideLabel\":hideLabel, \"hideLink\":hideLink, \"value\":((cmp.value)?cmp.value:\"Not provided\"),\"className\":cmp.className,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n if(cmp.className == \"guideRadioButton\" ||\n cmp.className == \"guideCheckBox\" ){\n fieldArray.push({\"type\":\"option\",\"name\":cmp.name,\"title\":cmp.title,\"grouped\":grouped,\"hideLabel\":hideLabel,\"hideLink\":hideLink, \"value\":((cmp.value)?cmp.value:\"Not provided\"), \"obj\":cmp,\"className\":cmp.className,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n //}\n }\n }\n });\n\n renderHTML();\t//\tthis generates the html inside the summary component\n}", "function CreateControlPanel() {\n // Create the Album info Content Item\n albumInfoObject = new ContentItem();\n albumInfoObject.heading = strInstructions;\n albumInfoObject.layout = gddContentItemLayoutNews;\n albumInfoObject.flags = gddContentItemFlagStatic; // dont take clicks\n pluginHelper.AddContentItem(albumInfoObject, gddItemDisplayInSidebar);\n \n // Create Controls\n ctrlFileOpen = new ContentItem();\n ctrlPlayPause = new ContentItem();\n ctrlStop = new ContentItem();\n ctrlPrev = new ContentItem();\n ctrlNext = new ContentItem();\n \n // Set the images\n ctrlFileOpen.image = utils.LoadImage(\"open.gif\");\n ctrlStop.image = utils.LoadImage(\"stop.gif\");\n ctrlPrev.image = utils.LoadImage(\"prev.gif\");\n ctrlNext.image = utils.LoadImage(\"next.gif\");\n ctrlPlayPause.image = imgPlay;\n \n // Tooltips\n ctrlFileOpen.tooltip = strTooltipOpen;\n ctrlStop.tooltip = strTooltipStop;\n ctrlPrev.tooltip = strTooltipPrev;\n ctrlNext.tooltip = strTooltipNext;\n ctrlPlayPause.tooltip = strTooltipPlay;\n\n // OnDetailsview is called on single clicks, so use that to do various tasks\n ctrlFileOpen.onDetailsView = OpenFileButtonClicked;\n ctrlPlayPause.onDetailsView = PlayPauseButtonClicked;\n ctrlStop.onDetailsView = StopButtonClicked;\n ctrlPrev.onDetailsView = PrevButtonClicked;\n ctrlNext.onDetailsView = NextButtonClicked;\n\n // Now add the items\n pluginHelper.SetFlags(gddPluginFlagNone, gddContentFlagManualLayout + gddContentFlagHaveDetails);\n pluginHelper.AddContentItem(ctrlFileOpen, gddItemDisplayInSidebar);\n pluginHelper.AddContentItem(ctrlPlayPause, gddItemDisplayInSidebar);\n pluginHelper.AddContentItem(ctrlStop, gddItemDisplayInSidebar);\n pluginHelper.AddContentItem(ctrlPrev, gddItemDisplayInSidebar);\n pluginHelper.AddContentItem(ctrlNext, gddItemDisplayInSidebar);\n}", "function loadPropertiesPanel(metaData) {\n const stepMetaData = metaData.stepMetaData;\n const pipelineMetaData = metaData.pipelineStepMetaData;\n $('#step-form #pipelineStepId').text(pipelineMetaData.id);\n $('#step-form #stepId').text(stepMetaData.id);\n $('#step-form #pipelineStepIdInput').val(pipelineMetaData.id);\n $('#step-form #pipelineStepIdInput').css('display', 'none');\n $('#step-form #displayName').text(stepMetaData.displayName);\n $('#step-form #description').text(stepMetaData.description);\n $('#step-form #type').text(stepMetaData.type);\n\n //setup the rename button\n $('#step-form #pipelineStepIdRenameButton').unbind('click');\n $('#step-form #pipelineStepIdRenameButton').click(() => {\n const pipelineStepId = $('#step-form #pipelineStepId');\n const pipelineStepIdInput = $('#step-form #pipelineStepIdInput');\n const pipelineStepIdButton = $('#step-form #pipelineStepIdRenameButton');\n if (pipelineStepIdInput.css('display') === 'none') {\n pipelineStepIdInput.css('display', 'block');\n pipelineStepId.css('display', 'none');\n pipelineStepIdButton.text('Confirm');\n savedStepId = pipelineStepIdInput.val();\n } else {\n pipelineStepIdInput.css('display', 'none');\n pipelineStepId.css('display', 'block');\n pipelineStepIdButton.text('Rename');\n pipelineMetaData.id = pipelineStepIdInput.val();\n pipelineStepId.text(pipelineMetaData.id);\n renamePipelineStep(pipelineMetaData.id, savedStepId);\n }\n })\n // Get the parent step ids\n const stepIdCompletion = buildParentIdCompletionArray(pipelineMetaData.id);\n // load step form\n const stepForm = $('<div id=\"' + stepMetaData.id + '\">');\n let formDiv = $('<div class=\"form-group\">').appendTo(stepForm);\n // Execute if empty\n $('<label>Execute If Empty:</label>').appendTo(formDiv);\n let input = $('<input id=\"executeIfEmpty\" class=\"form-control\"/>');\n input.appendTo(formDiv);\n let select = $('<select id=\"executeIfEmptyType\" size=\"1\" class=\"form-control\">');\n select.appendTo(formDiv);\n $(executeIfEmptyTypeOptions).appendTo(select);\n input.typeahead({\n hint: true,\n highlight: true,\n minLength: 1\n },\n {\n name: 'steps',\n source: function (request, cb) {\n const type = $('#executeIfEmptyType').val();\n if (type === 'step' || type === 'secondary') {\n cb(_.filter(stepIdCompletion, s => _.startsWith(s.toLowerCase(), request.toLowerCase())));\n }\n }\n });\n\n // Build out the parameters\n _.forEach(stepMetaData.params, (param) => {\n formDiv = $('<div class=\"form-group\">').appendTo(stepForm);\n $('<label>' + param.name + ':' + '</label>').appendTo(formDiv);\n input = $('<input id=\"' + param.name + '\" class=\"form-control\"/>');\n input.appendTo(formDiv);\n select = $('<select id=\"' + param.name + 'Type\" size=\"1\" class=\"form-control\">').appendTo(formDiv);\n $(parameterTypeOptions).appendTo(select);\n input.focusin(function () {\n let tempParam = _.find(pipelineMetaData.params, p => p.name === param.name);\n const selectVal = $('#' + param.name + 'Type').val();\n if (!tempParam) {\n tempParam = {\n name: param.name,\n type: selectVal\n };\n pipelineMetaData.params.push(tempParam);\n }\n if (selectVal === 'script') {\n showCodeEditorDialog(tempParam.value || '', param.language || 'scala',\n function (value, lang) {\n tempParam.value = value;\n tempParam.language = lang;\n $('#' + tempParam.name).val(value);\n });\n $(this).prop('disabled', true);\n } else if (selectVal === 'object') {\n const val = _.isString(tempParam.value) ? setStringValue(tempParam.value) : tempParam.value;\n objectEditorDialog.showObjectEditor(val || {},\n param.className,\n function (value, schemaName) {\n $('#' + tempParam.name).val(JSON.stringify(value));\n tempParam.value = value;\n tempParam.className = schemaName;\n });\n }\n });\n input.typeahead({\n hint: true,\n highlight: true,\n minLength: 1\n },\n {\n name: 'steps',\n source: function (request, cb) {\n const type = $('#executeIfEmptyType').val();\n if (type === 'step' || type === 'secondary') {\n cb(_.filter(stepIdCompletion, s => _.startsWith(s.toLowerCase(), request.toLowerCase())));\n }\n }\n });\n });\n // Clear the old form\n $('#step-parameters-form div').remove();\n // Add the new form\n $('#step-parameters-form').append(stepForm);\n // Setup the form\n let type = getType(pipelineMetaData.executeIfEmpty, 'static','static');\n let value;\n input = $('#executeIfEmpty');\n if (type !== 'static' && type !== 'script') {\n input.val(pipelineMetaData.executeIfEmpty.substring(1));\n }\n input.blur(handleInputChange);\n let el = $('#executeIfEmptyType');\n el.change(handleTypeSelectChange);\n el.val(type);\n _.forEach(stepMetaData.params, function (param) {\n el = $('#' + param.name + 'Type');\n el.change(handleTypeSelectChange);\n input = $('#' + param.name);\n input.blur(handleInputChange);\n });\n // Initialize the parameters form with existing values\n let defaultValue;\n let pipelineStepParam;\n _.forEach(stepMetaData.params, function (param) {\n defaultValue = param.defaultValue;\n value = defaultValue;\n // Get the pipeline step parameter\n pipelineStepParam = _.find(pipelineMetaData.params, function(p) { return p.name === param.name; });\n if (pipelineStepParam) {\n value = pipelineStepParam.value || defaultValue;\n pipelineStepParam.value = value;\n }\n // Handle script versus param.type\n type = getType(value, param.type, param.type === 'script' ? 'script' : 'static');\n if (value && (type === 'global' || type === 'step' || type === 'secondary')) {\n value = value.substring(1);\n } else if (value && type === 'object') {\n value = JSON.stringify(value);\n }\n input = $('#' + param.name);\n input.val(value);\n // set the select value\n select = $('#' + param.name + 'Type');\n select.val(type);\n // Prevent edits against the result fields\n if (param.type === 'result') {\n input.prop('disabled', true);\n select.prop('disabled', 'disabled');\n }\n });\n}", "function panelMetaData(url){\n\tpanelView = 'metadata';\n\tpanelShow(220, 'meta');\n\t$('panelFrame').src = myPath+'ressource/lib/media.metadata.php?url='+url;\n}", "fields () {\n return ['title', 'subtitle', 'body', 'favicon'];\n }", "function createInformationTile() {\n var newWidget = JSONfn.parse(JSONfn.stringify(widgetGenericTemplate));\n newWidget.uid = Date.now();\n newWidget.typeId = 'infoTile';\n newWidget.type = 'Information Tile';\n return newWidget;\n }", "addStaticFields() {\n let managementButtons = [\n new PushButtonField({\n name: 'ports',\n style: 'interactive',\n caption: gettext('Ports'),\n icon: new StockIcon({name: 'port', stockName: 'qtoggle'}),\n onClick(form) {\n Navigation.navigate({path: ['ports', `~${form.getDeviceName()}`]})\n }\n }),\n new PushButtonField({\n name: 'reboot',\n caption: gettext('Reboot'),\n style: 'highlight',\n icon: new StockIcon({name: 'sync'}),\n onClick(form) {\n form.pushPage(form.makeConfirmAndReboot())\n }\n }),\n new PushButtonField({\n name: 'firmware',\n style: 'colored',\n backgroundColor: Theme.getColor('@magenta-color'),\n backgroundActiveColor: Theme.getColor('@magenta-active-color'),\n caption: gettext('Firmware'),\n icon: new StockIcon({name: 'firmware', stockName: 'qtoggle'}),\n disabled: true,\n onClick(form) {\n form.pushPage(form.makeUpdateFirmwareForm())\n }\n }),\n new PushButtonField({\n name: 'factory_reset',\n caption: gettext('Reset'),\n icon: new StockIcon({name: 'reset'}),\n style: 'danger',\n onClick(form) {\n form.pushPage(form.makeConfirmAndFactoryReset())\n }\n }),\n new PushButtonField({\n name: 'backup',\n caption: gettext('Backup'),\n style: 'interactive',\n icon: new StockIcon({name: 'upload'}),\n onClick(form) {\n form.pushPage(form.makeBackupForm())\n }\n }),\n new PushButtonField({\n name: 'restore',\n caption: gettext('Restore'),\n style: 'interactive',\n icon: new StockIcon({name: 'download'}),\n onClick(form) {\n form.pushPage(form.makeRestoreForm())\n }\n })\n ]\n\n this.addField(-1, new CompositeField({\n name: 'management_buttons',\n label: gettext('Device Management'),\n separator: true,\n flow: Window.isSmallScreen() ? 'vertical' : 'horizontal',\n columns: 3,\n equalSize: true,\n fields: managementButtons\n }))\n }", "function ContemporaryMeta({ metadata }) {\n return (\n <>\n <CollectionDescription about={metadata.description} />\n {metadata.category && metadata.category.split(\",\").includes(\"Lidar\") && (\n <AboutLidar />\n )}\n <Collapse>\n <Collapse.Panel\n header={\n <h3\n style={{\n fontVariant: \"small-caps\",\n fontWeight: \"800\",\n margin: 0,\n }}\n >\n metadata\n </h3>\n }\n >\n {metadata &&\n fields[\"contemporary\"].map((k, i) => (\n <div key={metadata.collection_id + \"_\" + k.key}>\n <h4 style={{ fontVariant: \"small-caps\", fontWeight: \"800\" }}>\n {metadata[k.key] ? k.label : null}\n </h4>\n {emailRegex.test(metadata[k.key]) && (\n <a href={`mailto:${metadata[k.key]}`}>{metadata[k.key]}</a>\n )}\n {urlRegex.test(metadata[k.key]) && (\n <a\n target=\"_blank\"\n rel=\"noreferrer\"\n href={`${metadata[k.key]}`}\n >\n {metadata[k.key]}\n </a>\n )}\n {!emailRegex.test(metadata[k.key]) &&\n !urlRegex.test(metadata[k.key]) && (\n <p>{metadata[k.key] ? String(metadata[k.key]) : null}</p>\n )}\n </div>\n ))}\n </Collapse.Panel>\n </Collapse>\n\n {metadata.s_three_key && metadata.s_three_key.length &&\n <Collapse>\n <Collapse.Panel\n header={\n <h3\n style={{\n fontVariant: \"small-caps\",\n fontWeight: \"800\",\n margin: 0,\n }}\n >\n additional collection download links\n </h3>\n }\n >\n <h4 style={{fontVariant: \"small-caps\", fontWeight: \"800\"}}>downloadable data store for this collection</h4>\n <a href={\"https://tnris-data-warehouse.s3.us-east-1.amazonaws.com/index.html?prefix=LCD/collection/\" + metadata.s_three_key}>Link to our data store for this collection</a>\n <br /><br />\n <h4 style={{fontVariant: \"small-caps\", fontWeight: \"800\"}}>aws cli uri for this collection (will require aws account)</h4>\n {\"s3://tnris-data-warehouse/LCD/collection/\" + metadata.s_three_key}\n </Collapse.Panel>\n </Collapse>\n }\n <CollectionMapService metadata={metadata} />\n <CollectionSupplementalDownloads metadata={metadata} />\n <div style={{ borderBottom: \"1 px solid grey\", padding: \".25rem\" }}>\n <HyperLink\n url={metadata.license_url}\n text={metadata.license_name}\n label=\"license\"\n />\n </div>\n <CollectionCitation metadata={metadata} />\n <CollectionSocialShare />\n </>\n );\n}", "function updateSchema() {\n var properties = {};\n var required = [];\n $scope.defaultValues = {};\n var schema = {\n type: \"object\",\n required: required,\n properties: properties\n };\n var inputClass = \"span12\";\n var labelClass = \"control-label\";\n //var inputClassArray = \"span11\";\n var inputClassArray = \"\";\n var labelClassArray = labelClass;\n var metaType = $scope.metaType;\n if (metaType) {\n var pidMetadata = Osgi.configuration.pidMetadata;\n var pid = metaType.id;\n schema[\"id\"] = pid;\n schema[\"name\"] = Core.pathGet(pidMetadata, [pid, \"name\"]) || metaType.name;\n schema[\"description\"] = Core.pathGet(pidMetadata, [pid, \"description\"]) || metaType.description;\n var disableHumanizeLabel = Core.pathGet(pidMetadata, [pid, \"schemaExtensions\", \"disableHumanizeLabel\"]);\n angular.forEach(metaType.attributes, function (attribute) {\n var id = attribute.id;\n if (isValidProperty(id)) {\n var key = encodeKey(id, pid);\n var typeName = asJsonSchemaType(attribute.typeName, attribute.id);\n var attributeProperties = {\n title: attribute.name,\n tooltip: attribute.description,\n 'input-attributes': {\n class: inputClass\n },\n 'label-attributes': {\n class: labelClass\n },\n type: typeName\n };\n if (disableHumanizeLabel) {\n attributeProperties.title = id;\n }\n if (attribute.typeName === \"char\") {\n attributeProperties[\"maxLength\"] = 1;\n attributeProperties[\"minLength\"] = 1;\n }\n var cardinality = attribute.cardinality;\n if (cardinality) {\n // lets clear the span on arrays to fix layout issues\n attributeProperties['input-attributes']['class'] = null;\n attributeProperties.type = \"array\";\n attributeProperties[\"items\"] = {\n 'input-attributes': {\n class: inputClassArray\n },\n 'label-attributes': {\n class: labelClassArray\n },\n \"type\": typeName\n };\n }\n if (attribute.required) {\n required.push(id);\n }\n var defaultValue = attribute.defaultValue;\n if (defaultValue) {\n if (angular.isArray(defaultValue) && defaultValue.length === 1) {\n defaultValue = defaultValue[0];\n }\n //attributeProperties[\"default\"] = defaultValue;\n // TODO convert to boolean / number?\n $scope.defaultValues[key] = defaultValue;\n }\n var optionLabels = attribute.optionLabels;\n var optionValues = attribute.optionValues;\n if (optionLabels && optionLabels.length && optionValues && optionValues.length) {\n var enumObject = {};\n for (var i = 0; i < optionLabels.length; i++) {\n var label = optionLabels[i];\n var value = optionValues[i];\n enumObject[value] = label;\n }\n $scope.selectValues[key] = enumObject;\n Core.pathSet(attributeProperties, ['input-element'], \"select\");\n Core.pathSet(attributeProperties, ['input-attributes', \"ng-options\"], \"key as value for (key, value) in selectValues.\" + key);\n }\n properties[key] = attributeProperties;\n }\n });\n // now lets override anything from the custom metadata\n var schemaExtensions = Core.pathGet(Osgi.configuration.pidMetadata, [pid, \"schemaExtensions\"]);\n if (schemaExtensions) {\n // now lets copy over the schema extensions\n overlayProperties(schema, schemaExtensions);\n }\n }\n // now add all the missing properties...\n var entity = {};\n angular.forEach($scope.configValues, function (value, rawKey) {\n if (isValidProperty(rawKey)) {\n var key = encodeKey(rawKey, pid);\n var attrValue = value;\n var attrType = \"string\";\n if (angular.isObject(value)) {\n attrValue = value.Value;\n attrType = asJsonSchemaType(value.Type, rawKey);\n }\n var property = properties[key];\n if (!property) {\n property = {\n 'input-attributes': {\n class: inputClass\n },\n 'label-attributes': {\n class: labelClass\n },\n type: attrType\n };\n properties[key] = property;\n if (rawKey == 'org.osgi.service.http.port') {\n properties[key]['input-attributes']['disabled'] = 'disabled';\n properties[key]['input-attributes']['title'] = 'Changing port of OSGi http service is not possible from Hawtio';\n }\n }\n else {\n var propertyType = property[\"type\"];\n if (\"array\" === propertyType) {\n if (!angular.isArray(attrValue)) {\n attrValue = attrValue ? attrValue.split(\",\") : [];\n }\n }\n }\n if (disableHumanizeLabel) {\n property.title = rawKey;\n }\n //comply with Forms.safeIdentifier in 'forms/js/formHelpers.ts'\n key = key.replace(/-/g, \"_\");\n entity[key] = attrValue;\n }\n });\n // add default values for missing values\n angular.forEach($scope.defaultValues, function (value, key) {\n var current = entity[key];\n if (!angular.isDefined(current)) {\n //log.info(\"updating entity \" + key + \" with default: \" + value + \" as was: \" + current);\n entity[key] = value;\n }\n });\n //log.info(\"default values: \" + angular.toJson($scope.defaultValues));\n $scope.entity = entity;\n $scope.schema = schema;\n $scope.fullSchema = schema;\n }", "function renderTempElement(type,data) {\n var visibleFields=VisibleFields(type,'single',vm.notFields.split(','));\n vm.current = data;\n vm.fields = visibleFields.map(function(field) {\n return {\n value: field,\n label: content.labelOf(field)\n };\n });\n vm.rdf_source = rdfSource(vm.current.id);\n \n }", "function changeMetaData(data) {\n let $panelBody = document.getElementById(\"metadata-sample\");\n // clear any existing metadata\n $panelBody.innerHTML = \"\";\n // Loop through keys in json response and create new tags for metadata\n for (let key in data) {\n h5Tag = document.createElement(\"h5\");\n metadataText = document.createTextNode(`${key}: ${data[key]}`);\n h5Tag.append(metadataText);\n $panelBody.appendChild(h5Tag);\n }\n}", "config_fields() {\n\t\treturn [{\n\t\t\ttype: 'text',\n\t\t\tid: 'info',\n\t\t\twidth: 12,\n\t\t\tlabel: 'Information',\n\t\t\tvalue: 'This module controls a Datavideo vision mixer.</br>Note: Companion needs to be restarted if the model is changed.</br>Use Auto port selection for SE-2200.</br>'\n\t\t},\n\t\t{\n\t\t\ttype: 'textinput',\n\t\t\tid: 'host',\n\t\t\tlabel: 'IP Address',\n\t\t\twidth: 6,\n\t\t\tdefault: '192.168.1.101',\n\t\t\tregex: this.REGEX_IP\n\t\t},\n\t\t{\n\t\t\ttype: 'dropdown',\n\t\t\tid: 'port',\n\t\t\tlabel: 'Port',\n\t\t\twidth: 4,\n\t\t\tchoices: this.CHOICES_PORT,\n\t\t\tdefault: '0',\n\t\t},\n\t\t{\n\t\t\ttype: 'dropdown',\n\t\t\tid: 'modelID',\n\t\t\tlabel: 'Model',\n\t\t\twidth: 6,\n\t\t\tchoices: this.CHOICES_MODEL,\n\t\t\tdefault: 'se1200mu'\n\t\t},\n\t\t{\n\t\t\ttype: 'checkbox',\n\t\t\tid: 'debug',\n\t\t\tlabel: 'Debug to console',\n\t\t\tdefault: '0',\n\t\t},\n\t\t{\n\t\t\ttype: 'checkbox',\n\t\t\tid: 'legacy_feedback',\n\t\t\tlabel: 'Legacy feedback request (For testing)',\n\t\t\tdefault: '0',\n\t\t},\n\t\t]\n\t}", "function addFields(field, currFieldName, realIndex) {\n if (field.group) {\n var isGroupCreated = false, property;\n for (var i = 0; i < self.displayData.length; i++) {\n if (self.displayData[i].name === field.group && self.displayData[i].container === 'g') {\n isGroupCreated = true;\n property = { 'name': currFieldName, 'realFieldIndex': realIndex };\n property.extensionName = field.extensionName;\n self.displayData[i].fields.push(property);\n break;\n }\n }\n if (!isGroupCreated) {\n var groupDetails = getGroupDetails(field.group);\n var group = {\n container: 'g',\n fields: [],\n name: groupDetails.id,\n groupDetails: {\n 'id': groupDetails.id,\n 'heading': $translate.instant(groupDetails.heading),\n 'collapsible': groupDetails.collapsible\n }\n };\n property = { 'name': currFieldName, 'realFieldIndex': realIndex };\n property.extensionName = field.extensionName;\n group.fields.push(property);\n self.displayData.push(group);\n }\n } else {\n var fieldContainerCreated = false;\n var displayDataLength = self.displayData.length;\n if (displayDataLength && self.displayData[displayDataLength - 1].container === 'f') {\n fieldContainerCreated = true;\n property = { 'name': currFieldName, 'realFieldIndex': realIndex };\n self.displayData[displayDataLength - 1].fields.push(property);\n }\n\n if (!fieldContainerCreated) {\n property = { 'container': 'f', 'name': currFieldName, 'realFieldIndex': realIndex, 'fields': [] };\n property.fields.push({ 'name': currFieldName, 'realFieldIndex': realIndex });\n self.displayData.push(property);\n }\n\n }\n\n if (typeof field.type === \"object\") {\n Object.getOwnPropertyNames(field.type).forEach(function (propName) {\n addFields(field.type[propName], currFieldName + \".\" + propName);\n });\n }\n }", "function ShowHideAttributes(printDebug, frm, cdt, cdn, reload_defaults, refresh_items) {\r\n if (printDebug) console.log(__(\"ShowHideAttributes*****************************\"));\r\n\t//var configurator_mode = false;\r\n\r\n\tif (locals[cdt][cdn]) {\r\n\t\t\r\n var row = locals[cdt][cdn];\r\n\t\t\r\n\t\tvar template = \"\"\r\n\t\t\r\n\t\tif (row.configurator_of){\r\n\t\t\ttemplate = row.configurator_of\r\n\t\t}\r\n\t\t\r\n\t\t//Retrouver les attributs qui s'appliquent\r\n\t\tfrappe.call({\r\n\t\t\tmethod: \"radplusplus.radplusplus.controllers.configurator.get_all_attributes_fields\",\r\n\t\t\targs: {\"item_code\": template}, // renmai - 2017-12-07 \r\n\t\t\tcallback: function(res) {\r\n\t\t\t\tif (printDebug) console.log(__(\"CALL BACK get_all_attributes_fields\"));\r\n\t\t\t\t//Convertir le message en Array\r\n\t\t\t\tvar attributes = (res.message || {});\r\n\t\t\t\t\r\n\t\t\t\tvar attributes = {};\r\n\t\t\t\tfor (var i = 0, len = res.message.length; i < len; i++) {\r\n\t\t\t\t\tattributes[res.message[i].field_name] = res.message[i];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (printDebug) console.log(__(\"attributes ---- >\" ));\t\t\t\t\r\n\t\t\t\tif (printDebug) console.log(__(attributes));\r\n\t\t\t\tif (printDebug) console.log(__(\"< ---- attributes\" ));\t\r\n\t\t\t\t\r\n\t\t\t\t//Pointeur sur grid\r\n\t\t\t\tvar grid = cur_frm.fields_dict[\"items\"].grid;\r\n\t\r\n\t\t\t\tif (printDebug) console.log(__(\"grid.docfields.length:\" + grid.docfields.length));\r\n\t\t\t\t\r\n\t\t\t\t$.each(grid.docfields, function(i, field) {\r\n\t\t\t\t\t// debugger;\r\n\t\t\t\t\tif (printDebug) console.log(__(\"field.fieldname :\" + field.fieldname ));\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (typeof attributes[field.fieldname] !== 'undefined'){\r\n\t\t\t\t\t\tif (printDebug) console.log(__(\"attributes[field.fieldname].name : \" + attributes[field.fieldname].name ));\r\n\t\t\t\t\t\tfield.depends_on = \"eval:false\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (attributes[field.fieldname].parent != null){\r\n\t\t\t\t\t\t\tfield.depends_on = \"eval:true\";\r\n\t\t\t\t\t\t\tif (printDebug) console.log(__(\"attributes[field.fieldname].parent : \" + attributes[field.fieldname].parent ));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar field_value = frappe.model.get_value(row.doctype, row.name, field.fieldname);\r\n\t\t\t\t\t\t\tif (!field_value){ \r\n\t\t\t\t\t\t\t\tvar first_value = frappe.utils.filter_dict(cur_frm.fields_dict[\"items\"].grid.docfields, {\"fieldname\": field.fieldname})[0].options[0][\"value\"]\r\n\t\t\t\t\t\t\t\tfrappe.model.set_value(row.doctype, row.name, field.fieldname, first_value);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\tconsole.log(__(\"field_value : \" + field_value));\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//configurator_mode = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* if (typeof attributes[field.fieldname] !== 'undefined'){\r\n\t\t\t\t\t\tif (printDebug) console.log(__(\"if (typeof attributes[field.fieldname] !== 'undefined') \"));\r\n\t\t\t\t\t\tif (attributes[field.fieldname].parent != null){\r\n\t\t\t\t\t\t\tfield.hidden_due_to_dependency = false;\r\n\t\t\t\t\t\t\tif (printDebug) console.log(__(\"attributes[field.fieldname].parent : \" + attributes[field.fieldname].parent ));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} */\r\n\t\t\t\t\t\r\n\t\t\t\t\t// renmai 2017-12-07\r\n\t\t\t\t\trefresh_field(field);\r\n\t\t\t\t\t// }\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* if (printDebug) console.log(__(attributes[j]));\r\n\t\t\t\t\tif (grid_row.grid_form.fields_dict[attributes[j][0]]){\r\n\t\t\t\t\t\tgrid_row.grid_form.fields_dict[attributes[j][0]].set_value(attributes[j][1]);\r\n\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\r\n\t\t\t\t//Reloader les valeurs par défaut suite aux changements\r\n\t\t\t\tif (reload_defaults)\r\n\t\t\t\t\tAssignDefaultValues(printDebug, frm, cdt, cdn);\r\n\r\n\t\t\t\tif (refresh_items)\r\n\t\t\t\t\trefresh_field(\"items\");\r\n\r\n\t\t\t\t//pour chaque attribut\r\n\t\t\t\t/* for (var j = 0; j < attributes.length; j++) {\r\n\t\t\t\t\tif (printDebug) console.log(__(attributes[j]));\r\n\t\t\t\t\tif (grid_row.grid_form.fields_dict[attributes[j][0]]){\r\n\t\t\t\t\t\tgrid_row.grid_form.fields_dict[attributes[j][0]].set_value(attributes[j][1]);\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\r\n\t\t\t\t/* var grid_row = cur_frm.open_grid_row();\r\n\t\t\t\t$.each(attributes, function(i, attribute) {\r\n\t\t\t\t// for (var j = 0; j < len(attributes); j++) {\r\n\t\t\t\t\tif (attribute.parent != null) {\r\n\t\t\t\t\t\tif (printDebug) console.log(__(\"attribute.field_name : \" + attribute.field_name));\t\r\n\t\t\t\t\t\tif (grid_row.grid_form.fields_dict[attribute.field_name] && cur_frm.cur_grid.grid_form.fields_dict[attribute.field_name].df.fieldtype == \"Select\"){\r\n\t\t\t\t\t\t\tif (printDebug) console.log(__(\"grid_row.grid_form.fields_dict[attribute.field_name] : \" + grid_row.grid_form.fields_dict[attribute.field_name]));\t\r\n\t\t\t\t\t\t\tfrappe.model.set_value(row.doctype, row.name, attribute.field_name, cur_frm.cur_grid.grid_form.fields_dict[attribute.field_name].df.options[0].key);\r\n\t\t\t\t\t\t\t//grid_row.grid_form.fields_dict[attribute.field_name].set_value(attribute[j][1]);\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}); */\r\n\t\t\t\t\t\r\n\t\t\t\tif (printDebug) console.log(__(\"CALL BACK get_all_attributes_fields END\"));\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "transform( node ) {\n\t\t\t\t\n\t\t\t\tconst { portalId, formId } = node.dataset;\n\t\t\t\tconst attrs = {};\n\n\t\t\t\tif ( portalId ) {\n\t\t\t\t\tattrs.portalId = portalId;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( formId ) {\n\t\t\t\t\tattrs.formId = formId;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn createBlock( 'hubspot/form', attrs );\n\t\t\t}", "get fields () {\n return {\n id: {\n type : 'int',\n primary: true,\n },\n\n title: {\n type: 'text'\n },\n\n album: {\n type: 'text'\n },\n\n preview_link: {\n type: 'text'\n },\n\n artwork: {\n type: 'text'\n },\n\n artist_id: {\n type: 'int'\n }\n }\n }", "handle_sensor_metadata(parent, sensor_metadata) {\n console.log(\"handle_sensor_metadata got\", sensor_metadata);\n\n let type_info = {};\n // clone \"acp_type_info\" into its own jsonobject and remove from sensor_metadata\n try {\n type_info = JSON.parse(JSON.stringify(sensor_metadata[\"acp_type_info\"]));\n } catch (err) {\n console.log(\"handle_sensor_metadata parse error for acp_type_info\");\n }\n delete sensor_metadata.acp_type_info;\n\n // Display the Sensor Metadata jsonobject\n let sensor_metadata_txt = JSON.stringify(sensor_metadata, null, 2);\n let sensor_el = document.createElement('pre');\n sensor_el.id = 'sensor_metadata';\n sensor_el.innerHTML = this.escapeHTML(sensor_metadata_txt);\n parent.sensor_info_el.appendChild(sensor_el);\n\n // Display the Sensor Type Metadata object\n // Add the acp_type_id as a heading on the type_info section\n parent.type_heading_type_el.innerHTML = sensor_metadata.acp_type_id;\n let type_txt = JSON.stringify(type_info, null, 2);\n let type_el = document.createElement('pre');\n type_el.id = 'sensor_type_metadata';\n type_el.innerHTML = this.escapeHTML(type_txt);\n parent.type_info_el.appendChild(type_el);\n }", "function TcPermDetailsPanel() {}", "function getMetadata() {\n $scope.metadata = $scope.domainObject &&\n $scope.domainObject.hasCapability('metadata') &&\n $scope.domainObject.useCapability('metadata');\n }", "addPanel(component) {\nthis\n.addInfoToComponent(component, formEditorConstants.COMPONENT_TYPE_PANEL)\n.addProperty(component, 'name', this._componentList.findComponentText(component.type, 'name', 'Panel'))\n.addProperty(component, 'zIndex', 0)\n.addProperty(component, 'width', 200)\n.addProperty(component, 'height', 128);\nif (!('containerIds' in component)) {\nthis.addProperty(component, 'containerIds', [this._formEditorState.getNextId()]);\n}\nreturn component;\n}", "function test_dynamic_dialog_fields_ansible_tower_templates() {}", "@wire(getFieldSetMetadata, {\n recordId: '$recordId',\n fieldSetName: '$fieldSetName'\n })\n wiredFieldSetMetadata({\n error,\n data\n }) {\n this.isLoading = true;\n if (data) {\n // Get the FieldSet Name if we have no custom title\n if (!this.strTitle) this.strTitle = data.fieldSetLabel;\n // Get the Record Type Id\n this.recordTypeId = data.recordTypeId;\n // Get the SObject Name\n this.sObjectName = data.sObjectName;\n // If we have record fields, Remove them all\n if (!!this.recordFields.length)\n while (this.recordFields.length > 0) this.recordFields.pop();\n // Get the fields metadata and populate fields\n data.fieldsMetadata.forEach((fd) => {\n // Get valid JSON\n const fieldProperties = JSON.parse(fd);\n const {\n fieldSetProperties,\n fieldDescribeProperties\n } = fieldProperties;\n // Add the field\n this.recordFields.push({\n name: fieldDescribeProperties.name,\n isRequired: fieldSetProperties.isRequired || fieldSetProperties.dbRequired,\n isUpdateable: !!fieldDescribeProperties.updateable,\n editable: this.isEditing && !!fieldDescribeProperties.updateable\n });\n });\n // Clear any errors\n this.metadataError = undefined;\n } else if (error) {\n this.metadataError = 'Unknown error';\n if (Array.isArray(error.body)) {\n this.metadataError = error.body.map(e => e.message).join(', ');\n } else if (typeof error.body.message === 'string') {\n this.metadataError = error.body.message;\n }\n console.error('getMetadata error', this.metadataError);\n }\n if (this.recordFields.length || this.metadataError) this.isLoading = false;\n }", "function formAlter(event,form,next) {\n \n // Content - fires\n var newSection = {\n id:'form-section-template',\n label:'Template Alter',\n fields:[\n {label:'Status',name:'content[template]',type:'textarea',description:'A field added dynamically to the content from by the template module'}, \n ]\n }\n \n form.sections.push(newSection);\n \n return next(form);\n \n}", "static get builderInfo() {\n return {\n title: 'textfield',\n group: 'basic',\n icon: 'fa fa-envelope-open',\n weight: 70,\n documentation: 'http://help.form.io/userguide/#table',\n schema: CustomComponent.schema(),\n };\n }", "function addField() {\n ctrl.productProperties.push({'key': '', 'value': ''});\n }", "postProcessgetHaxJSONSchema(schema) {\n schema.properties[\"__editThis\"] = {\n type: \"string\",\n component: {\n name: \"a\",\n properties: {\n id: \"cmstokenidtolockonto\",\n href: \"\",\n target: \"_blank\"\n },\n slot: \"Edit this view\"\n }\n };\n return schema;\n }", "function createInformationBoard() {\n var newWidget = JSONfn.parse(JSONfn.stringify(widgetGenericTemplate));\n newWidget.uid = Date.now();\n newWidget.typeId = 'infoBoard';\n newWidget.type = 'Information Board';\n newWidget.sizeX = 2;\n newWidget.sizeY = 3;\n this.SetSetting(newWidget, 'bodyTextSize', 16);\n this.SetSetting(newWidget, 'bodyIconSize', 16);\n this.SetSetting(newWidget, 'bodyValueSize', 16);\n return newWidget;\n }", "function updateUI(){\n\t\t\t\tExt.each(toggleFields, function(fieldName){\n\t\t\t\t\t//var el = form.findField(fieldName).getEl().up('div.x-form-item');\n\t\t\t\t\t//el.setVisibilityMode(Ext.Element.DISPLAY).setVisible(rec.data['has_' + fieldName] == '1');\n\t\t\t\t\tform.findField(fieldName).setVisible(rec.data['has_' + fieldName] == '1');\n\t\t\t\t});\n\t\t\t\t// because imagePreview_image_id is not a formField but a button, we cannot find it with form.findField():\n\t\t\t\t[''].concat(LANGUAGES).forEach(function(lang) {\n\t\t\t\t\tvar key = 'ImagePreview_image_id' + (lang ? '_' + lang : '');\n\t\t\t\t\tif (formPanel[key]) {\n\t\t\t\t\t\tformPanel[key].setVisible(rec.data.has_image == 1);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (typeof rec.data.variables !== 'undefined' && form.findField('variables')) {\n\t\t\t\t\tform.findField('variables').setVisible(rec.data.variables && rec.data.variables.length);\n\t\t\t\t}\n\t\t\t}", "function populateDataFields() {}", "function configureFields(){\n\n // Look at the modal's Category as well as user Categories\n let cats = $filter('userCategories')($scope.categories, $scope.user) || [];\n\n if( !cats.includes($scope.category) ){\n cats.push($scope.category);\n }\n\n let fields = cats.map(cat => cat.editFields)\n .reduce( (showFields, catFields) => {\n catFields.forEach( f => {\n if( !showFields.includes(f)){\n showFields.push(f);\n }\n });\n\n return showFields;\n }, []);\n\n $timeout(() => {\n // Clear out fields\n $scope.config.fields = {};\n fields.forEach( col => $scope.config.fields['show_field_' + col] = true)\n });\n\n return fields;\n }", "function buildInfoPanel(info) {\n var html = \"<div class='panel panel-default minimal'>\";\n html += \"<a data-toggle='collapse' data-parent='#accordion' href='#colps\" + info.id + \"'>\";\n html += \"<div class='tab-panel-heading' style='padding-top: 10px;'><span class='panel-title'>\";\n html += \"<small class='col-sm-3' style='color: #000;'>\" + info.PostedDate + \"</small> &emsp;\";\n html += \"<span class='col-sm-push-1'><strong>\" + info.Title + \"</strong></span>\";\n html += \"</span><i class='icon-down-open' style='float: right;'></i></div></a>\";\n html += \"<div id='colps\" + info.id + \"' class='panel-collapse collapse'>\" + info.Content + \"</div></div>\";\n $(\"#otherinfopanel\").append(html);\n}", "function ciniki_web_pages() {\n //\n // Panels\n //\n this.childFormat = {\n '5':{'name':'List'},\n '8':{'name':'Image List'},\n '10':{'name':'Name List'},\n '11':{'name':'Thumbnails'},\n '12':{'name':'Buttons'},\n\n// '6':{'name':'Menu'},\n// '32':{'name':'List'},\n };\n this.parentChildrenFormat = {\n '5':{'name':'List'},\n '6':{'name':'Menu'},\n '7':{'name':'Page Menu'},\n '8':{'name':'Image List'},\n '11':{'name':'Thumbnails'},\n '12':{'name':'Buttons'},\n// '32':{'name':'List'},\n };\n this.menuFlags = {\n '1':{'name':'Header'},\n '2':{'name':'Footer'},\n };\n this.init = function() {\n }\n\n this.createEditPanel = function(cb, pid, parent_id, rsp) {\n var pn = 'edit_' + pid;\n //\n // Check if panel already exists, and reset for use\n //\n if( this.pn == null ) {\n //\n // The panel to display the edit form\n //\n this[pn] = new M.panel('Page', 'ciniki_web_pages', pn, 'mc', 'medium', 'sectioned', 'ciniki.web.pages.edit');\n this[pn].data = {}; \n this[pn].modules_pages = {};\n this[pn].stackedData = [];\n this[pn].page_id = pid;\n this[pn].page_type = (rsp.page != null && rsp.page.page_type != null ? rsp.page.page_type : 10);\n this[pn].showSelect = function() {\n M.ciniki_web_pages['edit_'+pid].editSelect('details', 'parent_id', 'yes');\n }\n this[pn].sections = {\n 'details':{'label':'', 'aside':'yes', 'fields':{\n 'parent_id':{'label':'Parent Page', 'type':'select', 'options':{},\n 'editable':'afterclick',\n 'confirmMsg':'Are you sure you want to move this page on your website?',\n 'confirmButton':'Move Page',\n 'confirmFn':this[pn].showSelect,\n },\n 'title':{'label':'Menu Title', 'type':'text'},\n 'article_title':{'label':'Page Title', 'visible':'no', 'type':'text'},\n 'sequence':{'label':'Page Order', 'type':'text', 'size':'small'},\n '_flags_1':{'label':'Visible', 'type':'flagtoggle', 'bit':0x01, 'field':'flags_1', 'default':'on'},\n '_flags_2':{'label':'Private', 'type':'flagtoggle', 'bit':0x02, 'field':'flags_2', 'default':'off',\n 'active':function() { return M.modFlagAny('ciniki.customers', 0x03); },\n },\n '_flags_3':{'label':'Members Only', 'type':'flagtoggle', 'bit':0x04, 'field':'flags_3', 'default':'off',\n 'active':function() { return M.modFlagSet('ciniki.customers', 0x02); },\n },\n 'menu_flags':{'label':'Menu Options', 'type':'flags', 'flags':this.menuFlags},\n '_flags_4':{'label':'Password', 'type':'flagtoggle', 'bit':0x08, 'field':'flags_4', 'default':'off',\n 'active':(M.modFlagSet('ciniki.web', 0x2000)),\n 'on_fields':['page_password'],\n },\n 'page_password':{'label':'', 'type':'text', 'visible':(M.modFlagOn('ciniki.web', 0x2000) && (rsp.page.flags&0x08) == 0x08 ? 'yes' : 'no')},\n }},\n '_page_type':{'label':'Page Type', 'aside':'yes', 'visible':'hidden', 'fields':{\n 'page_type':{'label':'', 'hidelabel':'yes', 'type':'toggle', 'toggles':{}, 'onchange':'M.ciniki_web_pages[\\'' + pn + '\\'].setPageType();'},\n }},\n '_redirect':{'label':'Redirect', 'visible':'hidden', \n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('_redirect'); },\n 'fields':{\n 'page_redirect_url':{'label':'URL', 'type':'text'},\n }},\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'content', \n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('_tabs'); },\n 'tabs':{\n 'content':{'label':'Content', 'fn':'M.ciniki_web_pages[\\'' + pn + '\\'].switchTab(\"content\");'},\n 'files':{'label':'Files', 'fn':'M.ciniki_web_pages[\\'' + pn + '\\'].switchTab(\"files\");'},\n 'gallery':{'label':'Gallery', 'fn':'M.ciniki_web_pages[\\'' + pn + '\\'].switchTab(\"gallery\");'},\n 'children':{'label':'Child Pages', 'fn':'M.ciniki_web_pages[\\'' + pn + '\\'].switchTab(\"children\");'},\n }},\n '_module':{'label':'Module', 'visible':'hidden', \n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('_module'); },\n 'fields':{\n 'page_module':{'label':'Module', 'type':'select', 'options':{}, 'onchangeFn':'M.ciniki_web_pages[\\'' + pn + '\\'].setModuleOptions();'},\n }},\n '_module_options':{'label':'Options', \n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('_module_options'); },\n 'fields':{\n }},\n '_image':{'label':'', 'type':'imageform', 'aside':'yes',\n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('_image'); },\n 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', \n 'controls':'all', 'history':'no', \n 'addDropImage':function(iid) {\n M.ciniki_web_pages[pn].setFieldValue('primary_image_id', iid, null, null);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':'M.ciniki_web_pages.'+pn+'.deletePrimaryImage',\n },\n }},\n '_image_caption':{'label':'', 'aside':'yes',\n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('_image_caption'); },\n 'fields':{\n '_flags_15':{'label':'Show Image', 'type':'flagtoggle', 'field':'flags_15', 'reverse':'yes', 'bit':0x4000},\n 'primary_image_caption':{'label':'Caption', 'type':'text'},\n // 'primary_image_url':{'label':'URL', 'type':'text'},\n }},\n '_synopsis':{'label':'Synopsis', 'aside':'yes', \n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('_synopsis'); },\n 'fields':{\n 'synopsis':{'label':'', 'type':'textarea', 'size':'small', 'hidelabel':'yes'},\n }},\n '_content':{'label':'Content', \n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('_content'); },\n 'fields':{\n 'content':{'label':'', 'type':'textarea', 'size':'xlarge', 'hidelabel':'yes'},\n }},\n 'files':{'label':'Files', // 'aside':'yes', //'visible':'hidden', \n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('files'); },\n 'type':'simplegrid', 'num_cols':1,\n 'headerValues':null,\n 'cellClasses':[''],\n 'addTxt':'Add File',\n 'addFn':'M.ciniki_web_pages.'+pn+'.editComponent(\\'ciniki.web.pagefiles\\',\\'M.ciniki_web_pages.'+pn+'.updateFiles();\\',{\\'file_id\\':\\'0\\'});',\n },\n '_files':{'label':'', // 'aside':'yes', //'visible':'hidden', \n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('_files'); },\n 'fields':{\n '_flags_13':{'label':'Reverse Order', 'type':'flagtoggle', 'bit':0x1000, 'field':'flags_13', 'default':'on'},\n }},\n 'images':{'label':'Gallery', 'type':'simplethumbs',\n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('images'); },\n },\n '_images':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('_images'); },\n 'addTxt':'Add Image',\n 'addFn':'M.ciniki_web_pages.'+pn+'.editComponent(\\'ciniki.web.pageimages\\',\\'M.ciniki_web_pages.'+pn+'.addDropImageRefresh();\\',{\\'add\\':\\'yes\\'});',\n },\n '_children':{'label':'Child Pages', \n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('_children'); },\n 'fields':{\n 'child_title':{'label':'Heading', 'type':'text'},\n 'child_format':{'label':'Format', 'active':'yes', 'type':'flags', 'toggle':'yes', 'none':'no', 'join':'yes', 'flags':this.childFormat},\n }},\n 'pages':{'label':'', 'type':'simplegrid', 'num_cols':1, \n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('pages'); },\n 'seqDrop':function(e,from,to) {\n M.ciniki_web_pages[pn].savePos();\n M.api.getJSONCb('ciniki.web.pageUpdate', {'tnid':M.curTenantID, \n 'page_id':M.ciniki_web_pages[pn].data.pages[from].page.id,\n 'parent_id':M.ciniki_web_pages[pn].page_id,\n 'sequence':M.ciniki_web_pages[pn].data.pages[to].page.sequence, \n }, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_web_pages[pn].updateChildren();\n });\n },\n 'addTxt':'Add Child Page',\n 'addFn':'M.ciniki_web_pages.'+pn+'.childEdit(0);',\n },\n 'sponsors':{'label':'Sponsors', 'type':'simplegrid', 'visible':'hidden', 'num_cols':1,\n 'visible':function() { return M.ciniki_web_pages[pn].sectionVisible('sponsors'); },\n 'addTxt':'Manage Sponsors',\n 'addFn':'M.ciniki_web_pages.'+pn+'.sponsorEdit(0);',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_web_pages.'+pn+'.savePage();'},\n 'delete':{'label':'Delete', 'visible':(pid==0?'no':'yes'), 'fn':'M.ciniki_web_pages.'+pn+'.deletePage();'},\n }},\n };\n this[pn].fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.web.pageHistory', 'args':{'tnid':M.curTenantID,\n 'page_id':this.page_id, 'field':i}};\n };\n this[pn].sectionData = function(s) { \n return this.data[s];\n };\n this[pn].sectionVisible = function(s) {\n if( s == '_tabs' && this.page_type == 10 ) {\n return 'yes';\n }\n// this.sections._image.visible = (pt=='10' || ((pt==20 || pt==30) && this.data.parent_id > 0) ?'yes':'hidden');\n// this.sections._image_caption.visible = (pt=='10'?'yes':'hidden');\n if( s == '_synopsis' && (this.page_type == 10 || (this.page_type == 11 && this.data.parent_id > 0)) ) {\n return 'yes';\n }\n if( s == '_synopsis' && this.page_type == 20 && this.data.parent_id > 0 ) {\n return 'yes';\n }\n if( s == '_content' && ((this.page_type == 10 && this.sections._tabs.selected == 'content') || this.page_type == 11) ) {\n return 'yes';\n }\n if( (s == '_image' || s == '_image_caption') && (this.page_type == 10 )) {\n return 'yes';\n }\n if( s == '_image' && (this.page_type == 11 || this.page_type == 20) && this.data.parent_id > 0 ) {\n return 'yes';\n }\n if( (s == 'images' || s == '_images') && this.page_type == 10 && this.sections._tabs.selected == 'gallery' ) {\n return 'yes';\n }\n if( (s == 'files' || s == '_files') && this.page_type == 10 && this.sections._tabs.selected == 'files' ) {\n return 'yes';\n }\n if( (s == '_children' || s == 'pages') && this.page_type == 10 && this.sections._tabs.selected == 'children' ) {\n return 'yes';\n }\n if( s == 'pages' && this.page_type == 11 ) {\n return 'yes';\n }\n if( s == '_redirect' && this.page_type == 20 ) {\n return 'yes';\n }\n if( (s == '_module' || s == '_module_options') && this.page_type == 30 ) {\n return 'yes';\n }\n return 'hidden';\n }\n this[pn].switchTab = function(t) {\n this.sections._tabs.selected = t;\n this.refreshSection('_tabs');\n this.showHideSections(['_synopsis', '_redirect', '_image', '_image_caption', '_content', 'images', '_images', 'files', '_files', '_children', 'pages', 'sponsors', '_modules', '_module_options']);\n }\n this[pn].fieldValue = function(s, i, j, d) {\n if( i == 'parent_id' ) { return ' ' + this.data[i]; }\n return this.data[i];\n };\n this[pn].cellValue = function(s, i, j, d) {\n if( s == 'pages' ) {\n return d.page.title;\n } else if( s == 'files' ) {\n return d.file.name;\n } else if( s == 'sponsors' && j == 0 ) { \n return '<span class=\"maintext\">' + d.sponsor.title + '</span>';\n }\n };\n this[pn].rowFn = function(s, i, d) {\n if( s == 'pages' ) {\n return 'M.ciniki_web_pages.'+pn+'.childEdit(\\'' + d.page.id + '\\');';\n } else if( s == 'files' ) {\n return 'M.startApp(\\'ciniki.web.pagefiles\\',null,\\'M.ciniki_web_pages.'+pn+'.updateFiles();\\',\\'mc\\',{\\'file_id\\':\\'' + d.file.id + '\\'});';\n } else if( s == 'sponsors' ) {\n return 'M.startApp(\\'ciniki.sponsors.ref\\',null,\\'M.ciniki_web_pages.'+pn+'.updateSponsors();\\',\\'mc\\',{\\'ref_id\\':\\'' + d.sponsor.ref_id + '\\'});';\n }\n };\n this[pn].thumbFn = function(s, i, d) {\n return 'M.startApp(\\'ciniki.web.pageimages\\',null,\\'M.ciniki_web_pages.'+pn+'.addDropImageRefresh();\\',\\'mc\\',{\\'page_id\\':M.ciniki_web_pages.'+pn+'.page_id,\\'page_image_id\\':\\'' + d.image.id + '\\'});';\n };\n this[pn].deletePrimaryImage = function(fid) {\n this.setFieldValue(fid, 0, null, null);\n return true;\n };\n this[pn].addDropImage = function(iid) {\n if( this.page_id == 0 ) {\n var c = this.serializeForm('yes');\n var rsp = M.api.postJSON('ciniki.web.pageAdd', \n {'tnid':M.curTenantID}, c);\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n this.page_id = rsp.id;\n }\n var rsp = M.api.getJSON('ciniki.web.pageImageAdd', \n {'tnid':M.curTenantID, 'image_id':iid, 'page_id':this.page_id});\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n return true;\n };\n this[pn].addDropImageRefresh = function() {\n if( M.ciniki_web_pages[pn].page_id > 0 ) {\n M.api.getJSONCb('ciniki.web.pageGet', {'tnid':M.curTenantID, \n 'page_id':M.ciniki_web_pages[pn].page_id, 'images':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_web_pages[pn];\n p.data.images = rsp.page.images;\n p.refreshSection('images');\n p.show();\n });\n }\n return true;\n };\n this[pn].editComponent = function(a,cb,args) {\n if( this.page_id == 0 ) {\n var p = this;\n var c = this.serializeFormData('yes');\n M.api.postJSONFormData('ciniki.web.pageAdd', \n {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n p.page_id = rsp.id;\n args['page_id'] = rsp.id;\n M.startApp(a,null,cb,'mc',args);\n });\n } else {\n args['page_id'] = this.page_id;\n M.startApp(a,null,cb,'mc',args);\n }\n };\n\n this[pn].updateFiles = function() {\n if( this.page_id > 0 ) {\n M.api.getJSONCb('ciniki.web.pageGet', {'tnid':M.curTenantID, \n 'page_id':this.page_id, 'files':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_web_pages[pn];\n p.data.files = rsp.page.files;\n p.refreshSection('files');\n p.show();\n });\n }\n return true;\n };\n\n this[pn].updateChildren = function() {\n if( this.page_id > 0 ) {\n M.api.getJSONCb('ciniki.web.pageGet', {'tnid':M.curTenantID, \n 'page_id':this.page_id, 'children':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_web_pages[pn];\n p.data.pages = rsp.page.pages;\n p.refreshSection('pages');\n p.show();\n });\n }\n return true;\n };\n this[pn].updateSponsors = function() {\n if( this.page_id > 0 ) {\n M.api.getJSONCb('ciniki.web.pageGet', {'tnid':M.curTenantID, \n 'page_id':this.page_id, 'sponsors':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_web_pages[pn];\n p.data.sponsors = rsp.page.sponsors;\n p.refreshSection('sponsors');\n p.show();\n });\n }\n return true;\n };\n\n this[pn].childEdit = function(cid) {\n if( this.page_id == 0 ) {\n // Save existing data as new page\n var p = this;\n var c = this.serializeFormData('yes');\n M.api.postJSONFormData('ciniki.web.pageAdd', \n {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n p.page_id = rsp.id;\n M.ciniki_web_pages.pageEdit('M.ciniki_web_pages.'+pn+'.updateChildren();',cid,p.page_id);\n });\n } else {\n M.ciniki_web_pages.pageEdit('M.ciniki_web_pages.'+pn+'.updateChildren();',cid,this.page_id);\n }\n };\n this[pn].sponsorEdit = function(cid) {\n if( this.page_id == 0 ) {\n // Save existing data as new page\n var p = this;\n var c = this.serializeFormData('yes');\n M.api.postJSONFormData('ciniki.web.pageAdd', \n {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n p.page_id = rsp.id;\n// M.ciniki_web_pages.pageEdit('M.ciniki_web_pages.'+pn+'.updateChildren();',cid,p.page_id);\n M.startApp('ciniki.sponsors.ref',null,p.panelRef+'.updateSponsors();','mc',{'object':'ciniki.web.page','object_id':p.page_id});\n });\n } else {\n M.startApp('ciniki.sponsors.ref',null,this.panelRef+'.updateSponsors();','mc',{'object':'ciniki.web.page','object_id':this.page_id});\n }\n };\n // \n // Add or remove sections based on page type\n //\n this[pn].setPageType = function() {\n var pt = this.formValue('page_type');\n this.page_type = pt;\n var p = M.gE(this.panelUID);\n if( pt == '10' ) { //|| (pt == 11 && this.data.parent_id > 0) ) {\n p.children[0].className = 'large mediumaside';\n } else if( pt == '11' ) {\n p.children[0].className = 'large mediumaside';\n } else if( pt == '20' ) {\n p.children[0].className = 'medium';\n } else {\n p.children[0].className = 'medium mediumaside';\n }\n// this.sections._module_options.visible = 'hidden';\n// this.sections._image.visible = (pt=='10' || ((pt==20 || pt==30) && this.data.parent_id > 0) ?'yes':'hidden');\n// this.sections._image_caption.visible = (pt=='10'?'yes':'hidden');\n// this.sections._synopsis.visible = (pt=='10' || ((pt==20 || pt==30) && this.data.parent_id > 0)?'yes':'hidden');\n// this.sections._content.visible = ((pt=='10'||pt==11)?'yes':'hidden');\n// this.sections.files.visible = (pt=='10'?'yes':'hidden');\n// this.sections._files.visible = (pt=='10'?'yes':'hidden');\n// this.sections.images.visible = (pt=='10'?'yes':'hidden');\n// this.sections._images.visible = (pt=='10'?'yes':'hidden');\n// this.sections._children.visible = (pt=='10'?'yes':'hidden');\n// this.sections.pages.visible = (pt=='10'||pt=='11'?'yes':'hidden');\n// this.sections.sponsors.visible = (pt=='10'?'yes':'hidden');\n// this.sections._redirect.visible = (pt=='20'?'yes':'hidden');\n// this.sections._module.visible = (pt=='30'?'yes':'hidden');\n// this.sections._module_options.visible = (pt=='30'?'yes':'hidden');\n if( pt == '30' ) { \n this.setModuleOptions();\n }\n this.refreshSection('_tabs');\n this.showHideSections(['_synopsis', '_redirect', '_image', '_image_caption', '_content', 'images', '_images', 'files', '_files', '_children', 'pages', 'sponsors', '_module', '_module_options']);\n this.refreshSection('_module');\n/* for(i in this.sections) {\n var e = M.gE(this.panelUID + '_section_' + i);\n if( e != null && this.sections[i].visible != null && this.sections[i].visible != 'no' ) {\n if( this.sections[i].visible == 'hidden' ) {\n e.style.display = 'none';\n } else if( this.sections[i].visible == 'yes' ) {\n e.style.display = 'block';\n }\n }\n } */\n var e = M.gE(this.panelUID + '_article_title');\n if( pt == 10 || pt == 11 ) {\n this.sections.details.fields.article_title.visible = 'yes';\n e.parentNode.parentNode.style.display = '';\n } else {\n this.sections.details.fields.article_title.visible = 'no';\n e.parentNode.parentNode.style.display = 'none';\n }\n };\n this[pn].setModuleOptions = function() {\n// this.sections._module_options.visible = 'hidden';\n var mod = this.formValue('page_module');\n this.sections._module_options.fields = {};\n for(var i in this.modules_pages) {\n if( i == mod ) {\n if( this.modules_pages[i].options != null ) {\n for(var j in this.modules_pages[i].options) {\n// this.sections._module_options.visible = 'yes';\n this.setModuleOptionsField(this.modules_pages[i].options[j]);\n }\n }\n break;\n }\n }\n this.refreshSection('_module_options');\n// var e = M.gE(this.panelUID + '_section__module_options');\n// if( e != null && this.sections._module_options.visible == 'yes' && this.sections._module.visible == 'yes' ) {\n// e.style.display = 'block';\n// this.refreshSection('_module_options');\n// } else {\n// e.style.display = 'none';\n// }\n };\n this[pn].setModuleOptionsField = function(option) {\n this.sections._module_options.fields[option.setting] = {'label':option.label, 'type':option.type, 'hint':(option.hint!=null?option.hint:'')};\n if( option.type == 'toggle' ) {\n this.sections._module_options.fields[option.setting].toggles = {};\n for(var i in option.toggles) {\n this.sections._module_options.fields[option.setting].toggles[option.toggles[i].value] = option.toggles[i].label;\n }\n }\n else if( option.type == 'select' ) {\n this.sections._module_options.fields[option.setting].options = {};\n for(var i in option.options) {\n this.sections._module_options.fields[option.setting].options[option.options[i].value] = option.options[i].label;\n }\n }\n else if( option.type == 'image_id' ) {\n this.sections._module_options.fields[option.setting].addDropImage = function(iid) {\n M.ciniki_web_pages[pn].setFieldValue(option.setting, iid, null, null);\n return true;\n };\n if( option.controls != null ) {\n this.sections._module_options.fields[option.setting].controls = option.controls;\n } else {\n this.sections._module_options.fields[option.setting].controls = 'all';\n }\n }\n this.data[option.setting] = option.value;\n };\n this[pn].addButton('save', 'Save', 'M.ciniki_web_pages.'+pn+'.savePage();');\n this[pn].addClose('Cancel');\n this[pn].addLeftButton('website', 'Preview', 'M.ciniki_web_pages.'+pn+'.previewPage();');\n this[pn].savePage = function(preview) {\n var p = this;\n var flags = this.formValue('child_format');\n if( this.formValue('_flags_1') == 'on' ) {\n flags |= 0x01;\n } else {\n flags &= ~0x01;\n }\n if( this.formValue('_flags_2') == 'on' ) {\n flags |= 0x02;\n } else {\n flags &= ~0x02;\n }\n if( this.formValue('_flags_3') == 'on' ) {\n flags |= 0x04;\n } else {\n flags &= ~0x04;\n }\n if( this.formValue('_flags_4') == 'on' ) {\n flags |= 0x08;\n } else {\n flags &= ~0x08;\n }\n if( this.formValue('_flags_13') == 'on' ) {\n flags |= 0x1000;\n } else {\n flags &= ~0x1000;\n }\n if( this.formValue('_flags_15') == 'on' ) {\n flags |= 0x4000;\n } else {\n flags &= ~0x4000;\n }\n if( this.page_id > 0 ) {\n var c = this.serializeFormData('no');\n if( c != null || flags != this.data.flags ) {\n if( c == null ) { c = new FormData; }\n if( flags != this.data.flags ) {\n c.append('flags', flags);\n }\n M.api.postJSONFormData('ciniki.web.pageUpdate', \n {'tnid':M.curTenantID, 'page_id':this.page_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n if( preview != null ) {\n M.showWebsite(preview);\n } else {\n p.close();\n }\n });\n } else {\n if( preview != null ) {\n M.showWebsite(preview);\n } else {\n this.close();\n }\n }\n } else {\n var c = this.serializeFormData('yes');\n c.append('flags', flags);\n M.api.postJSONFormData('ciniki.web.pageAdd', \n {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n if( preview != null ) {\n M.showWebsite(preview);\n } else {\n p.close();\n }\n });\n }\n };\n this[pn].previewPage = function() {\n this.savePage(this.data.full_permalink);\n };\n this[pn].deletePage = function() {\n var p = this;\n M.confirm('Are you sure you want to delete this page? All files and images will also be removed from this page.',null,function() {\n M.api.getJSONCb('ciniki.web.pageDelete', {'tnid':M.curTenantID, \n 'page_id':p.page_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n p.close();\n });\n });\n };\n }\n\n// this[pn].sections.details.fields.parent_id.options = {'0':'None'};\n if( rsp.parentlist != null && rsp.parentlist.length > 0 ) {\n this[pn].sections.details.fields.parent_id.active = 'yes';\n this[pn].sections.details.fields.parent_id.options = {};\n this[pn].sections.details.fields.parent_id.options[' ' + 0] = 'None';\n for(var i in rsp.parentlist) {\n if( rsp.parentlist[i].page.id != this[pn].page_id ) {\n this[pn].sections.details.fields.parent_id.options[' ' + rsp.parentlist[i].page.id] = rsp.parentlist[i].page.title;\n }\n }\n } else {\n this[pn].sections.details.fields.parent_id.active = 'no';\n }\n this[pn].data = rsp.page;\n this[pn].modules_pages = rsp.modules_pages;\n // Remove child_format flags\n this[pn].data.flags_1 = (rsp.page.flags&0xFFFFFF0F);\n this[pn].data.flags_2 = (rsp.page.flags&0xFFFFFF0F);\n this[pn].data.flags_3 = (rsp.page.flags&0xFFFFFF0F);\n this[pn].data.flags_4 = (rsp.page.flags&0xFFFFFF0F);\n this[pn].data.flags_13 = (rsp.page.flags&0x00001000);\n this[pn].data.flags_15 = (rsp.page.flags&0x00004000);\n this[pn].data.child_format = (rsp.page.flags&0x00000FF0);\n this[pn].sections.details.fields.parent_id.active = 'yes';\n if( this[pn].page_id == 0 && parent_id != null ) {\n this[pn].data.parent_id = parent_id;\n if( parent_id == 0 ) {\n this[pn].data.title = '';\n }\n }\n this[pn].sections._page_type.visible = 'hidden';\n this[pn].sections._page_type.fields.page_type.toggles = {'10':'Custom'};\n // Check if flags for page menu and page redirects\n if( (M.curTenant.modules['ciniki.web'].flags&0x0640) > 0 ) {\n this[pn].sections._page_type.visible = 'yes';\n if( (M.curTenant.modules['ciniki.web'].flags&0x0800) > 0 ) {\n this[pn].sections._page_type.fields.page_type.toggles['11'] = 'Manual';\n }\n if( (M.curTenant.modules['ciniki.web'].flags&0x0400) > 0 ) {\n this[pn].sections._page_type.fields.page_type.toggles['20'] = 'Redirect';\n }\n if( (M.curTenant.modules['ciniki.web'].flags&0x0240) > 0 ) {\n this[pn].sections._page_type.fields.page_type.toggles['30'] = 'Module';\n this[pn].sections._module.fields.page_module.options = {};\n if( rsp.modules_pages != null ) {\n for(i in rsp.modules_pages) {\n this[pn].sections._module.fields.page_module.options[i] = rsp.modules_pages[i].name;\n }\n }\n }\n } else {\n this[pn].data.page_type = 10;\n }\n if( this[pn].data.parent_id == 0 ) {\n // Give them the option of how to display sub pages\n this[pn].sections._children.fields.child_format.flags = this.parentChildrenFormat;\n this[pn].sections.details.fields.menu_flags.visible = 'yes';\n } else {\n this[pn].sections._children.fields.child_format.flags = this.childFormat;\n this[pn].sections.details.fields.menu_flags.visible = 'no';\n }\n if( M.curTenant.modules['ciniki.sponsors'] != null \n && (M.curTenant.modules['ciniki.sponsors'].flags&0x02) ) {\n this[pn].sections.sponsors.visible = 'hidden';\n } else {\n this[pn].sections.sponsors.visible = 'no';\n }\n \n this[pn].refresh();\n this[pn].show(cb);\n this[pn].setPageType();\n }\n\n //\n // Arguments:\n // aG - The arguments to be parsed into args\n //\n this.start = function(cb, appPrefix, aG) {\n args = {};\n if( aG != null ) { args = eval(aG); }\n\n //\n // Create the app container if it doesn't exist, and clear it out\n // if it does exist.\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_web_pages', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n } \n\n this.pageEdit(cb, args.page_id, args.parent_id); \n }\n\n this.pageEdit = function(cb, pid, parent_id) {\n M.api.getJSONCb('ciniki.web.pageGet', {'tnid':M.curTenantID,\n 'page_id':pid, 'parent_id':parent_id, 'images':'yes', 'files':'yes', \n 'children':'yes', 'parentlist':'yes', 'sponsors':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_web_pages.createEditPanel(cb, pid, parent_id, rsp); \n });\n };\n}", "function formAlter(event,form,next) {\n\n // Content - fires\n var newSection = {\n id:'form-section-template',\n label:'Template Alter',\n fields:[\n {label:'Status',name:'content[template]',type:'textarea',description:'A field added dynamically to the content from by the template module'},\n ]\n }\n\n form.sections.push(newSection);\n\n return next(form);\n\n}", "async process_fields() {\n\n const fields_template = this._blockkit_conifg.block_kit.fields;\n\n const result = {};\n result.type = \"section\";\n result.fields = [];\n\n for (const template_index in fields_template) {\n const template_value = fields_template[template_index];\n result.fields.push({\n type: \"mrkdwn\",\n text: \"*\" + template_index + \":*\\n\" + await helper.str_dot_walk_obj(this._obj, template_value)\n });\n }\n\n return result;\n }", "function ciniki_classes_class() {\n //\n // Panels\n //\n this.classWebflags = {\n '1':{'name':'Visible'},\n };\n this.init = function() {\n //\n // The panel for editing a class\n //\n this.edit = new M.panel('Class',\n 'ciniki_classes_class', 'edit',\n 'mc', 'medium mediumaside', 'sectioned', 'ciniki.classes.class.edit');\n this.edit.data = null;\n this.edit.class_id = 0;\n this.edit.additional_images = [];\n this.edit.sections = { \n '_image':{'label':'', 'aside':'yes', 'type':'imageform', 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', \n 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_classes_class.edit.setFieldValue('primary_image_id',iid);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':'M.ciniki_classes_class.edit.deletePrimaryImage',\n },\n }},\n 'details':{'label':'', 'aside':'yes', 'fields':{\n 'name':{'label':'Title', 'hint':'Title', 'type':'text'},\n 'category':{'label':'Category', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes'},\n 'subcat':{'label':'Sub-Category', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes'},\n 'webflags':{'label':'Website', 'hint':'', 'type':'flags', 'flags':this.classWebflags},\n }}, \n '_synopsis':{'label':'Synopsis', 'fields':{\n 'synopsis':{'label':'', 'hidelabel':'yes', 'hint':'', 'size':'small', 'type':'textarea'},\n }},\n '_description':{'label':'Description', 'fields':{\n 'description':{'label':'', 'hidelabel':'yes', 'hint':'', 'type':'textarea'},\n }},\n 'images':{'label':'Gallery', 'type':'simplethumbs'},\n '_images':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'addTxt':'Add Additional Image',\n 'addFn':'M.ciniki_classes_class.editImage(0);',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_classes_class.saveClass();'},\n 'delete':{'label':'Delete', 'fn':'M.ciniki_classes_class.removeClass();'},\n }},\n }; \n this.edit.sectionData = function(s) { return this.data[s]; }\n this.edit.fieldValue = function(s, i, d) { return this.data[i]; }\n this.edit.liveSearchCb = function(s, i, value) {\n if( i == 'category' || i == 'subcat' ) {\n var rsp = M.api.getJSONBgCb('ciniki.classes.classSearchField', {'tnid':M.curTenantID, 'field':i, 'start_needle':value, 'limit':15},\n function(rsp) {\n M.ciniki_classes_class.edit.liveSearchShow(s, i, M.gE(M.ciniki_classes_class.edit.panelUID + '_' + i), rsp.results);\n });\n }\n };\n this.edit.liveSearchResultValue = function(s, f, i, j, d) {\n if( (f == 'category' || f == 'subcat' ) && d.result != null ) { return d.result.name; }\n return '';\n };\n this.edit.liveSearchResultRowFn = function(s, f, i, j, d) { \n if( (f == 'category' || f == 'subcat' ) && d.result != null ) {\n return 'M.ciniki_classes_class.edit.updateField(\\'' + s + '\\',\\'' + f + '\\',\\'' + escape(d.result.name) + '\\');';\n }\n };\n this.edit.updateField = function(s, fid, result) {\n M.gE(this.panelUID + '_' + fid).value = unescape(result);\n this.removeLiveSearch(s, fid);\n };\n this.edit.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.classes.classHistory', 'args':{'tnid':M.curTenantID, \n 'class_id':this.class_id, 'field':i}};\n }\n this.edit.deletePrimaryImage = function(fid) {\n this.setFieldValue(fid, 0, null, null);\n return true;\n };\n this.edit.addDropImage = function(iid) {\n if( M.ciniki_classes_class.edit.class_id > 0 ) {\n var rsp = M.api.getJSON('ciniki.classes.classImageAdd', \n {'tnid':M.curTenantID, 'image_id':iid, \n 'class_id':M.ciniki_classes_class.edit.class_id});\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n return true;\n } else {\n var name = M.ciniki_classes_class.edit.formValue('name');\n if( name == '' ) {\n M.alert('You must enter the name of the class first');\n return false;\n }\n // Save the class\n var c = M.ciniki_classes_class.edit.serializeForm('yes');\n c += '&images=' + iid;\n var rsp = M.api.postJSON('ciniki.classes.classAdd', {'tnid':M.curTenantID}, c);\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_classes_class.edit.class_id = rsp.id;\n// , function(rsp) {\n// if( rsp.stat != 'ok' ) {\n// M.api.err(rsp);\n// return false;\n// }\n// M.ciniki_classes_class.edit.class_id = rsp.id;\n// });\n return true;\n }\n };\n this.edit.addDropImageRefresh = function() {\n if( M.ciniki_classes_class.edit.class_id > 0 ) {\n var rsp = M.api.getJSONCb('ciniki.classes.classGet', {'tnid':M.curTenantID, \n 'class_id':M.ciniki_classes_class.edit.class_id, 'images':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_classes_class.edit;\n p.data.images = rsp.class.images;\n p.refreshSection('images');\n p.show();\n });\n }\n return true;\n };\n this.edit.thumbFn = function(s, i, d) {\n return 'M.ciniki_classes_class.editImage(\\'' + d.image.id + '\\');';\n };\n this.edit.addButton('save', 'Save', 'M.ciniki_classes_class.saveClass();');\n this.edit.addClose('Cancel');\n }\n\n //\n // Arguments:\n // aG - The arguments to be parsed into args\n //\n this.start = function(cb, appPrefix, aG) {\n args = {};\n if( aG != null ) { args = eval(aG); }\n\n //\n // Create the app container if it doesn't exist, and clear it out\n // if it does exist.\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_classes_class', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n } \n\n this.editClass(cb, args.class_id);\n }\n\n this.editClass = function(cb, cid) {\n this.edit.reset();\n if( cid != null ) { this.edit.class_id = cid; }\n this.edit.sections.details.fields.category.active = ((M.curTenant.modules['ciniki.classes'].flags&0x01)>0)?'yes':'no';\n this.edit.sections.details.fields.subcat.active = ((M.curTenant.modules['ciniki.classes'].flags&0x02)>0)?'yes':'no';\n if( this.edit.class_id > 0 ) {\n this.edit.sections._buttons.buttons.delete.visible = 'yes';\n M.api.getJSONCb('ciniki.classes.classGet', {'tnid':M.curTenantID, \n 'class_id':this.edit.class_id, 'images':'yes', 'files':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_classes_class.edit;\n p.data = rsp.class;\n p.refresh();\n p.show(cb);\n });\n } else {\n this.edit.sections._buttons.buttons.delete.visible = 'no';\n this.edit.data = {};\n this.edit.additional_images = [];\n this.edit.refresh();\n this.edit.show(cb);\n }\n };\n\n this.saveClass = function() {\n if( this.edit.class_id > 0 ) {\n var c = this.edit.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.classes.classUpdate', \n {'tnid':M.curTenantID, 'class_id':M.ciniki_classes_class.edit.class_id}, c,\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_classes_class.edit.close();\n });\n } else {\n this.edit.close();\n }\n } else {\n var name = this.edit.formValue('name');\n if( name == '' ) {\n M.alert('You must enter the name of the class first');\n return false;\n }\n var c = this.edit.serializeForm('yes');\n M.api.postJSONCb('ciniki.classes.classAdd', \n {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_classes_class.edit.close();\n });\n }\n };\n\n this.editImage = function(iid) {\n if( this.edit.class_id > 0 ) {\n M.startApp('ciniki.classes.classimages',null,'M.ciniki_classes_class.edit.addDropImageRefresh();','mc',{'class_id':this.edit.class_id,'class_image_id':iid});\n } else {\n var name = this.edit.formValue('name');\n if( name == '' ) {\n M.alert('You must enter the name of the class first');\n return false;\n }\n // Save the class\n var c = this.edit.serializeForm('yes');\n M.api.postJSONCb('ciniki.classes.classAdd', {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_classes_class.edit.class_id = rsp.id;\n M.startApp('ciniki.classes.classimages',null,'M.ciniki_classes_class.editClass();','mc',{'class_id':rsp.id,'class_image_id':iid});\n });\n }\n };\n\n this.removeClass = function() {\n M.confirm(\"Are you sure you want to remove this class and all the images and files associated with it?\",null,function() {\n M.api.getJSONCb('ciniki.classes.classDelete', \n {'tnid':M.curTenantID, 'class_id':M.ciniki_classes_class.edit.class_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_classes_class.edit.close();\n });\n });\n }\n}", "function loadMetadata() {\n\tvar s = '<thead><td class=\"textcell1\">Type</td><td class=\"textcell2\"><span id=\"mprop\"></span></td><td class=\"textcell3\"><span id=\"mval\"></span></td><td class=\"textcell4\">Information</td></thead>';\n\ts += '<tbody>';\n\ts += stringLine4Val( 'codeMetadata', '<span id=\"tytitle\">-</span>', '-', '', '<span id=\"infotytitle\">-</span>', 'writehalf' );\n\ts += stringLine4Val( 'codeMetadata', 'Transcription', '<span id=\"tyname\">-</span>', '', '<span id=\"infotyname\">-</span>', 'writehalf' ); // put 'readonly' if edit the filename in metadata is not permitted anymore\n\ts += stringLine4Val( 'codeMetadata', 'Transcription', '<span id=\"tyloc\">-</span>', '', '<span id=\"infotyloc\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', 'Transcription', '<span id=\"tydate\">-</span>', '', '<span id=\"infotydate\">-</span>', 'writehalf' );\n\ts += stringLine4Val( 'codeMetadata', 'Transcription', '<span id=\"typlacen\">-</span>', '', '<span id=\"infoplacen\">-</span>', 'writehalf' );\n\ts += stringLine4Val( 'codeMetadata', 'Media', '<span id=\"tymname\">-</span>', '', '<span id=\"infotymname\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', 'Media', '<span id=\"tymrelloc\">-</span>', '', '<span id=\"infotymrelloc\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', 'Media', '<span id=\"tymloc\">-</span>', '', '<span id=\"infotymloc\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', 'Media', '<span id=\"tymtype\">-</span>', '', '<span id=\"infotymtype\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', 'Media', '<span id=\"tymdur\">-</span>', '', '<span id=\"infotymdur\">-</span>', 'readonly' );\n\ts += stringLine4Val( 'codeMetadata', '-', '-', '-', '---', 'readonly' );\n\t/*\n\t * et on y ajoute les notes s'il y en a (compatibilité anciens formats)\n\t */\n\tif (trjs.data.note) {\n\t\tfor (var i = 0; i < trjs.data.note.length; i++) {\n s += stringLine4Val( 'codeMetadata', trjs.data.note[i]['type'], trjs.data.note[i]['property'], trjs.data.note[i]['value'], trjs.data.note[i]['info'] );\n\t\t}\n\t}\n\ts += stringLine4Val( 'codeMetadata', '-', '-', '-', '---', 'readonly' );\n\tif (trjs.data.metadata) {\n for (var i=0 ; i < trjs.data.metadata.length; i++) {\n s += stringLine4Val( 'codeMetadata', trjs.data.metadata[i]['type'], trjs.data.metadata[i]['property'], trjs.data.metadata[i]['value'], trjs.data.metadata[i]['info'] );\n }\n\t}\n\ts += '</tbody>';\n\t$('#metadata').html(s);\n}", "function setupDynamicPart_r(real_estate_record_type, json_payload) {\n\n $('input[name=\"real_estate_record_type_r\"]').on('click', function(){\n appendToDynamicPanel_r(real_estate_record_type, json_payload);\n })\n\n}", "function addFrameDetails() {\n // Add frame elements in inherited frame element list\n $.each(inheritedElements, function(index, fe) {\n var option = createOption(fe.fields.fe_name, 'inherited', index == 0);\n $('#inherited').append(option);\n });\n\n // Add frame elements in new (uninherited) frame element list\n $.each(newElements, function(index, fe) {\n var option = createOption(fe.fields.fe_name, 'new', index == 0);\n $('#new').append(option);\n });\n\n // Add subframes\n for(var i = 0; i < subframes.length; i++) {\n var subframe = createSubframe(subframes[i].fields.name, subelements[i], i == 0);\n $('#subframes').append(subframe);\n }\n}", "static setEmbedField() {\n const rows = document.querySelector('#fields-table tbody').querySelectorAll('tr');\n let fields = [], name = \"\", value = \"\", i = 0;\n rows.forEach((row) => {\n name = row.querySelector('.field-names').textContent;\n value = row.querySelector('.field-values').textContent;\n if (name && value) {\n fields[i++] = {\n name: name,\n value: value,\n inline: row.querySelector('.field-inline input').checked,\n };\n }\n });\n document.querySelector('#embed-fields').value = JSON.stringify(fields);\n }", "_mapFieldsToMenu() {\n const that = this;\n\n if (!that.fields && !that._valueFields) {\n return;\n }\n\n that._fields = (that.fields || that._valueFields).concat(that._manuallyAddedFields).map(field => {\n return { label: field.label, value: field.dataField, dataType: field.dataType, filterOperations: field.filterOperations, lookup: field.lookup };\n });\n }", "function build_protein_info_panel(data, div) {\n div.empty();\n var protein = data.controller.get_current_protein();\n div.append(protein['description']);\n div.append(\"<br>----<br>\");\n div.append(dict_html(protein['attr']));\n}", "function ciniki_products_images() {\n this.webFlags = {\n '1':{'name':'Visible'},\n };\n this.init = function() {\n //\n // The panel to display the edit form\n //\n this.edit = new M.panel('Edit Image',\n 'ciniki_products_images', 'edit',\n 'mc', 'medium', 'sectioned', 'ciniki.products.images.edit');\n this.edit.default_data = {};\n this.edit.data = {};\n this.edit.product_id = 0;\n this.edit.product_image_id = 0;\n this.edit.sections = {\n '_image':{'label':'Photo', 'type':'imageform', 'fields':{\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no'},\n }},\n 'info':{'label':'Information', 'type':'simpleform', 'fields':{\n 'name':{'label':'Title', 'type':'text'},\n 'sequence':{'label':'Order', 'type':'text', 'size':'small'},\n 'webflags':{'label':'Website', 'type':'flags', 'join':'yes', 'flags':this.webFlags},\n }},\n '_description':{'label':'Description', 'type':'simpleform', 'fields':{\n 'description':{'label':'', 'type':'textarea', 'size':'small', 'hidelabel':'yes'},\n }},\n '_save':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_products_images.saveImage();'},\n 'delete':{'label':'Delete', 'fn':'M.ciniki_products_images.deleteImage();'},\n }},\n };\n this.edit.fieldValue = function(s, i, d) { \n if( this.data[i] != null ) {\n return this.data[i]; \n } \n return ''; \n };\n this.edit.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.products.imageHistory', 'args':{'tnid':M.curTenantID, \n 'product_image_id':this.product_image_id, 'field':i}};\n };\n this.edit.addDropImage = function(iid) {\n M.ciniki_products_images.edit.setFieldValue('image_id', iid, null, null);\n return true;\n };\n this.edit.addButton('save', 'Save', 'M.ciniki_products_images.saveImage();');\n this.edit.addClose('Cancel');\n };\n\n this.start = function(cb, appPrefix, aG) {\n args = {};\n if( aG != null ) {\n args = eval(aG);\n }\n\n //\n // Create container\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_products_images', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n }\n\n if( args.add != null && args.add == 'yes' ) {\n this.showEdit(cb, 0, args.product_id);\n } else if( args.product_image_id != null && args.product_image_id > 0 ) {\n this.showEdit(cb, args.product_image_id);\n }\n return false;\n }\n\n this.showEdit = function(cb, iid, eid) {\n if( iid != null ) {\n this.edit.product_image_id = iid;\n }\n if( eid != null ) {\n this.edit.product_id = eid;\n }\n if( this.edit.product_image_id > 0 ) {\n var rsp = M.api.getJSONCb('ciniki.products.imageGet', \n {'tnid':M.curTenantID, 'product_image_id':this.edit.product_image_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_products_images.edit.data = rsp.image;\n M.ciniki_products_images.edit.refresh();\n M.ciniki_products_images.edit.show(cb);\n });\n } else {\n this.edit.reset();\n this.edit.data = {'webflags':1};\n this.edit.refresh();\n this.edit.show(cb);\n }\n };\n\n this.saveImage = function() {\n if( this.edit.product_image_id > 0 ) {\n var c = this.edit.serializeFormData('no');\n if( c != '' ) {\n var rsp = M.api.postJSONFormData('ciniki.products.imageUpdate', \n {'tnid':M.curTenantID, \n 'product_image_id':this.edit.product_image_id}, c,\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } else {\n M.ciniki_products_images.edit.close();\n }\n });\n } else {\n this.edit.close();\n }\n } else {\n var c = this.edit.serializeFormData('yes');\n var rsp = M.api.postJSONFormData('ciniki.products.imageAdd', \n {'tnid':M.curTenantID, 'product_id':this.edit.product_id}, c,\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } else {\n M.ciniki_products_images.edit.close();\n }\n });\n }\n };\n\n this.deleteImage = function() {\n M.confirm('Are you sure you want to delete this image?',null,function() {\n var rsp = M.api.getJSONCb('ciniki.products.imageDelete', {'tnid':M.curTenantID, \n 'product_image_id':M.ciniki_products_images.edit.product_image_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_products_images.edit.close();\n });\n });\n };\n}", "function InitDataConfigIntegrationFields() {\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields = {};\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.AddNewField = AddNewField;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.OnOpenJsonModal = OnOpenJsonModal;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.Close = CloseDataExtIntegrationFields;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.OnDataExtIntegrationFieldsClick = OnDataExtIntegrationFieldsClick;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.Save = IntegrationConfigFieldsSave;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.Delete = DeleteConfirmation;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.EditDataConfigField = EditDataConfigField;\n \n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.SaveBtnText = \"OK\";\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.IsDisableSaveBtn = false;\n\n InitExpression();\n InitRelatedInput();\n }", "configureFields() {\n let fields = {}\n\n for(let fieldName in this.props.schema.fields) {\n let field = this.props.schema.fields[fieldName]\n\n fields[fieldName] = {}\n fields[fieldName].value = undefined\n fields[fieldName].isValid = false\n fields[fieldName].required = false\n\n if(\n field.type === 'select'\n || field.type === 'checkbox'\n ) {\n fields[fieldName].isValid = true\n }\n }\n\n if(this.props.schema.required) {\n this.props.schema.required.forEach(fieldName => {\n fields[fieldName].required = true\n })\n }\n\n return fields\n }", "function getViewOrListMetaAndData(name) {\n\t\t\tvar returnObject = {\n\t\t\t\tdata: null,\n\t\t\t\tmeta: null,\n\t\t\t\tisView: true,\n\t\t\t\tisEdit: true\n\t\t\t};\n\n\t\t\tif (name === \"\") {\n\t\t\t\tfor (var i = 0; i < contentData.defaultRecordView.regions.length; i++) {\n\t\t\t\t\tif (contentData.defaultRecordView.regions[i].name === \"content\") {\n\t\t\t\t\t\treturnObject.meta = fastCopy(contentData.defaultRecordView.regions[i]);\n\t\t\t\t\t\treturnObject.meta.label = \"General\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturnObject.isView = true;\n\t\t\t\treturnObject.isEdit = true;\n\t\t\t\treturnObject.data = fastCopy(resolvedCurrentView.data[0]);\n\t\t\t} else {\n\t\t\t\tvar selectedDataName = \"\";\n\t\t\t\treturnObject.isEdit = false;\n\t\t\t\tfor (var i = 0; i < contentData.defaultRecordView.sidebar.items.length; i++) {\n\t\t\t\t\tif (contentData.defaultRecordView.sidebar.items[i].dataName === name) {\n\t\t\t\t\t\t//Set meta\n\t\t\t\t\t\t// If in edit mode (view from the current entity) the data should be different -> we need the content region meta, not the view meta as in recursive-view directive\n\t\t\t\t\t\tif (contentData.defaultRecordView.sidebar.items[i].type === \"view\") {\n\t\t\t\t\t\t\tfor (var j = 0; j < contentData.defaultRecordView.sidebar.items[i].meta.regions.length; j++) {\n\t\t\t\t\t\t\t\tif (contentData.defaultRecordView.sidebar.items[i].meta.regions[j].name === \"content\") {\n\t\t\t\t\t\t\t\t\treturnObject.isEdit = true;\n\t\t\t\t\t\t\t\t\treturnObject.meta = fastCopy(contentData.defaultRecordView.sidebar.items[i].meta.regions[j]);\n\t\t\t\t\t\t\t\t\treturnObject.meta.label = fastCopy(contentData.defaultRecordView.sidebar.items[i].meta.label);\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\telse {\n\t\t\t\t\t\t\treturnObject = contentData.defaultRecordView.sidebar.items[i];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Set data\n\t\t\t\t\t\tselectedDataName = contentData.defaultRecordView.sidebar.items[i].dataName;\n\t\t\t\t\t\tif (contentData.defaultRecordView.sidebar.items[i].type === \"view\") {\n\t\t\t\t\t\t\treturnObject.isView = true;\n\t\t\t\t\t\t\treturnObject.data = fastCopy(resolvedCurrentView.data[0][selectedDataName][0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (contentData.defaultRecordView.sidebar.items[i].type === \"viewFromRelation\") {\n\t\t\t\t\t\t\treturnObject.isView = true;\n\t\t\t\t\t\t\treturnObject.data = fastCopy(resolvedCurrentView.data[0][selectedDataName]);\n\t\t\t\t\t\t} else if (contentData.defaultRecordView.sidebar.items[i].type === \"list\") {\n\t\t\t\t\t\t\treturnObject.isView = false;\n\t\t\t\t\t\t\treturnObject.data = fastCopy(resolvedCurrentView.data[0][selectedDataName]);\n\t\t\t\t\t\t} else if (contentData.defaultRecordView.sidebar.items[i].type === \"listFromRelation\") {\n\t\t\t\t\t\t\treturnObject.isView = false;\n\t\t\t\t\t\t\treturnObject.data = fastCopy(resolvedCurrentView.data[0][selectedDataName]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn returnObject;\n\t\t}", "extractFields(fields) {\n\t\treturn fields.map(field => (\n\t\t\t<div key={`div_${field.id}`} id={field.id}>\n\t\t\t\t<Field\n\t\t\t\t\tkey={field.id}\n\t\t\t\t\tvalue={field}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t));\n\t}", "function newMeta(x) {\r\n var id = x.id;\r\n var ethnicity = x.ethnicity;\r\n var gender = x.gender;\r\n var age = x.age;\r\n var location = x.location;\r\n}", "function createInfoPanel() {\n return new Ext.Panel({\n border: true,\n id: 'infoPanel',\n baseCls: 'md-info',\n autoWidth: true,\n contentEl: 'infoContent',\n autoLoad: {\n url: '../../apps/search/home_' + catalogue.LANG + '.html',\n callback: loadCallback,\n scope: this,\n loadScripts: false\n }\n });\n }", "function parse_hpsm_fields() {\n var arr = document.querySelectorAll(\".x-tab-panel-body .x-panel.x-panel-noborder\");\n for (var i=0; i < arr.length; i++) {\n if(arr[i].id.substring(0, 3) == \"ext\") {\n if(arr[i].className.indexOf('x-hide-nosize') == -1){\n var arr2 = arr[i].querySelectorAll(\"iframe.ux-mif\");\n if(arr2.length === 1) {\n var doc = arr2[0].contentWindow.document;\n console.log(doc);\n var fields = {}, listButtons = {}, unknownButtons = {}, findButtons = {}, fillButtons = {}, actionButtons = {}, labels = {};\n\n labels[\"interactionId\"] = $('label:contains(\"Interaction ID\")', doc).first();\n labels[\"status\"] = $('label:contains(\"Status\")', doc).first();\n labels[\"helpdesk\"] = $('label:contains(\"Helpdesk\")', doc).first();\n labels[\"contact\"] = $('label:contains(\"Contact\")', doc).first();\n labels[\"contactEmail\"] = $('label:contains(\"Contact email\")', doc).first();\n labels[\"title\"] = $('label:contains(\"Title\")', doc).first();\n labels[\"endUser\"] = $('label:contains(\"End user\")', doc).first();\n labels[\"endUserDept\"] = $('label:contains(\"End user dept.\")', doc).first();\n labels[\"description\"] = $('label:contains(\"Description\")', doc).first();\n labels[\"category\"] = $('label:contains(\"Category\")', doc).first();\n labels[\"subcategory\"] = $('label:contains(\"Subcategory\")', doc).first();\n labels[\"service\"] = $('label:contains(\"Service\")', doc).first();\n labels[\"impact\"] = $('label:contains(\"Impact\")', doc).first();\n labels[\"urgency\"] = $('label:contains(\"Urgency\")', doc).first();\n labels[\"priority\"] = $('label:contains(\"Priority\")', doc).first();\n labels[\"assignmentGroup\"] = $('label:contains(\"Assignment group\")', doc).first();\n labels[\"assignee\"] = $('label:contains(\"Assignee\")', doc).first();\n labels[\"targetDate\"] = $('label:contains(\"SLA target date\")', doc).first();\n labels[\"newUpdate\"] = $('label:contains(\"New update\")', doc).first();\n labels[\"closureCode\"] = $('label:contains(\"Closure code\")', doc).first();\n labels[\"solution\"] = $('label:contains(\"Solution\")', doc).first();\n\n fields[\"interactionId\"] = $(\"#\"+labels[\"interactionId\"].attr(\"for\"), doc);\n fields[\"status\"] = $(\"#\"+labels[\"status\"].attr(\"for\"), doc);\n fields[\"helpdesk\"] = $(\"#\"+labels[\"helpdesk\"].attr(\"for\"), doc);\n fields[\"contact\"] = $(\"#\"+labels[\"contact\"].attr(\"for\"), doc);\n fields[\"contactEmail\"] = $(\"#\"+labels[\"contactEmail\"].attr(\"for\"), doc);\n fields[\"title\"] = $(\"#\"+labels[\"title\"].attr(\"for\"), doc);\n fields[\"endUser\"] = $(\"#\"+labels[\"endUser\"].attr(\"for\"), doc);\n fields[\"endUserDept\"] = $(\"#\"+labels[\"endUserDept\"].attr(\"for\"), doc);\n fields[\"description\"] = $(\"#\"+labels[\"description\"].attr(\"for\"), doc);\n fields[\"category\"] = $(\"#\"+labels[\"category\"].attr(\"for\"), doc);\n fields[\"subcategory\"] = $(\"#\"+labels[\"subcategory\"].attr(\"for\"), doc);\n fields[\"service\"] = $(\"#\"+labels[\"service\"].attr(\"for\"), doc);\n fields[\"impact\"] = $(\"#\"+labels[\"impact\"].attr(\"for\"), doc);\n fields[\"urgency\"] = $(\"#\"+labels[\"urgency\"].attr(\"for\"), doc);\n fields[\"priority\"] = $(\"#\"+labels[\"priority\"].attr(\"for\"), doc);\n fields[\"assignmentGroup\"] = $(\"#\"+labels[\"assignmentGroup\"].attr(\"for\"), doc);\n fields[\"assignee\"] = $(\"#\"+labels[\"assignee\"].attr(\"for\"), doc);\n // fields[\"assigneeFull\"] = $( \"#X\" + (parseInt(labels[\"assignee\"].attr(\"for\").replace(\"X\", \"\")) + 1), doc );\n fields[\"targetDate\"] = $(\"#\"+labels[\"targetDate\"].attr(\"for\"), doc);\n fields[\"newUpdate\"] = $(\"#\"+labels[\"newUpdate\"].attr(\"for\"), doc);\n fields[\"closureCode\"] = $(\"#\"+labels[\"closureCode\"].attr(\"for\"), doc);\n fields[\"solution\"] = $(\"#\"+labels[\"solution\"].attr(\"for\"), doc);\n\n listButtons[\"status\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"Button\", doc);\n listButtons[\"helpdesk\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"Button\", doc);\n listButtons[\"impact\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"Button\", doc);\n\n unknownButtons[\"contact\"] = $( \"#X\" + (parseInt(labels[\"contact\"].attr(\"for\").replace(\"X\", \"\")) + 1), doc );\n unknownButtons[\"endUser\"] = $( \"#X\" + (parseInt(labels[\"endUser\"].attr(\"for\").replace(\"X\", \"\")) + 1), doc );\n unknownButtons[\"service\"] = $( \"#X\" + (parseInt(labels[\"service\"].attr(\"for\").replace(\"X\", \"\")) + 1), doc );\n\n findButtons[\"service\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FindButton\", doc);\n\n fillButtons[\"contact\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"endUser\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"category\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"subcategory\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"service\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"assignmentGroup\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"assignee\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"closureCode\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n\n actionButtons[\"markAsSpam\"] = $('button:contains(\"Mark as SPAM\")', doc);\n actionButtons[\"newEmail\"] = $('button:contains(\"New Email\")', doc);\n actionButtons[\"fullCaseflow\"] = $('button:contains(Full Case Flow)', doc);\n actionButtons[\"refreshHistory\"] = $('button:contains(Refresh History)', doc);\n\n var parsed = {}\n parsed[\"fields\"] = fields;\n parsed[\"listButtons\"] = listButtons;\n parsed[\"unknownButtons\"] = unknownButtons;\n parsed[\"findButtons\"] = findButtons;\n parsed[\"fillButtons\"] = fillButtons;\n parsed[\"actionButtons\"] = actionButtons;\n //console.log(parsed);\n return parsed;\n }\n }\n }\n }\n}", "function loadInUI(currentNode, parent) {\r\n\t \r\n\t // number of Field Tags at current level\r\n\t\t\tvar count = currentNode.length;\r\n\t\r\n\t\t\tfor( var i = 0 ; i < count ; i++ ) {\r\n\t\r\n\t // To store ith Field Tag object at current level\r\n\t\t\t\tvar content = null;\r\n\t\t\t\tvar tagType ;\r\n\t\t\t\tvar name , type ,xPath ,comment, customAtt;\r\n\t\r\n\t // Identify Type of Field Tag object \r\n\t\t\t\tif(currentNode[i][\"scalar\"]!=undefined) \r\n\t {\r\n\t\t\t\t\tcontent = currentNode[i][\"scalar\"];\r\n\t\t\t\t\ttagType = \"Scalar\";\r\n\t\t\t\t} \r\n\t else if(currentNode[i][\"collection\"]!=undefined)\r\n\t {\r\n\t\t\t\t\tcontent = currentNode[i][\"collection\"];\r\n\t\t\t\t\ttagType = \"Collection\";\r\n\t\t\t\t} \r\n\t else if(currentNode[i][\"composite\"]!=undefined) \r\n\t {\r\n\t\t\t\t\tcontent = currentNode[i][\"composite\"];\r\n\t\t\t\t\ttagType = \"Composite\";\r\n\t\t\t\t} \r\n\t else \r\n\t {\n\t \t//alert(JSON.stringify(currentNode[i]));\r\n\t\t\t\t\talert(\"Invalid Object - Unable to load in UI\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\r\n\t // Every one is identified by an ID which is set to Timestamp at which it is created.\r\n\t // Getting current timestamp\r\n\t\t\t\tvar currentID = new Date();\r\n\t\r\n\t // Fill in all standard field attributes is they exists\r\n\t\t\t\tname = content[\"name\"];\r\n\t\t\t\txPath = content[\"xpath\"]==undefined ? \"\" : content[\"xpath\"];\r\n\t\t\t\tcomment = content[\"comment\"]==undefined ? \"\" : content[\"comment\"];\r\n\t\n\t\t\t\tif(content[\"scalar_type\"] != undefined)\n\t\t\t\t{\n\t\t\t\t\ttype = content[\"scalar_type\"];\n\t\t\t\t}\n\t\t\t\telse if(content[\"child_type\"] != undefined)\n\t\t\t\t{\n\t\t\t\t\ttype = content[\"child_type\"];\n\t\t\t\t}\n\t\t\t\telse if(content[\"type\"] != undefined)\n\t\t\t\t{\n\t\t\t\t\ttype = content[\"type\"];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttype = \"\";\n\t\t\t\t}\n\t\t\t\t\r\n\t // Check existance of custom attributes using global list object customAttributeData\r\n\t\t\t\tcustomAtt = loadCustomAttributes(content);\r\n\t\r\n\t // Add node with all required field. true as 3rd parameter helps in identifying call type. \r\n\t\t\t\tAddNode(name,parent,true,type,xPath,comment,tagType,customAtt,currentID);\r\n\t\r\n\t // If ith Field Tag has kids then make a recursive call for all kids of ith Field tag.\r\n\t\t\t\tif(content[\"kids\"]!=undefined)\r\n\t {\r\n\t\t\t\t\tcurrentID = currentID.getTime();\r\n\t // Calling recursively by incrementing level and ID for parent.\t\t\t\r\n\t \tloadInUI(content[\"kids\"],currentID);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t}", "function LoadSectionProperty(obj, newTab) {\n CurrentTab = newTab;\n SetChangeItem4Section(obj);\n\n if (obj.type != 16) {\n var pgSection = new Ext.grid.PropertyGrid({\n closable: true,\n autoHeight: true,\n id: 'pgSectionProperty',\n customEditors: {\n 'Default Label': new Ext.grid.GridEditor(new Ext.form.Field({ readOnly: true })),\n 'Admin_FieldProperty_DefaultInstructions': new Ext.grid.GridEditor(new Ext.form.Field({ readOnly: true }))\n },\n listeners: {\n propertychange: function (source, recordId, value, oldValue) {\n if (recordId == 'Admin_FieldProperty_Licensee_CollapseText') {\n var chk = true;\n if (value != '') {\n var pat = /^\\d+$/;\n chk = pat.test(value);\n\n //&& Math.floor(value) != NaN\n if (!chk) {\n pgSection.store.getById('Admin_FieldProperty_Licensee_CollapseText').set('value', Math.floor(value));\n }\n }\n\n if (chk && typeof oldValue != 'undefined' && oldValue != value) {\n var sectionids = obj._sectionIdValue.split(Ext.Const.SplitChar);\n sectionids[3] = value;\n var sectionidstring = \"\";\n for (var i = 0; i < sectionids.length; i++) {\n sectionidstring += sectionids[i] + Ext.Const.SplitChar;\n }\n obj._sectionIdValue = sectionidstring.substring(0, sectionidstring.length - 1);\n var changeItem1 = new CollapseLineObj(Ext.Const.OpenedId, obj._id, value);\n changeItems.UpdateItem(12, changeItem1);\n ModifyMark();\n }\n }\n else if (recordId == 'Admin_SectionProperty_Editable') {\n if (value != '') {\n pgSection.store.getById('Admin_SectionProperty_Editable').set('value', value);\n }\n\n if (typeof oldValue != 'undefined' && oldValue != value) {\n var sectionids = obj._sectionIdValue.split(Ext.Const.SplitChar);\n sectionids[3] = value;\n var sectionidstring = \"\";\n for (var i = 0; i < sectionids.length; i++) {\n sectionidstring += sectionids[i] + Ext.Const.SplitChar;\n }\n obj._sectionIdValue = sectionidstring.substring(0, sectionidstring.length - 1);\n changeItem = new SectionEditableObj(Ext.Const.OpenedId, obj._id, value);\n changeItems.UpdateItem(13, changeItem);\n ModifyMark();\n }\n }\n else {\n if (oldValue != null && oldValue != '') {\n if (recordId == 'Admin_SectionProperty_SectionHeading') {\n SetSectionLabel(obj, EncodeHTMLTag(value));\n }\n\n if (oldValue != value) {\n changeItem.Label = value;\n changeItems.UpdateItem(4, changeItem);\n ModifyMark();\n }\n }\n }\n },\n beforeedit: function (e) {\n DisabledDropDownButtons(true);\n var record = e.grid.store.getAt(e.row);\n var cell = e.grid.getBox();\n if (record.id == 'Section Instructions') {\n e.cancel = true;\n if (!isWinShow) {\n PopupHtmlEditor(e.grid, obj._getSubLabel());\n htmlEditorTargetCtrl = obj;\n htmlEditorTargetType = htmlEditorTargetTypes.Section;\n }\n }\n else if (record.id == 'Admin_SectionProperty_ContactTypeLevel_Editable') {\n e.cancel = true;\n //Clear the previous showType value.\n showType = 0;\n RenderContactTypeEditableControl();\n\n SetFormWinPosition(cell);\n newFormWin.setTitle('Contact Type Editable');\n newFormWin.show();\n isDDLWinShow = true;\n }\n },\n cellclick: function (grid, rowIndex, columnIndex, e) {\n DisabledHtmlEditorButtons(true);\n }\n }\n });\n\n var viewId = obj._sectionIdValue.split(Ext.Const.SplitChar)[1];\n pgSection.customEditors[Ext.LabelKey.Admin_SectionProperty_Editable] = new BoolComboBoxGridEditor();\n\n pgSection.store.sortInfo = null;\n if (obj._labelKeyValue == \"per_licensee_generalinfo_section_title\") {\n pgSection.setSource({\n 'Default Label': '',\n 'Admin_SectionProperty_SectionHeading': '',\n 'Section Instructions': Ext.LabelKey.Admin_ClickToEdit_Watermark,\n 'Admin_FieldProperty_Licensee_CollapseText': obj._sectionIdValue.split(Ext.Const.SplitChar)[3]\n });\n }\n else if (obj.get_ElementType() == 'AccelaLabel' && obj.get_LabelType() == 41) {\n //FieldSet title\n pgSection.setSource({\n 'Default Label': '',\n 'Admin_SectionProperty_SectionHeading': ''\n });\n }\n else if (obj.get_ElementType() == 'AccelaLabel' && obj.get_LabelType() == 42) {\n var editable = '';\n var sectionIds = obj._sectionIdValue.split(Ext.Const.SplitChar);\n\n if (sectionIds.length == 4) {\n editable = sectionIds[3];\n }\n\n pgSection.setSource({\n 'Default Label': '',\n 'Admin_SectionProperty_SectionHeading': '',\n 'Section Instructions': Ext.LabelKey.Admin_ClickToEdit_Watermark,\n 'Admin_SectionProperty_Editable': editable\n });\n\n pgSection.store.getById('Admin_SectionProperty_Editable').set('name', Ext.LabelKey.Admin_SectionProperty_Editable);\n }\n else if (obj.get_ElementType() == 'AccelaRadioButton' && obj.get_LabelType() == 50) {\n pgSection.setSource({\n 'Default Label': '',\n 'Admin_SectionProperty_SectionHeading': ''\n });\n }\n else if (viewId == \"60142\") {\n pgSection.setSource({\n 'Default Label': '',\n 'Admin_SectionProperty_SectionHeading': '',\n 'Section Instructions': Ext.LabelKey.Admin_ClickToEdit_Watermark,\n 'Admin_SectionProperty_ContactTypeLevel_Editable': Ext.LabelKey.Admin_ClickToEdit_Watermark\n });\n\n pgSection.store.getById('Admin_SectionProperty_ContactTypeLevel_Editable').set('name', Ext.LabelKey.Admin_SectionProperty_Editable);\n }\n else {\n pgSection.setSource({\n 'Default Label': '',\n 'Admin_SectionProperty_SectionHeading': '',\n 'Section Instructions': Ext.LabelKey.Admin_ClickToEdit_Watermark\n });\n }\n\n pgSection.getColumnModel().setConfig([\n { header: 'Name', sortable: false, dataIndex: 'name', id: 'name' },\n { header: 'Value', sortable: false, dataIndex: 'value', id: 'value' }\n ]);\n\n RenderGrid(1, pgSection);\n\n needSave = true;\n \n //GetLabelKey\n pgSection.store.getById('Admin_SectionProperty_SectionHeading').set('name', Ext.LabelKey.Admin_SectionProperty_SectionHeading);\n if (obj._labelKeyValue == \"per_licensee_generalinfo_section_title\") {\n pgSection.store.getById('Admin_FieldProperty_Licensee_CollapseText').set('name', Ext.LabelKey.Admin_FieldProperty_Licensee_CollapseLine);\n }\n\n //GetValue\n pgSection.store.getById('Default Label').set('value', obj._defaultLabelValue);\n pgSection.store.getById('Admin_SectionProperty_SectionHeading').set('value', GetSectionLabel(obj));\n }\n}", "constructor(structure, viewer, params) {\n super(structure, viewer, params);\n this.n = 0; // Subclass create sets value\n this.parameters = Object.assign({\n labelVisible: {\n type: 'boolean'\n },\n labelSize: {\n type: 'number', precision: 3, max: 10.0, min: 0.001\n },\n labelColor: {\n type: 'color'\n },\n labelFontFamily: {\n type: 'select',\n options: {\n 'sans-serif': 'sans-serif',\n 'monospace': 'monospace',\n 'serif': 'serif'\n },\n buffer: 'fontFamily'\n },\n labelFontStyle: {\n type: 'select',\n options: {\n 'normal': 'normal',\n 'italic': 'italic'\n },\n buffer: 'fontStyle'\n },\n labelFontWeight: {\n type: 'select',\n options: {\n 'normal': 'normal',\n 'bold': 'bold'\n },\n buffer: 'fontWeight'\n },\n labelsdf: {\n type: 'boolean', buffer: 'sdf'\n },\n labelXOffset: {\n type: 'number', precision: 1, max: 20, min: -20, buffer: 'xOffset'\n },\n labelYOffset: {\n type: 'number', precision: 1, max: 20, min: -20, buffer: 'yOffset'\n },\n labelZOffset: {\n type: 'number', precision: 1, max: 20, min: -20, buffer: 'zOffset'\n },\n labelAttachment: {\n type: 'select',\n options: {\n 'bottom-left': 'bottom-left',\n 'bottom-center': 'bottom-center',\n 'bottom-right': 'bottom-right',\n 'middle-left': 'middle-left',\n 'middle-center': 'middle-center',\n 'middle-right': 'middle-right',\n 'top-left': 'top-left',\n 'top-center': 'top-center',\n 'top-right': 'top-right'\n },\n rebuild: true\n },\n labelBorder: {\n type: 'boolean', buffer: 'showBorder'\n },\n labelBorderColor: {\n type: 'color', buffer: 'borderColor'\n },\n labelBorderWidth: {\n type: 'number', precision: 2, max: 0.3, min: 0, buffer: 'borderWidth'\n },\n labelBackground: {\n type: 'boolean', rebuild: true\n },\n labelBackgroundColor: {\n type: 'color', buffer: 'backgroundColor'\n },\n labelBackgroundMargin: {\n type: 'number', precision: 2, max: 2, min: 0, rebuild: true\n },\n labelBackgroundOpacity: {\n type: 'range', step: 0.01, max: 1, min: 0, buffer: 'backgroundOpacity'\n },\n labelFixedSize: {\n type: 'boolean', buffer: 'fixedSize'\n },\n lineOpacity: {\n type: 'range', min: 0.0, max: 1.0, step: 0.01\n },\n linewidth: {\n type: 'integer', max: 50, min: 1, buffer: true\n }\n }, this.parameters, {\n flatShaded: null\n });\n }", "_mapFieldsToMenu() {\n const that = this;\n\n if (!that.fields && !that._valueFields) {\n return;\n }\n\n that._fields = (that.fields || that._valueFields).map(field => {\n let menuField = {};\n\n menuField.label = field.label;\n menuField.value = field.dataField;\n menuField.dataType = field.dataType;\n\n return menuField;\n });\n }", "function customize_repeater_single_field() {\n var $control = $(this).parents('#customize-control-slider_pages');\n customize_repeater_write($control);\n }", "static fields () {\n return {\n id: this.increment(),\n label: this.attr(''),\n value: this.attr(''),\n type: this.attr(''),\n }\n }", "prepareMetadata_() {\n if (this.jekyllMetadata.iconId) {\n this.jekyllMetadata.icon_id = this.jekyllMetadata.iconId;\n }\n }", "function updatePanel() {\n var panelDiv = document.getElementById(\"panel\");\n panelDiv.style.textAlign = \"center\";\n // title\n var titleElement = document.createElement(\"h2\");\n titleElement.innerText = title;\n panelDiv.appendChild(titleElement);\n // description\n var descriptionElement = document.createElement(\"div\");\n descriptionElement.style.paddingBottom = \"10px\";\n descriptionElement.innerText = appDescription;\n panelDiv.appendChild(descriptionElement);\n // attribute field select\n var selectElement = createSelect(variables);\n panelDiv.appendChild(selectElement);\n view.ui.add(panelDiv, \"bottom-left\");\n selectElement.addEventListener(\"change\", selectVariable);\n // generate the renderer for the first selected attribute\n selectVariable();\n }", "function ContentMetadataDisplay(props) {\n return (_jsx(Grid, Object.assign({ container: true, spacing: props.spacing }, { children: props.metadataTypes.map(metadataType => {\n var _a, _b, _c, _d, _e;\n return (_jsx(Grid, Object.assign({ item: true, xs: (_a = props.width) !== null && _a !== void 0 ? _a : 12, style: { marginBottom: (_b = props.mb) !== null && _b !== void 0 ? _b : '10px' } }, { children: _jsx(ContentTagger, Object.assign({}, props.actions, { metadataType: metadataType, selected: (_c = props.metadata[metadataType.id]) !== null && _c !== void 0 ? _c : [], toAdd: (_d = props.toAdd) === null || _d === void 0 ? void 0 : _d[metadataType.id], options: (_e = props.options[metadataType.id]) !== null && _e !== void 0 ? _e : [], label: metadataType.name }), void 0) }), metadataType.id));\n }) }), void 0));\n}", "function createMetaData(){\n var title = document.getElementById(\"title\").value;\n var composer = document.getElementById(\"composer\").value;\n var author = document.getElementById(\"author\").value;\n var availability = document.getElementById(\"availability\").value;\n var comment = document.getElementById(\"comment\").value;\n \n metaData = new MetaData(title, composer, author, availability, comment);\n \n document.getElementById(\"input\").innerHTML = sourceForm();\n document.getElementById(\"meiOutput\").value = createMEIOutput();\n}", "function fill_with_test_metadata() {\n set_proj_meta_inputs(proj_form, test_proj_inputs);\n set_common_meta_inputs(common_form, test_common_inputs);\n\n for (var name in test_samples_inputs) {\n var test_sample_inputs = test_samples_inputs[name];\n var sample_form = sample_forms[names_to_ids[name]];\n\n set_sample_meta_inputs(sample_form, test_sample_inputs);\n }\n}", "function _addDetail() {\n for (var i = 0; i < vm.items.length; i++) {\n vm.items[i].actions = [{\n label: vm.items[i].description\n }];\n vm.items[i].startsAt = new Date(vm.items[i].startsAt); //as per requirement of bootstrap calendar\n vm.items[i].endsAt = new Date(vm.items[i].endsAt); //as per requirement of bootstrap calendar\n }\n }", "additionalContent() {\n let info = this.state.data.info;\n return (\n <div key=\"inside_components\" id=\"inside-contents\"> \n <City key={guidGenerator()} name={info.current_observation.display_location.full} />\n <InfoBox key=\"infoBoxDiv\" data_obv={info.current_observation} metricState={this.state.metric} />\n </div>\n )\n }", "function set_proj_meta_input() {\n proj_form = $('#proj');\n\n // Set the project id header\n var html = proj_form.html();\n proj_form.html(html.replace(new RegExp('PROJECT_ID', 'g'), proj_id));\n\n // Set up contributors.\n var contributors_group = proj_form.find('.proj_contributors_group');\n var contributors_div = contributors_group.children('.contributors_inputs');\n set_contributors(contributors_div);\n\n // Set up Factor 1 name and values.\n var factor_card = proj_form.find('.factor_card');\n set_factor(factor_card);\n\n // Enable experimental design.\n var design_group = proj_form.find('.proj_experimental_design_group');\n var design_inputs = design_group.children('.experimental_design_inputs');\n var factor_hide_radio = design_group.find('#proj_design_1_radio');\n var factor_show_radio = design_group.find('#proj_design_2_radio');\n var div_to_toggle = factor_card.clone(true);\n div_to_toggle.children('h6').text('Contrast Factor 2');\n div_to_toggle.addClass('collapse');\n design_inputs.append(div_to_toggle);\n set_radio_collapse_toggle(factor_hide_radio, factor_show_radio, div_to_toggle);\n\n // Then, we must also set up listeners to show/hide appropriate factor 1\n // and factor 2 information for each sample.\n set_factor_to_sample_listeners(factor_hide_radio, factor_show_radio, design_inputs);\n\n proj_form.find('.save_btn').click(function () {\n var btn = $(this);\n\n // Disable this button.\n btn.prop('disabled', true);\n\n // Function to show next form.\n function show_next_form() {\n var header = $('#sample_meta_header');\n header.show();\n $('#sample_meta_common').show();\n scroll_to_ele(header);\n }\n\n save_proj(show_saved, btn, show_next_form);\n });\n\n // Disable 2-factor design if there are less than 8 samples.\n if (Object.keys(proj.samples).length < 8) {\n factor_show_radio.prop('disabled', true);\n }\n\n // Enable popovers and tooltips.\n enable_popovers_tooltips(proj_form);\n}", "_schemaChanged() {\n //make sure the content is there first\n setTimeout(() => {\n let itemLabel = this.schema.items.itemLabel;\n if (this.schema && Array.isArray(this.schema.value)) {\n this.schema.value.forEach(val => {\n this.push(\"__headings\", val[itemLabel]);\n });\n }\n this.shadowRoot.querySelectorAll(\".item-fields\").forEach(item => {\n let index = item.getAttribute(\"data-index\"),\n propertyName = `${this.propertyPrefix}${this.propertyName}`,\n prefix = `${propertyName}.${index}`,\n //path = `${propertyName}.properties.${index}`,\n val = this.schema.value[index];\n //for each array item, request the fields frrom eco-json-schema-object\n this.dispatchEvent(\n new CustomEvent(\"build-fieldset\", {\n bubbles: false,\n cancelable: true,\n composed: true,\n detail: {\n container: item,\n path: propertyName,\n prefix: prefix,\n properties: this.schema.properties.map(prop => {\n let newprop = JSON.parse(JSON.stringify(prop));\n newprop.value = val[prop.name];\n return newprop;\n }),\n type: EcoJsonSchemaArray.tag,\n value: this.schema.value || []\n }\n })\n );\n });\n }, 0);\n }", "@wire(getObjectInfo, { objectApiName: '$objName' })\n getObjMetadata( { data }){\n if (data) {\n const items =[];\n\n for (const field in data.fields) {\n if (data.fields.hasOwnProperty(field)) {\n let fieldLabel = data.fields[field].label;\n let fieldAPI = data.fields[field].apiName;\n //Constructing label value pair for multiselect picklist\n items.push({label: fieldLabel,\n value: fieldAPI});\n \n }\n }\n \n this.options.push(...items);\n \n }\n }", "function MetaData(props, state) {\n var _this = this;\n _super.call(this, props, state);\n this.isShowMore = undefined;\n this.isFloating = false;\n this.prevPageY = 0;\n this.allowUp = false;\n this.allowDown = false;\n /**\n * handler for scroll and wheel - to prevent the event propagation to stop the scroll of\n */\n this.onScroll = function (event) {\n event.stopPropagation();\n };\n /**\n * handler for Mousewheel event of popout content - to prevent the scroll propagation to filelist panel.\n */\n this.onMousewheel = function (event) {\n if ((htmlUtilities.isIE || htmlUtilities.isEdge) && _this.props.isSelected !== true\n && _this.props.isFilelistPanelCollapsed !== true) {\n var height = _this.refs.metaData.clientHeight;\n var scrollHeight = _this.refs.metaData.scrollHeight;\n var scrollTop = _this.refs.metaData.scrollTop;\n if (((scrollTop === (scrollHeight - height) && event.deltaY > 0)\n || (scrollTop === 0 && event.deltaY < 0))) {\n event.preventDefault();\n }\n }\n };\n /**\n * returns the show more or less JSX element\n */\n this.showMoreLessElement = function () {\n var showMoreLessElement = null;\n if (_this.isShowMore !== undefined) {\n showMoreLessElement =\n React.createElement(\"a\", {href: 'javascript:void(0);', className: classNames('meta-change-view ', { 'fixed': (_this.isFloating && (_this.isShowMore === false)) }), onClick: _this.onShowMoreLessClick, id: 'showmorelessbutton'}, (_this.isShowMore === true) ?\n localeStore.instance.TranslateText('marking.response.ecoursework-file-browser.show-more-metadata') :\n localeStore.instance.TranslateText('marking.response.ecoursework-file-browser.show-less-metadata'));\n }\n return showMoreLessElement;\n };\n /**\n * click event handler of show more or less button .\n */\n this.onShowMoreLessClick = function () {\n _this.isShowMore = !_this.isShowMore;\n _this.isFloating = false;\n _this.setState({ renderedOn: Date.now() });\n };\n /**\n * event handler for touch start\n */\n this.onTouchStart = function (event) {\n _this.prevPageY = (event.changedTouches) ? event.changedTouches[0].pageY : 0;\n // TODO: find an alterantive to avoid document.getElementById\n var content = document.getElementById('File_List');\n _this.allowUp = (content.scrollTop > 0);\n _this.allowDown = (content.scrollTop <= content.scrollHeight - content.clientHeight);\n };\n /**\n * event handler for touch move\n */\n this.onTouchMove = function (event) {\n event.preventDefault();\n // TODO: find an alterantive to avoid document.getElementById\n var content = document.getElementById('File_List');\n var pageY = event.changedTouches[0].pageY;\n var up = (pageY > _this.prevPageY);\n var down = (pageY < _this.prevPageY);\n var diff = Math.abs(_this.prevPageY - event.pageY);\n _this.prevPageY = event.pageY;\n if ((up && _this.allowUp)) {\n content.scrollTop = (content.scrollTop - diff);\n }\n else if (down && _this.allowDown) {\n content.scrollTop = (content.scrollTop + diff);\n }\n };\n /**\n * event handler for touch end\n */\n this.onTouchEnd = function (event) {\n _this.prevPageY = 0;\n };\n /**\n * to show the Show more or less buttons based on the content size.\n */\n this.showMoreOrLessButtton = function () {\n var timeOut;\n if (_this.props.isSelected === true && eCourseWorkFileStore.instance.fileListPanelCurrentView === enums.FileListPanelView.List) {\n if (_this.refs.metaData) {\n /* this is to reset the top of metadata div even after scrolling the popout of the same */\n _this.refs.metaData.scrollTop = 0;\n }\n if (htmlUtilities.isAndroidDevice || htmlUtilities.isEdge) {\n timeOut = 0;\n }\n else {\n timeOut = constants.GENERIC_ANIMATION_TIMEOUT;\n }\n setTimeout(function () {\n var that = _this;\n var scrollValue = (that.refs.metaViewControl) ? (that.refs.metaViewControl.getBoundingClientRect().top) : undefined;\n var _isFloating = that.isFloating;\n var _isShowMore = that.isShowMore;\n var metadatTop = (that.refs.metaData) ? that.refs.metaData.getBoundingClientRect().top : 0;\n var windowHeight = window.innerHeight;\n /* Conditions for displaying the floating show less button. (Based on the scrolling) */\n if (scrollValue > windowHeight && windowHeight > metadatTop) {\n that.isFloating = true;\n }\n else {\n that.isFloating = false;\n }\n var containerHeight = (that.refs.metaData) ? that.refs.metaData.clientHeight : 0;\n var innerHeight = (that.refs.metaDataInner) ? that.refs.metaDataInner.clientHeight : 0;\n /* Conditions for displaying the show more button based on the meta data content size.*/\n if (innerHeight > containerHeight && that.isShowMore === undefined) {\n that.isShowMore = true;\n }\n /* Defect Fix : #57280 , Added condition for rechecking the display of showmore link after resizing the window*/\n if (innerHeight === containerHeight && that.isShowMore === true) {\n that.isShowMore = undefined;\n }\n /* re rendering if floating or show more options changed - Using private variables for these to avoid mutating of state\n in will receive props*/\n if (_isFloating !== that.isFloating || _isShowMore !== that.isShowMore) {\n that.setState({ renderedOn: Date.now() });\n }\n }, timeOut);\n }\n };\n this.state = {\n renderedOn: Date.now()\n };\n this.showMoreOrLessButtton = this.showMoreOrLessButtton.bind(this);\n }", "addStaticFields() {\n if (Config.slavesEnabled) {\n let device = Cache.findPortSlaveDevice(this.getPortId())\n let attrs = device ? device.attrs : Cache.getMainDevice()\n let displayName = attrs.display_name || attrs.name\n let path\n if (device) {\n path = ['devices', `~${device.name}`]\n }\n else {\n path = ['settings']\n }\n\n this.addField(1, new PushButtonField({\n name: 'device',\n label: gettext('Device'),\n caption: displayName,\n style: 'interactive',\n icon: new StockIcon({name: 'device', stockName: 'qtoggle'}),\n description: gettext('Device to which the port belongs.'),\n onClick(form) {\n Navigation.navigate({path: path})\n }\n }))\n }\n }", "function showConfiguration(panel,type,extraData){\n $(\"#settings\").remove();\n $(\"#widgets\").slideUp(\"slow\");\n $(\"#companies\").slideUp(\"slow\");\n if($(\"#companiesList\").length!=0){\n $(\"#companiesList\").html(\"\")\n \n }\n\n var aux=$(\"#currentCreation\").length\n if(aux!=0){\n deleteCreation(numWidget)\n numWidget--\n }\n aux=$(\"#currentSettings\").length\n if(aux!=0){\n $(\"#currentSettings\").remove()\n }\n var color=($(\"#panel\"+panel).css('background-color'));\n var objectPanel=GetPanel(panel);\n numWidget++;\n\n if(type==\"HighInfo\"){\n var widget= new HighInfo(numWidget,panel,color,extraData,actualReadingData[extraData]);\n \n }else if(type==\"HighDemo\"){\n var widget= new HighDemo(numWidget,panel,color,extraData);\n \n }else if(type==\"HighTime\"){\n\n var widget= new HighTime(numWidget,panel,color,extraData,actualReadingData[extraData]);\n \n }else if(type==\"VideoWidget\"){\n var widget= new VideoWidget(numWidget,panel,color)\n\n }else if(type==\"HtmlInfoWidget\"){\n var widget= new HtmlInfoWidget(numWidget,panel,color,extraData,actualReadingData[extraData])\n\n }\n\n objectPanel.pushElement(widget)\n $(\"#making\").slideDown(\"slow\")\n widget.makeMenu()\n}", "function emblContentMetaProperties_Read() {\n var metaProperties = {};\n // <!-- Content descriptors -->\n // <meta name=\"embl:who\" content=\"{{ meta-who }}\"> <!-- the people, groups and teams involved -->\n // <meta name=\"embl:what\" content=\"{{ meta-what }}\"> <!-- the activities covered -->\n // <meta name=\"embl:where\" content=\"{{ meta-where }}\"> <!-- at which EMBL sites the content applies -->\n // <meta name=\"embl:active\" content=\"{{ meta-active }}\"> <!-- which of the who/what/where is active -->\n metaProperties.who = metaProperties.who || document.querySelector(\"meta[name='embl:who']\");\n metaProperties.what = metaProperties.what || document.querySelector(\"meta[name='embl:what']\");\n metaProperties.where = metaProperties.where || document.querySelector(\"meta[name='embl:where']\");\n metaProperties.active = metaProperties.active || document.querySelector(\"meta[name='embl:active']\");\n\n // <!-- Content role -->\n // <meta name=\"embl:utility\" content=\"-8\"> <!-- if content is task and work based or if is meant to inspire -->\n // <meta name=\"embl:reach\" content=\"-5\"> <!-- if content is externally (public) or internally focused (those that work at EMBL) -->\n metaProperties.utility = metaProperties.utility || document.querySelector(\"meta[name='embl:utility']\");\n metaProperties.reach = metaProperties.reach || document.querySelector(\"meta[name='embl:reach']\");\n\n // <!-- Page infromation -->\n // <meta name=\"embl:maintainer\" content=\"{{ meta-maintainer }}\"> <!-- the contact person or group responsible for the page -->\n // <meta name=\"embl:last-review\" content=\"{{ meta-last-review }}\"> <!-- the last time the page was reviewed or updated -->\n // <meta name=\"embl:review-cycle\" content=\"{{ meta-review-cycle }}\"> <!-- how long in days before the page should be checked -->\n // <meta name=\"embl:expiry\" content=\"{{ meta-expiry }}\"> <!-- if there is a fixed point in time when the page is no longer relevant -->\n metaProperties.maintainer = metaProperties.maintainer || document.querySelector(\"meta[name='embl:maintainer']\");\n metaProperties.lastReview = metaProperties.lastReview || document.querySelector(\"meta[name='embl:last-review']\");\n metaProperties.reviewCycle = metaProperties.reviewCycle || document.querySelector(\"meta[name='embl:review-cycle']\");\n metaProperties.expiry = metaProperties.expiry || document.querySelector(\"meta[name='embl:expiry']\");\n for (var key in metaProperties) {\n if (metaProperties[key] != null && metaProperties[key].getAttribute(\"content\").length != 0) {\n metaProperties[key] = metaProperties[key].getAttribute(\"content\");\n } else {\n metaProperties[key] = 'notSet';\n }\n }\n return metaProperties;\n}", "function guestInfo(){\nxapi.command('UserInterface Extensions Panel Save', {\n PanelId: 'guest_info'\n },\n `<Extensions>\n <Version>1.5</Version>\n <Panel>\n <Type>InCall</Type>\n <Icon>${adhocUI_Details.buttonIcon}</Icon>\n <Order>2</Order>\n <Color>${adhocUI_Details.buttonColor}</Color>\n <Name>${adhocUI_Details.buttonText.call}</Name>\n <Page>\n <Name>${callService_Details.onCallTitle}</Name>\n <Row>\n <Name>Row</Name>\n <Widget>\n <WidgetId>info_pane_text_2</WidgetId>\n <Name>${callService_Details.row_1}</Name>\n <Type>Text</Type>\n <Options>size=4;fontSize=normal;align=left</Options>\n </Widget>\n </Row>\n <Row>\n <Name>Row</Name>\n <Widget>\n <WidgetId>join_comp_text_2</WidgetId>\n <Name>${callService_Details.row_2}</Name>\n <Type>Text</Type>\n <Options>size=4;fontSize=small;align=left</Options>\n </Widget>\n </Row>\n <Row>\n <Name>Row</Name>\n <Widget>\n <WidgetId>join_vid_text_2</WidgetId>\n <Name>${callService_Details.row_3}</Name>\n <Type>Text</Type>\n <Options>size=4;fontSize=small;align=left</Options>\n </Widget>\n </Row>\n <Row>\n <Name>Row</Name>\n <Widget>\n <WidgetId>join_phone_text_2</WidgetId>\n <Name>${callService_Details.row_4}</Name>\n <Type>Text</Type>\n <Options>size=4;fontSize=small;align=left</Options>\n </Widget>\n </Row>\n <Options>hideRowNames=1</Options>\n </Page>\n </Panel>\n </Extensions>`\n);\n}", "function fillMetaData() {\n var o = {};\n o.cid = activeCollectionId();\n o.path = collectionPath(o.cid);\n o.dia = getLastMarkedEntry(o.cid);\n\n if (! o.dia) {\n statusError('no marked image/collection found');\n return ;\n }\n o.pos = getEntryPos(o.dia);\n o.name = getDiaName(o.dia);\n fillMetaFromServer(o);\n\n}", "function setDescriptionTemplate(){\r\n CKEDITOR.instances.app_bundle_product_form_longDescription.setData(`<p>Your satisfaction is our number one goal. Keep in mind that we offer hassle-free returns if needed. If you have any questions or problems, please contact us.</p>\r\n\r\n<p>Please Note: All included items are shown in the pictures</p>\r\n\r\n<p>${newTitle}<br />\r\n${itemNumber}</p>\r\n\r\n<p><strong>Features:</strong></p>\r\n\r\n<ul>\r\n\t<li>Feature 1</li>\r\n</ul>\r\n\r\n<p><strong>What&#39;s included:</strong></p>\r\n\r\n<ul>\r\n\t<li>${newTitle}</li>\r\n</ul>\r\n\r\n<p><strong>What&#39;s not included:</strong></p>\r\n\r\n<ul>\r\n\t<li>Any other accessories</li>\r\n</ul>\r\n\r\n<p><strong>Condition:</strong></p>\r\n\r\n<ul>\r\n\t<li>Used in good working condition</li>\r\n\t<li>Shows signs of use such as scuffs and scratches</li>\r\n\t<li>See photos for details</li>\r\n</ul>\r\n`)\r\n }", "addCustomizableElementsPanel() {\n\t\tconst x = 680;\n\t\tconst y = 309;\n\n\t\tconst charBackground = this.game.add.image(x + 28, y + 27, 'character_preview');\n\t\tcharBackground.height = 220;\n\t\tcharBackground.width = 190;\n\n\t\tthis.addPanelElement('Body Type', 'Left', 0, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_Body_A_Down2.png'), 'body');\n\t\tthis.addPanelElement('Hairstyle', 'Left', 1, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_HairStyle_A_Down2.png'), 'hairstyle');\n\t\tthis.addPanelElement('Facial Hair', 'Left', 2, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_FacialHair_A_Down2.png'), 'facialhair');\n\t\tthis.addPanelElement('Upper Body', 'Left', 3, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_UpperBody_A_Down2.png'), 'upperbody');\n\t\tthis.addPanelElement('Lower Body', 'Left', 4, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_LowerBody_A_Down2.png'), 'lowerbody');\n\t\tthis.addPanelElement('Headwear', '', 0, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_HeadWear_A_Down2.png'), 'headwear');\n\t\tthis.addPanelElement('Facewear', '', 1, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_FaceWear_A_Down2.png'), 'facewear');\n\t\tthis.addPanelElement('Hands/Arms', '', 2, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_Hands_A_Down2.png'), 'hands');\n\t\tthis.addPanelElement('Footwear', '', 3, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_FootWear_A_Down2.png'), 'footwear');\n\t\tthis.addPanelElement('Weapon', '', 4, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_Weapon_A_Down_RightHanded2.png'), 'weapon');\n\t\tthis.addEyeColorModifiers(new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_EyeColour_A_Down2.png'), 'eyecolour');\n\n\t\tthis.addTurnCharacter();\n\n\t\tthis.characterShuffle();\n\t}", "_create(props) {\n super._create(props);\n\n this.set({\n schema: {\n component: 'Form',\n fields: [\n {\n name: 'text',\n component: 'TextField',\n label: 'Text',\n multiline: true,\n docLevel: 'basic',\n help: 'Any markdown. See markdownguide.org'\n }\n ]\n }\n });\n }", "@api\n form(isCreate, fields) {\n let augmentedFields = fields.map((field) => {\n return {\n ...field,\n options:\n field.dataType === \"Picklist\"\n ? this.wiredPicklistOptions.data[field.apiName]\n : []\n };\n });\n return `\n <form action=\"{{FORM_ACTION}}\" method=\"get\" style=${elementStyles.form}>\n ${augmentedFields.map(elementString).join(\"\")}\n ${\n isCreate\n ? `<input type=\"hidden\" value='{{RECORD_ID}}' name=\"recordId\"/>`\n : \"\"\n }\n <input type=\"hidden\" value='${this.objectApiName}' name=\"objectApiName\"/>\n <input type=\"hidden\" value='{{FORM_ID}}' name=\"formId\"/>\n <button type=\"submit\" style=\"${elementStyles.button}\">Submit</button>\n </form>\n `;\n }", "function makeDataPanel() {\n var dataPanel,\n panelProperties = new Ext.Panel({\n region: 'north',\n height: 30,\n cls: 'properties-panel',\n html: '<div class=\"properties\">'\n + '<div class=\"left\"><p class=\"label\"><label for=\"speed\">Facteur de vitesse(kme/h) : </label></p><p><input id=\"speed\" class=\"speed\" type=\"number\" name=\"speed\" value=\"4\" /></p></div>'\n + '<div class=\"right\" style=\"display:none;\"><p class=\"label\"><label for=\"maps\">Cartes topographiques : </label></p><p><input id=\"maps\" type=\"text\" name=\"maps\" /></p></div>'\n + '</div>'\n });\n\n this.tabPanel = this.makeGridsTabPanel();\n\n dataPanel = new Ext.Panel({\n title: 'Informations',\n layout: 'border',\n region: 'south',\n height: 300,\n split: true,\n cls: 'data-panel',\n items: [\n panelProperties,\n this.tabPanel,\n this.makeFooter()\n ]\n });\n\n return dataPanel;\n}", "function showMFForm(pageIdToLoad) {\n\n console.log(\"show Benefit to fit your life form\");\n $(\"#myform\").css('display','block');\n $(\"#myform\").html(\"\");\n $(\"#myform\").alpaca({\n \"view\": \"bootstrap-edit\",\n \"data\": node,\n \"schema\": {\n \"title\": \"newMF\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"name\",\n \"readonly\":true\n }, \n \"headerTitle\": {\n \"type\": \"string\",\n \"title\": \"headerTitle\"\n },\n \"callout1\": {\n \"type\": \"string\",\n \"title\": \"callout1\"\n },\n \"callout2\": {\n \"type\": \"string\",\n \"title\": \"callout2\"\n },\n \"accordions\": {\n \"type\": \"array\",\n \"title\": \"accordions\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"accordionItem\",\n \"properties\": {\n \"accordionName\": {\n \"type\": \"string\",\n \"title\": \"Name\"\n },\n \"headerText\": {\n \"type\": \"string\",\n \"title\": \"Header Text\"\n },\n \"items\": {\n \"type\": \"array\",\n \"title\": \"Upper Accordion Items\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"Item\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"Item Name\"\n },\n \"link\": {\n \"type\": \"string\",\n \"title\": \"item Link Url\"\n },\n \"description\": {\n \"type\": \"string\",\n \"title\": \"Item Description\"\n }\n }\n }\n },\n \"subAccordions\": {\n \"type\": \"array\",\n \"title\": \"subaccordions\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"subaccordion\",\n \"properties\": {\n \"subAccordionName\": {\n \"type\": \"string\",\n \"title\": \"Sub Accordion Name\"\n },\n \"items\": {\n \"type\": \"array\",\n \"title\": \"Sub Accordion Items\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"Item\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"Item Name\"\n },\n \"link\": {\n \"type\": \"string\",\n \"title\": \"item Link Url\"\n },\n \"description\": {\n \"type\": \"string\",\n \"title\": \"Item Description\"\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"_parent\": \"n:node\",\n \"items\": {},\n \"description\": \"custom:pagebtfy0\",\n \"$schema\": \"http://json-schema.org/draft-04/schema#\"\n },\n \"options\": {\n \"form\": {\n \"buttons\": {\n \"submit\": {\n \"click\": function () {\n clearTimer();\n console.log(\"Timer Cleared\");\n setTimer();\n console.log(\"Timer Set\");\n\n var value = this.getValue();\n //alert(JSON.stringify(value, null, \" \"));\n node.headerTitle = value.headerTitle;\n node.callout1 = value.callout1;\n node.callout2 = value.callout2;\n node.accordions = value.accordions;\n node.update().then(function () {\n alert(\"Form Submitted\");\n window.location =\"../index.html\";\n });\n }\n }\n }\n },\n \"title\": \"newPageTitle\",\n \"engineId\": \"alpaca1\",\n \"fields\": {\n \"headerTitle\": {\n \"type\": \"text\"\n },\n \"callout1\": {\n \"type\": \"ckeditor\" \n },\n \"callout2\": {\n \"type\": \"ckeditor\" \n },\n \"accordions\": {\n \"options\": {\n \"actionBarType\": \"right\"\n }\n }\n }\n }\n });\n}", "build(fields, model, metadata) {\n var vm = this\n var payload\n\n if (!metadata) {\n return {}\n }\n\n payload = {\n tableName: metadata.catalogName,\n primaryKey: metadata.primaryKey,\n identityKey: metadata.identityKey,\n foreignReference: metadata.foreignReference,\n }\n\n if (metadata.mode === 'insert') {\n payload.insertRows = []\n model.forEach((record, index) => {\n var row = {}\n vm.dirtyFieldsIterator(fields[index], row, record)\n payload.insertRows.push(row)\n })\n } else if (metadata.mode === 'edit') {\n payload.updateRows = []\n model.forEach((record, index) => {\n var row = {}\n vm.dirtyFieldsIterator(fields[index], row, record)\n // Set primaryKey and/or identityKey as DataRow with current value\n if (!!payload.primaryKey) {\n row[payload.primaryKey] = record[payload.primaryKey]\n }\n if (!!payload.identityKey) {\n row[payload.identityKey] = record[payload.identityKey]\n }\n payload.updateRows.push(row)\n })\n } else if (metadata.mode === 'filters') {\n payload.dataRows = []\n model.forEach((record, index) => {\n var row = {}\n vm.dirtyFieldsIterator(fields[index], row, record)\n payload.dataRows.push(row)\n })\n }\n\n return payload\n }", "function getPageModelSFE() {\n var entity = { Description: '', ExtendedDesc: '', PageSetId: '', DefaultPriceListId: '', Sort: '', Status: 1 };\n var form = [\n {\n type: \"section\", htmlClass: \"row\", disableSuccessState: true, disableErrorState: true,\n items: [\n {\n type: \"section\", disableSuccessState: true, disableErrorState: true,\n items: [\n { fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'col-md-6 col-xs-6 noPadding', key: \"Description\", copyValueTo: [\"ExtendedDesc\"] },\n { fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'col-md-6 col-xs-6 noPadding', key: \"ExtendedDesc\" }\n ]\n }]\n },\n { fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'noPadding', key: 'PageSetId', type: 'select', titleMap: [] },\n { fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'noPadding', key: 'DefaultPriceListId', type: 'select', titleMap: [] },\n //{ fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'noPadding', key: \"Sort\" },\n //{ fieldHtmlClass: 'custom-form-style', key: \"Status\" }\n ];\n var schema = {\n type: 'object',\n title: \"Comment\",\n properties: {\n // 'Description': '', 'Color': '', 'Background': '', 'PriceListId': '', 'NavigateToPage': '', 'SetDefaultSalesType': ''\n Description: { type: 'string', title: 'Page Description', validationMessage: \"You need to add a Desciption.\" },\n ExtendedDesc: { type: 'string', title: 'Page Extended Description', validationMessage: \"You need to add a Desciption.\" },\n PageSetId: { title: 'PageSet', type: 'number', htmlClass: 'customFormSelect', format: 'uiselect', placeholder: 'Select Pageset...', nullLabel: '---', },\n DefaultPriceListId: { title: 'Default Pricelist', type: 'number', htmlClass: 'customFormSelect', format: 'uiselect', placeholder: 'Select Default Pricelist...', nullLabel: '---', validationMessage: \"You need to add a Default Pricelist.\" },\n Sort: { title: 'Sort', type: \"number\" },\n Status: { title: 'Status', type: \"number\" },\n },\n required: ['Description', 'ExtendedDesc', 'PageSetId', 'DefaultPriceListId']\n }\n var ret = {\n schema: schema,\n form: form,\n entity: entity\n }\n return ret;\n}", "renderFields() {\n return _.map(confirmRegisterFields, ({ name, label, type }) => <Field component={FormField} type='text' key={name} name={name} label={label} htmltype={type} />)\n \n }", "static ad_children_columnConfig() {\n return [\n {\n label: 'Admin Code Master',\n fieldName: 'Admin_Code_Master',\n type: 'text'\n },\n {\n label: 'Admin Code',\n fieldName: 'Admin_Code',\n type: 'text'\n },\n {\n label: 'Description(English)',\n fieldName: 'Description_En',\n type: 'text'\n },\n {\n label: 'Description(Traditional Chinese)',\n fieldName: 'Description_Tc',\n type: 'text'\n },\n {\n label: 'Description(Simplified Chinese)',\n fieldName: 'Description_Sc',\n type: 'text'\n },\n {\n label: 'Admin Code Filtering',\n fieldName: 'Admin_Code_Filtering',\n type: 'text'\n },\n {\n label: 'Admin Code Mapping',\n fieldName: 'Admin_Code_Mapping',\n type: 'text'\n },\n {\n label: 'Delete Indicate',\n fieldName: 'Delete_Indicate',\n type: 'text'\n },\n {\n type: 'action',\n typeAttributes: {\n rowActions: [{ label: 'Delete', name: 'delete' }]\n }\n }\n ]\n }", "function buildDetailInfoBlock(mainDirectory, subDirectory, infoData) {\n var field = cmap[mainDirectory][subDirectory]['detailField'];\n var basicInfo = field.basicInfo\n var detailInfo = field['detailInfo']\n console.log('basicInfo',basicInfo)\n var basicInfoHtml = ''\n var detailInfoHtml = ''\n $.each(basicInfo, function (index, val) {\n if (val in infoData) {\n switch (val)\n {\n case 'name':\n basicInfoHtml += '<div class=\"form-group col-md-6 formBlock wordBreak\">\\\n <label class=\"formItem\">*项目名称:</label>\\\n <input type=\"text\" class=\"form-control\" name=\"name\" value=\"\">\\\n <span class=\"originInfo name\"></span>\\\n </div>'\n }\n }\n })\n\n}", "function metadataStaticView() {\n html= HtmlService\n .createTemplateFromFile('staticMetadata')\n .evaluate()\n .setSandboxMode(HtmlService.SandboxMode.IFRAME);\n DocumentApp.getUi().showSidebar(html);\n }", "fields () {\n return {\n author: 'creator',\n title: 'title',\n subject: 'sub'\n }\n }", "fields () {\n return {\n author: 'creator',\n title: 'title',\n subject: 'sub'\n }\n }", "function applyMetadata()\n {\n\n\n // get metadata values\n var metadata = groovebox[\"metadata\"];\n\n\n // get the current audio file name\n var currentAudioFile = $(\".track-info\").attr(\"file\");\n\n\n // check if the (new) metadata is different than the currently playing song\n if (groovebox[\"stream\"][\"track\"] !== currentAudioFile)\n {\n\n\n // update the metadata\n\n\n // update the track name\n $(\".track-info .track-name\").html(metadata[\"title\"]).attr(\"title\", metadata[\"title\"]);\n\n\n // update the track artist\n $(\".track-info .track-artist\").html(metadata[\"artist\"]).attr(\"title\", metadata[\"artist\"]);\n\n\n // update the cover-art\n $(\".album-art img\").attr(\"src\", metadata[\"coverArt\"] +\"&\"+ new Date().getTime());\n\n\n // update the current audio file\n $(\".track-info\").attr(\"file\", groovebox[\"stream\"][\"track\"]);\n\n\n }\n\n\n }", "function fill_data(ele) {\n var p_tag = ele.children('p.tab_type');\n var meta_title = ele.children('h3').text();\n var meta_desc = ele.children('p.meta_desc').text();\n var meta_date = p_tag.children('span.type_latest').text();\n var meta_download = p_tag.children('span.type_hot').text();\n var meta_likes = p_tag.children('span.type_favorite').text();\n\n $('#theme_detail_panel h3').text(meta_title);\n $('#theme_detail_panel p').text(meta_desc);\n $('#theme_detail_panel ul li.info_date').text(meta_date);\n $('#theme_detail_panel ul li.info_download').text(meta_download);\n $('#theme_detail_panel ul li.info_fb').text(meta_likes);\n\n }", "function attFields() {\n\n\tlet code = '<div id=\"fieldadd\">';\n\tfor (i = 0; i < NAME_LIST.length; i++) {\n\n\t\tif (NAME_LIST[i] === 'color') {\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<a class=\"w3-text-red\">*</a><br>'+\n\t\t\t\t\t\t'<input type=\"color\" id=\"color\" value=#808080 style=\"width:100%\">'+\n\t\t\t\t\t'</div>';\n\n\t\t} else if (NECESSARY_VAL.indexOf(NAME_LIST[i]) !== -1){\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<a class=\"w3-text-red\">*</a><br>'+\n\t\t\t\t\t\t'<input type=\"text\" autocomplete=\"on\" class=\"w3-input w3-border\" id=\"'+ NAME_LIST[i] +'\">'+\n\t\t\t\t\t'</div>';\n\t\t} else if ([\"PDB_file\",\"image\"].indexOf(NAME_LIST[i]) !== -1){\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<br>'+\n\t\t\t\t\t\t'<input type=\"file\" autocomplete=\"on\" id=\"'+ NAME_LIST[i] +'\">'+\n\t\t\t\t\t'</div>';\n\t\t} else {\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<br>'+\n\t\t\t\t\t\t'<input type=\"text\" autocomplete=\"on\" class=\"w3-input w3-border\" id=\"'+ NAME_LIST[i] +'\">'+\n\t\t\t\t\t'</div>';\n\t\t}\n\t};\n\t\n\tcode += '</div>';\n\treturn code;\n}", "function refreshFields () {\n var self = this;\n\n if (!self['import'].template) {\n return;\n }\n\n // TODO Move to config\n var templateSel = self.config['import'].ui.selectors.templateSel,\n nameSel = self.config['import'].ui.selectors.nameSel,\n reqSel = self.config['import'].ui.selectors.fieldRequired,\n fieldSelectSel = self.config['import'].ui.selectors.fieldSelectSel;\n\n // set template\n var $template = self.$.fieldTemplate;\n var fieldsToAdd = [];\n\n // show mapping fields\n $('.mapping-fields').show();\n\n // reorder the fields\n var fields = [];\n var schema = self['import'].template.schema;\n\n // get the schema fields with keys and computed labels\n for (var key in schema) {\n if (!schema.hasOwnProperty(key)) continue;\n\n // ignore core fields and link fields\n if (key[0] === '_' || schema[key].link) continue;\n\n // clone the schema field to avoid changes in the referenced object\n var field = JSON.parse(JSON.stringify(schema[key]));\n\n // label (i18n) if available, else key\n var label = field.label || key;\n if (typeof label === 'object') {\n label = label[M.getLocale()] || key;\n }\n\n field.key = key;\n field.label = label;\n\n fields.push(field);\n }\n\n // sort the fields\n fields.sort(function(f1, f2) {\n if (f1.order < f2.order) {\n return -1;\n } else if (f1.order > f2.order) {\n return 1;\n } else {\n return f1.label <= f2.label ? -1 : 1;\n }\n });\n\n // add the fields\n for (var i = 0; i < fields.length; ++i) {\n\n // clone DOM template\n // TODO possible error due to substring\n var $field = $template.clone().removeClass(templateSel.substring(1));\n\n // set the label\n $field.find(nameSel).text(fields[i].label);\n\n // show the required marker\n if (fields[i].required) {\n $field.find(reqSel).show();\n }\n\n // append options\n if (self.$.fieldOptions) {\n $(fieldSelectSel, $field).append(self.$.fieldOptions.clone()).attr('name', fields[i].key);\n }\n\n if (fields[i].type === 'number') {\n $('.operator', $field).removeClass('hide');\n } else {\n $('.operator', $field).addClass('hide');\n }\n\n // push field into array\n fieldsToAdd.push($field);\n }\n\n // empty all fields\n self.$.fields.empty()\n // and append the new fields\n .append(fieldsToAdd);\n}", "getFieldInfo() {\n const info = super.getFieldInfo();\n const ClassName = this.ele.fieldClass;\n const ele = new ClassName(this.ele.props);\n ele.setKey(this.key);\n info.ele = ele.getFieldInfo();\n return info;\n }", "static fields () {\n return { \n id: this.attr(null), \n brand: this.attr(''),\n c_price: this.attr(''),\n catalog_brand_id: this.attr(''),\n catalog_cate_id: this.attr(''),\n catalog_county_id: this.attr(''),\n catalog_unit_id: this.attr(''),\n code: this.attr(''),\n county: this.attr(''),\n created_at: this.attr(''),\n d_price: this.attr(''),\n e_price: this.attr(''), \n m_price: this.attr(''),\n name: this.attr(''),\n nh_price: this.attr(''),\n seq: this.attr(''),\n sku: this.attr(''),\n t_price: this.attr(''),\n unit: this.attr(''),\n updated_at: this.attr(''),\n weight: this.attr(''),\n shipping: this.attr(''), \n qty: this.attr(''), \n amount: this.attr(''), \n profit: this.attr(''), \n }\n }", "function DisplayConstituentCustomFields() {\n\n DisplayCustomFields('customFieldContainer', CustomFieldEntity.CRM, function () {\n $('.editable').prop('disabled', true);\n LoadDatePickers();\n LoadDatePair();\n });\n\n}", "function makeComplexExtDef (item) {\n //let sd = {resourceType:'StructureDefinition', url:url};\n let ar = item.url.split('/');\n let suffix = ':' + ar[ar.length-1];\n\n let sd = makeSDHeader(item,suffix);\n\n\n //the third element (extension.extension) needs a discriminator..\n let ele = sd.snapshot.element[2];\n ele.slicing = {discriminator : [{type:\"value\",path:'url'}],rules:'open'}\n\n\n\n //let ed = item.ed[0];\n\n //now add the elements for the child nodes...\n for (var i=1; i < item.ed.length; i++) {\n let ed = item.ed[i];\n\n //we know there must be a mapping, or it wouldn't be in the object\n let mapPath = ed.mapping[0].map\n console.log(mapPath)\n mapPath = mapPath.replace(/\\|/g,'')\n mapPath = mapPath.replace(/#/g,'')\n // console.log(mapPath)\n\n let sliceName = mapPath\n\n\n let dataType = 'string';\n let short = \"Short not present!\"\n if (ed.short) {\n short = ed.short.trim();\n }\n\n if (ed.type && ed.type.length > 0) {\n dataType = ed.type[0].code;\n }\n\n let ele1 = {id:'Extension'+suffix+'.extension'+ \":\" + sliceName,path:'Extension.extension',min:0,max:'*',base:{path:'Element.extension',min:0,max:'*'}};\n ele1.type = [{code:'Extension'}]\n ele1.definition = ed.definition;\n ele1.short = short;\n ele1.sliceName = sliceName;\n sd.snapshot.element.push(ele1);\n\n let ele2 = {id:'Extension'+suffix+'.extension:' + sliceName + \".id\",path:'Extension.extension.id',short:'Extension id',min:0,max:'1',base:{path:'Element.id',min:0,max:'1'}};\n ele2.definition = \"Unique id for referencing\"\n ele2.type = [{code:'string'}]\n sd.snapshot.element.push(ele2);\n\n let ele3 = {id:'Extension'+suffix+'.extension:' + sliceName + '.extension',path:'Extension.extension.extension',short:'extension',min:0,max:'0',base:{path:'Element.extension',min:0,max:'*'}}\n ele3.type = [{code:'Extension'}]\n ele3.slicing = {discriminator:[{type:'value',path:'url'}],rules:\"open\"};\n ele3.definition = 'child extension'\n sd.snapshot.element.push(ele3);\n\n\n let ele4 = {id:'Extension'+suffix+'.extension:' + sliceName + '.url',path:'Extension.extension.url',short:'Extension url',min:1,max:'1',base:{path:'Extension.url',min:1,max:'1'}};\n ele4.type = [{code:'uri'}];\n ele4.fixedUri = sliceName;\n //ele4.url = sliceName;\n ele4.definition = 'The unique Url';\n sd.snapshot.element.push(ele4);\n\n let ele5 = {};\n let v = \"value\" + dataType[0].toUpperCase() + dataType.substr(1);\n ele5.id = \"Extension\"+suffix+\".extension:\" + sliceName + '.' +v\n ele5.path = \"Extension.extension.\"+v;\n ele5.short = \"Value of extension\";\n ele5.definition = \"Value of extension\";\n ele5.min = 0;\n ele5.max = '1';\n ele5.base = {path:'Extension.value[x]',min:0,max:'1'};\n ele5.type = [{code:dataType}];\n ele5.definition = \"The actual value of the extension\";\n\n\n ele5.binding = ed.binding;\n\n\n sd.snapshot.element.push(ele5);\n\n }\n\n\n //the url for the overall complex extension...\n let ele4 = {id:'Extension.url',path:'Extension.url',short:'Extension url',min:1,max:'1',base:{path:'Extension.url',min:1,max:'1'}};\n ele4.type = [{code:'uri'}];\n ele4.fixedUri = item.url;\n ele4.definition = 'The unique Url'\n sd.snapshot.element.push(ele4);\n\n //the value\n let ele5 = {};\n let v = \"value\" + item.dataType[0].toUpperCase() + item.dataType.substr(1);\n ele5.id = \"Extension.value[x]\"\n ele5.path = \"Extension.value[x]\"\n ele5.short = \"Value of extension\";\n ele5.definition = \"Value of extension\";\n ele5.min = 0;\n ele5.max = '0';\n ele5.base = {path:'Extension.value[x]',min:0,max:'1'};\n ele5.type = [{code:item.dataType}];\n ele5.definition = \"The actula value of the extension\"\n sd.snapshot.element.push(ele5);\n\n return sd;\n}", "function zoto_detail_meta_info(options) {\n\tthis.options = options || {};\n\tthis.options.mode = this.options.mode || 'page'; // 'page' or 'modal'\n\n\t/*\n\t * Create our page elements\n\t */\n\tvar desc_epaper_options = {'attribute': \"description\", 'multi_line': 1, 'starting_text': _(\"click here to add a photo description.\")};\n\tvar tag_cloud_options = {'can_delete': true, 'weighted': false};\n\tif(this.options.mode == 'modal') {\n\t\tdesc_epaper_options['maxchar'] = 300;\n\t\ttag_cloud_options['tag_count'] = 15;\n\t} else {\n\t\tthis.modal_licensing = new zoto_modal_licensing(this.options.mode);\n\t\tthis.a_edit_license = A({'href':\"javascript:void(0)\"}, \"edit\");\n\t\tthis.edit_license = SPAN({'style':\"font-size: 9px;\"}, \" (\", this.a_edit_license, \")\");\n\t}\n\tthis.title_epaper = new zoto_e_paper_lite({'id': \"title_epaper\", 'blur_update': true, 'attribute': \"title\", 'starting_text': _(\"click here to add a title\")});\n\tthis.description_epaper = new zoto_e_paper_image_attributes(desc_epaper_options);\n\tthis.tags_header = DIV({'style': \"margin-bottom: 3px\"}, H3({}, _('tags')));\n\tthis.look_ahead = new zoto_tag_lookahead({min_length: 3, allow_spaces: true});\n\tthis.tag_cloud = new zoto_image_tag_cloud(tag_cloud_options);\n\n\t//replaceChildNodes(this.albums_header, H3({'style': \"margin-top: 10px;\"}, _(\"albums\")));\n\t//this.albums_header = DIV({'syle': \"margin-bottom: 10px; margin-top: 10px;\"});\n\tthis.albums_header = H3({'style': \"margin-top: 10px;\"}, _(\"albums\"));\n\tthis.album_list = SPAN({}, \"\");\n\n\t//\n\t// Advanced info\n\t//\n\tthis.perms = SPAN({});\n\tthis.license_text = SPAN({}, \"\");\n\n\tthis.date_taken_link = A({'href': \"javascript: void(0);\"}, \"\");\n\tthis.date_taken = SPAN({});\n\tthis.date_taken_holder = SPAN({}, _('taken: '), this.date_taken);\n\n\tthis.date_uploaded = SPAN({});\n\tthis.date_uploaded_holder = SPAN({}, _(\"uploaded: \"), this.date_uploaded);\n\t\t\n\t/* Advanced info */\n\tvar advanced = DIV({'style': \"margin-top: 5px\"},\n\t\tH3({}, _('advanced info')),\n\t\tthis.perms,\n\t\tthis.license_text, BR({'clear':\"ALL\"}),\n\t\tthis.date_taken_holder, BR({'clear':\"ALL\"}),\n\t\tthis.date_uploaded_holder, BR()\n\t);\n\n\tif (this.options.mode == \"page\") {\n\t\n\t\tthis.filename = SPAN({});\n\t\tthis.filename_holder = SPAN({}, _(\"filename\"), ': ', this.filename, BR());\n\t\n\t\tthis.source_name = SPAN({});\n\t\tthis.source_name_holder = SPAN({}, _(\"uploaded via\"), \": \", this.source_name, BR());\n\t\n\t\tthis.camera_make = SPAN({});\n\t\tthis.camera_make_holder = SPAN({}, _(\"make\"), \": \", this.camera_make, BR());\n\t\n\t\tthis.camera_model = SPAN({});\n\t\tthis.camera_model_holder = SPAN({}, _(\"model\"), \": \", this.camera_model, BR());\n\t\n\t\tthis.iso_speed = SPAN({});\n\t\tthis.iso_speed_holder = SPAN({}, _(\"iso speed\"), \": \", this.iso_speed, BR());\n\t\n\t\tthis.focal_length = SPAN({});\n\t\tthis.focal_length_holder = SPAN({}, _(\"focal length\"), \": \", this.focal_length, BR());\n\t\n\t\tthis.fstop = SPAN({});\n\t\tthis.fstop_holder = SPAN({}, _(\"f-stop\"), \": \", this.fstop, BR());\n\t\n\t\tthis.exposure_time = SPAN({});\n\t\tthis.exposure_time_holder = SPAN({}, _(\"exposure time\"), \": \", this.exposure_time, BR());\n\t\n\t\tvar extra_advanced = DIV({id: 'extra_advanced'}, \n\t\t\tthis.filename_holder,\n\t\t\tthis.source_name_holder,\n\t\t\tthis.camera_make_holder,\n\t\t\tthis.camera_model_holder,\n\t\t\tthis.iso_speed_holder,\n\t\t\tthis.focal_length_holder,\n\t\t\tthis.fstop_holder,\n\t\t\tthis.exposure_time_holder\n\t\t);\n\t\tappendChildNodes(advanced, extra_advanced);\n\t\tthis.advanced_link = element_opener(extra_advanced, _(\"view all advanced info\"), _(\"hide advanced info\"));\n\t} else {\n\t\tthis.advanced_link = A({'href': \"javascript: void(0);\"}, _(\"more\"));\n\t}\n\tappendChildNodes(advanced, this.advanced_link);\n\n\tthis.el = DIV({id: 'meta_holder'},\n\t\tthis.title_epaper.el,\n\t\tthis.description_epaper.el,\n\t\tthis.tags_header,\n\t\tthis.look_ahead.el,\n\t\tthis.tag_cloud.el,\n\t\tthis.albums_header,\n\t\tthis.album_list,\n\t\tadvanced\n\t);\n\t\n\tconnect(this.title_epaper, 'EPAPER_EDITED', this, 'handle_edit');\n\tconnect(this.title_epaper, 'IMAGE_ATTRIBUTE_CHANGED', this, function(new_value) {\n\t\tthis.info.title = new_value;\n\t});\n\tconnect(this.tag_cloud, 'TAG_CLICKED', this, function(tag_name) {\n\t\tsignal(this, 'TAG_CLICKED', tag_name);\n\t});\n\tconnect(this.description_epaper, 'IMAGE_ATTRIBUTE_CHANGED', this, function(new_value) {\n\t\tthis.info.description = new_value;\n\t});\n\tconnect(this.look_ahead, 'NEW_TAG_ADDED', this.tag_cloud, 'refresh');\n\tconnect(this.look_ahead, 'NEW_TAG_ADDED', this, function(){\n\t\tsignal(this, 'NEW_TAG_ADDED');\n\t});\n\tconnect(authinator, 'USER_LOGGED_IN', this, 'update');\n\tconnect(this.date_taken_link, 'onclick', this, function(e) {\n\t\tsignal(this, 'DATE_CLICKED', this.info.date);\n\t});\n\n\tif (this.options.mode == \"page\") {\n\t\tconnect(this.a_edit_license, 'onclick', this, function(e){\n\t\t\tthis.modal_licensing.handle_image_detail_click(this.media_id)\n\t\t});\n\t\tconnect(this.modal_licensing, \"LICENSE_UPDATED\", this, function(result){\n\t\t\tthis.info.license = Number(result);\n\t\t\tthis.update();\n\t\t});\n\t} else {\n\t\tconnect(this.advanced_link, 'onclick', this, function(e) {\n\t\t\tcurrentDocument().modal_manager.move_zig();\n\t\t\tcurrentWindow().site_manager.update(this.info.owner_username, 'detail', this.media_id);\n\t\t});\n\t\tconnect(this.description_epaper, 'MORE_CLICKED', this, function(e) {\n\t\t\tcurrentDocument().modal_manager.move_zig();\n\t\t\tcurrentWindow().site_manager.update(this.info.owner_username, 'detail', this.media_id);\n\t\t});\n\t\tconnect(this.tag_cloud, 'MORE_CLICKED', this, function(e) {\n\t\t\tcurrentDocument().modal_manager.move_zig();\n\t\t\tcurrentWindow().site_manager.update(this.info.owner_username, 'detail', this.media_id);\n\t\t});\n\t}\n\n\tthis.a_cc_icon_attribution = this.create_license_icon(\n\t\t['attribution'], \"by\");\n\tthis.a_cc_icon_noderivs = this.create_license_icon(\n\t\t['attribution', 'noderivs'], \"by-nd\");\n\tthis.a_cc_icon_noncomm_noderivs = this.create_license_icon(\n\t\t['attribution', 'noderivs', 'noncomm'], \"by-nc-nd\");\n\tthis.a_cc_icon_noncomm = this.create_license_icon(\n\t\t['attribution', 'noncomm'], \"by-nc\");\n\tthis.a_cc_icon_noncomm_sharealike = this.create_license_icon(\n\t\t['attribution', 'noncomm', 'sharealike'], \"by-nc-sa\");\n\tthis.a_cc_icon_sharealike = this.create_license_icon(\n\t\t['attribution', 'sharealike'], 'by-sa');\n}", "handleFieldsChangeByPlugin(e, value) {\n let name = value.name;\n\n if (this.currentComponent && name){\n let fields = Object.assign({}, this.currentComponent.state.fields);\n fields[name] = value.value;\n\n this.currentComponent.setState({fields: fields});\n }\n }", "setup() {\n\t\tlet inputs = [\n\t\t\t{\n\t\t\t\tname: \"itemName\",\n\t\t\t\tlabel: \"Item Name\",\n\t\t\t\tplaceholder: \"Insert new item name\",\n\t\t\t\trules: \"required|string\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"itemPrice\",\n\t\t\t\tlabel: \"Price\",\n\t\t\t\tplaceholder: \"Insert new item price\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"itemDesc\",\n\t\t\t\tlabel: \"Description\",\n\t\t\t\tplaceholder: \"Insert new item description\",\n\t\t\t\ttype: \"textbox\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"itemWidth\",\n\t\t\t\tlabel: \"itemWidth\",\n\t\t\t\tplaceholder: \"Width\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"itemLength\",\n\t\t\t\tlabel: \"itemLength\",\n\t\t\t\tplaceholder: \"Length\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"itemHeight\",\n\t\t\t\tlabel: \"itemHeight\",\n\t\t\t\tplaceholder: \"Height\",\n\t\t\t},\n\t\t];\n\n\t\treturn {\n\t\t\tfields: inputs,\n\t\t};\n\t}" ]
[ "0.6136295", "0.61114705", "0.5857351", "0.5809938", "0.577988", "0.57367694", "0.5733026", "0.5688529", "0.56878614", "0.56536007", "0.5622596", "0.5618403", "0.5572465", "0.5551668", "0.55448836", "0.55206007", "0.55187744", "0.5518138", "0.5501968", "0.54950213", "0.5478372", "0.5475398", "0.5455224", "0.54215807", "0.54200613", "0.54053324", "0.53982633", "0.53910017", "0.53776294", "0.5374735", "0.5374187", "0.5373025", "0.53685486", "0.5361789", "0.53526455", "0.5346398", "0.53437054", "0.53351593", "0.5332726", "0.5316223", "0.5303591", "0.5291094", "0.528318", "0.52748764", "0.52741367", "0.52707964", "0.5265799", "0.5259845", "0.5256657", "0.5256598", "0.52543277", "0.5253618", "0.52485585", "0.5243971", "0.52437735", "0.5242026", "0.5228521", "0.5226554", "0.5226416", "0.5216525", "0.52165014", "0.52132845", "0.52046347", "0.5203378", "0.51973146", "0.51966256", "0.51965", "0.5195545", "0.51935273", "0.51906264", "0.5189896", "0.51898074", "0.5173036", "0.5170617", "0.5166348", "0.51660305", "0.5165605", "0.5165354", "0.51634425", "0.51542157", "0.51525164", "0.515043", "0.5147099", "0.514101", "0.5131255", "0.5129124", "0.51280755", "0.5115288", "0.5115288", "0.5113663", "0.510812", "0.5106134", "0.5103555", "0.50927514", "0.50899494", "0.5089446", "0.50843626", "0.5072599", "0.5072579", "0.5061953" ]
0.708944
0
$Author: pallabib $ $Date: 20161223 12:20:54 $ xenos Dashboard business feed infrastructure Object
function xenos$DBD$SavedQuery(parent) { // inherit this.inherit = xenos$DBD$Content; this.inherit(parent, 'xenos$DBD$SavedQuery'); // self var self = this; // attributes self.parent.hasGraph = false; // feeds this.count = 0; this.feeds = {}; this.feedsOrder = {}; // has feeds this.hasFeeds = function() { return self.count != 0; }; this.feedByPk = function(pk) { return self.feeds[pk]; }; // preparation this.prepareActivity = function() { // reset first this.feeds = {}; this.feedsOrder = {}; jQuery.each(this.json.value[0].feeds, function(order, rawFeed) { var feed = { pk: rawFeed.pk, selector: self.parent.parent.pk + 'x' + self.parent.pk + 'x' + rawFeed.pk, name: rawFeed.name, originalName: rawFeed.name, order: order, maiden: true, viewUri: rawFeed.feedUrl }; // prepare self.count++; self.feeds[feed.pk] = feed; self.feedsOrder[order] = feed.pk; }); }; // rendition this.renderer = new xenos$DBD$SavedQuery$renderer(this); // other functions // content updater this.saveNames = function(update) { if (update) { self.updateNames(); } else { self.discardNames(); } }; // update content this.updateNames = function(callback, delegator) { jQuery.each(self.feeds, function(pk, feed) { self.updateName(pk, callback, delegator); }); }; // discard update this.discardNames = function() { jQuery.each(self.feeds, function(pk, feed) { feed.name = feed.originalName; feed.dirty = false; }); }; this.updateName = function(pk, callback, delegator, errorCallback) { var feed = self.feeds[pk]; if (feed.dirty) { var savedQryName = $.trim(feed.name); if(savedQryName==''){ xenos.postNotice(xenos.notice.type.error, xenos.i18n.utilcommonvalidationmessage.provide_criteria); return; } var maxLength = 30; if(savedQryName.length>maxLength){ xenos.postNotice(xenos.notice.type.error, xenos.utils.evaluateMessage(xenos.i18n.message.invalid_namelength,[maxLength])); return; } var data = '' + '{' + '"feedPk": [' + pk + '],' + '"workSpacePk": ' + self.parent.parent.pk + ',' + '"widgetPk": ' + self.parent.pk + ',' + '"feedName": "' + encodeURIComponent(savedQryName) + '",' + '"widgetType": "SAVED_QUERY"' + '}'; jQuery.ajax({ url: xenos.context.path + "/secure/ref/savedqueryfeed/edit.json", type: 'POST', contentType: 'application/json', data: data, success: function(content) { if(!content.success) { xenos.postNotice(xenos.notice.type.error, content.value[0]); if(errorCallback){ errorCallback.call(); } return; } feed.originalName = savedQryName; feed.dirty = false; xenos.postNotice(xenos.notice.type.info, savedQryName + xenos$DBD$i18n.saved_query.saved_query_renamed); if (callback) callback.call(delegator ? delegator : self, self); } }); } }; // edit name this.editName = function(pk, name, callback, delegator) { // fixed name if (!name || name == '') return false; // edited var feed = self.feeds[pk]; if (feed.name == name) return false; feed.name = name; feed.dirty = true; if (callback) callback.call(delegator ? delegator : self, feed); return true; }; // add feeds this.addFeeds = function(feedsPk, callback, delegator) { if (feedsPk.length == 0) return false; var uri = xenos.context.path + '/secure/ref/savedqueryfeed/addfeed.json'; var json = '' + '{' + '"feedPk": ' + '['; for (var p = 0, length = feedsPk.length, lengthMinus1 = feedsPk.length - 1; p < length; p++) { json += feedsPk[p].pk; if (p < lengthMinus1) json += ','; } json += '' + '],' + '"workSpacePk": ' + self.parent.parent.pk + ',' + '"widgetPk": ' + self.parent.pk + ',' + '"widgetType": "' + self.parent.widgetType + '"' + '}'; jQuery.ajax({ url: uri, type: 'POST', contentType: 'application/json', data: json, success: function(json) { var messages = []; if (!json.success) { if(json.value[0]) { messages.push(json.value[0]); } else { jQuery.each(feedsPk, function(p, pk) { var feed = self.parent.feeds[pk.displayRowNum]; messages.push(xenos$DBD$i18n.saved_query.saved_query_not_added + feed.name); }); } xenos.postNotice(xenos.notice.type.error, messages); return; } //updating the feeds after add to get the newly created custom_saved_query pk jQuery.getJSON(self.parent.contentUri, function(response) { if (!response.success) { if(response.value[0]) { messages.push(response.value[0]); } else { jQuery.each(feedsPk, function(p, pk) { var feed = self.parent.feeds[pk.displayRowNum]; messages.push(xenos$DBD$i18n.saved_query.saved_query_not_added + feed.name); }); } xenos.postNotice(xenos.notice.type.error, messages); return; } // prepare jQuery.each(feedsPk, function(p, pk) { var feed = self.parent.feeds[pk.displayRowNum]; // prepare feed.selector = self.parent.parent.pk + 'x' + self.parent.pk + 'x' + feed.pk; feed.order = self.count++; feed.maiden = true; feed.viewUri = response.value[0].feeds[feed.order].feedUrl; self.feeds[feed.pk] = feed; self.feedsOrder[feed.order] = feed.pk; messages.push(feed.name + xenos$DBD$i18n.saved_query.saved_query_added); }); xenos.postNotice(xenos.notice.type.info, messages); if (callback) callback.call(delegator ? delegator : self, feedsPk); }); } }); return true; }; // remove feed this.removeFeed = function(feedPk, callback, delegator) { var feed = self.feedByPk(feedPk); // First check the feed whether it is present. if (feed) { var uri = xenos.context.path + '/secure/ref/savedqueryfeed/remove/' + self.parent.parent.pk + '/' + self.parent.pk + '/' + feedPk + '.json'; jQuery.getJSON(uri, function(json) { if (!json.success) { console.log(json); xenos.postNotice(xenos.notice.type.error, xenos$DBD$i18n.saved_query.saved_query_not_removed + feed.name); return; } // remove from feeds self.removeAndReorderFeed(feedPk); xenos.postNotice(xenos.notice.type.info, feed.name + xenos$DBD$i18n.saved_query.saved_query_removed); if (callback) callback.call(delegator ? delegator : self, feed); }); } return true; }; /** * Remove a feed from the feed array and reorder the remaining feeds. */ this.removeAndReorderFeed = function(feedPk){ var feed = self.feedByPk(feedPk); self.count--; delete self.feeds[feedPk]; for (var newOrder = 0; newOrder < self.count; newOrder++) { if (newOrder >= feed.order) { self.feedsOrder[newOrder] = self.feedsOrder[newOrder + 1]; self.feeds[self.feedsOrder[newOrder]].order = newOrder; } } delete self.feedsOrder[self.count]; }; /** * Remove a saved query from widget only. */ this.removeDirtyFeed = function(feedPk, callback) { var feed = self.feedByPk(feedPk); self.removeAndReorderFeed(feedPk); if (callback) callback.call(self, feed); }; /** * Refresh a saved query widget. */ this.refresh = function() { var _func = function(row) { self.renderer.fixSaver(); $(row).remove(); }; var $widget = jQuery('#Widget' + self.parent.selector); $widget.find('.addFeed.contentArea').remove(); $widget.find('.addFeedButton').parent().parent().addClass('addButtonOpc'); jQuery.each($widget.find('.contentHolder').find('.row'), function(rowOrder, row){ self.removeDirtyFeed($(row).attr('pk'), _func(row)); }); $widget.find('.contentHolder').jScrollPane({showArrows: true}); self.prepareActivity(); self.renderer.render(true); if(!self.parent.parent.parent.editable){ $widget.find('.saveQuery-edit-ico-holder').hide(); $widget.find('.saveQuery-close-ico-holder').hide(); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xenos$DBD$BusinessFeed(parent) {\n // inherit\n this.inherit = xenos$DBD$Content;\n this.inherit(parent, 'xenos$DBD$BusinessFeed');\n // self\n var self = this;\n\n\n // attributes\n\n self.parent.hasGraph = true;\n\n\n // feeds\n this.count = 0;\n\n this.feeds = {};\n this.feedsOrder = {};\n\n // has feeds\n this.hasFeeds = function() {\n return self.count != 0;\n };\n\n this.feedByPk = function(pk) {\n return self.feeds[pk];\n };\n\n\n // chart data\n this.chartData = [];\n\n\n this.polling = function(feed) {\n var uri = xenos.context.path + '/secure/ref/businessfeed/detail/' + feed.pk + '.json';\n var options = {\n url: uri,\n dataType: 'json',\n success: function(json) {\n if (!json.success) {\n console.log(json);\n \t\t if(json.warning) {\n\t\t feed.warning = true;\n\t\t } else {\n\t\t feed.error = true;\n\t\t }\n self.render('update');\n return;\n }\n\n // prepare\n feed.error = false;\n\t\tfeed.warning = false;\n if (json.value[0].count != null)\n feed.data = json.value[0].count;\n\n // chart data\n var series = self.chartData[feed.order];\n if (series.data.length >= 10) {\n for (var i = 1 ; i < series.data.length ; i++) {\n series.data[i - 1] = series.data[i];\n }\n }\n series.data.push([new Date().getTime(), feed.data]);\n\n self.render('update');\n\n\n // direct chart\n if (self.renderer.chart) {\n series = self.renderer.chart.get(feed.name);\n series.addPoint({x: new Date().getTime(), y: feed.data}, true, series.data.length >= 10);\n }\n }\n };\n\n jQuery.ajaxq(self.parent.name, options);\n };\n\n\n // preparation\n this.prepareActivity = function() {\n // reset first\n this.feeds = {};\n this.feedsOrder = {};\n\n jQuery.each(this.json.value[0].feeds, function(order, rawFeed) {\n var feed = {\n pk: rawFeed.pk,\n selector: self.parent.parent.pk + 'x' + self.parent.pk + 'x' + rawFeed.pk,\n name: rawFeed.name,\n order: order,\n maiden: true,\n error: false,\n\t\twarning: false,\n data: 0,\n dataUri: rawFeed.dataUrl,\n dataInterval: rawFeed.asyncInterval,\n pollingId: 0,\n viewUri: rawFeed.feedUrl,\n\t\tcountRendered : false\n };\n\n // prepare\n self.count++;\n\n self.feeds[feed.pk] = feed;\n self.feedsOrder[order] = feed.pk;\n\n // chart data\n self.chartData.push({\n id: feed.name,\n name: feed.name,\n showInLegend: false,\n data: []\n });\n });\n };\n\n\n // rendition\n this.renderer = new xenos$DBD$BusinessFeed$renderer(this);\n\n\n // connection\n this.connectActivity = function() {\n jQuery.each(self.feeds, function(pk, feed) {\n if (feed.dataInterval) {\n if (!feed.countRendered)\n setTimeout(function() {self.polling(feed);}, 0);\n\n if (!feed.pollingId)\n feed.pollingId = setInterval(function() {self.polling(feed);}, feed.dataInterval);\n }\n });\n };\n\n this.disconnectActivity = function() {\n jQuery.each(self.feeds, function(pk, feed) {\n if (feed.pollingId) {\n clearInterval(feed.pollingId);\n feed.pollingId = 0;\n\n jQuery.ajaxq(self.parent.name);\n }\n });\n };\n\n\n // other functions\n\n // add feeds\n this.addFeeds = function(feedsPk, callback, delegator) {\n\t if (feedsPk.length == 0) return false;\n\n\t var uri = xenos.context.path + '/secure/ref/widget/addfeed.json';\n\n var json = ''\n + '{'\n + '\"feedPk\": '\n + '[';\n\n for (var p = 0, length = feedsPk.length, lengthMinus1 = feedsPk.length - 1; p < length; p++) {\n json += feedsPk[p].pk;\n\n if (p < lengthMinus1)\n json += ',';\n }\n\n json += ''\n + '],'\n + '\"workSpacePk\": ' + self.parent.parent.pk + ','\n + '\"widgetPk\": ' + self.parent.pk + ','\n + '\"widgetType\": \"' + self.parent.widgetType + '\"'\n + '}';\n\n\n jQuery.ajax({\n url: uri,\n type: 'POST',\n contentType: 'application/json',\n data: json,\n success: function(json) {\n var messages = [];\n\n if (!json.success) {\n console.log(json);\n jQuery.each(feedsPk, function(p, pk) {\n\t\t \n var feed = self.parent.feeds[pk.displayRowNum];\n messages.push(xenos$DBD$i18n.business.feed_not_added + feed.name);\n });\n xenos.postNotice(xenos.notice.type.error, messages);\n return;\n }\n\n // prepare\n jQuery.each(feedsPk, function(p, pk) {\n var feed = self.parent.feeds[pk.displayRowNum];\n // prepare\n feed.selector = self.parent.parent.pk + 'x' + self.parent.pk + 'x' + feed.pk;\n\n feed.order = self.count++;\n feed.maiden = true;\n feed.error = false;\n\t\t feed.warning = false;\n feed.data = 0;\n\n self.feeds[feed.pk] = feed;\n self.feedsOrder[feed.order] = feed.pk;\n\n // chart data\n self.chartData.push({\n id: feed.name,\n name: feed.name,\n showInLegend: false,\n data: []\n });\n\n // connect\n if (feed.dataInterval) {\n if (feed.data == 0)\n setTimeout(function() {self.polling(feed);}, 0);\n\n if (!feed.pollingId)\n feed.pollingId = setInterval(function() {self.polling(feed);}, feed.dataInterval);\n }\n\n messages.push(feed.name + xenos$DBD$i18n.business.feed_added);\n });\n\n\n xenos.postNotice(xenos.notice.type.info, messages);\n if (callback) callback.call(delegator ? delegator : self, feedsPk);\n }\n });\n\n return true;\n };\n\n // remove feed\n this.removeFeed = function(feedPk, callback, delegator) {\n var feed = self.feedByPk(feedPk);\n\n var uri = xenos.context.path + '/secure/ref/widget/remove/' + self.parent.parent.pk + '/' + self.parent.pk + '/' + feedPk + '.json';\n jQuery.getJSON(uri, function(json) {\n if (!json.success) {\n console.log(json);\n xenos.postNotice(xenos.notice.type.error, xenos$DBD$i18n.business.feed_not_removed + feed.name);\n return;\n }\n\n // remove from feeds\n self.count--;\n\n // disconnect\n if (feed.pollingId) {\n clearInterval(feed.pollingId);\n feed.pollingId = 0;\n }\n\n delete self.feeds[feedPk];\n\n for (var newOrder = 0; newOrder < self.count; newOrder++)\n if (newOrder >= feed.order) {\n self.feedsOrder[newOrder] = self.feedsOrder[newOrder + 1];\n self.feeds[self.feedsOrder[newOrder]].order = newOrder;\n\n // chart data\n self.chartData[newOrder] = self.chartData[newOrder + 1];\n }\n\n delete self.feedsOrder[self.count];\n\n // chart data\n self.chartData.pop();\n\n xenos.postNotice(xenos.notice.type.info, feed.name + xenos$DBD$i18n.business.feed_removed);\n if (callback) callback.call(delegator ? delegator : self, feed);\n });\n\n return true;\n };\n}", "function getAndDisplayBusinessData() {\n\tgetBusinessData(displayBusinessData);\n\n}", "debugEndpointProvider() {\n console.log(this.epProvider.getEndPointByName('allData'));\n console.log(this.epProvider.buildEndPointWithQueryStringFromObject({\n limit: 10,\n sort: 'title',\n page: 1,\n filter: 'marketing-automation,ad-network',\n direction: 1,\n }, '/fetch-all'));\n }", "async create(feed) {\n feed.options = {\n title: 'Mastering Backend Development',\n link: 'https://masteringbackend.com/jobs.xml',\n description: 'This is Mastering Backend Development Job feeds!',\n }\n\n const jobs = await Utils.getJobs()\n jobs.forEach((job) => {\n feed.addItem({\n title: job.title,\n id: `https://masteringbackend.com/jobs/${job.slug}`,\n link: `https://masteringbackend.com/jobs/${job.slug}`,\n description: job.location,\n content: job.description,\n date: new Date(job.created_at),\n updated: new Date(job.created_at),\n // author: {\n // name: post.author.name,\n // link: 'https://masteringbackend.com/authors/' + post.author.slug,\n // },\n })\n })\n }", "async create(feed) {\n feed.options = {\n title: 'Mastering Backend Development',\n link: 'https://masteringbackend.com/feed.xml',\n description: 'This is Mastering Backend Development feeds!',\n }\n\n const posts = await Utils.getPosts()\n posts.forEach((post) => {\n feed.addItem({\n title: post.title,\n id: `https://masteringbackend.com/posts/${post.slug}`,\n link: `https://masteringbackend.com/posts/${post.slug}`,\n description: post.excerpt,\n content: post.content,\n date: new Date(post.date),\n updated: new Date(post.modified),\n author: {\n name: post.author.name,\n link: 'https://masteringbackend.com/authors/' + post.author.slug,\n },\n })\n\n post.categories.forEach((category) => {\n feed.addCategory(category.title)\n })\n\n feed.addContributor({\n name: post.author.name,\n })\n })\n }", "function Business(local){\n this.name = local.name;\n this.image_url = local.image_url;\n this.price = local.price;\n this.rating = local.rating;\n this.url = local.url;\n}", "constructor() {\n /**\n * Deployment details. Initialized from the scope.\n * @export {!backendApi.DeploymentDetail}\n */\n this.deployment;\n }", "function getDataBySystem(jdata) {\n viewport.clear(); // reset viewport\n $('ul.variables').html(\"\"); // reset variables\n // reset entity objects\n mRoot.infoEntities = new Collection();\n mRoot.objEntities = new Collection();\n\n // reset connection objects\n mRoot.infoConnections = new Collection();\n mRoot.objConnections = new Collection();\n\n // reset variable objects\n mRoot.infoVariables = new Collection();\n\n var root = jdata.WorkflowService[\"ftwa:StartWorkflow\"][\"ftwa:StartWorkflow.Activities\"][\"p:Flowchart\"], // get from service to start workflow -> flowchart\n managers = jdata.WorkflowService[\"sap2010:WorkflowViewState.ViewStateManager\"][\"sap2010:ViewStateManager\"][\"sap2010:ViewStateData\"], // get from service\n variables = root[\"p:Flowchart.Variables\"]; // \n\n // get start\n var root_start = root[\"@StartNode\"] !== undefined ? root[\"@StartNode\"] : root[\"p:Flowchart.StartNode\"],\n start = new Entity();\n start.label = \"Start\";\n start.annotation = root[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root[\"@sap2010:Annotation.AnnotationText\"] : \"\";\n start.type = typeEntity.t_start;\n start.alias = root[\"@sap2010:WorkflowViewState.IdRef\"] === undefined ? root[\"sap2010:WorkflowViewState.IdRef\"] : root[\"@sap2010:WorkflowViewState.IdRef\"];\n mRoot.infoEntities.add(start);\n\n // get variables \n getVariables(variables);\n // get decisions and switchs\n getEntities(root);\n\n // get position info and connection\n mRoot.infoEntities.forEach(function (entity) {\n for (var i = 0; i < managers.length; i++) {\n var node = managers[i];\n if (node[\"@Id\"] === entity.alias) {\n var points = node[\"sap:WorkflowViewStateService.ViewState\"][\"scg:Dictionary\"][\"av:Point\"][\"#text\"].split(\",\");\n var sizes = node[\"sap:WorkflowViewStateService.ViewState\"][\"scg:Dictionary\"][\"av:Size\"][\"#text\"].split(\",\");\n entity.x = parseFloat(points[0]);\n entity.y = parseFloat(points[1]);\n entity.width = parseFloat(sizes[0]);\n entity.height = parseFloat(sizes[1]);\n\n if (entity.type !== typeEntity.t_approve && entity.type !== typeEntity.t_generic) {\n mRoot.objEntities.add(drawEntity(viewport, entity));\n } else {\n mRoot.objEntities.add(drawEntityFlow(viewport, entity));\n }\n\n if (entity.type === typeEntity.t_start) { // size of flowchart belong to start\n // resize viewport\n var size = node[\"@sap:VirtualizedContainerService.HintSize\"].split(\",\"); // hash size w/h\n mViewport = {\n width: parseFloat(size[0]) < defaultValue.viewport.width ? defaultValue.viewport.width : parseFloat(size[0]),\n height: parseFloat(size[1]) < defaultValue.viewport.height ? defaultValue.viewport.height : parseFloat(size[1])\n };\n $('#viewport').width(mViewport.width);\n $('#viewport').height(mViewport.height);\n viewport.setSize(mViewport.width, mViewport.height); // set new size of viewport from data\n\n // reset scroll\n if (scrollbar !== null) {\n scrollbar.destroy();\n }\n scrollbar = $('#chart').jScrollPane().data().jsp;\n }\n }\n }\n });\n\n mRoot.infoEntities.forEach(function (entity) {\n for (var i = 0; i < managers.length; i++) {\n var node = managers[i];\n if (node[\"@Id\"] === entity.alias) {\n // get connections\n if (node[\"sap:WorkflowViewStateService.ViewState\"][\"scg:Dictionary\"][\"av:PointCollection\"] !== undefined) {\n var info = node[\"sap:WorkflowViewStateService.ViewState\"][\"scg:Dictionary\"][\"av:PointCollection\"];\n if (node[\"sap:WorkflowViewStateService.ViewState\"][\"scg:Dictionary\"][\"x:String\"] !== undefined) {\n labelDefault = node[\"sap:WorkflowViewStateService.ViewState\"][\"scg:Dictionary\"][\"x:String\"][\"#text\"];\n getConnections(entity, info, labelDefault);\n } else {\n getConnections(entity, info);\n }\n }\n }\n }\n });\n mRoot.infoConnections.forEach(function (obj) {\n var connection = createConnection(obj);\n // can't draw label connnection begin/end is start\n if (mRoot.infoEntities.itemByID(obj.from).type !== typeEntity.t_start &&\n mRoot.infoEntities.itemByID(obj.to).type !== typeEntity.t_start) {\n // it's decision => set connection is true or false\n if (mRoot.infoEntities.itemByID(obj.from).type === typeEntity.t_decision) {\n if (obj.fromHolder == 2) {\n obj.label = 'False';\n } else {\n obj.label = 'True';\n }\n }\n // description of connection from switch\n obj.description = obj.label;\n\n // connection from generic/approve, it not labels\n if (mRoot.infoEntities.itemByID(obj.from).type !== typeEntity.t_generic &&\n mRoot.infoEntities.itemByID(obj.from).type !== typeEntity.t_approve) {\n // draw temp a label for get width/height.\n var temp = viewport.text(-100, -100, obj.label).attr({ \"font-size\": \"10px\" });\n connection.label = drawLabel(connection.posLabel.x, connection.posLabel.y, temp.getBBox().width, temp.getBBox().height, obj.label, viewport);\n connection.label.mask.parent = connection;\n temp.remove();\n }\n }\n\n mRoot.objConnections.add(connection);\n });\n}", "constructor() {\n // Always call super first in constructor\n // https://github.com/mdn/web-components-examples/blob/master/life-cycle-callbacks/main.js\n super()\n\n // Element functionality written in here\n this._hass = null\n this._config = null\n\n this.attachShadow({ mode: \"open\" })\n\n // card settings\n this.card_icon = null\n this.card_title = null\n this.card_height = 240\n\n // all for chart\n this.theme = \"\"\n this.themeSettings = null\n this.graphChart = null\n this.chart_type = \"bar\"\n this.chart_locale = \"de-DE\"\n this.chart_update = false\n this.ctx = null\n this.chartconfig = null\n this.graphData = {}\n\n // data providers\n this.hassEntities = []\n this.entities = []\n this.entityOptions = null\n this.entity_ids = []\n this.entityData = []\n this.entityNames = []\n\n // data service\n this.data_hoursToShow = 0\n this.data_group_by = \"day\"\n this.data_aggregate = \"last\"\n this.updateTimer = -1\n this.update_interval = 60 * 1000\n this.data_ignoreZero = false\n this.data_units = \"\"\n this.skipRender = false\n this.lastUpdate = null\n this.ready = false\n this.updating = false\n this.loginfo_enabled = true\n this._initialized = false\n this.initial = true\n this.dataInfo = {\n starttime: new Date(),\n endtime: new Date(),\n entities: \"\",\n time: new Date().getTime(),\n loading: false,\n url: \"\",\n param: \"\"\n }\n }", "constructor() {\n /**\n *\n * @member {String} name\n */\n this.name = undefined\n /**\n *\n * @member {String} displayName\n */\n this.displayName = undefined\n /**\n *\n * @member {String} url\n */\n this.url = undefined\n /**\n *\n * @member {String} description\n */\n this.description = undefined\n /**\n * @member {module:models/OpeningSchedule} openingHours\n */\n this.openingHours = undefined\n /**\n *\n * @member {String} storeContent\n */\n this.storeContent = undefined\n /**\n *\n * @member {Object} features\n */\n this.features = undefined\n /**\n * @member {module:models/GeoPoint} geoPoint\n */\n this.geoPoint = undefined\n /**\n *\n * @member {String} formattedDistance\n */\n this.formattedDistance = undefined\n /**\n *\n * @member {Number} distanceKm\n */\n this.distanceKm = undefined\n /**\n * @member {module:models/Image} mapIcon\n */\n this.mapIcon = undefined\n /**\n * @member {module:models/Address} address\n */\n this.address = undefined\n /**\n *\n * @member {Array.<module:models/Image>} storeImages\n */\n this.storeImages = undefined\n }", "constructor() {\n // Always call super first in constructor\n // https://github.com/mdn/web-components-examples/blob/master/life-cycle-callbacks/main.js\n super()\n\n /**\n * Element functionality written in here\n */\n this._hass = null\n this._config = null\n this.attachShadow({ mode: \"open\" })\n\n /**\n * card settings\n */\n this.card_icon = null\n this.card_title = null\n this.card_height = 240\n\n /**\n * all for chart\n */\n this.theme = \"\"\n this.themeSettings = null\n this.graphChart = null\n this.chart_type = \"bar\"\n this.chart_locale = \"de-DE\"\n this.chart_update = false\n this.ctx = null\n this.chartconfig = null\n this.graphData = {}\n\n /**\n * data providers\n */\n this.hassEntities = [] // all from hass\n this.entity_items = new Entities(null, false) // all entity data\n this.entity_options = null // all entity options\n\n /**\n * data service\n */\n this.updateTimer = -1\n this.update_interval = 60 * 1000\n this.skipRender = false\n this.lastUpdate = null\n this.ready = false\n this.updating = false\n this._initialized = false\n this.initial = true\n\n /**\n * all for the dataprovider\n */\n this.dataInfo = {\n time_start: new Date(),\n ISO_time_start: new Date().toISOString(),\n time_end: new Date(),\n ISO_time_end: new Date().toISOString(),\n entity_items: null,\n entities: \"\",\n useAlias: false,\n time: new Date().getTime(),\n loading: false,\n url: \"\",\n prev_url: \"not_set\",\n param: \"\",\n options: \"\"\n }\n\n /**\n * internal debugger and profiler\n */\n this.DEBUGMODE = 0\n this.DEBUGDATA = {\n API: {}\n }\n this.APISTART = performance.now()\n this.DEBUGDATA.API.elapsed_total = 0\n this.DEBUGDATA.PROFILER = {}\n }", "constructor() {\n // Always call super first in constructor\n // https://github.com/mdn/web-components-examples/blob/master/life-cycle-callbacks/main.js\n super()\n\n /**\n * Element functionality written in here\n */\n this._hass = null\n this._config = null\n this.attachShadow({ mode: \"open\" })\n\n /**\n * card settings\n */\n this.card_icon = null\n this.card_title = null\n this.card_height = 240\n\n /**\n * all for chart\n */\n this.theme = \"\"\n this.themeSettings = null\n this.graphChart = null\n this.chart_type = \"bar\"\n this.chart_locale = \"de-DE\"\n this.chart_update = false\n this.ctx = null\n this.chartconfig = null\n this.graphData = {}\n\n /**\n * data providers\n */\n this.hassEntities = [] // all from hass\n this.entity_items = new Entities(null, false) // all entity data\n this.entity_options = null // all entity options\n\n /**\n * data service\n */\n this.updateTimer = -1\n this.update_interval = 60 * 1000\n this.skipRender = false\n this.lastUpdate = null\n this.ready = false\n this.updating = false\n this._initialized = false\n this.initial = true\n\n /**\n * all for the dataprovider\n */\n this.dataInfo = {\n time_start: new Date(),\n ISO_time_start: new Date().toISOString(),\n time_end: new Date(),\n ISO_time_end: new Date().toISOString(),\n entity_items: null,\n entities: \"\",\n useAlias: false,\n time: new Date().getTime(),\n loading: false,\n url: \"\",\n prev_url: \"not_set\",\n param: \"\",\n options: \"\"\n }\n\n /**\n * internal debugger and profiler\n */\n this.DEBUGMODE = 0\n this.DEBUGDATA = {\n API: {}\n }\n this.APISTART = performance.now()\n this.DEBUGDATA.API.elapsed_total = 0\n this.DEBUGDATA.PROFILER = {}\n }", "function DataApi() { }", "function DataApi() { }", "function ProviderData() {}", "function ProviderData() {}", "function ProviderData() {}", "function ProviderData() { }", "function ProviderData() { }", "async create(feed) {\n feed.options = {\n title: '遺言書',\n link: 'https://blog.himanoa.net/rss',\n description: '遺言を書きます'\n }\n\n const posts = (await axios.get(\n `${process.env.apiUrl}/entries?offset=0&limit=15`\n )).data.entries\n posts.forEach(post => {\n feed.addItem({\n title: post.title,\n id: post.id,\n link: `https://blog.himanoa.net/entries/${post.id}`,\n description: post.html,\n content: post.html\n })\n })\n\n feed.addContributor({\n name: 'himanoa',\n email: '[email protected]',\n link: 'https://blog.himanoa.net'\n })\n }", "function DatasourceRegistryEntry( config ) {\n \n //console.log('config', config);\n // to modif config add OCD iotHubNodeId for Compatible\n //if (!config.hasOwnProperty('iotHubNodeId'))\n //{\n // config.iotHubNodeId = \"\";\n //}\n if (!config.hasOwnProperty('protocol')) {\n config.protocol = \"amqp\";\n }\n //console.log(config.id);\n //console.log(\"[\" + config.id + \"] Credentials:\" + RED.nodes.getCredentials(config.id));\n //if (RED.nodes.getCredentials(config.id) == undefined)\n //{\n // config.cloudReady = false;\n //}\n // console.log(RED.settings.ocdCurConf);\n \n if ((RED.hasOwnProperty('settings')) && \n (RED.settings.hasOwnProperty('ocdCurConf')) && \n (RED.settings.ocdCurConf.hasOwnProperty('status')) &&\n (RED.settings.ocdCurConf.status.toLowerCase() == 'ready') &&\n (RED.settings.ocdCurConf.hasOwnProperty('connectionString'))) {\n config.cloudReady = true;\n } else {\n config.cloudReady = false;\n }\n \n RED.nodes.createNode( this, config );\n \n var self = this;\n self.protocol = config.protocol;\n self.client = null;\n \n //console.log(self.id);\n //if (!self.hasOwnProperty('credentials'))\n if (!config.cloudReady) {\n // node no credentials change icon\n self.status({ fill: \"red\", shape: \"dot\", text: \"OCD Not Ready\", key: \"cloudReady\", keyValue: false });\n }\n \n self.tstampField = config.tstampField.trim() || \"tstamp\";\n self.dataField = config.dataField.trim() || \"data\";\n self.dataComponents = undefined;\n if( config.disableDiscover ) { self.dataComponents = null; }\n //this.iotHubNodeId = config.iotHubNodeId.trim() || \"\";\n \n self.clients = [];\n self.currentHistoryRequest = null;\n self.historyRequests = {};\n self.currentButtonRequest = null;\n self.buttonRequests = {};\n self.currentClickRequest = null;\n self.clickRequests = {};\n self.currentDataBroker = null;\n self.dataBrokers = {};\n \n this.on( \"input\" , function( msg ) {\n if(!msg.hasOwnProperty( \"payload\" )) {\n setStatus(self, statusEnum.nopayload);\n return;\n }\n\n if (sysConf.sysconf.inCloud == 0 &&\n self.hasOwnProperty('credentials') && \n self.credentials.hasOwnProperty('connectionstring')) {\n // process IoT Hub Device \n RED.log.info('DS ID: ' + self.id + ' CS: ' + self.credentials.connectionstring);\n // check self.client\n if (!self.client) {\n try {\n self.client = Client.fromConnectionString(self.credentials.connectionstring, Protocols[self.protocol]);\n } catch(e) {\n console.info(\"[Dashboard]Iot-hub-device]fromConnectionString Error:\", e);\n return;\n }\n \n self.client.open(function (err)\n {\n if (err)\n {\n RED.log.error('[Dashboard][' + self.id + '] Could not connect: ' + err.message);\n disconnectFromIoTHub(self);\n setStatus(self, statusEnum.disconnected);\n return;\n }\n else\n {\n RED.log.info('[Dashboard][' + self.id + '] Connected to Azure IoT Hub.');\n setStatus(self, statusEnum.connected);\n \n // Check if a message is pending and send it \n //if (pendingMessage) {\n // node.log('Message is pending. Sending it to Azure IoT Hub.');\n // // Send the pending message\n // sendData(pendingMessage);\n //}\n \n self.client.on('message', function (msg)\n {\n // We received a message\n RED.log.info('[Dashboard][' + self.id + '] Message received from Azure IoT Hub\\n Id: ' + msg.messageId + '\\n Payload: ' + msg.data);\n var outpuMessage = {};\n outpuMessage.messageId = msg.messageId;\n outpuMessage.payload = JSON.parse(msg.data);\n setStatus(self, statusEnum.received);\n self.send(outpuMessage);\n self.client.complete(msg, printResultFor(self, 'Completed'));\n });\n \n self.client.on('error', function (err) \n {\n RED.log.error(err.message); \n });\n \n self.client.on('disconnect', function () \n {\n disconnectFromIoTHub(self);\n });\n }\n });\n } else {\n sendData(self, msg);\n }\n } else {\n setStatus(self, {color: 'yellow', text: ''});\n }\n // --- \n \n if( typeof msg.payload == \"string\" && msg.payload == \"reset\" ) {\n self.dataComponents = undefined;\n self.sendToAll( JSON.stringify( {\n type : \"config\",\n id : self.id,\n config : self.getDatasourceConfig()\n }));\n return;\n }\n \n // Deduce(?) data components\n if( self.dataComponents === undefined ) {\n var dataPoint = util.isArray( msg.payload ) ? msg.payload[0] : msg.payload;\n if( dataPoint.hasOwnProperty( self.dataField ) ) {\n if( typeof dataPoint[ self.dataField ] === \"object\" ) {\n self.dataComponents = [];\n var dataObj = dataPoint[ self.dataField ];\n for( var key in dataObj )\n {\n if( !dataObj.hasOwnProperty( key ) ) { continue; }\n self.dataComponents.push( key );\n }\n }\n else { self.dataComponents = null; }\n }\n \n var configMsg = {\n type : \"config\",\n id : self.id,\n config : self.getDatasourceConfig()\n };\n \n self.sendToAll( JSON.stringify( configMsg ) );\n }\n \n var newData;\n \n // Historic data request\n if( !self.currentHistoryRequest && self.historyRequests.hasOwnProperty( msg._msgid ) ) {\n self.currentHistoryRequest = self.historyRequests[ msg._msgid ];\n delete self.historyRequests[ msg._msgid ];\n }\n \n if( self.currentHistoryRequest ) {\n newData = {\n type : \"history\",\n id : self.id,\n cid : self.currentHistoryRequest.cid,\n data : msg.payload\n };\n self.currentHistoryRequest.ws.send( JSON.stringify( newData ) );\n self.currentHistoryRequest = null;\n } else {\n newData = {\n type : \"live\",\n id : self.id,\n data : msg.payload\n };\n newData = JSON.stringify( newData );\n \n // Send live data to all connected clients\n this.sendToAll( newData );\n }\n \n } );\n \n this.on( \"close\" , function() {\n for( var i = 0; i < self.clients.length; i++ )\n {\n self.clients[i].ws.close();\n }\n } );\n \n // Finds the index of a data point inside an array of data points sorted by unique timestamp\n // If not found, will return the index of the closest data point with timestamp < queried timestamp\n this.findData = function( data , timestamp ) {\n var min = 0, max = data.length - 1, mid = 0;\n \n while( max >= min ) {\n mid = Math.floor( ( min + max ) / 2 );\n if( data[ mid ][ this.tstampField ] == timestamp ) { return mid; }\n else if( data[ mid ][ this.tstampField ] > timestamp ) { max = mid - 1; }\n else { min = mid + 1; }\n }\n \n return data[ mid ][ this.tstampField ] < timestamp ? mid : mid - 1;\n };\n \n this.handleHistoryRequest = function( ws , cid , start , end ) {\n var msg = {\n payload : {\n start : start,\n end : end\n },\n deviceId : this.id\n };\n \n var request = {\n ws : ws,\n cid : cid\n };\n \n self.currentHistoryRequest = request;\n this.send( msg );\n self.currentHistoryRequest = null;\n this.historyRequests[ msg._msgid ] = request;\n };\n \n this.handleButtonRequest = function( ws , cid , start , end ) {\n console.log(this.id);\n var msg = {\n payload : {\n start : start,\n end : end,\n button: \"button\"\n },\n deviceId : this.id\n };\n \n var request = {\n ws : ws,\n cid : cid\n };\n \n self.currentButtonRequest = request;\n this.send( msg );\n self.currentButtonRequest = null;\n this.buttonRequests[ msg._msgid ] = request;\n };\n \n this.handleClickRequest = function( ws , cid , data ) {\n var msg = {\n payload : {\n data : data\n },\n deviceId : this.id\n };\n \n var request = {\n ws : ws,\n cid : cid\n };\n \n self.currentClickRequest = request;\n this.send( msg );\n self.currentClickRequest = null;\n this.clickRequests[ msg._msgid ] = request;\n };\n \n /**\n *\n */\n this.handleDataBroker = function( ws , cid , data ) {\n var msg = {\n payload : {\n data : data\n },\n deviceId : this.id\n };\n \n var request = {\n ws : ws,\n cid : cid\n };\n \n self.currentDataBroker = request;\n this.send( msg );\n self.currentDataBroker = null;\n this.dataBrokers[ msg._msgid ] = request;\n };\n \n this.addClient = function( client ) {\n for( var i = 0; i < this.clients.length; i++ ) {\n if( client.ws == this.clients[i].ws ) { return; }\n }\n \n this.clients.push( client );\n var configMsg = {\n type : \"config\",\n id : this.id,\n config : this.getDatasourceConfig()\n };\n \n // console.log(\"[addClient] JSON.stringify( configMsg ):\" + JSON.stringify( configMsg ))\n client.ws.send( JSON.stringify( configMsg ) );\n };\n \n this.removeClient = function( ws ) {\n for( var i = 0; i < this.clients.length; i++ ) {\n if( this.clients[i].ws == ws ) {\n this.clients.splice( i , 1 );\n return;\n }\n }\n };\n \n this.sendToAll = function( msg ) {\n for(var i = 0; i < this.clients.length; i++ ) {\n if( this.clients[i].ws.readyState == this.clients[i].ws.CLOSED ) {\n this.clients.splice( i-- , 1 );\n continue;\n }\n this.clients[i].ws.send( msg );\n }\n };\n \n this.getDatasourceConfig = function() {\n return {\n name : this.name,\n tstampField : this.tstampField,\n dataField : this.dataField,\n dataComponents : this.dataComponents\n };\n };\n }", "function ProviderData(){}", "createBaseFeed(feedOptions, type) {\n const { config } = this.imports\n const { hCard } = this.options\n const defaults = {\n title: config.get('siteBaseUrl') + ` ${type} feed`,\n id: config.get('endpointBaseUrl') + `/plugin/feeds/${type}`, // TODO: need to add extra path\n link: config.get('siteBaseUrl'),\n generator: '@postr/plugin-feeds', // optional, default = 'Feed for Node.js'\n feedLinks: {\n jf2: config.get('endpointBaseUrl') + `/plugin/feeds/jf2`,\n rss: config.get('endpointBaseUrl') + `/plugin/feeds/rss`,\n json: config.get('endpointBaseUrl') + `/plugin/feeds/json`,\n atom: config.get('endpointBaseUrl') + `/plugin/feeds/atom`,\n },\n author: {\n name: hCard.properties.name[0],\n photo: hCard.properties.photo[0],\n link: hCard.properties.url\n ? hCard.properties.url[0]\n : config.get('siteBaseUrl'),\n },\n }\n feedOptions = Object.assign({}, defaults, feedOptions)\n const feed = new Feed(feedOptions)\n return feed\n }", "function xenos$DBD$TaskFeed(parent) {\n this.type = 'xenos$DBD$TaskFeed';\n // inherit\n this.inherit = xenos$DBD$Content;\n this.inherit(parent);\n // self\n var self = this;\n\tvar renderFirstTime = true;\t\n\t\n\t/*default markup*/\n\tthis.myTaskMarkup = \"<div class=\\\"row\\\">\"\n\t\t\t\t\t\t+ \"<div class=\\\"left contentBlockLabel {{if taskStatusName == 'CLOSE'}}strike{{/if}}\\\" >\"\n\t\t\t\t\t\t+ \" <span class=\\\"taskName\\\" title=${taskName}>${taskName}</span>\"\n\t\t\t\t\t\t+ \" <span class=\\\"taskAssignee\\\">${reporter}</span>\"\t\t \n\t\t\t\t\t\t+ \" <span class=\\\"taskDate\\\">${dueDateStr}</span>\"\n\t\t\t\t\t\t+ \"</div>\"\t\t\t\t \n\t\t\t\t\t\t+ \"{{if taskStatusName == 'CLOSE'}}\"\n\t\t\t\t\t\t+\" <div class=\\\"right task-reopen-ico-holder\\\"><span title=\\\"ReOpen\\\" class=\\\"right task-reopen-ico\\\" taskPk=${taskDetailPk}>R</span></div>\"\n\t\t\t\t\t\t+ \"{{else}}\"\n\t\t\t\t\t\t+\" <div class=\\\"right task-resolved-ico-holder\\\"><span title=\\\"Resolved\\\" class=\\\"right task-resolved-ico\\\" taskPk=${taskDetailPk}>Q</span></div>\"\n\t\t\t\t\t\t+ \"{{/if}}\"\n\t\t\t\t\t\t+ \"<div class=\\\"clear rowfooter\\\"></div>\"\n\t\t\t\t\t\t+ \"</div>\";\n\t\n\tthis.assignedTaskMarkup = \"<div class=\\\"row\\\">\"\n\t\t\t\t\t + \"<div class=\\\"left contentBlockLabel {{if taskStatusName == 'CLOSE'}}strike{{/if}}\\\" >\"\n\t\t\t\t\t + \"<span class=\\\"taskName\\\">${taskName}</span>\"\t\t\t\t \n\t\t\t\t\t + \"<span class=\\\"taskAssignee\\\">${assignee}</span>\"\t\t\t\t \n\t\t\t\t\t + \"<span class=\\\"taskDate\\\">${dueDateStr}</span>\"\n\t\t\t\t\t + \"</div><div class=\\\"clear rowfooter\\\"></div>\"\n\t\t\t\t\t + \"</div>\";\n\t\n\t/*group markup for my task*/\n\tthis.dueDateMyTaskMarkup = \"<div class=\\\"row grpHead group\\\" dueDate=${dueDateStr}> \"\n\t\t+ \"<div class=\\\"left contentBlockLabel\\\">\"\n + \" <span class=\\\"expand grpSymbol ${expanderSymbol($item)}\\\"></span> \"\n + \" <span class=\\\"grpTitle\\\">${dueDateStr}</span> \"\n + \" <span class=\\\"grpCount\\\">[${getItemsLength($item)}]</span> \"\n\t\t+ \"</div>\"\n\t\t+ \"<div class=\\\"clear rowfooter\\\"></div>\"\n\t\t+ \"</div>\"\n\t\t+ \"{{if expanded}} \"\n\t\t\t+ \"{{each getItems($item)}}\t \"\n\t\t\t\t+\"<div class=\\\"row grpRow\\\">\"\n\t\t\t\t\t\t+ \"<div class=\\\"left contentBlockLabel {{if taskStatusName == 'CLOSE'}}strike{{/if}}\\\" >\"\n\t\t\t\t\t\t+ \" <span class=\\\"taskName\\\" title=${taskName}>${taskName}</span>\"\n\t\t\t\t\t\t+ \" <span class=\\\"taskAssignee\\\">${reporter}</span>\"\t\n\t\t\t\t\t\t+ \"</div>\"\t\t\t\t \n\t\t\t\t\t\t+ \"{{if taskStatusName == 'CLOSE'}}\"\n\t\t\t\t\t\t+\" <div class=\\\"right task-reopen-ico-holder\\\"><span title=\\\"ReOpen\\\" class=\\\"right task-reopen-ico\\\" taskPk=${taskDetailPk}>R</span></div>\"\n\t\t\t\t\t\t+ \"{{else}}\"\n\t\t\t\t\t\t+\" <div class=\\\"right task-resolved-ico-holder\\\"><span title=\\\"Resolved\\\" class=\\\"right task-resolved-ico\\\" taskPk=${taskDetailPk}>Q</span></div>\"\n\t\t\t\t\t\t+ \"{{/if}}\"\n\t\t\t\t\t\t+ \"<div class=\\\"clear rowfooter\\\"></div>\"\n\t\t\t\t\t\t+ \"</div>\"\n\t\t\t+ \"{{/each}} \"\n\t\t+ \"{{/if}} \";\n\t\t\n\tthis.repoterMyTaskMarkup = \"<div class=\\\"row grpHead groupReporter\\\" reporter=${reporter}> \"\n\t\t+ \"<div class=\\\"left contentBlockLabel\\\">\"\n + \" <span class=\\\"expand grpSymbol ${expanderSymbol($item)}\\\"></span> \"\n + \" <span class=\\\"grpTitle\\\">${reporter}</span> \"\n + \" <span class=\\\"grpCount\\\">[${getItemsLength($item)}]</span> \"\n\t\t+ \"</div>\"\n\t\t+ \"<div class=\\\"clear rowfooter\\\"></div>\"\n\t\t+ \"</div>\"\n\t\t+ \"{{if expanded}} \"\n\t\t\t+ \"{{each getItems($item)}}\t \"\n\t\t\t\t+\"<div class=\\\"row grpRow\\\">\"\n\t\t\t\t\t\t+ \"<div class=\\\"left contentBlockLabel {{if taskStatusName == 'CLOSE'}}strike{{/if}}\\\" >\"\n\t\t\t\t\t\t+ \" <span class=\\\"taskName\\\" title=${taskName}>${taskName}</span>\"\n\t\t\t\t\t\t+ \" <span class=\\\"taskDate\\\">${dueDateStr}</span>\"\n\t\t\t\t\t\t+ \"</div>\"\t\t\t\t \n\t\t\t\t\t\t+ \"{{if taskStatusName == 'CLOSE'}}\"\n\t\t\t\t\t\t+\" <div class=\\\"right task-reopen-ico-holder\\\"><span title=\\\"ReOpen\\\" class=\\\"right task-reopen-ico\\\" taskPk=${taskDetailPk}>R</span></div>\"\n\t\t\t\t\t\t+ \"{{else}}\"\n\t\t\t\t\t\t+\" <div class=\\\"right task-resolved-ico-holder\\\"><span title=\\\"Resolved\\\" class=\\\"right task-resolved-ico\\\" taskPk=${taskDetailPk}>Q</span></div>\"\n\t\t\t\t\t\t+ \"{{/if}}\"\n\t\t\t\t\t\t+ \"<div class=\\\"clear rowfooter\\\"></div>\"\n\t\t\t\t\t\t+ \"</div>\"\n\t\t\t+ \"{{/each}} \"\n\t\t+ \"{{/if}} \";\n\t\t\n\t/*group markup for assigned task*/\t\n\tthis.dueDateAssignedTaskMarkup = \"<div class=\\\"row grpHead groupAssignedDueDate\\\" dueDate=${dueDateStr}> \"\n\t\t+ \"<div class=\\\"left contentBlockLabel\\\">\"\n + \" <span class=\\\"expand grpSymbol ${expanderSymbol($item)}\\\"></span> \"\n + \" <span class=\\\"grpTitle\\\">${dueDateStr}</span> \"\n + \" <span class=\\\"grpCount\\\">[${getItemsLength($item)}]</span> \"\n\t\t+ \"</div>\"\n\t\t+ \"<div class=\\\"clear rowfooter\\\"></div>\"\n\t\t+ \"</div>\"\n\t\t+ \"{{if expanded}} \"\n\t\t\t+ \"{{each getItems($item)}}\t \"\n\t\t\t\t+\"<div class=\\\"row grpRow\\\">\"\n\t\t\t\t\t+ \"<div class=\\\"left contentBlockLabel {{if taskStatusName == 'CLOSE'}}strike{{/if}}\\\" >\"\n\t\t\t\t\t+ \"<span class=\\\"taskName\\\">${taskName}</span>\"\t\t\t\t \n\t\t\t\t\t+ \"<span class=\\\"taskAssignee\\\">${assignee}</span>\"\t\n\t\t\t\t\t+ \"</div><div class=\\\"clear rowfooter\\\"></div>\"\n\t\t\t\t+ \"</div>\"\n\t\t\t+ \"{{/each}} \"\n\t\t+ \"{{/if}} \";\n\t\t\n\tthis.assignedGrpTaskMarkup = \"<div class=\\\"row grpHead groupAssigned\\\" assignee=${assignee}> \"\n\t\t+ \"<div class=\\\"left contentBlockLabel\\\">\"\n + \" <span class=\\\"expand grpSymbol ${expanderSymbol($item)}\\\"></span> \"\n + \" <span class=\\\"grpTitle\\\">${assignee}</span> \"\n + \" <span class=\\\"grpCount\\\">[${getItemsLength($item)}]</span> \"\n\t\t+ \"</div>\"\n\t\t+ \"<div class=\\\"clear rowfooter\\\"></div>\"\n\t\t+ \"</div>\"\n\t\t+ \"{{if expanded}} \"\n\t\t\t+ \"{{each getItems($item)}}\t \"\n\t\t\t\t+\"<div class=\\\"row grpRow\\\">\"\n\t\t\t\t\t + \"<div class=\\\"left contentBlockLabel {{if taskStatusName == 'CLOSE'}}strike{{/if}}\\\" >\"\n\t\t\t\t\t + \"<span class=\\\"taskName\\\">${taskName}</span>\"\t\t\t\t\t \n\t\t\t\t\t + \"<span class=\\\"taskDate\\\">${dueDateStr}</span>\"\n\t\t\t\t\t + \"</div><div class=\\\"clear rowfooter\\\"></div>\"\n\t\t\t\t\t + \"</div>\"\n\t\t\t+ \"{{/each}} \"\n\t\t+ \"{{/if}} \";\n\t/**\n\t\tAdd some simple templete methods to display items\n\t*/\n\t$.extend( window, { \n getItems: function( tmplItem ) {\n //console.log(tmplItem.data);\n\t\treturn tmplItem.data.value;\n }, \n getItemsLength : function( tmplItem ) {\n\t\tvar length = 0;\n\t\tif(tmplItem.data.value)\n\t\t\tlength = tmplItem.data.value.length\n //console.log(length);\n\t\treturn length;\n }, \n expanderSymbol: function( tmplItem ) {\n return tmplItem.data.expanded ? \"collapse\" : \"expand\";\n }\n\t});\n // feeds\n this.feeds = {};\n this.feedsPk = {};\n\tthis.itemExpand = [];\n this.feedsOrder = [];\n\tthis.$filterPending = false;\n\tthis.$filterRoutine = false;\n\tthis.$filterTask = '';\n\tthis.taskconfig = {};\n\tthis.modifiedtaskconfig = {};\n\t\n\tthis.taskFeedPks=[];\n\tthis.selectedPk = {};\n\tthis.$fn = function(feed){};\n\tthis.$filterfn = function(feed){};\n\tthis.$jsonresult = [];\n\n // has feeds\n this.hasFeeds = function() {\n return this.feedsOrder.length != 0;\n };\n\n\tthis.polling = function(feed) {\n\t\tif(renderFirstTime) {\n\t\t\trenderFirstTime = false;\n\t\t} else {\n\t\t\t//this.renderer.hideAddBtn($widget);\n\t\t\tthis.renderer.render('update');\n\t\t}\n\t};\n\n // preparation\n this.prepareActivity = function() {\n\t\tvar index = 0;\n\t\t//alert('task prepareActivity called');\n\t\t\t//console.log('this.json.value %o',this.json.value[0]);\n\t\tjQuery.each(this.json.value, function(order, rawFeed) {\n\t\t\t\n var feed = {\n pk: rawFeed.pk,\n name: rawFeed.name,\n id: rawFeed.id,\n order: order,\n data: 0,\n dataUri: rawFeed.dataUrl,\n dataInterval: rawFeed.asyncInterval,\n pollingId: 0,\n\t\t\t\tdateOffset:rawFeed.dateOffset,\n\t\t\t\tuserList:rawFeed.userList,\n viewUri: rawFeed.feedUrl\n }\n\t\t\t\n self.taskFeedPks[index] = feed.pk;\n\t\t\tself.taskconfig['dateOffset'] = feed.dateOffset;\n\t\t\tself.taskconfig['userList'] = feed.userList;\n\t\t\tself.taskconfig['dbdWorkspaceWidgetPk'] = rawFeed.dbdWorkspaceWidgetPk;\n\t\t\t/*if(index == 0){\n\t\t\t\tself.selectedPk =feed.id;\n\t\t\t}*/\n\t\t\tself.feeds[feed.id] = feed;\t\t\t\n self.feedsPk[order] = feed.pk;\n self.feedsOrder.push(order);\n\t\t\tindex++;\n });\n\t\tself.taskconfig['pks'] = self.taskFeedPks;\n\t\t\n };\n\t\n\t\n\t\n\tthis.contentUpdater = function(update){\n\t\tif (update) {\n self.updateContent();\n } else {\n self.discardConyentUpdate();\n }\n\t};\n\t\n\t\n\n // update widget\n this.updateContent = function(callback, delegator) {\n\t//console.log('.taskDateOffset %o :: ',$('.taskDateOffset'));\n\t//console.log($('.taskDateOffset').val());\n var uri = xenos.context.path + '/secure/ref/taskfeed/saveconfig.json';\n\n\n var json = ''\n + '{'\n + '\"dbdWorkspaceWidgetPk\": ' + self.taskconfig.dbdWorkspaceWidgetPk + ','\n + '\"pks\": [' + self.taskconfig.pks + '],'\n + '\"dateOffset\": ' + self.modifiedtaskconfig.dateOffset + ','\n + '\"userList\": \"' + self.modifiedtaskconfig.userList + '\"'\n + '}';\n\n\n jQuery.ajax({\n url: uri,\n type: 'POST',\n contentType: 'application/json',\n data: json,\n success: function(json) {\n if (!json.success) {\n //console.log(json);\n xenos.postNotice(xenos.notice.type.error, xenos$DBD$i18n.widget.widget_not_saved + self.parent.name);\n return;\n }\n\t\t\t self.taskconfig.dateOffset =self.modifiedtaskconfig.dateOffset;\n\t\t\t self.taskconfig.userList = self.modifiedtaskconfig.userList ;\n\n self.dirty = false;\n\n xenos.postNotice(xenos.notice.type.info, self.parent.name + xenos$DBD$i18n.widget.widget_saved);\n if (callback) callback.call(delegator ? delegator : self, self);\n }\n });\n };\n\n // discard update\n this.discardConyentUpdate = function() {\n\t\t self.modifiedtaskconfig.dateOffset = self.taskconfig.dateOffset;\n\t\t self.modifiedtaskconfig.userList = self.taskconfig.userList;\n\n self.dirty = false;\n };\n\n // rendition\n this.renderer = new xenos$DBD$TaskFeed$renderer(this);\n\n // connection\n this.connectActivity = function() {\n jQuery.each(self.feeds, function(pk, feed) {\n if (feed.dataInterval) {\n self.polling(feed);\n if (!feed.pollingId) {\n feed.pollingId = setInterval(function() {self.polling(feed);}, feed.dataInterval);\n\t\t\t\t}\n }\n });\n };\n\n this.disconnectActivity = function() {\n\t\trenderFirstTime = true;\n jQuery.each(self.feeds, function(pk, feed) {\n if (feed.pollingId) {\n clearInterval(feed.pollingId);\n feed.pollingId = 0;\n\t\t\t}\n });\n };\n}", "getDefinition() {\r\n const definition = {};\r\n definition.id = this.data.id;\r\n definition.name = this.data.name;\r\n definition.description = this.data.description;\r\n definition.room = this.data.room;\r\n definition.type = this.data.type;\r\n definition.capabilities = [];\r\n this.data.capabilities.forEach((capability) => {\r\n const capDef = {};\r\n capDef.type = capability.type;\r\n capDef.retrievable = capability.retrievable;\r\n capDef.parameters = capability.parameters;\r\n definition.capabilities.push(capDef);\r\n });\r\n if (this.data.properties) {\r\n definition.properties = [];\r\n this.data.properties.forEach((property) => {\r\n const propDef = {};\r\n propDef.type = property.type;\r\n propDef.retrievable = property.retrievable;\r\n propDef.parameters = property.parameters;\r\n definition.properties.push(propDef);\r\n });\r\n }\r\n return definition;\r\n }", "generateHistoricalData () {\n }", "createConfig() {\n return {\n facets: [{ key: 'main', fixedFactSheetType: 'Application' }],\n ui: {\n elements: createElements(this.settings),\n timeline: createTimeline(),\n update: (selection) => this.handleSelection(selection)\n }\n };\n }", "constructor(apiKey, websiteName, parentElement){\n this.apiUrl = `https://api.trustpilot.com/v1/business-units/find?name=${websiteName}&apikey=${apiKey}`;\n this.htmlParentElement = parentElement;\n this.data = {};\n }", "function BusinessIntelligenceCheck(){}", "static async getAll () {\n const feeds = await Feed.getAll()\n const associations = await Promise.all(feeds.map(this.getFeedAssociations))\n return feeds.map((feed, i) => new FeedData({\n feed,\n profile: associations[i].profile,\n subscribers: associations[i].subscribers,\n filteredFormats: associations[i].filteredFormats\n }))\n }", "function widgetPrototype(data) {\n\n\tvar _self = {};\n _self.vendor = data.vendor;\n _self.name = data.name;\n _self.version = data.version;\n _self.uri = data.vendor + '/' + data.name + '/' + data.version;\n _self.id = data.uri;\n _self.display_name = data.title;\n _self.contents = data.contents;\n if (data.type === 'widget') {\n\t for (var i = 0; i < data.altcontents.length; i ++) {\n\t \tif (data.altcontents[i].scope === \"yaast\") {\n\t \t\t_self.contents = data.altcontents[i];\n\t \t}\n\t }\n \t_self.default_width = data.widget_width;\n \t\t_self.default_height = data.widget_height;\n\t} else if (data.type === \"operator\") {\n\t\t_self.js_files = data.js_files;\n }\n\n\t// Inputs\n _self.inputs = {};\n for (var i = 0; i < data.wiring.inputs.length; i++) {\n _self.inputs[data.wiring.inputs[i].name] = data.wiring.inputs[i];\n }\n\n // Outputs\n _self.outputs = {};\n for (var i = 0; i < data.wiring.outputs.length; i++) {\n _self.outputs[data.wiring.outputs[i].name] = data.wiring.outputs[i];\n }\n\ti = null;\n\n\t// Properties\n\t_self.properties = {};\n\t_self.propertiesList = data.properties;\n\tfor (i = 0; i < data.properties.length; i++) {\n\t\t_self.properties[data.properties[i].name] = data.properties[i];\n\t}\n\t\n\t// Preferences\n\t_self.preferences = {};\n _self.preferenceList = data.preferences;\n for (i = 0; i < data.preferences.length; i++) {\n _self.preferences[data.preferences[i].name] = data.preferences[i];\n }\n\n return _self;\n \n}", "async create(feed) {\n await Promise.resolve(\n createRSSFeed(\n feed,\n APP_URL + '/' + FEED_FILE_NAME,\n AUTHOR,\n AUTHOR_EMAIL,\n APP_URL,\n APP_URL,\n APP_NAME,\n pkg.description,\n APP_URL + APP_COVER_IMG,\n APP_NAME\n )\n )\n }", "docToFeedItem(doc) {\n const { config } = this.imports\n const { hCard } = this.options\n\n const item = {\n title: doc.get('properties.name.0'),\n id: doc.getPermalink(),\n link: doc.getPermalink(),\n description: doc.get('properties.summary.0'),\n content: doc.get('properties.content.0.html'),\n author: [\n {\n name:\n doc.get('properties.author.0.properties.name.0') ||\n hCard.properties.name[0],\n link:\n doc.get('properties.author.0.properties.photo.0') ||\n hCard.properties.url\n ? hCard.properties.url[0]\n : config.get('siteBaseUrl'),\n email:\n doc.get('properties.author.0.properties.email.0') ||\n hCard.properties.name[0],\n },\n ],\n date: new Date(doc.get('properties.published.0')),\n image:\n doc.get('properties.featured.0') || doc.get('properties.photo.0.value'),\n }\n\n // Tidy up item removing undefined keys\n Object.keys(item).forEach((key) => {\n if (item[key] === undefined) {\n delete item[key]\n }\n })\n\n // Set title fallback from content\n if (!item.title && !item.description) {\n if (!item.content) {\n // This is a post type without a summary, name or content\n // TODO: Handle contentless posts like likes and reposts better.\n // console.warn(\n // '[Postr Feeds]',\n // 'Item is currently not supported',\n // doc.toMf2()\n // )\n return null\n } else {\n item.title =\n doc.get('properties.content.0.value').substring(0, 50) + '…'\n }\n // NOTE: This runs a lottt...\n // console.log('No title or description for rss', item)\n }\n\n // Set content fallback from title\n if (!item.content && (item.description || item.title)) {\n item.content = item.description || item.title\n }\n\n return item\n }", "function publishExternalAPI(appHelpers) {\n angular.extend(appHelpers, {\n 'per': per,\n 'generateLabelFromPeriod': generateLabelFromPeriod,\n 'generateFullLabelFromPeriod': generateFullLabelFromPeriod,\n 'getPeriodString': getPeriodString,\n 'getYearLabelFromPeriod': getYearLabelFromPeriod,\n 'getMonthFromPeriod': getMonthFromPeriod,\n 'getYearFromPeriod': getYearFromPeriod,\n 'getMonthIndexFromPeriod': getMonthIndexFromPeriod,\n 'getMonthFromNumber': getMonthFromNumber\n });\n }", "forApi() {\n return {\n entities: this.entities || 0,\n lastEntity: this.lastEntity\n };\n }", "function getBusinessObject(){\t\n//\tcreate a json object\n var p1 = \"\";\n var p2 = $(\"#support-lang\").val(); \n var p3 = $(\"#support-topic-title\").val();\n var p4 = $(\"#support-topic-content\").val();\n\n var p5 = $(\"#support-status\").val();\n\n \n var businessObject =\n {\n \t\tsupportId \t\t\t : p1,\n \t\tsupportLangNo \t\t : p2,\n \t\tsupportTopicTitle \t\t : p3,\n \t\tsupportTopicContent \t\t : p4,\n \t\tsupportStatus \t\t : p5\n\n };\n \n return businessObject;\n}", "function YellOmniture() {\n\tthis.ss = (typeof s === 'undefined') ? s_gi(config.account) : s;\n\t\n\tvar gConf = HAF.config.global;\n\tthis.ss.charSet=gConf.charset;\n\t/* Conversion Config */\n\tthis.ss.currencyCode=gConf.currency;\n\t\n\t/* Throwaway function to copy optional configuration values */\n\tfunction getCopier(source,dest) {\n\t\treturn function copyAttr(name, destName) {\n\t\t\tdestName = destName ? destName : name;\n\t\t\tif(typeof source[name] !== 'undefined')\n\t\t\t\tdest[destName] = source[name];\n\t\t}\n\t}\n\t/* Global non mandatory options copy to s */\n\tvar copier = getCopier(gConf,this.ss);\n\tcopier('trackDownloadLinks');\n\tcopier('trackExternalLinks');\n\tcopier('downloadFileTypes', 'linkDownloadFileTypes');\n\tcopier('internalDomains', 'linkInternalFilters');\n\n\t/* Originally configured like this\n\tthis.ss.trackInlineStats=true;\n\tthis.ss.linkLeaveQueryString=false;\n\t*/\n\n\n\n\t/* Omniture non mandatory options copy to s */\n\tcopier = getCopier(config,this.ss);\n\t/* TimeParting Config */\n\tcopier('dstStart');\n\tcopier('dstEnd');\n\tcopier('currentYear');\n\t\n\tcopier('serverSecure','trackingServerSecure');\n\n\t// These are non-optional\n\tthis.ss.visitorNamespace=config.namespace;\n\tthis.ss.trackingServer=config.server;\n\t\n\tthis.clear();\n}", "function GetUserBasedGridColumList(){\n var _filter = {\n \"SAP_FK\": authService.getUserInfo().AppPK,\n \"TenantCode\": authService.getUserInfo().TenantCode,\n \"SourceEntityRefKey\": authService.getUserInfo().UserId,\n \"EntitySource\": \"WMS_INWARDPRODUCTSUMMARY\",\n };\n var _input = {\n \"searchInput\": helperService.createToArrayOfObject(_filter),\n \"FilterID\": appConfig.Entities.UserSettings.API.FindAll.FilterID\n };\n \n apiService.post(\"eAxisAPI\", appConfig.Entities.UserSettings.API.FindAll.Url + authService.getUserInfo().AppPK, _input).then(function(response){\n if(response.data.Response[0]){\n InwardProductsummaryCtrl.ePage.Masters.UserValue= response.data.Response[0];\n if(response.data.Response[0].Value!=''){\n var obj = JSON.parse(response.data.Response[0].Value)\n InwardProductsummaryCtrl.ePage.Entities.Header.TableProperties.ProductSummaryList = obj;\n InwardProductsummaryCtrl.ePage.Masters.UserHasValue =true;\n }\n }else{\n InwardProductsummaryCtrl.ePage.Masters.UserValue = undefined;\n }\n })\n }", "getServiceModel(service) {\n const item = {\n /** used for update prop */\n oneApm: service.oneapm,\n appMonitor: service.appMonitor,\n environments: JSON.parse(JSON.stringify(service.environments)),\n hosts: JSON.parse(JSON.stringify(service.hosts)),\n prestopCommand: service.prestopCommand,\n terminationGracePeriodSeconds:service.terminationGracePeriodSeconds,\n rollingUpdate: service.rollingUpdate,\n loadBalance: service.loadBalance,\n gitLabAddress: service.gitLabAddress,\n gitLabBranch: service.gitLabBranch,\n mainClass: service.mainClass,\n relativePath: service.relativePath,\n mavenProfileId: service.mavenProfileId,\n // fileLocation: service.fileLocation ? service.fileLocation : [],\n vmOptions: service.vmOptions,\n instanceNum: service.instanceNum,\n serviceVersion: service.serviceVersion,\n volume: service.volume,\n subPath: service.subPath,\n configServiceName: service.configServiceName,\n claimName: service.claimName,\n enableJacoco: !!service.enableJacoco,\n };\n\n /** copy prop */\n ['id', 'appId', 'spaceId', 'orchId', 'orchIp', 'intranetDomain', 'intranetDomainList', 'internetDomainList', 'updateTime',\n 'containerStatus', // 运行状态:几个实例;几个运行中实例\n 'defaultSelect', // 是否是默认服务\n 'k8s', // 是否是k8s应用\n 'isCanaryDeploy', // 是否有灰度服务\n ].forEach(prop => {\n service.hasOwnProperty(prop) && (item[prop] = service[prop]);\n });\n // set value '---' if null\n ['appName', 'tag',\n 'serviceName'\n ].forEach(prop => {\n service.hasOwnProperty(prop) && (item[prop] = service[prop] ? service[prop] : '---');\n });\n item.formattedCreateTime = service.createTime ? this.$utils.formatDate(service.createTime, 'yyyy-MM-dd hh:mm:ss').split(' ') : '---';\n item['remainExpiredDays'] = service['remainExpiredDays'] ? parseInt(service['remainExpiredDays']) : 0;\n\n // props check for service model\n if (item['containerStatus']) {\n item.instanceCount = `${item['containerStatus'].Running}/${item['containerStatus'].Total}`;\n } else {\n item.instanceCount = '---';\n }\n\n item.image = {\n customImage: null == service.customImage ? false : service.customImage,\n typeName: appInfoHelper.getImageNameById(service.customImage),\n location: service.image,\n };\n\n // wrap cpuId and cpu to cpuInfo\n // cpu and memory from server is value, such as 2.0/4096\n // so get cpu and memory info by cpuAndMemoryInfo.\n if (service.cpuId && service.memoryId) {\n item.cpuInfo = {\n id: service.cpuId,\n size: service.cpu\n };\n item.memoryInfo = {\n id: service.memoryId,\n size: service.memory / 1024\n };\n } else {\n const cpuAndMemoryInfo = this.$storeHelper.getCPUAndMemoryInfoBySize(service.cpu, service.memory);\n item.cpuInfo = cpuAndMemoryInfo[0];\n item.memoryInfo = cpuAndMemoryInfo[1];\n }\n\n const language = {\n version: service.languageVersion,\n type: service.language,\n get name() {\n var name = '';\n switch (this.type) {\n case 'JAVA':\n name = 'java';\n break;\n case 'NODE_JS':\n name = 'nodejs';\n break;\n case 'PYTHON':\n name = 'python';\n break;\n case 'PHP':\n name = 'php';\n break;\n }\n return name;\n }\n };\n item.language = language;\n\n item.isJavaLanguage = language.type === 'JAVA';\n item.isPythonLanguage = language.type === 'PYTHON';\n\n // 更新healthCheck格式\n const healthCheck = this.getObjHealthCheck();\n healthCheck.type = this.$storeHelper.getHealthCheckTypeDescByKey(service.healthCheckType);\n healthCheck.content = service.healthCheck;\n healthCheck.initialDelay = service.hasOwnProperty('initialDelaySeconds') ? service['initialDelaySeconds'] : 120;\n healthCheck.periodSeconds = service.hasOwnProperty('periodSeconds') ? service['periodSeconds'] : 5;\n healthCheck.failureThreshold = service.hasOwnProperty('failureThreshold') ? service['failureThreshold'] : 5;\n healthCheck.timeoutSeconds = service.hasOwnProperty('timeoutSeconds') ? service['timeoutSeconds'] : 10;\n item.healthCheck = healthCheck;\n\n const portMap = {\n id: null,\n protocol: 'TCP',\n outerPort: '',\n containerPort: '',\n action: '',\n get exist() {\n return this.outerPort && this.containerPort;\n }\n };\n // 更新portMap格式\n if (service.portsMapping && service.portsMapping.length > 0) {\n portMap.id = service.portsMapping[0].id;\n portMap.protocol = service.portsMapping[0].protocol;\n portMap.outerPort = service.portsMapping[0].outerPort;\n portMap.containerPort = service.portsMapping[0].containerPort;\n portMap.action = service.portsMapping[0].action;\n }\n item.portMap = portMap;\n\n const packageInfo = {\n _type: '',\n _name: '',\n set type(value) {\n if (value !== 'WAR') {\n this._name = '';\n }\n this._type = value;\n },\n get type() {\n return this._type;\n },\n set name(value) {\n this._name = value;\n },\n get name() {\n if (this._type == 'WAR') {\n return this._name;\n } else {\n return '';\n }\n },\n get needSetName() {\n return this._type == 'WAR';\n }\n };\n packageInfo.type = service.packageType;\n packageInfo.name = service.buildName;\n item.packageInfo = packageInfo;\n // modelList.push(item);\n\n if (item['containerStatus']) {\n item.applicationServiceStatus = `${item.containerStatus.Running}/${item.containerStatus.Total}`;\n }\n return item;\n }", "connectedCallback(){super.connectedCallback();this.HAXWiring=new HAXWiring;this.HAXWiring.setup(RssItems.haxProperties,RssItems.tag,this)}", "constructor() {\n /**\n *\n * @member {String} code\n */\n this.code = undefined\n /**\n *\n * @member {String} name\n */\n this.name = undefined\n /**\n *\n * @member {String} url\n */\n this.url = undefined\n /**\n *\n * @member {String} description\n */\n this.description = undefined\n /**\n *\n * @member {Boolean} purchasable\n */\n this.purchasable = undefined\n /**\n * @member {module:models/Stock} stock\n */\n this.stock = undefined\n /**\n *\n * @member {Array.<module:models/FutureStock>} futureStocks\n */\n this.futureStocks = undefined\n /**\n *\n * @member {Boolean} availableForPickup\n */\n this.availableForPickup = undefined\n /**\n *\n * @member {Number} averageRating\n */\n this.averageRating = undefined\n /**\n *\n * @member {Number} numberOfReviews\n */\n this.numberOfReviews = undefined\n /**\n *\n * @member {String} summary\n */\n this.summary = undefined\n /**\n *\n * @member {String} manufacturer\n */\n this.manufacturer = undefined\n /**\n *\n * @member {String} variantType\n */\n this.variantType = undefined\n /**\n * @member {module:models/Price} price\n */\n this.price = undefined\n /**\n *\n * @member {String} baseProduct\n */\n this.baseProduct = undefined\n /**\n *\n * @member {Array.<module:models/Image>} images\n */\n this.images = undefined\n /**\n *\n * @member {Array.<module:models/Category>} categories\n */\n this.categories = undefined\n /**\n *\n * @member {Array.<module:models/Review>} reviews\n */\n this.reviews = undefined\n /**\n *\n * @member {Array.<module:models/Classification>} classifications\n */\n this.classifications = undefined\n /**\n *\n * @member {Array.<module:models/Promotion>} potentialPromotions\n */\n this.potentialPromotions = undefined\n /**\n *\n * @member {Array.<module:models/VariantOption>} variantOptions\n */\n this.variantOptions = undefined\n /**\n *\n * @member {Array.<module:models/BaseOption>} baseOptions\n */\n this.baseOptions = undefined\n /**\n *\n * @member {Boolean} volumePricesFlag\n */\n this.volumePricesFlag = undefined\n /**\n *\n * @member {Array.<module:models/Price>} volumePrices\n */\n this.volumePrices = undefined\n }", "constructor(log, config, api) {\n this.PlatformAccessory = PlatformAccessory\n this.Accessory = Accessory\n this.Service = Service\n this.Characteristic = Characteristic\n this.UUIDGen = UUIDGen\n this.log = log\n this.config = config\n this.devices = {}\n this.accessories = {}\n if (api) {\n // Save the API object as plugin needs to register new accessory via this object.\n this.api = api\n } else {\n this.log.error(\"Homebridge's version is too old, please upgrade!\")\n }\n if (this.api) {\n this.api.on('didFinishLaunching', this.didFinishLaunching.bind(this))\n }\n if (_homebridge.broadlink != undefined) {\n _homebridge.broadlink = this\n }\n this.log.debug('broadlink constructor done')\n }", "addFeed(feed) {\n this.add(feed.key, feed.value);\n }", "function create(feed) {\n return opdsSchema.generate(feed, {\n //version: '1.0',\n //encoding: 'UTF-8',\n standalone: true,\n pretty: true,\n });\n}", "static get WOPI_DISCOVERY_ENDPOINT() { return 'https://onenote.officeapps-df.live.com/hosting/discovery'; }", "function createDashboard() {\n var newDashboard = {};\n newDashboard.name = \"New Dashboard\";\n newDashboard.description = \"New Dashboard Description\";\n newDashboard.organisationId = null;\n newDashboard.createdBy = null;\n newDashboard.type = \"private\";\n newDashboard.widgets = [];\n newDashboard.homepage = false;\n newDashboard.backgroundColor = \"#FFFFFF\";\n newDashboard.widgetSpacing = 2;\n newDashboard.options = {\n columns: 15, // the width of the grid, in columns\n rows: 10, // the width of the grid, in columns\n pushing: true, // whether to push other items out of the way on move or resize\n floating: true, // whether to automatically float items up so they stack (you can temporarily disable if you are adding unsorted items with ng-repeat)\n swapping: true, // whether or not to have items of the same size switch places instead of pushing down if they are the same size\n width: 'auto', // can be an integer or 'auto'. 'auto' scales gridster to be the full width of its containing element\n colWidth: 'auto', // can be an integer or 'auto'. 'auto' uses the pixel width of the element divided by 'columns'\n //rowHeight: 'match', // can be an integer or 'match'. Match uses the colWidth, giving you square widgets.\n margins: [2, 2], // the pixel distance between each widget\n outerMargin: true, // whether margins apply to outer edges of the grid\n sparse: true, // \"true\" can increase performance of dragging and resizing for big grid (e.g. 20x50)\n isMobile: false, // stacks the grid items if true\n mobileBreakPoint: 600, // if the screen is not wider that this, remove the grid layout and stack the items\n mobileModeEnabled: true, // whether or not to toggle mobile mode when screen width is less than mobileBreakPoint\n minColumns: 1, // the minimum columns the grid must have\n minRows: 2, // the minimum height of the grid, in rows\n maxRows: 100,\n defaultSizeX: 1, // the default width of a gridster item, if not specifed\n defaultSizeY: 1, // the default height of a gridster item, if not specified\n minSizeX: 1, // minimum column width of an item\n maxSizeX: null, // maximum column width of an item\n minSizeY: 1, // minumum row height of an item\n maxSizeY: null, // maximum row height of an item\n resizable: {\n enabled: true,\n handles: ['n', 'e', 's', 'w', 'ne', 'se', 'sw', 'nw'],\n start: function (event, $element, widget) { console.log('resize-start'); console.log(widget); console.log($element); }, // optional callback fired when resize is started,\n resize: function (event, $element, widget) { console.log('resize'); console.log(widget); console.log($element); }, // optional callback fired when item is resized,\n stop: function (event, $element, widget) { console.log('resize-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished resizing\n },\n draggable: {\n enabled: true, // whether dragging items is supported\n // handle: '.my-class', // optional selector for drag handle\n start: function (event, $element, widget) { console.log('drag-start'); console.log(widget); console.log($element); }, // optional callback fired when drag is started,\n drag: function (event, $element, widget) { console.log('drag'); console.log(widget); console.log($element); }, // optional callback fired when item is moved,\n stop: function (event, $element, widget) { console.log('drag-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished dragging\n }\n\n };\n return newDashboard;\n }", "function getIncomingArticles() {\n\tlet articles = incomingData.posts;\n\treturn articles; // <object> has key for each feed it wants to give articles to\n}", "function calendarMain(payload) {\n this.payload = payload;\n}", "function populateFeedNew( data ) {\n\t\t// get the time two hours ago; Note: This is based on computer's current time\n\t\tvar twoHoursAgo = moment( new Date() ).subtract(2, 'hours').format('MM-DD-YYYY H:mm:ss');\n\t\t// make sure data's timestamp is no later than two hours ago\n\t\tif( moment(data.timestamp, 'YYYY-MM-DD H:mm:ss').isAfter(moment(twoHoursAgo, 'YYYY-MM-DD H:mm:ss')) ) {\t\t\t\t\t\n\t\t\t// create a user friendly format of our new feed's timestamp\n\t\t\tdata.displayTime = moment(data.timestamp).format('MM-DD-YYYY H:mm:ss');\n\t\t\t// add a 'passed' attribute which is primarily used to affect CSS styling\n\t\t\tif( data.grossWeight != undefined ) {\n\t\t\t\tdata.passed = ( data.status == 'P' ) ? 'passed' : 'failed';\n\t\t\t}\n\t\t\t// get our driver's license or commercial license\n\t\t\t// and attach it into our new feed\n\t\t\tif( data.driversLicense == undefined || data.driversLicense == null || data.driversLicense == \"null\" ) {\n\t\t\t\tdata.truckLicense = data.commercialDriversLicense;\n\t\t\t} else {\n\t\t\t\tdata.truckLicense = data.driversLicense;\n\t\t\t}\n\t\t\t// if this is the very first feed set it as our current and active truck\n\t\t\t// else if feed is not the same as the current feed, set the new feed as current\n\t\t\tif( $scope.truck.current == undefined || $scope.trucks.length == 0 ) {\n\t\t\t\tif( $scope.truck.scroll === true ) {\n\t\t\t\t\t$scope.truck.current = data;\n\t\t\t\t}\n\t\t\t\t$scope.trucks.push( data );\n\t\t\t\ttruckSequence[data.sequenceNumber.toString()] = data;\n\t\t\t} else if( ! moment($scope.trucks[$scope.trucks.length -1].timestamp, 'YYYY-MM-DD H:mm:ss').isSame(moment(data.timestamp, 'YYYY-MM-DD H:mm:ss')) ) {\t\n\t\t\t\tif( $scope.truck.scroll === true ) {\n\t\t\t\t\t$scope.truck.current = data;\n\t\t\t\t}\n\t\t\t\t$scope.trucks.push( data );\n\t\t\t\ttruckSequence[data.sequenceNumber.toString()] = data;\n\t\t\t}\n\t\t}\n\t}", "function getPageModelSFE() {\n var entity = { Description: '', ExtendedDesc: '', PageSetId: '', DefaultPriceListId: '', Sort: '', Status: 1 };\n var form = [\n {\n type: \"section\", htmlClass: \"row\", disableSuccessState: true, disableErrorState: true,\n items: [\n {\n type: \"section\", disableSuccessState: true, disableErrorState: true,\n items: [\n { fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'col-md-6 col-xs-6 noPadding', key: \"Description\", copyValueTo: [\"ExtendedDesc\"] },\n { fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'col-md-6 col-xs-6 noPadding', key: \"ExtendedDesc\" }\n ]\n }]\n },\n { fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'noPadding', key: 'PageSetId', type: 'select', titleMap: [] },\n { fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'noPadding', key: 'DefaultPriceListId', type: 'select', titleMap: [] },\n //{ fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'noPadding', key: \"Sort\" },\n //{ fieldHtmlClass: 'custom-form-style', key: \"Status\" }\n ];\n var schema = {\n type: 'object',\n title: \"Comment\",\n properties: {\n // 'Description': '', 'Color': '', 'Background': '', 'PriceListId': '', 'NavigateToPage': '', 'SetDefaultSalesType': ''\n Description: { type: 'string', title: 'Page Description', validationMessage: \"You need to add a Desciption.\" },\n ExtendedDesc: { type: 'string', title: 'Page Extended Description', validationMessage: \"You need to add a Desciption.\" },\n PageSetId: { title: 'PageSet', type: 'number', htmlClass: 'customFormSelect', format: 'uiselect', placeholder: 'Select Pageset...', nullLabel: '---', },\n DefaultPriceListId: { title: 'Default Pricelist', type: 'number', htmlClass: 'customFormSelect', format: 'uiselect', placeholder: 'Select Default Pricelist...', nullLabel: '---', validationMessage: \"You need to add a Default Pricelist.\" },\n Sort: { title: 'Sort', type: \"number\" },\n Status: { title: 'Status', type: \"number\" },\n },\n required: ['Description', 'ExtendedDesc', 'PageSetId', 'DefaultPriceListId']\n }\n var ret = {\n schema: schema,\n form: form,\n entity: entity\n }\n return ret;\n}", "function getDbsObj() {\n var postObj = {};\n\n postObj.companyId = companyId;\n postObj.Infobases = [];\n\n $(dbsListId + ' ' + dbsItemSelector).each(function () {\n \n var item = {},\n isNew = $(this).find(dbsSelectSelector).length;\n\n item.ConfigurationId = (isNew) ? parseInt($(this).find(dbsSelectSelector).val()) : $(this).find(dbsTitleSelector).data('config-id');\n if (!isNew) {\n item.Id = $(this).find(dbsNameSelector).data('id')\n };\n item.TypeUnocDb = $(this).find(dbsTypeSelector + ':checked').val();\n item.Name = $(this).find(dbsNameSelector).val();\n item.IsAutoUpdateEnabled = true; // hack for now. when this feature wiil be enabled, must be $(this).find(dbsUpdateSelector).prop('checked')\n item.Action = $(this).data('action');\n item.Size = 0; // hack for now. when this feature wiil be enabled, must be $(this).find(dbsSizeSelector).data('size')\n \n postObj.Infobases.push(item);\n });\n return postObj;\n}", "feed(state) {\n return state.feed || [];\n }", "getNewFeeds({state}, payload) {\n return new Promise((resolve, reject) => {\n axios.get('/v1/jobs?limit=100&offset=0', {\n },\n {\n headers: {\n Authorization: `Bearer ${payload.userToken}`\n }\n })\n .then((response) => {\n resolve(response.data);\n })\n .catch((error) => {\n reject(error.response.data);\n })\n })\n }", "function buildClasses(feed, results) {\n if (results)\n var d = results.data;\n switch (feed.name) {\n case \"system_information\":\n console.log(feed.name);\n var bikeShare = new BikeShare(d.system_id, d.name, d.language, d.url, d.phone_number, d.email, d.timezone);\n bikeShare.feeds = feeds;\n exports.bikeShares.push(bikeShare);\n break;\n case \"station_information\":\n console.log(feed.name);\n d.stations.forEach(function (station) {\n var s = new Station();\n s.stationInformation = new StationInformation(station.lon, station.lat, station.address, station.name, station.station_id);\n exports.bikeShares[0].stations.push(s);\n });\n console.log(exports.bikeShares[0].stations);\n break;\n case \"station_status\":\n console.log(feed.name);\n for (var i = 0; i < d.stations.length; i++) {\n for (var j = i; j < exports.bikeShares[0].stations.length; j++) {\n if (d.stations[i].station_id == exports.bikeShares[0].stations[j].stationInformation.station_id) {\n var s = d.stations[i];\n var status = new StationStatus(s.station_id, s.num_bikes_available, s.num_docks_available, s.is_installed, s.is_renting, s.is_returning, s.last_reported);\n exports.bikeShares[0].stations[j].stationStatus = status;\n break;\n }\n }\n }\n break;\n case \"system_pricing_plans\":\n console.log(feed.name);\n d.plans.forEach(function (p) {\n var plan = new PricingPlans(p.price, p.is_taxable, p.url, p.description, p.currency, p.name, p.plan_id);\n exports.bikeShares[0].pricingPlans.push(plan);\n });\n break;\n default:\n return;\n }\n }", "writeBusiness() {\n\t\tthis.writer.write(this.application.business);\n\t}", "_getHistory() {\n if (this.dataInfo.loading == true) return\n /**\n * check if the card is visible\n */\n if (this.card && this.card.getClientRects().length == 0) return\n this.ready = this.entity_items.isValid()\n\n if (this.ready) {\n if (this.DEBUGMODE) {\n this.APISTART = performance.now()\n /**\n * set the start time for the api call\n */\n this.DEBUGDATA.PROFILER.GETHASSDATA = {\n start: performance.now()\n }\n this.DEBUGDATA.PROFILER.GETBUCKETDATA = {\n start: performance.now()\n }\n this.DEBUGDATA.PROFILER.GETSTATEDATA = {\n start: performance.now()\n }\n }\n\n if (this.datascales.range > 0) {\n /**\n * check if we have entities...\n */\n this.dataInfo.entities = this.entity_items.getEntityIdsAsString()\n this.dataInfo.entity_items = this.entity_items.items\n this.dataInfo.useAlias = this.entity_items.useAliasFields()\n if (this.dataInfo.entities != \"\") {\n /**\n * start date, time and end date\n */\n this.dataInfo.time = new Date().getTime()\n this.dataInfo.time_start = new Date()\n if (this.datascales.range < 1.0) {\n this.dataInfo.time_start.setMinutes(this.dataInfo.time_start.getMinutes() - this.datascales.range * 60)\n this.dataInfo.range = `${this.datascales.range * 60} min`\n } else {\n if ([\"day\", \"month\", \"year\"].includes(this.datascales.unit) == true) {\n this.dataInfo.time_start.setHours(-this.datascales.range, 0, 0, 0)\n } else {\n this.dataInfo.time_start.setHours(this.dataInfo.time_start.getHours() - this.datascales.range)\n }\n this.dataInfo.range = `unit: ${this.datascales.unit}, range: ${this.datascales.range} h`\n }\n this.dataInfo.time_end = new Date()\n this.dataInfo.ISO_time_start = this.dataInfo.time_start.toISOString()\n this.dataInfo.ISO_time_end = this.dataInfo.time_end.toISOString()\n\n /**\n * remove skip initial state when fetching not-cached data (slow)\n * 1. significant_changes_only to only return significant state changes.\n * 2. minimal_response to only return last_changed and state for\n * states other than the first and last state (much faster).\n * 3. disable minimal_response this if alias (attribute) fields is used...\n */\n this.dataInfo.options = \"&skip_initial_state\"\n // this.dataInfo.options += `&significant_changes_only=${this.dataInfo.useAlias ? 1 : 0}`\n if (!this.dataInfo.useAlias) this.dataInfo.options += \"&minimal_response\"\n\n /**\n * simple param check\n */\n if (this.dataInfo.param == `${this.dataInfo.time_end}:${this.dataInfo.entities}`) {\n console.warn(\"Data allready loaded...\")\n return\n }\n this.dataInfo.param = `${this.dataInfo.time_end}:${this.dataInfo.entities}`\n\n /**\n * build the api url\n */\n this.dataInfo.url = `history/period/${this.dataInfo.ISO_time_start}?end_time=${this.dataInfo.ISO_time_end}&filter_entity_id=${this.dataInfo.entities}${this.dataInfo.options}`\n if (this.dataInfo.url !== this.dataInfo.prev_url) {\n /**\n * get the history data\n */\n this.dataInfo.loading = true\n const prom = this._hass.callApi(\"GET\", this.dataInfo.url).then(\n (stateHistory) => this._buildGraphData(stateHistory, API_DATAMODE.history),\n () => null\n )\n this.dataInfo.prev_url = this.dataInfo.url\n }\n } else {\n if (this.DEBUGMODE) {\n this.DEBUGDATA.INFLUXDB\n this.DEBUGDATA.PROFILER.INFLUXDB = {\n start: performance.now()\n }\n this.DEBUGDATA.INFLUXDB = {\n url: \"\",\n authorization: false,\n count: 0,\n status: \"init\"\n }\n }\n const _itemlist = this.entity_items.getEntitieslist()\n _itemlist.forEach((item) => {\n if (this.DEBUGMODE) {\n this.DEBUGDATA.PROFILER.INFLUXDB.start = performance.now()\n }\n if (item.datasource) {\n this._buildGraphDataInfluxDB(item)\n }\n })\n }\n } else {\n /**\n * build the current for the sensor(s)\n */\n this._buildGraphData(null, API_DATAMODE.statemode)\n }\n }\n }", "_getHistory() {\n if (this.dataInfo.loading == true) return\n /**\n * check if the card is visible\n */\n if (this.card && this.card.getClientRects().length == 0) return\n this.ready = this.entity_items.isValid()\n\n if (this.ready) {\n if (this.DEBUGMODE) {\n this.APISTART = performance.now()\n /**\n * set the start time for the api call\n */\n this.DEBUGDATA.PROFILER.GETHASSDATA = {\n start: performance.now()\n }\n this.DEBUGDATA.PROFILER.GETBUCKETDATA = {\n start: performance.now()\n }\n this.DEBUGDATA.PROFILER.GETSTATEDATA = {\n start: performance.now()\n }\n }\n\n if (this.datascales.range > 0) {\n /**\n * check if we have entities...\n */\n this.dataInfo.entities = this.entity_items.getEntityIdsAsString()\n this.dataInfo.entity_items = this.entity_items.items\n this.dataInfo.useAlias = this.entity_items.useAliasFields()\n if (this.dataInfo.entities != \"\") {\n /**\n * start date, time and end date\n */\n this.dataInfo.time = new Date().getTime()\n this.dataInfo.time_start = new Date()\n if (this.datascales.range < 1.0) {\n this.dataInfo.time_start.setMinutes(this.dataInfo.time_start.getMinutes() - this.datascales.range * 60)\n this.dataInfo.range = `${this.datascales.range * 60} min`\n } else {\n if ([\"day\", \"month\", \"year\"].includes(this.datascales.unit) == true) {\n this.dataInfo.time_start.setHours(-this.datascales.range, 0, 0, 0)\n } else {\n this.dataInfo.time_start.setHours(this.dataInfo.time_start.getHours() - this.datascales.range)\n }\n this.dataInfo.range = `unit: ${this.datascales.unit}, range: ${this.datascales.range} h`\n }\n this.dataInfo.time_end = new Date()\n this.dataInfo.ISO_time_start = this.dataInfo.time_start.toISOString()\n this.dataInfo.ISO_time_end = this.dataInfo.time_end.toISOString()\n\n /**\n * remove skip initial state when fetching not-cached data (slow)\n * 1. significant_changes_only to only return significant state changes.\n * 2. minimal_response to only return last_changed and state for\n * states other than the first and last state (much faster).\n * 3. disable minimal_response this if alias (attribute) fields is used...\n */\n this.dataInfo.options = \"&skip_initial_state\"\n // this.dataInfo.options += `&significant_changes_only=${this.dataInfo.useAlias ? 1 : 0}`\n if (!this.dataInfo.useAlias) this.dataInfo.options += \"&minimal_response\"\n\n /**\n * simple param check\n */\n if (this.dataInfo.param == `${this.dataInfo.time_end}:${this.dataInfo.entities}`) {\n console.warn(\"Data allready loaded...\")\n return\n }\n this.dataInfo.param = `${this.dataInfo.time_end}:${this.dataInfo.entities}`\n\n /**\n * build the api url\n */\n this.dataInfo.url = `history/period/${this.dataInfo.ISO_time_start}?end_time=${this.dataInfo.ISO_time_end}&filter_entity_id=${this.dataInfo.entities}${this.dataInfo.options}`\n if (this.dataInfo.url !== this.dataInfo.prev_url) {\n /**\n * get the history data\n */\n this.dataInfo.loading = true\n const prom = this._hass.callApi(\"GET\", this.dataInfo.url).then(\n (stateHistory) => this._buildGraphData(stateHistory, API_DATAMODE.history),\n () => null\n )\n this.dataInfo.prev_url = this.dataInfo.url\n }\n } else {\n if (this.DEBUGMODE) {\n this.DEBUGDATA.INFLUXDB\n this.DEBUGDATA.PROFILER.INFLUXDB = {\n start: performance.now()\n }\n this.DEBUGDATA.INFLUXDB = {\n url: \"\",\n authorization: false,\n count: 0,\n status: \"init\"\n }\n }\n const _itemlist = this.entity_items.getEntitieslist()\n _itemlist.forEach((item) => {\n if (this.DEBUGMODE) {\n this.DEBUGDATA.PROFILER.INFLUXDB.start = performance.now()\n }\n if (item.datasource) {\n this._buildGraphDataInfluxDB(item)\n }\n })\n }\n } else {\n /**\n * build the current for the sensor(s)\n */\n this._buildGraphData(null, API_DATAMODE.statemode)\n }\n }\n }", "dashboard() {\n return this.getDashboardV1()\n .catch((err) => {\n console.error(\"Error in 'marketCapHistory' method of nomics module\\n\" + err);\n throw new Error(err);\n });\n }", "function feedDataModule () {\n function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }\n\n const MAX_OLD_ITEMS_COUNT = 5;\n const MAX_GENERATED_FEED_LENGTH = MAX_OLD_ITEMS_COUNT + 3 + 5;\n const GENERATE_INTERVAL = 3000;\n const icons = [\"image\", \"work\", \"beach\"];\n const authorList = [\"Danny T\", \"John S\", \"Tyrion L\"];\n\n const stubbedData = [\n {\n content: \"Some Image\",\n icon: \"image\",\n author: \"Danny T\",\n date: getDate(0),\n uuid: uuid()\n },\n {\n content: \"Some Work\",\n icon: \"work\",\n author: \"John S\",\n date: getDate(-60000),\n uuid: uuid()\n },\n {\n content: \"Some Beach\",\n icon: \"beach\",\n author: \"Tyrion L\",\n date: getDate(-360000),\n uuid: uuid()\n },\n ...createOldItems(MAX_OLD_ITEMS_COUNT)\n ];\n\n const feedGenerator = (generateInterval = GENERATE_INTERVAL) => {\n let data = [...stubbedData];\n let newItemCallback = () => {};\n const concatData = items => {\n data = data.concat(items);\n };\n const getData = () => {\n return data;\n };\n const getOlderDataByTimestamp = (timeStamp, count) => {\n let itemCount = 0;\n return data\n .sort((a, b) => b.date - a.date)\n .filter(item => {\n if (+item.date <= +timeStamp && itemCount < count) {\n itemCount++;\n return true;\n } else {\n return false;\n }\n });\n };\n const getNewerDataByTimestamp = timeStamp => {\n return data\n .sort((a, b) => b.date - a.date)\n .filter(item => {\n return +item.date >= +timeStamp;\n });\n };\n const startFeedGenerator = () => createNewItemAtInterval();\n const stopFeedGenerator = intervalProcessId =>\n clearInterval(intervalProcessId);\n const subscribeWithCallback = (timeStamp, callback) => {\n newItemCallback = () => callback(getNewerDataByTimestamp(timeStamp));\n };\n const createNewItemAtInterval = () => {\n const intervalProcessId = setInterval(() => {\n if (data.length >= MAX_GENERATED_FEED_LENGTH) {\n stopFeedGenerator(intervalProcessId);\n }\n concatData(createNewPost());\n console.log(\"creating new post\");\n newItemCallback(data);\n }, generateInterval);\n };\n\n const unsubscribe = () => stopFeedGenerator();\n\n return {\n getData,\n getNewerDataByTimestamp,\n getOlderDataByTimestamp,\n startFeedGenerator,\n subscribeWithCallback,\n unsubscribe\n };\n };\n\n const pseudoLiveFeed = feedGenerator();\n\n function subscribeToNewFeedPosts(timeStamp, onChangeCallback) {\n pseudoLiveFeed.subscribeWithCallback(timeStamp, onChangeCallback);\n return () => pseudoLiveFeed.unsubscribe();\n }\n\n function createOldItems(count) {\n const arrayTemplate = new Array(count).fill({});\n const oldItems = arrayTemplate.map((item, i) => {\n const date = getDate(\n // generate random date ~1-8 days prior\n -(i * 1000 * 60 * 60 * Math.random() * 24 * 7) - 1000 * 60 * 60 * 24\n );\n const icon = getRandomFromList(icons);\n return {\n content: `OLD ${icon} post`,\n icon,\n date,\n author: \"[autogen]\",\n uuid: uuid()\n };\n });\n return oldItems;\n }\n\n function createNewPost() {\n const date = getDate();\n const icon = getRandomFromList(icons);\n const author = getRandomFromList(authorList);\n return {\n content: `NEW ${icon} post`,\n icon,\n date,\n author,\n uuid: uuid()\n };\n }\n\n function getDate(seconds = 0) {\n const date = new Date();\n return +date + seconds;\n }\n\n function loadFeedPosts(time, postCountLimit) {\n console.log(\"postCountLimit\", postCountLimit);\n return new Promise((resolve, reject) =>\n resolve(pseudoLiveFeed.getOlderDataByTimestamp(time, postCountLimit))\n );\n }\n\n function getOlderDataByTimestamp(data, timeStamp, count) {\n let itemCount = 0;\n return data\n .sort((a, b) => b.date - a.date)\n .filter(item => {\n if (+item.date <= +timeStamp && itemCount < count) {\n itemCount++;\n return true;\n } else {\n return false;\n }\n });\n }\n\n function getPostsByTime(time, postCountLimit) {\n return getOlderDataByTimestamp(stubbedData, time, postCountLimit);\n }\n\n function getRandomFromList(list) {\n const listLength = list.length;\n return list[Math.floor(Math.random() * listLength)];\n }\n \n return {\n stubbedData,\n getPostsByTime,\n loadFeedPosts,\n pseudoLiveFeed,\n subscribeToNewFeedPosts,\n };\n\n}", "function fetchFeeds(){\n var options = {\n // method: 'jsonrpc' // 'dnode'\n method: 'dnode'\n };\n app.feed.fetchAll(options,updateFromFeeds); \n}", "function enterprise(sid, eid, ename, uid, pwd, output, url, empCount, eSqft, eAsset, dSqft, dAsset, dcUsed, dcTemp, comments, regStatus, mcount, expDate) \r\n{\r\n\tthis.sid = sid;\r\n\tthis.eid = eid;\r\n\tthis.ename = ename;\r\n\tthis.uid = uid;\r\n\tthis.pwd = pwd;\r\n\tthis.output = output;\r\n\tthis.empCount = empCount\r\n\tthis.url = url;\r\n\tthis.eSqft = eSqft;\r\n\tthis.eAsset = eAsset;\r\n\tthis.dSqft = dSqft;\r\n\tthis.dAsset = dAsset;\r\n\tthis.dcUsed = dcUsed;\r\n\tthis.dcTemp = dcTemp;\r\n\tthis.comments = comments;\r\n\t//this.active = active;\r\n\tthis.regStatus = regStatus;\r\n\tthis.mcount = mcount;\r\n\tthis.expDate = expDate;\r\n}", "function Dashboard() {\n return /*#__PURE__*/react_default.a.createElement(FeatureBox, null, /*#__PURE__*/react_default.a.createElement(FeatureHeader, {\n alignItems: \"center\"\n }, /*#__PURE__*/react_default.a.createElement(FeatureHeaderTitle, null, \"Dashboard\"), /*#__PURE__*/react_default.a.createElement(Dashboard_DebugInfoButton, {\n ml: \"auto\"\n })), /*#__PURE__*/react_default.a.createElement(Dashboard_OperationBanner, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_MetricsCharts, null), /*#__PURE__*/react_default.a.createElement(Dashboard_LatestEventList, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_OperationList, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_AppList, null));\n}", "function getBaseDashboard(){\n return {\n 1: {\n id: '1',\n name: '容器 1',\n widgets: [\n {col: 0,row: 0,sizeY: 1,sizeX: 1,name: \"Widget 1\",id:0,content:\"array\"}, \n {col: 2,row: 0,sizeY: 1, sizeX: 1,name: \"Widget 2\",id:1,content:'map'}\n ]\n },\n 2: {\n id: '2',\n name: '容器 2',\n widgets: [\n {col: 1,row: 1,sizeY: 1,sizeX: 2,name: \"Other Widget 1\",id:0},\n {col: 1,row: 3,sizeY: 1, sizeX: 1,name: \"Other Widget 2\",id:1}\n ]\n }\n };\n }", "constructor(busComp, bookSvc, loginSvc) {\n this.busComp = busComp;\n this.bookSvc = bookSvc;\n this.loginSvc = loginSvc;\n this.title = 'BookMyBus';\n this.user = {};\n this.product = new Product();\n }", "getSubscriptionDescriptors() {\n console.log(\"GraphQl Service starting ...\");\n return [\n {\n aggregateType: \"Business\",\n messageType: \"emigateway.graphql.query.getACSSBusiness\"\n },\n {\n aggregateType: \"Business\",\n messageType: \"emigateway.graphql.query.getACSSBusinesses\"\n },\n {\n aggregateType: \"Business\",\n messageType: \"emigateway.graphql.query.getBusinessById\"\n },\n {\n aggregateType: \"Clearing\",\n messageType: \"emigateway.graphql.query.getAllClearingsFromBusiness\"\n },\n {\n aggregateType: \"Clearing\",\n messageType: \"emigateway.graphql.query.getClearingById\"\n },\n {\n aggregateType: \"Clearing\",\n messageType: \"emigateway.graphql.query.getAccumulatedTransactionsByIds\"\n },\n {\n aggregateType: \"Clearing\",\n messageType: \"emigateway.graphql.query.getAccumulatedTransactionsByClearingId\"\n },\n {\n aggregateType: \"Clearing\",\n messageType: \"emigateway.graphql.query.getTransactionsByIds\"\n },\n {\n aggregateType: \"Clearing\",\n messageType: \"emigateway.graphql.query.getTransactionsByAccumulatedTransactionId\"\n },\n {\n aggregateType: \"Settlement\",\n messageType: \"emigateway.graphql.query.getSettlementsByClearingId\"\n },\n {\n aggregateType: \"Settlement\",\n messageType: \"emigateway.graphql.query.getSettlementsCountByClearingId\"\n },\n {\n aggregateType: \"Settlement\",\n messageType: \"emigateway.graphql.query.getSettlementsByBusinessId\"\n },\n {\n aggregateType: \"Settlement\",\n messageType: \"emigateway.graphql.query.getSettlementsCountByBusinessId\"\n },\n {\n aggregateType: \"LogError\",\n messageType: \"emigateway.graphql.query.getAccumulatedTransactionErrors\"\n },\n {\n aggregateType: \"LogError\",\n messageType: \"emigateway.graphql.query.getAccumulatedTransactionErrorsCount\"\n },\n {\n aggregateType: \"LogError\",\n messageType: \"emigateway.graphql.query.getClearingErrors\"\n },\n {\n aggregateType: \"LogError\",\n messageType: \"emigateway.graphql.query.getClearingErrorsCount\"\n },\n {\n aggregateType: \"LogError\",\n messageType: \"emigateway.graphql.query.getSettlementErrors\"\n },\n {\n aggregateType: \"LogError\",\n messageType: \"emigateway.graphql.query.getSettlementErrorsCount\"\n },\n {\n aggregateType: \"Settlement\",\n messageType: \"emigateway.graphql.mutation.changeSettlementState\"\n }\n ];\n }", "function ResourceHub(props) {\n // return('This is the resource hub');\n const objectparams = Object.assign({}, props);\n const DynamicCollectionLayout = getLayout(objectparams.layout).component;\n\n let _collection = false;\n if(objectparams.dynamicProps){\n _collection=new Mura.EntityCollection(objectparams.dynamicProps.collection,Mura._requestcontext);\n }\n const [collection,setCollection]=useState(_collection);\n \n //console.log(objectparams.dynamicProps);\n\n //SET DEFAULTS FOR CURRENT FILTER PARAMETERS\n const _curSubtype = objectparams.dynamicProps ? objectparams.dynamicProps.filterprops.subtype : '*';\n const _curCategoryIds = objectparams.dynamicProps ? objectparams.dynamicProps.filterprops.categoryid : '*';\n const _curPersonaId = objectparams.dynamicProps ? objectparams.dynamicProps.filterprops.personaid : '*';\n const _curCategoriesArray = objectparams.dynamicProps ? objectparams.dynamicProps.filterprops.selectedcats : [];\n const _hasMXP = objectparams.dynamicProps ? objectparams.dynamicProps.filterprops.hasmxp : false;\n\n const [curSubtype, setCurSubtype]=useState(_curSubtype);\n const [curCategoriesArray, setCurCategoriesArray]=useState(_curCategoriesArray);\n const [curCategoryIds, setCurCategoryIds]=useState(_curCategoryIds);\n const [curPersonaId, setCurPersonaId]=useState(_curPersonaId);\n const [hasMXP, setHasMXP]=useState(_hasMXP);\n const [newFilter, setNewFilter]=useState(false);\n const [filterUpdated, setFilterUpdated]=useState(new Date().toString());\n \n const updateFilter = (e) => {\n switch(e.target.name) {\n case 'subtype':\n let subtype = e.target.value;\n if (subtype != curSubtype) {\n setCurSubtype(subtype);\n setNewFilter(true);\n setFilterUpdated(new Date().toString());\n }\n break\n case 'personaid':\n let personaid = e.target.value;\n if (personaid != curPersonaId){\n setCurPersonaId(personaid);\n setNewFilter(true);\n setFilterUpdated(new Date().toString());\n }\n break\n default:\n if (!curCategoryIds.includes(e.target.value)){\n setCurCategoriesArray(updateCategoryIds(e.target.name,e.target.value,curCategoriesArray));\n setCurCategoryIds(getCategoryIds(curCategoriesArray));\n setNewFilter(true);\n setFilterUpdated(new Date().toString());\n } \n }//switch \n }\n\n if(!objectparams.dynamicProps){\n\n useEffect(() => {\n let isMounted = true;\n if (isMounted) {\n getFilterProps(curSubtype,curCategoryIds,curPersonaId,curCategoriesArray,newFilter).then((filterProps) => {\n if (isMounted) {\n setHasMXP(filterProps.hasmxp);\n setCurSubtype(filterProps.subtype);\n setCurCategoryIds(filterProps.categoryid);\n setCurPersonaId(filterProps.personaid);\n setCurCategoriesArray(filterProps.selectedcats);\n if(isMounted){\n getCollection(props,filterProps).then((collection) => {\n setCollection(collection);\n });\n }\n }\n });\n }\n return () => { isMounted = false };\n }, [filterUpdated])\n\n if(collection) {\n console.log('dynamic');\n return (\n <div>\n <RenderFilterForm \n updateFilter={updateFilter}\n {...props}\n curSubtype={curSubtype}\n curCategoryId={curCategoryIds}\n curPersonaId={curPersonaId}\n curCategoriesArray={curCategoriesArray}\n hasMXP={hasMXP}\n />\n\n <DynamicCollectionLayout collection={collection} props={props} link={RouterlessLink}/>\n\n </div>\n )\n } else {\n console.log('empty');\n return (\n <div>{/* EMPTY COLLECTION */}</div>\n )\n }\n\n } else {\n console.log('ssr');\n useEffect(() => {\n let isMounted = true;\n if (isMounted) {\n getFilterProps(curSubtype,curCategoryIds,curPersonaId,curCategoriesArray,newFilter).then((filterProps) => {\n if(isMounted){\n setHasMXP(filterProps.hasmxp);\n setCurSubtype(filterProps.subtype);\n setCurCategoryIds(filterProps.categoryid);\n setCurPersonaId(filterProps.personaid);\n setCurCategoriesArray(filterProps.selectedcats);\n \n getCollection(props,filterProps).then((collection) => {\n if(isMounted){\n setCollection(collection);\n }\n })\n }\n });\n }\n return () => { isMounted = false };\n }, [filterUpdated])\n\n return (\n <div>\n <RenderFilterForm \n updateFilter={updateFilter}\n {...props}\n curSubtype={curSubtype}\n curCategoryId={curCategoryIds}\n curPersonaId={curPersonaId}\n curCategoriesArray={curCategoriesArray}\n hasMXP={hasMXP}\n />\n <DynamicCollectionLayout collection={collection} props={props} link={RouterLink}/>\n </div>\n )\n\n }\n}", "getBreeds() {\n return this.state.api.retrieve()\n }", "function getRSS() {\r\n // Contains rss\r\n let rssItems = \"\";\r\n let rssFeed = \"\";\r\n\r\n // Use promise, we are async below...so return a Promise\r\n return new Promise(resolve => {\r\n // Scrape the data\r\n var x = Xray({\r\n filters: {\r\n trim: function (value) {\r\n // Strip leading whitespaces. Transform multi-whitespaces (spacesbar) to one\r\n // and replace other whitespace characters like \\n etc with nothing\r\n return typeof value === 'string' ? value.replace(/\\s{2,}/g,' ').trim() : value;\r\n }\r\n }\r\n });\r\n\r\n x(eventsUrl, '#sidebar-second', // Right hand sidebar has events\r\n { \r\n page1: x('.page-1', // take page-1 only, that's 5 events\r\n [{\r\n title: '.event-title | trim',\r\n date: '.out-date-box | trim', // Short format w/o year\r\n eventTime: '.date-display-single', // Date AND time\r\n contributor: '.contributor | trim', // Person/Organization or none\r\n link: '.event-title a@href'\r\n }]\r\n )\r\n }\r\n )\r\n .then((data) => {\r\n data.page1.forEach(event => {\r\n var itemCopy = (rss.item()).slice(); // copy template\r\n //var itemCopy = RSS_ITEM_TEMPLATE.slice(); // copy template\r\n itemCopy = itemCopy.replace('ITEM_TITLE', event.date + ' - ' + event.title.substring(0,maxTitleLen-1));\r\n itemCopy = itemCopy.replace('ITEM_LINK', event.link);\r\n itemCopy = itemCopy.replace('ITEM_DESCRIPTION', (event.contributor == null ? \"\":\"Ved: \"+event.contributor+\" -- \") + event.eventTime);\r\n rssItems = rssItems + itemCopy;\r\n })\r\n \r\n var rssCopy = (rss.container()).slice();\r\n rssCopy = rssCopy.replace(\"RSS_TITLE\", rssTitle);\r\n rssCopy = rssCopy.replace(\"RSS_LINK\", rssLink);\r\n rssCopy = rssCopy.replace(\"RSS_DESCRIPTION\", rssDesc);\r\n // Tell user of feed that there is no features today if no items found\r\n rssCopy = rssCopy.replace('RSS_ITEMS',\r\n (rssItems === \"\" ? (rss.itemEmpty()).replace(\"RSS_TITLE\", rssTitle) : rssItems));\r\n\r\n // Promise resolved, return the new shiny RSS\r\n rssFeed = rssCopy;\r\n resolve(rssFeed); \r\n })\r\n })\r\n} // End getRSS", "function getFeeds() {\n // Create an object for each feed in the blogs array\n // Get the content for each feed in the blogs array\n // Return when all asynchronous operations are complete\n // Create an object for each feed in the blogs array\n blogs = [\n{\n key: \"Agile\",\n url: 'http://blog.jayway.com/category/agile/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \"Android\",\n url: 'http://blog.jayway.com/category/android/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \"Architecture\",\n url: 'http://blog.jayway.com/category/architecture/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \"Cloud\",\n url: 'http://blog.jayway.com/category/cloud/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \"Cocoa\",\n url: 'http://blog.jayway.com/category/cocoa/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \"Embedded\",\n url: 'http://blog.jayway.com/category/embedded/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \"Events\",\n url: 'http://blog.jayway.com/category/events/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \"Java\",\n url: 'http://blog.jayway.com/category/java/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \"Dynamic languages\",\n url: 'http://blog.jayway.com/category/dynamic-languages/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \"Testing\",\n url: 'http://blog.jayway.com/category/testing/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \"Tips and tricks\",\n url: 'http://blog.jayway.com/category/tips-tricks/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \"User experience\",\n url: 'http://blog.jayway.com/category/user-experience/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/logo.png',\n acquireSyndication: acquireSyndication, dataPromise: null\n},\n{\n key: \".NET\",\n url: 'http://blog.jayway.com/category/net/feed/atom',\n title: 'tbd', updated: 'tbd',\n backgroundImage: '/images/smalllogo.png', /* '/images/logo.png', */\n acquireSyndication: acquireSyndication, dataPromise: null\n}\n ];\n\n // Get the content for each feed in the blogs array\n blogs.forEach(function (feed) {\n feed.dataPromise = feed.acquireSyndication(feed.url);\n dataPromises.push(feed.dataPromise);\n });\n\n // Return when all asynchronous operations are complete\n return WinJS.Promise.join(dataPromises).then(function () {\n return blogs;\n });\n\n }", "function setupFromLS() {\n //Get data from local storage\n let data = LSCtrl.getData();\n if (data) {\n //Set data in our data structure\n budgetCtrl.setDataFromLS(data);\n //Fix object Expense in data structure\n budgetCtrl.fixObjectExpense();\n //Display on UI\n let updatedData = budgetCtrl.getData();\n UICtrl.displayDataFromLS(updatedData);\n }\n }", "constructor({ id, name, start_date: startDate, end_date: endDate }, fetched) { // as set in our backend, this is passed in to create new Calendar instance\n this.id = id; \n this.name = name;\n this.startDate = new Date(startDate); // specified this is a Date Object\n this.endDate = new Date (endDate); // specified this is a Date Object\n this.cellsPlans = {}; // not passed in - set an empty object for the specific calendar's plans to be added to. Key is Cell ID and value is plans associated\n this.fetched = fetched; // passed in, but not from backend - refers to whether we have had to retrieve these plans from the backend already for a user\n }", "@wire(getObjectInfo, { objectApiName: RIDER_OBJECT })\n riderObjectSchema({ data }) {\n if (data && data.fields) {\n let riderObjectFields = data.fields;\n this.listRiderColumns = [\n { label: riderObjectFields.RFO_TASRiderId__c.label, fieldName: 'RFO_TASRiderId__c' },\n { label: riderObjectFields.RFO_TotalOfCars__c.label, fieldName: 'RFO_TotalOfCars__c'},\n { label: riderObjectFields.Assumed_of_Cars__c.label, fieldName: 'Assumed_of_Cars__c', type: 'number', editable: true },\n { label: riderObjectFields.RFO_RiderType__c.label, fieldName: 'RFO_RiderType__c' },\n { label: riderObjectFields.RFO_OriginalMaturityDate__c.label, fieldName: 'RFO_OriginalMaturityDate__c', type: \"date-local\" },\n { label: riderObjectFields.RFO_CurrentMaturityDate__c.label, fieldName: 'RFO_CurrentMaturityDate__c', type: \"date-local\" },\n { label: riderObjectFields.RFO_RiderRate__c.label, fieldName: 'RFO_RiderRate__c', type: 'currency', cellAttributes: { alignment: 'left' } },\n { label: riderObjectFields.RFO_Term__c.label, fieldName: 'RFO_Term__c' },\n { label: riderObjectFields.RFO_RiderAverageBeginDate__c.label, fieldName: 'RFO_RiderAverageBeginDate__c', type: \"date-local\" },\n { label: riderObjectFields.RFO_RiderAverageEndDate__c.label, fieldName: 'RFO_RiderAverageEndDate__c', type: \"date-local\" },\n { label: riderObjectFields.RFO_Status__c.label, fieldName: 'RFO_Status__c' }\n ];\n }else{\n }\n }", "get_internal_config_data() {\n const d = {\n height: $(this.element).height(),\n sync: {\n mode: this._sync_mode,\n },\n filtering: {\n mode: this._filtering,\n },\n data: {\n data_id: this.data_id,\n data_source_name_hint: (this.data_source != null ? this.data_source.name : ''), // Helper to restore old dataset in the case of redundancy\n }\n }\n // TODO: timeline association, etc.\n\n if (this._last_update != null) {\n d.sync.first = this._last_update.first\n d.sync.last = this._last_update.last\n d.sync.units = this._last_update.units\n }\n\n return d\n }", "dataProcessing(data) {\n\n if (data.length === 0) {\n let reformatedData = [{ separator: true, title: \"You don't have any widgets\" }]\n return reformatedData\n } else {\n let reformatedData = [{ separator: true, title: \"Actual site : \" + this.context.siteName }]\n\n data.forEach(element => {\n let icon = this.icons[element[\"type\"]]\n\n reformatedData.push({\n title: element[\"name\"],\n id: element[\"id\"],\n buttonIcon: 'chevron-right',\n icon: icon,\n type : element[\"type\"],\n })\n });\n reformatedData.push({ separator: true, title: '' });\n return reformatedData\n }\n }", "createChartData() {\n /**\n * entities : all entities data and options\n * entityOptions : global entities options\n */\n if (!this.entity_items.isValid()) return null\n // const _data = this.entity_items.getData()\n\n const _data = this.entity_items.getChartLabelAndData()\n\n if (_data.length === 0) {\n console.error(\"Create Chart Data, no Data present !\")\n return null\n }\n\n let _defaultDatasetConfig = {\n mode: \"current\",\n unit: \"\"\n }\n\n let _graphData = this.getDefaultGraphData()\n _graphData.config.mode = \"simple\"\n\n /**\n * merge entity options\n */\n if (this.entity_options) {\n _defaultDatasetConfig = {\n ..._defaultDatasetConfig,\n ...this.entity_options\n }\n }\n\n /**\n * merge dataset_config\n * all entity labels\n * add dataset entities\n */\n _graphData.data.labels = _data.labels //this.entity_items.getNames()\n _graphData.data.datasets[0] = _defaultDatasetConfig\n _graphData.data.datasets[0].label = this.card_config.title || \"\"\n /**\n * add the unit\n */\n if (this.entity_options && this.entity_options.unit) {\n _graphData.data.datasets[0].unit = this.entity_options.unit || \"\"\n } else {\n _graphData.data.datasets[0].units = this.entity_items.getEntitieslist().map((item) => item.unit)\n }\n\n /**\n * case horizontal bar\n */\n\n if (this.card_config.chart.isChartType(\"horizontalbar\")) {\n _graphData.data.datasets[0].indexAxis = \"y\"\n }\n\n /**\n * custom colors from the entities\n */\n let entityColors = _data.colors //this.entity_items.getColors()\n\n if (this.entity_options && this.entity_options.gradient != undefined) {\n _graphData.config.gradient = true\n }\n\n if (entityColors.length === _graphData.data.labels.length) {\n _graphData.data.datasets[0].backgroundColor = entityColors\n _graphData.data.datasets[0].showLine = false\n } else {\n if (this.card_config.chart.isChartType(\"radar\")) {\n _graphData.data.datasets[0].backgroundColor = COLOR_RADARCHART\n _graphData.data.datasets[0].borderColor = COLOR_RADARCHART\n _graphData.data.datasets[0].borderWidth = 1\n _graphData.data.datasets[0].pointBorderColor = COLOR_RADARCHART\n _graphData.data.datasets[0].pointBackgroundColor = COLOR_RADARCHART\n _graphData.data.datasets[0].tooltip = true\n _graphData.config.gradient = false\n } else {\n /**\n * get backgroundcolor from DEFAULT_COLORS\n */\n entityColors = DEFAULT_COLORS.slice(1, _data.data.length + 1)\n _graphData.data.datasets[0].backgroundColor = entityColors\n _graphData.data.datasets[0].borderWidth = 0\n _graphData.data.datasets[0].showLine = false\n }\n }\n _graphData.data.datasets[0].data = _data.data\n _graphData.config.segmentbar = false\n\n /**\n * add the data series and return the new graph data\n */\n if (this.card_config.chart.isChartType(\"bar\") && this.card_config.chartOptions && this.card_config.chartOptions.segmented) {\n const newData = this.createSimpleBarSegmentedData(_graphData.data.datasets[0])\n if (newData) {\n _graphData.data.datasets[1] = {}\n _graphData.data.datasets[1].data = newData.data\n _graphData.data.datasets[1].tooltip = false\n _graphData.data.datasets[1].backgroundColor = newData.backgroundColors\n _graphData.data.datasets[1].borderWidth = 0\n _graphData.data.datasets[1].showLine = false\n _graphData.config.segmentbar = newData.data.length !== 0\n }\n }\n return _graphData\n }", "function getAuditLogs(endpointURL,data){\n\n Alfresco.util.Ajax.jsonGet({\n url: Alfresco.constants.URL_CONTEXT + endpointURL,\n dataObj: data,\n successCallback: {\n fn: function (result) {\n // ページング系処理\n var pagination = result.json[\"list\"][\"pagination\"];\n $('#prev-page').prop('disabled', !Boolean(pagination.skipCount));\n $('#next-page').prop('disabled', !pagination.hasMoreItems);\n $('#download-audit-log').prop('disabled', false);\n $('#delete-audit-log').prop('disabled', false);\n\n result.json.list.entries = settleEntries(result.json.list.entries);\n\n // データテーブル形処理\n YAHOO.example.Data = result.json;\n var dataSource = new YAHOO.util.DataSource(YAHOO.example.Data);\n dataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;\n dataSource.responseSchema = AuditLogBrowser.RESPONSE_SCHEMA;\n\n var dataTable = new YAHOO.widget.DataTable(\"audit-log-table\", AuditLogBrowser.COLUMN_DEFINITION, dataSource, AuditLogBrowser.configs);\n\n // ソート情報\n dataTable.subscribe(\"theadCellClickEvent\", function (oArgs) {\n var uiSortedBy = this.getState().sortedBy;\n delete uiSortedBy.column;\n AuditLogBrowser.configs.sortedBy = uiSortedBy;\n });\n\n },\n scope: this\n },\n failureCallback: {\n fn: function (res) {\n $('#download-audit-log').prop('disabled', true);\n $('#delete-audit-log').prop('disabled', true);\n $('#prev-page').prop('disabled', true);\n $('#next-page').prop('disabled', true);\n $('.alert.alert-danger.data-error').show();\n },\n scope: this\n }\n });\n}", "function createFeedsApi(config) {\n if (config === void 0) { config = {}; }\n return function (context) {\n context.defineActions(actions);\n context.dispatch(function (state) { return (tslib_1.__assign(tslib_1.__assign({}, state), { feeds: {} })); });\n return function (_, target) {\n var feeds = 0;\n return {\n createConnector: function (resolver) {\n var id = piral_core_1.buildName(target.name, feeds++);\n var options = utils_1.createFeedOptions(id, resolver);\n var invalidate = function () {\n var _a;\n (_a = options.dispose) === null || _a === void 0 ? void 0 : _a.call(options);\n context.createFeed(options.id);\n };\n if (options.immediately) {\n context.loadFeed(options);\n }\n else {\n invalidate();\n }\n var connect = (function (component) { return withFeed_1.withFeed(component, options); });\n Object.keys(options.reducers).forEach(function (type) {\n var reducer = options.reducers[type];\n if (typeof reducer === 'function') {\n connect[type] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n context.updateFeed(id, args, function (data, item) { return reducer.call.apply(reducer, tslib_1.__spreadArray([connect, data], item)); });\n };\n }\n });\n connect.invalidate = invalidate;\n return connect;\n },\n };\n };\n };\n}", "function bloglist() {\n console.log('Inside factory now');\n var deferred = $q.defer();\n \n $http.get(blogUrl + '/blog/list/status')\n .then (\n function(response) {\n deferred.resolve(response.data);\n },\n function(errResponse) {\n deferred.reject(errResponse);\n }\n );\n return deferred.promise;\n }", "function draw_endpoint( data ) {\n\n draw_tools( data );\n draw_table( data );\n _resource.get_sheets_labels( draw_tabs );\n\n // deactivate menu button and hide the panel\n manage_top_panel( $('#top-menu').find('.active'), function () {\n hide_panel( data['type'] );\n });\n }", "getData() {\n const data = super.getData();\n data['abilities'] = game.system.template.actor.data.abilities;\n\n // Sheet display details\n const type = this.item.type;\n mergeObject(data, {\n type: type,\n hasSidebar: true,\n sidebarTemplate: () => `public/systems/dnd5e/templates/items/${type}-sidebar.html`,\n hasDetails: [\"consumable\", \"equipment\", \"feat\", \"spell\", \"weapon\"].includes(type),\n detailsTemplate: () => `public/systems/dnd5e/templates/items/${type}-details.html`\n });\n\n // Damage types\n let dt = duplicate(CONFIG.damageTypes);\n if ( [\"spell\", \"feat\"].includes(type) ) mergeObject(dt, CONFIG.healingTypes);\n data['damageTypes'] = dt;\n\n // Consumable Data\n if ( type === \"consumable\" ) {\n data.consumableTypes = CONFIG.consumableTypes\n }\n\n // Spell Data\n else if ( type === \"spell\" ) {\n mergeObject(data, {\n spellTypes: CONFIG.spellTypes,\n spellSchools: CONFIG.spellSchools,\n spellLevels: CONFIG.spellLevels,\n spellComponents: this._formatSpellComponents(data.data)\n });\n }\n\n // Weapon Data\n else if ( this.item.type === \"weapon\" ) {\n data.weaponTypes = CONFIG.weaponTypes;\n data.weaponProperties = this._formatWeaponProperties(data.data);\n }\n\n // Feat types\n else if ( type === \"feat\" ) {\n data.featTypes = CONFIG.featTypes;\n data.featTags = [\n data.data.target.value,\n data.data.time.value\n ].filter(t => !!t);\n }\n\n // Equipment data\n else if ( type === \"equipment\" ) {\n data.armorTypes = CONFIG.armorTypes;\n }\n\n // Tool-specific data\n else if ( type === \"tool\" ) {\n data.proficiencies = CONFIG.proficiencyLevels;\n }\n return data;\n }", "function glueMainPageData(data) {\n console.log(typeof data);\n life = data.Life;\n console.assert(life !== undefined, \"Life is undefined.\");\n resolutionUnit = data.ResolutionUnit;\n if(life.Notes == null){\n life.Notes = [];\n }\n lifeService.datifyLifeObject(life);\n console.log(\"life\");\n console.log(life);\n visibleNotes = life.Notes;\n //createMomentsFromDataAttrs(); // Done here in the beginning so only need to create Moments once (performance problems).\n updateLifeComponents();\n zoomLifeCalendar();\n refreshDragSelectObject();\n}", "function RetrieveFeeds() {\n feeds.forEach(function (feed) {\n GetDataFeed(feed);\n });\n }", "function getBusinessEvents() {\n const apicall = 'http://localhost:3010/api/events';\n fetch(apicall, {\n method: 'GET',\n headers: Auth.headerJsonJWT(),\n }).then((response) => {\n if (!response.ok) {\n if (response.status === 401) {\n Auth.removeJWT();\n context.setAuthState(false);\n throw response;\n }\n }\n return response.json();\n }).then((json) => {\n setAllBusinessEvents(json);\n setBusinessEvents(json.slice(0, 8));\n })\n .catch((error) => {\n console.log(error);\n });\n }", "function getPageInsertModelSFE() {\n var schema = {\n type: 'object',\n title: \"Comment\",\n properties: {\n //htmlClass: \"street foobar\", fieldHtmlClass: \"street\" labelHtmlClass: \"street\"\n Description: { type: 'string', title: 'Description', validationMessage: \"You need to add a Desciption.\" },\n DefaultPriceListId: { title: 'Pricelist', type: 'number', htmlClass: 'customFormSelect', format: 'uiselect', placeholder: 'Select default pricelist...', nullLabel: '---', validationMessage: \"You need to add a Default Pricelist.\" },\n Status: { title: 'Status', type: 'number', htmlClass: 'customFormSelect', format: 'uiselect', placeholder: 'Select Action...', nullLabel: '---' },\n Sort: { type: 'number', title: 'Sort' }\n },\n required: ['Description', 'DefaultPriceListId']\n }\n var form = [\n { fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'noPadding', key: \"Description\", feedback: false },\n { fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'noPadding', key: 'DefaultPriceListId', type: 'select', titleMap: [], feedback: false },\n { fieldHtmlClass: 'custom-form-style', labelHtmlClass: 'custom-form-style', htmlClass: 'noPadding', key: \"Sort\", readonly: true, feedback: false }\n ];\n\n var entity = { Description: \"\", Sort: null, DefaultPriceListId: \"\", Status: 1 }\n var ret = {\n schema: schema,\n form: form,\n entity: entity\n }\n return ret;\n}", "constructor(allblogservice, router) {\n this.allblogservice = allblogservice;\n this.router = router;\n // array for storing blogs\n this.allBlogsArray = new Array();\n }", "function CreateWidget(config) {\n var datastream = config.datastream;\n if(Array.isArray(datastream)) {\n datastream.forEach(function (element) {\n widgetRepository.hasOwnProperty(element) ? console.log(\"Duplicate Datastream: \" + element) : (widgetRepository[element] = config);\n //widgetRepository[element] = config;\n })\n } else if (typeof datastream === 'string' || datastream instanceof String){\n widgetRepository.hasOwnProperty(datastream) ? console.log(\"Duplicate Datastream: \" + datastream) : (widgetRepository[config.datastream] = config);\n //widgetRepository[config.datastream] = config;\n }\n}", "static get properties() { return {\n response: { type: Object },\n //productItem is to list of the products\n productItem:{\n type: Array,\n notify: true,\n value: null\n },\n //Existing entriesint to productEntries\n productList:{\n type: Array,\n value: null\n },\n //creating produc list Array\n produclistArray:{\n type: Array,\n value: null\n },\n //productPrice is the total amount\n productPrice:{\n type: Number,\n value: null\n },\n }\n }", "function setupChannelApis() {\n var fabricNet=require(__dirname+'/utils/fabric_net_api.js')(fcw,configer,logger);\n\n var channelinfo={\n low:0,\n high:0,\n currentBlockHash:\"\",\n previousBlockHash:\"\"\n };\n\n app.channelinfo=channelinfo;\n //enroll_admin\n fabricNet.enroll_admin(2,function (err,obj) {\n if(err==null) {\n logger.info(\"get genesis block\");\n var g_option = configer.makeEnrollmentOptions(0);\n g_option.chaincode_id=configer.getChaincodeId();\n g_option.chaincode_version=configer.getChaincodeVersion();\n logger.info(g_option.chaincode_id);\n g_option.event_url=configer.getPeerEventUrl(configer.getFirstPeerName(configer.getChannelId()))\n\n fcw.query_channel_info(obj,g_option,function (err,resp) {\n if (err!=null){\n logger.error(\"Error for getting channel info!\");\n }else {\n app.channelinfo.low=resp.height.low;\n app.channelinfo.high=resp.height.high;\n app.channelinfo.currentBlockHash=resp.currentBlockHash;\n app.channelinfo.previousBlockHash=resp.previousBlockHash\n }\n });\n\n var cc_api=require(__dirname+'/utils/creditcheck_cc_api.js')(obj,g_option,fcw,logger);\n cc_api.setupEventHub(app.wss,app.channelinfo);\n app.cc_api=cc_api;\n }else{\n logger.error(\"Error for enroll admin to channel!\");\n }\n });\n}", "function rss() {\r\n\tvar xml = <rss version=\"2.0\">\r\n\t<channel>\r\n\t\t<title>{this.title}</title>\r\n\t\t<link>{\"http://\"+req.data.http_host+this.href()}</link>\r\n\t\t<description>{this.description}</description>\r\n\t</channel>\r\n</rss>;\r\n\r\n\tvar posts = app.getObjects(['Post'],{'published':true},{sort:{'date':'desc'},maxlength:10});\r\n\r\n\tfor(var i = 0; i < posts.length; i++) {\r\n\t\txml.channel.* += <item>\r\n\t\t<title>{posts[i].title}</title>\r\n\t\t<link>{\"http://\"+req.data.http_host+posts[i].getURI()}</link>\r\n\t\t<description>{posts[i].body}</description>\r\n\t\t<pubDate>{posts[i].postdate}</pubDate>\r\n\t</item>;\r\n\t}", "function getFeedItems() {\n return service.feedItems;\n }", "function inventoryPlatforms () {\n return [{\n product: Products.rhel, // link to the Product to get more info in the Views\n // should deprecate next line??\n displayName: Products.rhel.fullName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.rhel.code);\n }\n }, {\n product: Products.docker, // link to the Product to get more info in the Views\n //should deprecate next line??\n displayName: Products.docker.fullName,\n subFilters: [{\n displayName: Products.docker.roles.host.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.docker.code);\n MultiButtonService.setState('inventoryDockerContainers', false);\n MultiButtonService.setState('inventoryDockerImages', false);\n MultiButtonService.setState('inventoryDockerHosts', true);\n }\n }, {\n displayName: Products.docker.roles.container.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.docker.code);\n MultiButtonService.setState('inventoryDockerContainers', true);\n MultiButtonService.setState('inventoryDockerImages', false);\n MultiButtonService.setState('inventoryDockerHosts', false);\n }\n }, {\n displayName: Products.docker.roles.image.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.docker.code);\n MultiButtonService.setState('inventoryDockerContainers', false);\n MultiButtonService.setState('inventoryDockerImages', true);\n MultiButtonService.setState('inventoryDockerHosts', false);\n }\n }],\n doFilter: function () {\n FilterService.setSelectedProduct(Products.docker.code);\n MultiButtonService.setState('inventoryDockerContainers', true);\n MultiButtonService.setState('inventoryDockerImages', true);\n MultiButtonService.setState('inventoryDockerHosts', true);\n }\n }, {\n product: Products.ocp,\n displayName: Products.ocp.fullName,\n subFilters: [{\n displayName: Products.ocp.roles.cluster.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.ocp.code);\n MultiButtonService.setState('inventoryOCPMasters', false);\n MultiButtonService.setState('inventoryOCPNodes', false);\n MultiButtonService.setState('inventoryOCPClusters', true);\n }\n }, {\n displayName: Products.ocp.roles.master.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.ocp.code);\n MultiButtonService.setState('inventoryOCPMasters', true);\n MultiButtonService.setState('inventoryOCPNodes', false);\n MultiButtonService.setState('inventoryOCPClusters', false);\n }\n }, {\n displayName: Products.ocp.roles.node.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.ocp.code);\n MultiButtonService.setState('inventoryOCPMasters', false);\n MultiButtonService.setState('inventoryOCPNodes', true);\n MultiButtonService.setState('inventoryOCPClusters', false);\n }\n }],\n doFilter: function () {\n FilterService.setSelectedProduct(Products.ocp.code);\n MultiButtonService.setState('inventoryOCPMasters', true);\n MultiButtonService.setState('inventoryOCPNodes', true);\n MultiButtonService.setState('inventoryOCPClusters', true);\n }\n }, {\n product: Products.rhev, // link to the Product to get more info in the Views\n // should deprecate next line??\n displayName: Products.rhev.fullName,\n subFilters: [{\n displayName: Products.rhev.roles.cluster.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.rhev.code);\n MultiButtonService.setState('inventoryRHEVManagers', false);\n MultiButtonService.setState('inventoryRHEVHypervisors', false);\n MultiButtonService.setState('inventoryRHEVClusters', true);\n }\n }, {\n displayName: Products.rhev.roles.manager.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.rhev.code);\n MultiButtonService.setState('inventoryRHEVManagers', true);\n MultiButtonService.setState('inventoryRHEVHypervisors', false);\n MultiButtonService.setState('inventoryRHEVClusters', false);\n }\n }, {\n displayName: Products.rhev.roles.hypervisor.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.rhev.code);\n MultiButtonService.setState('inventoryRHEVManagers', false);\n MultiButtonService.setState('inventoryRHEVHypervisors', true);\n MultiButtonService.setState('inventoryRHEVClusters', false);\n }\n }],\n doFilter: function () {\n FilterService.setSelectedProduct(Products.rhev.code);\n MultiButtonService.setState('inventoryRHEVManagers', true);\n MultiButtonService.setState('inventoryRHEVHypervisors', true);\n MultiButtonService.setState('inventoryRHEVClusters', true);\n }\n }, {\n product: Products.osp, // link to the Product to get more info in the Views\n //should deprecate next line??\n displayName: Products.osp.fullName,\n subFilters: [{\n displayName: Products.osp.roles.cluster.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.osp.code);\n MultiButtonService.setState('inventoryOSPCluster', true);\n MultiButtonService.setState('inventoryOSPDirector', false);\n MultiButtonService.setState('inventoryOSPCompute', false);\n MultiButtonService.setState('inventoryOSPController', false);\n }\n }, {\n displayName: Products.osp.roles.director.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.osp.code);\n MultiButtonService.setState('inventoryOSPCluster', false);\n MultiButtonService.setState('inventoryOSPDirector', true);\n MultiButtonService.setState('inventoryOSPCompute', false);\n MultiButtonService.setState('inventoryOSPController', false);\n }\n }, {\n displayName: Products.osp.roles.compute.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.osp.code);\n MultiButtonService.setState('inventoryOSPCluster', false);\n MultiButtonService.setState('inventoryOSPDirector', false);\n MultiButtonService.setState('inventoryOSPCompute', true);\n MultiButtonService.setState('inventoryOSPController', false);\n }\n }, {\n displayName: Products.osp.roles.controller.shortName,\n doFilter: function () {\n FilterService.setSelectedProduct(Products.osp.code);\n MultiButtonService.setState('inventoryOSPCluster', false);\n MultiButtonService.setState('inventoryOSPDirector', false);\n MultiButtonService.setState('inventoryOSPCompute', false);\n MultiButtonService.setState('inventoryOSPController', true);\n }\n }],\n doFilter: function () {\n FilterService.setSelectedProduct(Products.osp.code);\n MultiButtonService.setState('inventoryOSPCluster', true);\n MultiButtonService.setState('inventoryOSPDirector', true);\n MultiButtonService.setState('inventoryOSPCompute', true);\n MultiButtonService.setState('inventoryOSPController', true);\n }\n }];\n }", "function getDataInODATAFormat(result, schemaCollection) {\n var functName = \"getDataInODATAFormat\";\n var field;\n try {\n var entityCollection = [];\n var viewInfo = Tribridge.ViewEditor.CustomViews[index];\n //Check if result is null\n if (result != null && result != 'undefined') {\n for (var i = 0; i < result.length; i++) {\n entityCollection[i] = {};\n //Check for attributes\n if (result[i].attributes != null && result[i].attributes != 'undefined') {\n\n // Add the value of statecode to the dummy IsActiveRecord column\n if (result[i].attributes[\"statecode\"] != null && result[i].attributes[\"statecode\"] != undefined && result[i].attributes[\"statecode\"] != 'undefined') {\n entityCollection[i][\"_IsActiveRecord\"] = result[i].attributes[\"statecode\"].value;\n }\n\n //Check if schemaCollection have atrribute\n for (var j = 0; j < schemaCollection.length; j++) {\n\n var attri = \"\";\n\n attri = schemaCollection[j].field;\n\n if (attri != null && attri != undefined && attri != \"undefined\") {\n if (result[i].attributes[attri.toLowerCase()] != undefined && attri != \"undefined\") {\n field = result[i].attributes[attri.toLowerCase()];\n }\n else {\n field = schemaCollection[j];\n }\n }\n\n if (field != 'undefined' && field != undefined) {\n //Check for type and then add it according to format\n if (field.type != 'undefined' && field.type != undefined) {\n switch (field.type.toLowerCase()) {\n\n case \"OptionSetValue\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = { Value: field.value, FormattedValue: field.formattedValue };\n }\n else {\n entityCollection[i][schemaCollection[j].field] = { Value: null, FormattedValue: null };\n }\n break;\n case \"EntityReference\".toLowerCase():\n if (field.id != undefined && field.id != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = { Id: field.id, Name: field.name, LogicalName: field.logicalName };\n }\n else {\n entityCollection[i][schemaCollection[j].field] = { Id: null, Name: null, LogicalName: null };\n }\n break;\n case \"EntityCollection\".toLowerCase():\n //Do nothing\n break;\n\n case \"Money\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = { Value: (field.value) };\n }\n else {\n entityCollection[i][schemaCollection[j].field] = { Value: (0) };\n }\n break;\n case \"decimal\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = parseFloat(field.value).toFixed(2).toString();\n // entityCollection[i][schemaCollection[j].field] = parseFloat(field.value).toFixed(2);\n }\n else {\n entityCollection[i][schemaCollection[j].field] = parseFloat(0).toFixed(2).toString();\n }\n break;\n case \"int\".toLowerCase():\n case \"integer\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = field.value.toString();\n }\n else {\n entityCollection[i][schemaCollection[j].field] = null;\n }\n break;\n case \"double\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = field.value.toString();\n }\n else {\n entityCollection[i][schemaCollection[j].field] = null;\n }\n break;\n case \"datetime\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n var isFilterApplied = false;\n for (p = 0; p < viewInfo[\"Columns\"].length; p++) {\n if (viewInfo[\"Columns\"][p][\"Name\"] == schemaCollection[j].field) {\n isFilterApplied = viewInfo[\"Columns\"][p][\"Filterable\"];\n break;\n }\n }\n\n if (isFilterApplied) { // 0810\n // then bind HH:MM:SS = 0 else filtering wont work\n var arr = field.formattedValue.split(' ');\n var dd = new Date(arr[0]);\n\n entityCollection[i][schemaCollection[j].field] = new Date(dd.getFullYear(), dd.getMonth(), dd.getDate(), 0, 0, 0);\n }\n else {\n // then bind the actual time part of datetime\n var arr = field.formattedValue.split('T');\n if (arr.length > 1) {\n var time = arr[1].split(':');\n entityCollection[i][schemaCollection[j].field] = new Date(arr[0] + \", \" + time[0] + \":\" + time[1] + \":\" + \"00\");\n }\n else {\n entityCollection[i][schemaCollection[j].field] = new Date(arr[0]);\n }\n }\n }\n break;\n case \"image\".toLowerCase():\n entityCollection[i][schemaCollection[j].field] = { isValid: true, errorMsg: \"\", isNewRecord: false };\n break;\n default:\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = field.value;\n }\n else {\n entityCollection[i][schemaCollection[j].field] = null;\n }\n break;\n\n }\n }\n }\n }\n }\n }\n }\n\n // check if any unsaved new records are present\n if (Tribridge.ViewEditor.ErrorRecords != null && Tribridge.ViewEditor.ErrorRecords.length > 0) {\n // Add the unsaved new records to the entity collection\n for (var i = 0; i < Tribridge.ViewEditor.ErrorRecords.length; i++) {\n //Check for new records\n if (Tribridge.ViewEditor.ErrorRecords[i].isNewRecord) {\n //Check if schemaCollection have atrribute\n var obj = {};\n for (var j = 0; j < schemaCollection.length; j++) {\n var attri = \"\";\n attri = schemaCollection[j].field;\n if (Tribridge.ViewEditor.ErrorRecords[i].record[attri] != null && Tribridge.ViewEditor.ErrorRecords[i].record[attri] != undefined) {\n obj[attri] = Tribridge.ViewEditor.ErrorRecords[i].record[attri];\n }\n }\n // Also add the colSaveVal field to bind the err\n obj[\"colSaveVal\"] = { isValid: false, errorMsg: Tribridge.ViewEditor.ErrorRecords[i].error, isNewRecord: true };\n entityCollection.splice(0, 0, obj);\n }\n }\n }\n return entityCollection;\n } catch (e) {\n throwError(functName, e);\n }\n}", "constructor(parentElement, businessData) {\n this.parentElement = parentElement;\n this.data = businessData;\n this.displayData = [];\n\n this.initVis()\n\n }", "constructor(parentElement, businessData) {\n this.parentElement = parentElement;\n this.data = businessData;\n this.displayData = [];\n\n this.initVis()\n\n }", "getDefinitions(params) {\n console.log('[DataProvider][getDefinitions] : %s begin', params);\n\n return Promise.timeout(1)\n .then(() => {\n\n return [\n {\n \"name\": \"addr\",\n \"kind\": \"cluster\",\n \"provides\": {\n \"web\": {\n \"public\": true,\n \"service\": \"web\"\n }\n }\n },\n {\n \"name\": \"proc\",\n \"cluster\": \"addr\",\n \"code\": {\n \"kind\": \"docker\"\n },\n \"sector\": \"main\",\n \"kind\": \"service\",\n \"consumes\": [\n {\n \"actions\": [\n \"subscribe\"\n ],\n \"queue\": \"jobs\"\n },\n {\n \"database\": \"book\"\n }\n ]\n },\n {\n \"cluster\": \"addr\",\n \"code\": {\n \"kind\": \"docker\"\n },\n \"kind\": \"service\",\n \"provides\": {\n \"default\": {\n \"port\": 4000,\n \"protocol\": \"http\"\n }\n },\n \"name\": \"app\",\n \"sector\": \"main\",\n \"consumes\": [\n {\n \"database\": \"book\"\n },\n {\n \"actions\": [\n \"publish\"\n ],\n \"queue\": \"jobs\"\n },\n {\n \"cluster\": \"phone\"\n }\n ]\n },\n {\n \"cluster\": \"addr\",\n \"code\": {\n \"kind\": \"docker\"\n },\n \"kind\": \"service\",\n \"provides\": {\n \"default\": {\n \"port\": 3000,\n \"protocol\": \"http\"\n }\n },\n \"name\": \"web\",\n \"sector\": \"main\",\n \"consumes\": [\n {\n \"service\": \"app\"\n }\n ]\n },\n {\n \"cluster\": \"addr\",\n \"init\": \"init.sql\",\n \"subClass\": \"sql\",\n \"kind\": \"database\",\n \"name\": \"book\",\n \"class\": \"sql\",\n \"sector\": \"main\"\n },\n {\n \"name\": \"jobs\",\n \"cluster\": \"addr\",\n \"class\": \"queue\",\n \"subClass\": \"pubsub\",\n \"sector\": \"main\",\n \"kind\": \"queue\"\n },\n {\n \"name\": \"memory\",\n \"config\": {\n \"max\": 150,\n \"min\": 100\n },\n \"sector\": \"main\",\n \"kind\": \"policy\",\n \"target\": {\n \"cluster\": \"addr\"\n }\n },\n {\n \"name\": \"memory\",\n \"config\": {\n \"max\": null,\n \"min\": 150\n },\n \"sector\": \"main\",\n \"kind\": \"policy\",\n \"target\": {\n \"cluster\": \"addr\",\n \"deployment\": \"gprod\"\n }\n },\n {\n \"name\": \"memory\",\n \"config\": {\n \"max\": 300,\n \"min\": 200\n },\n \"sector\": \"main\",\n \"kind\": \"policy\",\n \"target\": {\n \"cluster\": \"addr\",\n \"service\": \"proc\",\n \"deployment\": \"gprod\"\n }\n },\n {\n \"name\": \"scale\",\n \"config\": {\n \"max\": 10,\n \"min\": 1,\n \"metrics\": {\n \"cpu\": {\n \"targetAverage\": 44\n },\n \"current_connections\": {\n \"targetAverage\": 200\n },\n \"memory\": {\n \"targetAverage\": \"1G\"\n }\n }\n },\n \"sector\": \"main\",\n \"kind\": \"policy\",\n \"target\": {\n \"cluster\": \"addr\",\n \"service\": \"app\",\n \"deployment\": \"gprod\"\n }\n },\n {\n \"name\": \"cpu\",\n \"config\": {\n \"max\": 0.15,\n \"min\": 0.1\n },\n \"sector\": \"main\",\n \"kind\": \"policy\",\n \"target\": {\n \"cluster\": \"addr\"\n }\n },\n {\n \"name\": \"cpu\",\n \"config\": {\n \"max\": 0.2,\n \"min\": 0.15\n },\n \"sector\": \"main\",\n \"kind\": \"policy\",\n \"target\": {\n \"cluster\": \"addr\",\n \"deployment\": \"gprod\"\n }\n },\n {\n \"name\": \"cpu\",\n \"config\": {\n \"max\": 0.25,\n \"min\": 0.2\n },\n \"sector\": \"main\",\n \"kind\": \"policy\",\n \"target\": {\n \"cluster\": \"addr\",\n \"service\": \"proc\",\n \"deployment\": \"gprod\"\n }\n }\n ];\n });\n }", "render() {\n return (\n <Grid>\n <Offerings\n productData={this.props.products.main_offering}\n type={\"main\"}\n maxProducts={1}\n />\n <Offerings\n productData={this.props.products.sale_offerings}\n type={\"ribbon\"}\n maxProducts={3}\n />\n </Grid>\n );\n }", "fetchSuppliers(){\r\n return Api().get('/suppliers')\r\n }", "function o(o){return {origin:\"portal-item\",url:U(o.itemUrl),portal:o.portal||w.getDefault(),portalItem:o,readResourcePaths:[]}}", "function o(o){return {origin:\"portal-item\",url:U(o.itemUrl),portal:o.portal||w.getDefault(),portalItem:o,readResourcePaths:[]}}", "feed() {\n const key = this.io.getSessionKey();\n\n this.whenAuthenticated('/', (key, user) =>\n this.render(Feed, {\n user: user,\n edit: () => this.io.navigate('/a/edit/'),\n newTab: () => this.io.navigate('/tabs/new/'),\n getPage: (page, done) =>\n this.logs.frontpage(key, page, {\n success: done,\n error: () => done([])\n }),\n }));\n }", "render() {\n const {intl, data} = this.props;\n\n return (\n <Layout>\n <Header headerType=\"black-header\"/>\n <Landing data={data.cms.nodeQuery.entities[0].entityTranslation}/>\n <Mission data={data.cms.nodeQuery.entities[0].entityTranslation}/>\n <Milestone data={data.cms.nodeQuery.entities[0].entityTranslation}/>\n <Cause data={data.cms.nodeQuery.entities[0].entityTranslation}/>\n <SideBar />\n <Footer />\n </Layout>\n );\n }" ]
[ "0.63348174", "0.54379946", "0.5367656", "0.52795196", "0.52003944", "0.5195895", "0.5131012", "0.51104456", "0.5095767", "0.5040104", "0.5009075", "0.5009075", "0.498304", "0.498304", "0.49781817", "0.49781817", "0.49781817", "0.49778026", "0.49778026", "0.49695635", "0.49667656", "0.495648", "0.49525717", "0.49506", "0.4943506", "0.49320012", "0.48902562", "0.4879411", "0.4866006", "0.48579413", "0.4855801", "0.48490828", "0.4847627", "0.48443058", "0.4817777", "0.48170775", "0.48152405", "0.480835", "0.4807612", "0.47859296", "0.47848037", "0.477525", "0.47711912", "0.47698724", "0.4761341", "0.47492355", "0.47486955", "0.47468743", "0.4745776", "0.47435558", "0.47369248", "0.47340807", "0.47322187", "0.47200802", "0.47196633", "0.4718053", "0.4718053", "0.4711424", "0.47071543", "0.47058806", "0.4704873", "0.4704669", "0.46976316", "0.46904033", "0.46828413", "0.46778324", "0.46742973", "0.46658012", "0.4662336", "0.466121", "0.46577", "0.4655058", "0.46518022", "0.46508658", "0.4649652", "0.46487445", "0.46448997", "0.4644128", "0.46440786", "0.464171", "0.46406016", "0.4630819", "0.46297732", "0.46245843", "0.46194294", "0.46177384", "0.46157894", "0.46143228", "0.4613963", "0.46070614", "0.4606091", "0.46023366", "0.46009558", "0.46009558", "0.46006432", "0.45989573", "0.45981732", "0.45945787", "0.45945787", "0.45931634", "0.45905212" ]
0.0
-1
utility method to get a value from json using key
function getValue(myJSON, test){ var str = ''; for (var key in myJSON) { if (myJSON.hasOwnProperty(key) && String(test) === String(key)) { str = myJSON[key]; } } return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getValue(key, jsonObj=this.config) {\n if(typeof(key) != 'string') return\n return key.split('.').reduce((p,c)=>p&&p[c]||null, jsonObj)\n }", "function getEntryValue(json,key){\n\tvar entry = json[ENTRY];\n\tif(entry != undefined){\n\t\tfor(var i = 0; i < entry.length; i++){\n\t\t\tif(entry[i][KEY] == key){\n\t\t\t\treturn entry[i][VALUE];\n\t\t\t}\n\t\t}\n\t}\n\telse{\n\t\treturn undefined;\n\t}\n}", "function get(key) {\n return data[key];\n }", "function getValue (obj, key) {\n return obj[key]\n}", "get(key) {\n const item = this.getItem(key);\n if (item) {\n return item.value;\n }\n return undefined;\n }", "function getValue(object, key) {\n return object[key];\n}", "get(key) {\n let index = this.getIndex(key);\n let data = this.data[index].value;\n if (!data.value) {\n return null;\n }\n return data.value;\n }", "getValue( key ) {\n return this.get( key );\n }", "function get_(key){\n\t\tfor(var i = 0; i < keyValueMap.length; i++){\n\t\t\tif(keyValueMap[i].k == key){\n\t\t\t\treturn keyValueMap[i].v;\n\t\t\t}\n\t\t}\n\t}", "function getEntryValueFromOuter(json,entryKey,key){\n\tvar entry = json[entryKey][ENTRY];\n\tif(entry != undefined){\n\t\tfor(var i = 0; i < entry.length; i++){\n\t\t\tif(entry[i][KEY] == key){\n\t\t\t\treturn entry[i][VALUE];\n\t\t\t}\n\t\t}\n\t}\n\telse{\n\t\treturn undefined;\n\t}\n}", "function get(object, key) {\n //Loop through the object\n //if you find that key return value\n //else return undefined\n for(let banana in object) {\n return object[key];\n}\n}", "getValueInPath(json, path) {\n const pathElements = this.pathUtilService.toPathArray(path);\n let value = json;\n pathElements.forEach(pathElement => {\n value = value[pathElement];\n if (!value) {\n throw new Error(`\"${pathElement}\" of given path not defined in given json`);\n }\n });\n return value;\n }", "function grabKey(obj, key) {\n return obj[key];\n}", "get(key) {\n return this.data[key];\n }", "get(key) {\n return this.data[key];\n }", "get(key) {\n return this.data[key];\n }", "function getAtFromJson(pos, object, keyname) {\n var counter = 0;\n var result = null;\n $.each(object, function(key,value){ \n if(counter == pos) {\n result = value[keyname];\n return false;\n };\n counter++;\n });\n return result;\n }", "function getDataValue(state, key) {\n\t var data = getDataObject(state);\n\t return data[key];\n\t}", "function getDataValue(state, key) {\n\t var data = getDataObject(state);\n\t return data[key];\n\t}", "function getDataValue(state, key) {\n\t var data = getDataObject(state);\n\t return data[key];\n\t}", "get(key) {\n return this.has(key)\n ? this.items[key].value\n : null;\n }", "jsonParseGrab(OBJ, key) {\n return JSON.parse(JSON.stringify(OBJ))[key];\n }", "function getValueFrom(object, key) {\n var keys = key.split('.');\n var value = object;\n for (var i = 0; i < keys.length; i++) {\n var v = value[keys[i]];\n if (v !== undefined) {\n value = v;\n } else {\n return undefined;\n }\n }\n return value;\n}", "get(key) {\n const value = this.storageMechanism.getItem(key);\n try {\n return JSON.parse(value);\n } catch (error) {\n return value;\n }\n }", "static accessValue(object, key) {\n const keys = key.split('.');\n let value = object;\n for (let i = 0, max = keys.length; i < max; i++) {\n value = value[keys[i]];\n }\n return value;\n }", "function get(obj, key) {\n let data = init(obj);\n \n switch (typeof key) {\n case \"string\":\n case \"number\":\n return data[key];\n }\n \n return data;\n}", "function get(key) {\n return JSON.parse(self.storage.getItem(key));\n }", "function get(key) {\n return JSON.parse(self.storage.getItem(key));\n }", "function getUserInfoByKey(DATAJSONFILE, key, value) {\r\n // get json array from json string\r\n var jsonUserArray = JSON.parse(fs.readFileSync(DATAJSONFILE, 'utf8'));\r\n // find same value\r\n return jsonUserArray.find(function (element) {\r\n return element[key] == value;\r\n });\r\n}", "function get(context, key) {\n var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n var userDefaults = getUserDefaults(context);\n var storedValue = userDefaults.stringForKey_(key);\n if (!storedValue) {\n return defaultValue;\n }\n try {\n return JSON.parse(storedValue);\n } catch (e) {\n return defaultValue;\n }\n}", "get (key) {\n return this.data[key]\n }", "get(key, mode) {\n //mode can be enforced by passing 2nd argument\n mode = this.checkMode(mode);\n var object = window[mode].getItem(key);\n if (object) {\n return JSON.parse(object);\n }\n //return false when value for key doesn't exist\n return false;\n }", "function get_obj_key_val(obj,key){\n\t\tif (!is_undefined_key(obj,key)) {\n\t\t\treturn _obj_composed_key_val(obj,key);\n\t\t}else {\n\t\t\treturn -1;\n\t\t}\n\n\t\tfunction _obj_composed_key_val(obj,key_str) {\n\t\t\tvar arr_key = key_str.split(\".\");\n\t\t\tvar inner_val = obj;\n\t\t\tfor (var i = 0; i < arr_key.length; i++) {\n\t\t\t\tinner_val = inner_val[arr_key[i]];\n\t\t\t}\n\t\t\treturn inner_val;\n\t\t}\n\t}", "function getValue(obj, subkey) {\n if (!subkey)\n subkey = '#';\n if (obj && obj[subkey])\n return obj[subkey];\n else\n return null;\n}", "getValueFromKey(key) {\r\n if (!(key in this.cache)) return null;\r\n this.updateMostRecent(this.cache[key]);\r\n return this.cache[key].value;\r\n }", "function searchGet(key, obj)\n{\n obj || (obj=this);\n\n var value;\n var Key=key.charAt(0).toUpperCase() + key.substring(1);\n var accessor;\n\n if((accessor=(\"get\" + Key)) in obj)\n {\n var fn=obj[accessor];\n\n value=fn.call(obj);\n }\n // else if((\"is\" + Key) in obj)\n // {\n // value=obj.isKey();\n // }\n // else if((\"_\" + key) in obj)\n // {\n // value=obj[\"_\" + key];\n // }\n // else if((\"_is\" + Key) in obj)\n // {\n // value=obj[\"_is\" + key];\n // }\n // else// if((key in obj))\n // {\n // value=obj[key];\n // }\n else {\n value=ivarGet(key, obj);\n }\n\n return value;\n}", "query(key, value) {\n let result = this.JSONFile.filter((item) => {\n return item[key] == value;\n });\n\n return result[0];\n }", "getValueFromKey(key) {\n if (!(key in this.cache)) return null;\n this.updateMostRecent(this.cache[key]);\n return this.cache[key].value;\n }", "function key_value(key) {\n return Evaluator.key_value(key);\n}", "getData(key) { return this.data[key]; }", "function getValue(key, callback) {\n\n\tlog('getting key: ' + key);\n\n\tvar pair = {\n\t\tkey: key,\n\t\tvalue: undefined\n\t};\n\n\tpost('/key-value-store/get.php', JSON.stringify(pair), callback);\n\n}", "getItem(key: string) {\n const cache = this._cache;\n\n if (!cache) {\n return null;\n }\n\n const cacheItem = cache.getItem(key);\n\n if (!cacheItem) {\n return null;\n }\n\n try {\n return JSON.parse(cacheItem);\n } catch (err) {\n return this._cache.getItem(key);\n }\n }", "getItem(key: string) {\n const cache = this._cache;\n\n if (!cache) {\n return null;\n }\n\n const cacheItem = cache.getItem(key);\n\n if (!cacheItem) {\n return null;\n }\n\n try {\n return JSON.parse(cacheItem);\n } catch (error) {\n return this._cache.getItem(key);\n }\n }", "get(key) {\n const index = this.keys.indexOf(key);\n return this.values[index];\n }", "getJsonValue(key) {\n return this.storageService.secureStorage.getItem(key);\n }", "function getValue(key, array){\n\tfor (i in array) {\n\t\tif (array[key]) {\n\t\t\treturn array[key];\n\t\t}\n\t}\n\treturn false;\n}", "static get(key) {\r\n key = localStorage.getItem(key);\r\n \r\n try {\r\n return JSON.parse(key);\r\n } catch {\r\n return key;\r\n }\r\n }", "get(key) {\n var promise = new Promise((resolve, reject) => {\n this._get().then((data) => {\n if (typeof key !== 'undefined') {\n if (data.hasOwnProperty(key)) {\n resolve(data[key]);\n } else {\n resolve(null);\n }\n } else {\n resolve(data);\n }\n });\n });\n return promise;\n }", "function keyValueArrayGet(keyValueArray, key) {\n var index = keyValueArrayIndexOf(keyValueArray, key);\n\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n\n return undefined;\n }", "function keyValueArrayGet(keyValueArray, key) {\n var index = keyValueArrayIndexOf(keyValueArray, key);\n\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n\n return undefined;\n }", "function keyValueArrayGet(keyValueArray, key) {\n var index = keyValueArrayIndexOf(keyValueArray, key);\n\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n\n return undefined;\n }", "function getValue(k, obj) {\n const keyArr = k.split('.');\n let o = obj;\n for (let i = 0; i < keyArr.length; i++) {\n o = o[keyArr[i]];\n }\n if (o === undefined) return '';\n return o;\n }", "function getVal(input, key) {\n for (var i=0; i < input.length ; ++i){\n if(input[i]['size'] == key){\n return input[i]['quantity'];\n }\n }\n }", "get(key: K): ?V {\n var val = this.tree.find([key, null]);\n return val ? val[1] : null;\n }", "get(key) {\n const type = this.map[key];\n\n if (this.store && type) {\n const value = this.store.getItem(key);\n return type === 'string' || value == null ? value : JSON.parse(value);\n }\n\n return type || null;\n }", "get() { return this.data[key] }", "function valueFromUrl(key) {\n\tvar r = new RegExp(`${key}=([^&]*)`);\n\tvar match = document.location.search.match(r);\n\tif (match && match[1]) {\n\t\treturn match[1];\n\t}\n\treturn null;\n}", "function keyValueArrayGet(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n return undefined;\n}", "function keyValueArrayGet(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n return undefined;\n}", "function keyValueArrayGet(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n return undefined;\n}", "function keyValueArrayGet(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n return undefined;\n}", "function keyValueArrayGet(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n return undefined;\n}", "function keyValueArrayGet(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n return undefined;\n}", "function keyValueArrayGet(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n return undefined;\n}", "getStorageItemValue(item_key, key) {\n if (localStorage.getItem(item_key)) {\n var item_value = JSON.parse(localStorage.getItem(item_key));\n var item_index = item_value.findIndex((obj => obj[0] === key));\n return (item_index >= 0) ? item_value[item_index][1] : null;\n }\n else {\n return null;\n }\n }", "get(key) {\n const address = this._hash(key);\n if(this.data[address]){\n for (let i = 0; i < this.data[address].length; i++) {\n let currenctBucket = this.data[address][i];\n if (currenctBucket) {\n if (currenctBucket[0] === key) {\n return currenctBucket[1];\n }\n }\n }\n }\n return undefined;\n }", "item(key)\n\t{\n\t\tkey = this.toString(key);\n\t\tif (!super.has(key))\n\t\t{\n\t\t\t/*if (isBrowser()) throw new Runtime.Exceptions.KeyNotFound(key);*/\n\t\t\tvar _KeyNotFound = use(\"Runtime.Exceptions.KeyNotFound\");\n\t\t\tthrow new _KeyNotFound(key);\n\t\t}\n\t\tvar val = super.get(key);\n\t\tif (val === null || val == undefined) return null;\n\t\treturn val;\n\t}", "function get(key) {\n return option_1.Option(this.value()[key]);\n}", "function findValue(key) {\n try {\n if (window.localStorage.getItem(key) != null) {\n return JSON.parse(window.localStorage.getItem(key));\n }\n } catch (error) {\n //An older Gecko 1.8.1/1.9.0 method of storage (Deprecated due to the obvious security hole):\n if (window.globalStorage[location.hostname].getItem(key) != null) {\n return JSON.parse(window.globalStorage[location.hostname].getItem(key));\n }\n }\n return null;\n}", "function get(k, key$$1, value, fields) {\n return accessor(\n function(d) { return key$$1(d) === k ? value(d) : NaN; },\n fields,\n k + ''\n );\n }", "findValueByKey(array, key) {\n\n for (let i = 0; i < array.length; i++) {\n\n if (array[i][key]) {\n\n return array[i][key];\n }\n }\n return null;\n }", "function keyValueArrayGet(keyValueArray, key) {\n var index = keyValueArrayIndexOf(keyValueArray, key);\n\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n\n return undefined;\n}", "function get(obj, key, defaultVal){\n var result = obj[key];\n return (typeof result!==\"undefined\")? result : defaultVal;\n}", "function getJsonItem(iD, key){\n\tvar jsonData = JSON.parse(localStorage.getItem(iD.toString()));\n\tconsole.log(key + \": \" + parseInt(jsonData[key.toString()]));\n\treturn parseInt(jsonData[key.toString()]);\n}", "function getValue(obj, keyPath) {\n let keys = keyPath.split(\".\");\n\n while (keys.length > 0 && obj != null) {\n keyPath = keys.shift();\n obj = obj[keyPath];\n }\n\n return obj;\n}", "get(project, key) {\n this.set_project(project)\n return this.data[key];\n }", "search(key) {\r\n const hash = this.calculateHash(key);\r\n if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {\r\n return this.values[hash][key];\r\n } else {\r\n return null;\r\n }\r\n }", "function get_value(key, tree)\n{\n\tlet paths = key.split('.');\n\n\tfor (var i = 0; i < paths.length; i++)\n\t{\n\t\tvar path = paths[i];\n\n\t\t// treat arrays a little differently\n\t\tif (path.indexOf('[') >= 0 && path.indexOf(']') >= 0)\n\t\t{\n\t\t\tvar index = str_utils.between(path, '[', ']');\n\t\t\tvar ary_path = str_utils.replace_last('[' + index + ']', '', path);\n\n\t\t\tif (typeof tree[ary_path] === 'undefined')\n\t\t\t{\n\t\t\t\tthrow \"Invalid path: \" + key;\n\t\t\t}\n\n\t\t\ttree = tree[ary_path];\n\t\t\tpath = index;\n\t\t}\n\n\t\t// we didn't get a valid tree path\n\t\t// so we need to bail now\n\t\tif (typeof tree[path] === 'undefined')\n\t\t{\n\t\t\tthrow 'Invalid path: ' + key;\n\t\t}\n\n\t\ttree = tree[path];\n\n\t}\t\n\n\treturn tree;\n}", "static getValue(field, key) {\n if(key.startsWith('#')) {\n throw new Error('Please use the field without leading hash.');\n }\n\n if(field[`#override_${key}`]) {\n return field[`#${key}`];\n }\n\n return getNested(() => field.composite_elements.find(element => element['#key'] === key)['#default_value'], null);\n }", "get(key) {\n let index = this.hash(key);\n if (this.keyMap[index]) {\n for (let i = 0; i < this.keyMap[index].length; i++) {\n if (this.keyMap[index][i][0] === key) {\n return this.keyMap[index][i][1];\n }\n }\n }\n return undefined;\n }", "get(key) {\n const map = this._getMap(key, false);\n if (map) {\n return map.get(key);\n }\n }", "async get(key) {\n const value = sessionStorage[key];\n\n if (value) {\n return JSON.parse(value);\n }\n\n return null;\n }", "function getItem(key, callback) {\n switch (dbBackend) {\n // Find the value for this key directly from IndexedDB and pass the\n // value to a callback function.\n case DB_TYPE_INDEXEDDB:\n indexedTransaction('readonly', function getItemBody(store) {\n var request = store.get(key);\n\n request.onsuccess = function getItemOnSuccess() {\n callback(request.result);\n };\n\n request.onerror = _errorHandler(request);\n });\n break;\n // If we're using localStorage, we have to load the value from\n // localStorage, parse the JSON, and then send that value to the\n // callback function.\n case DB_TYPE_LOCALSTORAGE:\n var result = localStorage.getItem(key);\n\n // If a result was found, parse it from serialized JSON into a\n // JS object. If result isn't truthy, the key is likely\n // undefined and we'll pass it straight to the callback.\n if (result) {\n result = JSON.parse(result);\n }\n\n callback(result);\n break;\n }\n }", "function getObject(key) {\n\tvar storage = window.localStorage;\n\tvar value = storage.getItem(key);\n\treturn value && JSON.parse(value);\n}", "function getAccount(userJson){\n for (var key in userJson){\n if (userJson[key] && typeof userJson[key] == 'object') return userJson[key];\n }\n }", "getParam(jsonFile, keyName) {\n return artifactGetParam(this, jsonFile, keyName);\n }", "function getObjInObjWithKey(obj, key, val){\n\t\tfor(var i in obj){\n\t\t if(obj[i][key] === val) return obj[i];\n\t\t}\n\t\treturn false;\n\t}", "function getProperty(obj, key) {\n return obj[key];\n}", "retrieve(key) {\n \n }", "async get(key) {\n const all = await this.getAll();\n return all[key];\n }", "locale(key) {\n //Open and read JSON file\n console.log(\"Locale OBJ: \", this.obj);\n let val = null;\n //Find and Return Value of specified Key\n return this.obj[key];\n }", "_get(key) { return undefined; }", "function findPropertyInResults(key, results) {\r\n // sanitise the response to get just the property we want\r\n return results.filter(function(item) {\r\n return item.Key === key;\r\n })[0];\r\n}", "function get_(key) {\n return B (function(obj) { return key in obj ? Just (obj[key]) : Nothing; })\n (toObject);\n }", "function getValue(key) {\n const value = document.getElementById(key + '-cost').innerText;\n return value;\n}", "function getItem(key) {\n return Promise.resolve(key)\n .then(function(key) {\n return map.get(key)\n })\n }", "get(){return this[key]}", "get(key) {\n return this.frame.get(to_key(key));\n }", "retrieve(key) {\n const index = getIndexBelowMax(key.toString(), this.limit);\n const bucket = this.storage.get(index);\n if (Array.isArray(bucket)) {\n for (let i = 0; i < bucket.length; i++) {\n const objKey = bucket[i][0];\n if (objKey === key) {\n return bucket[i][1];\n }\n }\n }\n }", "function getJsonValue(path, obj) {\n function cleanObjPart(s) {\n // Handle the case when processing an array element (e.g. \"jobs[0]\")\n var re = /(\\w+)\\s*\\[\\s*(\\d+)\\s*\\]\\s*/;\n var match = re.exec(s);\n var objPart;\n if (match != null) {\n var elem1 = match[1];\n var index = parseInt(match[2], 10);\n objPart = obj[elem1][index];\n }\n else {\n objPart = obj[s];\n }\n return objPart;\n }\n\n var NOT_FOUND = \"notFound\";\n var parts = path.split(/(?!\\B\"[^\"]*)\\.(?![^\"]*\"\\B)/);\n var part;\n var last = removeDoubleQuotes(parts.pop());\n while ((part = parts.shift())) {\n part = removeDoubleQuotes(part);\n var objPart = cleanObjPart(part);\n if (typeof objPart != \"object\") return NOT_FOUND;\n obj = objPart;\n }\n\n var r = cleanObjPart(last);\n return r === undefined ? NOT_FOUND : r;\n}" ]
[ "0.76459277", "0.75812715", "0.73374736", "0.7189652", "0.6905238", "0.6902459", "0.67366785", "0.6709172", "0.6602449", "0.65832", "0.6447544", "0.6441811", "0.64086366", "0.6374087", "0.63648623", "0.63648623", "0.6360102", "0.6334987", "0.6334987", "0.6334987", "0.6312089", "0.62732106", "0.62456197", "0.62067544", "0.62056303", "0.62041736", "0.62041295", "0.62041295", "0.61675435", "0.61502385", "0.6144036", "0.6135706", "0.60892904", "0.60848045", "0.6036857", "0.6025115", "0.6022627", "0.60073507", "0.60064167", "0.60013884", "0.5984353", "0.5980878", "0.5977041", "0.59692156", "0.5967261", "0.5966339", "0.5951098", "0.5943098", "0.5923337", "0.59231514", "0.59231514", "0.59098125", "0.58857465", "0.58781886", "0.58773285", "0.5874495", "0.58721775", "0.58701414", "0.58701414", "0.58701414", "0.58701414", "0.58701414", "0.58701414", "0.58701414", "0.5867345", "0.5867147", "0.5859976", "0.585818", "0.5835597", "0.58240694", "0.58194524", "0.5816255", "0.5816153", "0.58097595", "0.58091515", "0.5805847", "0.58055556", "0.5802107", "0.5798002", "0.5793837", "0.57925963", "0.5762461", "0.5742666", "0.57420903", "0.5734252", "0.57224154", "0.5718345", "0.57111174", "0.5710769", "0.5707816", "0.5695752", "0.5689981", "0.56757987", "0.5672649", "0.566573", "0.56651664", "0.56514406", "0.564671", "0.56382173", "0.56365085" ]
0.65923405
9
set values in the localstorage json obj'z
function setValue(jsonID, test, value){ var myJSON = JSON.parse(localStorage[jsonID]); for (var key in myJSON) { if (myJSON.hasOwnProperty(key) && String(test) === String(key)) { myJSON[key] = value; } } localStorage[jsonID] = JSON.stringify(myJSON); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setJsonStorage (chave, valor){\n localStorage.setItem(chave,valor);\n}", "function setFromLocal () {\n _.each(settings, (v, k) => {\n var value = localStorage.getItem(k);\n if (value) {\n settings[k] = JSON.parse(value);\n }\n });\n}", "function setData(id, obj){\n localStorage.setItem(id, JSON.stringify(obj));\n}", "function setJsonData() {\n\tvar files = ['dayclub','nightclub','service'];\n\n\t$.each(files, function(index, value) {\n \t\tconsole.log( value );\n\n\t\t$.getJSON('data/'+ value +'.json', function(json) {\n\t\t\tlocalStorage.setItem(value+'-data', JSON.stringify(json));\n\t\t\tvar retrievedObject = localStorage.getItem(value+'-data');\n\t\t\tconsole.log('retrievedObject: '+ value, JSON.parse(retrievedObject));\n\t\t});\n\t});\n}", "function setLocalStorge() {\n\n // khi lưu xuống localStorage chuyển data thành String\n\n localStorage.setItem(\n \"DanhSachNhanVien\",\n JSON.stringify(danhSachNhanVien.mangNhanVien)\n );\n}", "function setLocalStorage() {\n var dados = {\n jornadaCertPonto: jornadaCertPonto,\n almoco: almoco,\n jornadaSap: jornadaSap,\n tolerancia: tolerancia,\n semAlmoco: semAlmoco,\n horasAbonadas: horasAbonadas,\n saldoAdpBruto: saldoAdpBruto,\n };\n\n localStorage.setItem(keyLocalStorage, JSON.stringify(dados));\n}", "function _storage() {\n localStorage.setObject(\"data\", data);\n }", "function setLocalStorage(){\r\n var playerSetter = JSON.stringify(allPlayers);\r\n localStorage.setItem('players', playerSetter);\r\n}", "function storeLocal(obj) {\n\n Object.keys(obj).forEach((key) => {\n console.log(`Set ${key} = ${obj[key]}`);\n localStorage.setItem(key, obj[key]);\n });\n // localStorage.setItem('fullname', fullName);\n // localStorage.setItem('username', userName);\n // localStorage.setItem('image', imageName);\n console.log('Data stored');\n}", "function setStorage(data)\n\t\t \t{\n\t\t \t\tvar data = JSON.stringify(data);\n\t\t \t\t//alert(\"SAVED\");\n\t\t \t\tlocalStorage.setItem('data',data);\n\t\t \t}", "function setLocalObject(objName, obj) {\n localStorage.setItem(objName, JSON.stringify(obj)); \n }", "function setLocalStorage(location,data){\n localStorage.setItem(location, JSON.stringify(data));\n}", "function setLS(key,value){\n window.localStorage.setItem(key, JSON.stringify(value));\n\n}", "function updateLocalStorage() {\n objString = '{\"nextId\": \"' + nextId + '\"}';\n convertObjectToString(root);\n localStorage.setItem(LOCAL_STORAGE, objString);\n }", "function saveLocal(object) {\r\n var value = JSON.stringify(object);\r\n localStorage.setItem(1, value);\r\n //data = JSON.parse(localStorage.getItem(1));\r\n //alert(\"primeiro\" + data[0].nome);\r\n getLocal();\r\n}", "function setItemToLocalStorage(name, data) {\n localStorage.setItem(name, JSON.stringify(data));\n}", "function setLocalStorage(items) {\n \n localStorage.setItem('storage-key', JSON.stringify(items));\n }", "function setLocalData(key, data) {\n if (Modernizr.localstorage) {\n localStorage.setItem(key, JSON.stringify(data));\n }\n }", "function fillStorage() {\n var local = {\n uid : uid,\n Time : timeLocal,\n Todos : todos\n }\n localStorage.clear();\n window.localStorage.setItem(`local`,JSON.stringify(local));\n mapping();\n}", "function setlocalStorage(todoItems){\r\n let JSONready = JSON.stringify(todoItems)\r\n localStorage.setItem('todoItems',JSONready);\r\n}", "function writeA()\n {\n myObj = {nome: \"Francisco\", idade: 20, cidade: \"Ipueiras\"};\n myObj = JSON.stringify(myObj);\n localStorage.setItem(\"testJSON\", myJSON);\n }", "function autoFillData() {\n //the actual JSON obj data required for this to work is coming for our json.js file which is loaded from out HTML\n //Store the JSON obj into local storage\n for(var n in json){\n var id = Math.floor(Math.random()*1000001);\n localStorage.setItem(id, JSON.stringify(json[n]));\n }\n }", "function createData(localJson){\n\tlocalStorage.setItem(userID.toString(), localJson);\n}", "function dataObjectUpdated() {\n //set item in localstorage in JSON string format\n localStorage.setItem('todoList', JSON.stringify(data))\n}", "function autoFillData(){\n\t\t//The actual JSON OBJECT data required for this to work is coming from our json.js file which is loaded from our HTML page.\n\t\t//Store JSON OBJECT into local storage.\n\t\tfor(var n in json){\n\t\t\tvar id = Math.floor(Math.random()*100000001);\n\t\t\tlocalStorage.setItem(id, JSON.stringify(json[n]));\n\t\t}\n\t}", "function updateLocalStorage(key,data){\r\n let jsonString = JSON.stringify(data);\r\n localStorage.setItem(key,jsonString);\r\n}", "function storeData(data){\n localStorage.data = JSON.stringify(data);\n }", "function setObject(key, value) {\n window.localStorage.setItem(key, JSON.stringify(value));\n}", "function autoFillData(){\n\t\t//The actual JSON object data required for this to work comes from our json.js file which is loaded from our html page.\n\t\t//Store the JSON object into Local Storage.\n\t\tfor(var n in json){\n\t\t\tvar id = Math.floor(Math.random()*100000001);\n\t\t\tlocalStorage.setItem(id, JSON.stringify(json[n]));\n\t\t}\n\t}", "function setObject(key, value) {\n\twindow.localStorage.setItem(key, JSON.stringify(value));\n}", "function autoFillData(){\n\t\t//The actual JSON OBJECT date required for this to work is coming from our json.js.\n\t\t//Store the JSON OBJECT into our Local Storage.\n\t\tfor(var n in json){\n\t\t\tvar id = Math.floor(Math.random()*100000001);\n\t\t\tlocalStorage.setItem(id, JSON.stringify(json[n]));\t\n\t\t}\n\t}", "function autoFillData(){\n\t\t//The actual JSON OBJECT data required for this to work is coming from our json.js file, which is laoded from our HTML page\n\t\t//Store the JSON OBJECT into Local Storage.\n\t\tfor(var n in json){\n\t\t\tvar id = Math.floor(Math.random()*9999999);\n\t\t\tlocalStorage.setItem(id, JSON.stringify(json[n]));\n\t\t}\n\t\t\n\t}", "function initLocalStorage() {\n\t//\n\tvalue = that.get(key);\n\tif (value == null) {\n\t\tthat.set(key, JSON.stringify([]));\n\t}\n}", "function autoFillData(){\n //The Actual JSON Object data required for this to work is coming from our json.js file which is loaded from additemHTML page\n //Store the JSON data into Local Storage\n for(var n in json){\n var id = Math.floor(Math.random()*10000000001);\n localStorage.setItem(id, JSON.stringify(json[n]));\n }\n }", "function getJsonData() {\n //Store JSON Object into Local Storage.\n for (var n in json) {\n var id = Math.floor(Math.random()*10000001);\n localStorage.setItem(id, JSON.stringify(json[n]));\n }\n }", "function setData(loc, val) {\n if (storage) {\n storage.setItem(loc, JSON.stringify(val));\n }\n }", "function datatoLocalstorage() {\r\n localStorage.setItem('tasksData', JSON.stringify(tasksData));\r\n}", "function setMovieData(movieIndex,moviePrice){\r\n //no need to json.stringify as it is already a string\r\n localStorage.setItem('selectedMovieIndex',movieIndex);\r\n localStorage.setItem('selectedMoviePrice',moviePrice);\r\n}", "set (data, callback) {\n chrome.storage.local.set(data, callback)\n }", "function storeLocal() {\n const jsonUserData = JSON.stringify(userData);\n localStorage.setItem('fullname', jsonUserData);\n}", "function updateStorage()\r\n{\r\n\tlocalStorage.setItem('todos',JSON.stringify(todo));\r\n\tlocalStorage.setItem('completed',JSON.stringify(completed));\r\n}", "function autoFillData() {\n\t\t// Retrieve JSON OBJECT from json.js //\n\t\t// Store the JSON OBJECT to local storage //\n\t\tfor(var n in json) {\n\t\tvar id = Math.floor(Math.random()*10001);\n\t\tlocalStorage.setItem(id, JSON.stringify(json[n]));\n\t\t}\n\t}", "function cache_set(){\n\t\tif (typeof(window.localStorage) !== \"undefined\") {\n\t\t\tfor(key in main_data){\n\t\t\t\tswitch(key){\n\t\t\t\t\t// Keys to not cache\n\t\t\t\t\tcase \"messages_display\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// Keys to cache as json strings\n\t\t\t\t\tcase \"app_tokens\":\n\t\t\t\t\tcase \"auth_user\":\n\t\t\t\t\tcase \"branding\":\n\t\t\t\t\tcase \"dashboard\":\n\t\t\t\t\tcase \"form_data\":\n\t\t\t\t\tcase \"globals\":\n\t\t\t\t\tcase \"header\":\n\t\t\t\t\tcase \"headers\":\n\t\t\t\t\tcase \"login\":\n\t\t\t\t\tcase \"messages\":\n\t\t\t\t\tcase \"messages_action\":\n\t\t\t\t\tcase \"view\":\n\t\t\t\t\tcase \"reports\":\n\t\t\t\t\tcase \"roles\":\n\t\t\t\t\t\twindow.localStorage.setItem('ORJ.'+key, JSON.stringify(main_data[key]));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\twindow.localStorage.setItem('ORJ.'+key, main_data[key]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tlog('info',\"localStorage / cache is not working\");\n\t\t}\n\t}", "function setLocalStorageData(data) {\n localStorage.setItem(\"cartItems\", JSON.stringify(data));\n }", "function setLocalStorage() {\n localStorage.setItem(\"DSNV\", JSON.stringify(dsnv.arr));\n}", "function local_setValue(name, value) { name=\"GMxs_\"+name; if ( ! value && value !=0 ) { localStorage.removeItem(name); return; }\n var str=JSON.stringify(value); localStorage.setItem(name, str );\n }", "function settingFunction() {\n\n let allUsersString = JSON.stringify(allUsers);\n localStorage.setItem('allUsers', allUsersString);\n\n}", "function updateLocalStore() {\n localStorage.setItem(\"TAREAS\", JSON.stringify(list));\n}", "function saveToStorage(){\n console.debug('saving settings', self);\n\n try {\n localStorage.setItem(self.name, JSON.stringify(self.data));\n } catch (e) {\n }\n }", "saveData(){\n localStorage.setItem(\"wish_list\", JSON.stringify(this.asDict()));\n }", "static save(key, value) {\r\n value = JSON.stringify(value);\r\n \r\n localStorage.setItem(key, value);\r\n }", "function updateStorage() {\n localStorage.setItem(\"budgetItems\", JSON.stringify(budgetItems));\n localStorage.setItem(\"lastID\", lastID);\n}", "function updateLocalStorage(){\n localStorage.setItem('inputObjects', JSON.stringify(items));\n}", "function createLocalStorage(){\n\n let convertS= JSON.stringify(Busmall.allBus);\n // console.log(convertS);\n localStorage.setItem('myProducts', convertS);\n\n}", "function setLocaleStorage(name, value){\n localStorage.setItem(name, JSON.stringify(value));\n}", "function storageSet() {\n city = cityNameEl.text()\n cityArray.push(city);\n localStorage.setItem('cityname', JSON.stringify(cityArray));\n}", "function setData(array, name) {\n //console.log(\"array:\" + array);\n var json = JSON.stringify(array);\n localStorage.setItem(name, json);\n}", "set(id, object){\n localStorage.setItem(`${this.state.context}-${id}`, JSON.stringify(object));\n }", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "function valueToLStorage(pobj){ //pobj debe ser un elemento o id de elemento válido\n\tif (typeof(Storage)!== 'undefined'){\n\t\tvar aux=selectObjId(pobj);\n\t\tif ((aux!==null) && (aux.value!==undefined)){\n\t\t\tlocalStorage.setItem(aux.id, aux.value);\n\t\t}\n\t\telse {\n\t\t\tconsole.log('ERROR: Objeto o propiedad value inexistente');\n\t\t}\n\t}\telse {\n\t\talert('Su navegador no soporta HTML5 API Storage');}\n}", "function store(obj) {\n var json = JSON.stringify(obj);\n return localStorage.setItem(storageKey, json);\n }", "function saveListStorage(list){\n var jsonStr = JSON.stringify(list);//usando json para transfoma texto em uma string\n localStorage.setItem(\"list\",jsonStr);\n}", "function updateLocalStorage(){\nlocalStorage.setItem(\"todoList\", JSON.stringify(data));\n}", "function defaultFillData(){\n for ( var n in json){\n var id = Math.floor(Math.random()*100000000);\n localStorage.setItem(id, JSON.stringify(json[n]));\n }\n \n \n }", "static setItem(value) {\n let item = JSON.stringify(value);\n localStorage.setItem(CartManager.key, item);\n }", "function saveEmployee() {\n //convert array of entries into json strings\n var jsonEmployee = JSON.stringify(gEmployee);\n //setting the key and value\n localStorage.setItem(\"Employee\", jsonEmployee);\n}", "function autoFillData(){\n\t\tfor(var n in json){\n\t\t\tvar id = Math.floor(Math.random()*100000001); // math that randomly picks a number to attach to the string\n\t\t\tlocalStorage.setItem(id, JSON.stringify(json[n]));\n\t\t};\n\t}", "function saveLocal() {\r\n let aJson = JSON.stringify(Productos)\r\n localStorage.setItem(\"productos\", aJson)\r\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 ", "function saveData() {\n if (localStorage != null && JSON != null) {\n localStorage[\"size\"] = JSON.stringify(size);\n localStorage[\"cartData\"] = JSON.stringify(cartData);\n }\n }", "function setDataFromLocalStorage() { \t\n \tCORE.LOG.addInfo(\"PROFILE_PAGE:setDataFromLocalStorage\");\n \t$(\"#name\").val(gameData.data.player.profile.name);\n \t$(\"#surname\").val(gameData.data.player.profile.surname);\n \t$(\"#age\").val(gameData.data.player.profile.age);\n \t$(\"#sex\").val(gameData.data.player.profile.sex);\n \t$(\"#mobile\").val(gameData.data.player.profile.mobile); \n \t \t \t\n }", "function storeLocal(key, data) {\n window.localStorage.setItem(key, JSON.stringify(data));\n }", "function setToStorage(key, value) {\n localStorage.setItem(key, JSON.stringify(value));\n}", "_setInitialSettings() {\n let settings = [\n {\n id: 'adrenaline_timer',\n title: 'Minuteur d\\'adrénaline',\n value: '3'\n },\n {\n id: 'adrenaline_unit',\n title: 'Quantité d\\'adrénaline injectée',\n value: '1'\n },\n {\n id: 'adrenaline_repeat',\n title: 'Répéter l\\'alerte d\\'adrénaline',\n value: '2'\n }\n ]\n AsyncStorage.setItem(\"settings\",JSON.stringify(settings))\n }", "function updateLocalStorage() {\n // Updates local storage with the key name of 'transactions,' and key value of transactions array as JSON object.\n // ! storage.setItem(keyName, keyValue) adds/updates key for given storage object.\n // ! JSON.stringify() converts JavaScript value to JSON object.\n localStorage.setItem('transactions', JSON.stringify(transactions))\n}", "function setLocalStorageItems(id) {\n\t\tvar storages = JSON.parse(localStorage.getItem(\"storages\") || \"[]\");\n\t\tstorages.push({ id });\n\t\tlocalStorage.setItem(\"storages\", JSON.stringify(storages));\n\t}", "function autoFillData(){\n\t\t\n\t\tfor(var n in json){\n\t\t\tvar id = Math.floor(Math.random()*100000001);\n\t\t\tlocalStorage.setItem(id, JSON.stringify(json[n]));\n\t\t}\n\t\n\t}", "function init(jsonObj) {\n localStorage.setItem(\"client_id\", jsonObj.client_id);\n localStorage.setItem(\"type\", jsonObj.type);\n localStorage.setItem(\"callback_function\", jsonObj.callback_function);\n}", "function getLocalStorge() {\n\n // khi lấy localStorage lên để sử dụng chuyển thành JSON\n if (localStorage.getItem(\"DanhSachNhanVien\")) {\n danhSachNhanVien.mangNhanVien = JSON.parse(localStorage.getItem(\"DanhSachNhanVien\"));\n taoBang();\n }\n}", "function setScores(){\n var view ={\n score: secondsRemaining,\n initials: highscoreInput.value,\n }\n localStorage.setItem('individual', JSON.stringify(view))\n\n}", "function setLocalStorage(key, value) {\n localStorage.setItem(key, JSON.stringify(value));\n}", "function setPersistenceData(key, value, nameSpace, scope){\n var storage = jQuery.localStorage;\n\tif(storage && key != null && key != 'undefined' && key != '' && value != null && value != 'undefined' && value != '')\n\t{\n\t\tif(nameSpace != null && nameSpace != 'undefined' && nameSpace != '')\n\t\t{\n\t\t} \n\t\telse {\n\t\t\tnameSpace = 'Global';\n\t\t}\n\t\tif(scope != null && scope != 'undefined' && scope != '')\n\t\t{\n\t\t}else {\n\t\t\tscope = 'local'; // possible values 'local', 'session' and 'none'\n\t\t}\n\t\t\n\t\tvar JsonObj = {\n\t\t\t\t\"value\" : value,\t\t\t\t\n\t\t\t\t\"scope\" : scope\n\t\t};\n\t\t\n\t\tstorage.set(nameSpace, key, JsonObj);\n\t}\n\t\n}", "function storage() {\n let string = JSON.stringify(Product.allProduct);\n localStorage.setItem('product', string)\n\n}", "saveToStorage() {\r\n localStorage.setItem('accountList', JSON.stringify(this._accountList));\r\n localStorage.setItem('settings', JSON.stringify(this._settings));\r\n localStorage.setItem('lastAssignedID', JSON.stringify(this._lastAssignedID));\r\n }", "saveToLocal() {\n let alarmsJson = JSON.stringify(this.alarms);\n localStorage.setItem(\"alarmTime\", alarmsJson);\n let currentId = String(this.currentId);\n localStorage.setItem(\"currentId\", currentId);\n }", "function storageData(name, data) {\n \n localStorage.setItem(name, JSON.stringify(data));\n \n}", "function setLocalStorage(items, callback) {\r\n for (var key in items) {\r\n if (items.hasOwnProperty(key)) {\r\n localStorage.setItem(key, JSON.stringify(items[key]));\r\n }\r\n }\r\n if (callback) {\r\n callback();\r\n }\r\n }", "function parseLocalStorage(){\n var previousGoatsArr =JSON.parse(localStorage.getItem('goats'))\n console.log(previousGoatsArr);\n // this funtcion will update the newly created objects with the old literation values\n update(previousGoatsArr);\n\n}", "function autoFillData() {\n for (var n in json) {\n var id = Math.floor(Math.random() * 100000001);\n localStorage.setItem(id, JSON.stringify(json[n]));\n }\n }", "function autoFillData(){\n \tfor (var n in json){\n \t\tvar id = Math.floor(Math.random() * 100000001);\n \t\t\tlocalStorage.setItem(id, JSON.stringify(json[n]));\n \t}\n }", "function SaveJsonLocal(){\n var recordname = document.getElementById(\"jsonRecordName\").value;\n var myjson = JSON.stringify(marks);\n localStorage.setItem(recordname, myjson);\n invalidate();\n ListLocalStorage();\n}", "function setLocalStorage() {\n var userDetails = JSON.parse(localStorage.getItem(\"userDetails\"));\n var reportFault = new Object();\n reportFault.user = userDetails.userID;\n reportFault.carriage = $('#carNum').val();\n localStorage.setItem('reportFault', JSON.stringify(reportFault));\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 saveListStorage(list) {\n var jsonStr = JSON.stringify(list);\n localStorage.setItem(\"list\", jsonStr);\n}", "function setLocalStorage(fieldName, value) {\n\twindow.localStorage.setItem(fieldName, JSON.stringify(value));\t\n}", "function updateLocalStorage(){\n localStorageService.set(listKey, this.acListP);\n }", "setStorage (name, content) {\n if (!name) return\n if (typeof content !== 'string') {\n content = JSON.stringify(content)\n }\n window.localStorage.setItem(name, content)\n }", "saveToStorage() {\n try {\n localStorage.setItem(this.name, JSON.stringify(this.storage));\n } catch(e) {\n\n }\n }", "function setItemsToLS(prefix, data) {\n $.each(data, function (key, val) {\n console.log('try to saving ' + prefix + ' to LS:');\n if (val) {\n localStorage.setItem(prefix + val.id, JSON.stringify(val));\n } else {\n console.log('ERROR setItemstoLS: val is null');\n }\n });\n}", "function setLocalStorage(key, value) {\n\n switch(key){\n case \"repository\":\n localStorage.repository = value;\n break;\n case \"branch\":\n localStorage.branch = value;\n break;\n case \"functional_area\":\n localStorage.functional_area = value;\n break;\n case \"impacted_area\":\n localStorage.impacted_area = value;\n break;\n case \"weblink\":\n localStorage.weblink = value;\n break;\n case \"start_date\":\n localStorage.start_date = value;\n break;\n case \"end_date\":\n localStorage.end_date = value;\n break;\n }\n\n}" ]
[ "0.7622409", "0.74646574", "0.7352124", "0.729354", "0.7283864", "0.72609043", "0.716526", "0.70970756", "0.7091086", "0.7067295", "0.7057939", "0.7045395", "0.69681346", "0.6931148", "0.6924947", "0.69090265", "0.68853825", "0.68849415", "0.6863318", "0.68631524", "0.6856915", "0.6841618", "0.6840943", "0.6838184", "0.6815901", "0.6814305", "0.6807696", "0.68028134", "0.6799579", "0.67909837", "0.67905766", "0.6787384", "0.67824405", "0.67786825", "0.6773243", "0.67530686", "0.6745446", "0.6727651", "0.6718487", "0.6713237", "0.6711009", "0.67076796", "0.6692145", "0.667875", "0.6670823", "0.6668974", "0.6664414", "0.66643727", "0.66477185", "0.6644504", "0.6640259", "0.6625127", "0.66227543", "0.66210985", "0.6619571", "0.66103107", "0.6603537", "0.6599773", "0.6597763", "0.65949595", "0.65914154", "0.65896845", "0.65752953", "0.65720224", "0.65703887", "0.65697616", "0.65692395", "0.656492", "0.6559327", "0.6556306", "0.6556065", "0.65527225", "0.6543654", "0.65429145", "0.6524874", "0.6523851", "0.6522771", "0.65117246", "0.6510626", "0.65084445", "0.65037465", "0.65035605", "0.6502435", "0.6502013", "0.64984953", "0.64872664", "0.6481423", "0.64812344", "0.6475902", "0.64744955", "0.64707863", "0.6467674", "0.6464572", "0.6459946", "0.64566326", "0.645105", "0.645069", "0.6447803", "0.6444054", "0.64347595" ]
0.7021132
12
Toggle populating of data autofilling on the tab the user is on
function doPaxClickEvt(jsonID, id, value) { chrome.tabs.getSelected(null, function (tab){ if(id.length){ chrome.tabs.sendRequest(tab.id, {data: getValue(JSON.parse(localStorage[jsonID]), id)}); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static expandData () {\n $('tbody#bindOutput tr:visible a.json-toggle.collapsed').click();\n }", "function toggleData() {\n $log.debug('toggleData');\n $scope.forecastData = $scope.forecastData ? false : true;\n $scope.locationInfo = $scope.locationInfo ? false : true;\n }", "function activateAndResetFields(){\n initData();\n document.getElementById('logger-type').disabled=false;\n document.getElementById('country').disabled=false;\n document.getElementById('state').disabled=false;\n document.getElementById('site').disabled=false;\n document.getElementById('wave').disabled=false;\n document.getElementById('zone').disabled=false;\n document.getElementById('sub-zone').disabled=false;\n \n if($(\"#graphs\").css(\"display\") == \"inline\") {\n $(\"#graphs\").css(\"display\", \"none\");\n $(\"#data\").css(\"display\", \"inline\");\n $('.onoffswitch-inner:before').hide();\n $('.onoffswitch-inner:after').show();\n }\n\n}", "function autoEditAppear() {\n flickAppear('reveal',0);\n flickAppear('reveal',5);\n flickAppear('reveal',1);\n disableButton('myonoffswitch',false);\n disableDiv('onOffSwitchContainer','auto');\n visibleAutoEdit = true;\n}", "function toggle(){\n if (active_tab){\n if (active_tab.active) \n active_tab.hide();\n else\n active_tab.show();\n } \n }", "function toggleAutocomplete() {\n autocompleteFlag = false;\n userSelectedLocation = null;\n}", "changeMode() {\n this.attendBooths = !this.attendBooths;\n }", "function toggleRepopulation(){\n\trepopulating = !repopulating;\n}", "static collapseData () {\n $('tbody#bindOutput tr:visible a.json-toggle').not('.collapsed').click();\n }", "function changeData(tab) {\n\ttab1 = document.getElementById('ContactInfo');\n\ttab2 = document.getElementById('About');\n\ttab3 = document.getElementById('People');\n\n\tif(tab == 1) {\n\t\ttab2.style.display = \"none\";\n\t\ttab3.style.display = \"none\";\n\t\ttab1.style.display = \"block\";\n\t} else if(tab == 2) {\n\t\ttab1.style.display = \"none\";\n\t\ttab3.style.display = \"none\";\n\t\ttab2.style.display = \"block\";\n\t} else {\n\t\ttab2.style.display = \"none\";\n\t\ttab1.style.display = \"none\";\n\t\ttab3.style.display = \"block\";\n\t}\n}", "function semTab() {\r\n\tchecatab = false;\r\n}", "triggerRedraw() {\n \tlet jtabid = this.idFor('jtab');\n\t$(jtabid).empty();\n\tthis.jsonToTopTable(this, $(jtabid));\n}", "function onClick() {\n setShowData(false);\n }", "function expandedCollapsed(tab, acao) {\n Xrm.Page.ui.tabs.get(tab).setDisplayState(acao);\n}", "@action updateDataToShow(value) {\n this.dataToShow = value;\n this.selectedData = this.data[0].details;\n this.activeDetailTab = this.data[0].label;\n }", "changeTab(data) {\n model.samPresent({do:'changeTab', ...data});\n }", "function toggleTab(i, label) {\n if(chart.data.datasets[i].hidden === false) {\n chart.data.datasets[i].hidden = true; \n label.classList.remove('option-active');\n } else if(chart.data.datasets[i].hidden === true) {\n chart.data.datasets[i].hidden = false;\n label.classList.add('option-active');\n } \n chart.update();\n}", "switchCaseloadTrend() {\n // console.log(\"222\");\n this.isShowCaseStatus = false;\n if (this.isShowCaseloadTrend == false) {\n this.isShowCaseloadTrend = true;\n } else {\n this.isShowCaseloadTrend = false;\n }\n }", "function goToAccRec() {\n $('#peInvoiceInformation').show();\n $('#invoiceInformation').hide();\n $('#financialSection').show();\n updatePricingInfo();\n fillPeInvsTable(DATA);\n}", "function clickNewModel()\n{\n//\ttab1.isNew = true;\n\ttab1.modelId = null;\n\ttab2.enabled = true;\n\ttab3.enabled = false;\n\ttab4.enabled = false;\n\ttab5.enabled = false;\n\ttab6.enabled = false;\n tab7.enabled = false;\n tab8.enabled = false;\n changeStartTime();\n\tresetCheckedId();\n\tonTabClick(\"btn2\");\n}", "function enterPlanMode(){\n vm.permission.planMode = true;\n vm.permission.endHint = false;\n angular.copy(vm.model.data,vm.plan.current);\n\n for(var i = 0;i < vm.plan.current.length;i++)\n {\n vm.plan.current[i].id = i;\n vm.plan.current[i].isSelected = false;\n }\n\n angular.element('.plan-overlay').css('visibility','visible');\n\n }", "function refreshManageDataUI() {\n // show the manage person UI and hide the other UIs\n document.getElementById(\"Person-M\").style.display = \"block\";\n document.getElementById(\"Person-R\").style.display = \"none\";\n document.getElementById(\"Person-C\").style.display = \"none\";\n document.getElementById(\"Person-U\").style.display = \"none\";\n document.getElementById(\"Person-D\").style.display = \"none\";\n}", "function toggleProfileData() {\n toggleElement('profileInfo');\n}", "_selectedTabModifield() {\n if (this.selectedTab === 0) {\n this.$.shipping.removeAttribute(\"hidden\");\n this.$.review.setAttribute(\"hidden\", true);\n }\n if (this.selectedTab === 1) {\n this.$.shipping.setAttribute(\"hidden\", true);\n this.$.review.removeAttribute(\"hidden\");\n }\n }", "enableTab() {\n this.setTabIndex(\"0\");\n this.rating.enableTab();\n }", "function showListInMode(showingMode){\n\n \n let currentMode = localStorage.getItem(\"currentMode\");\n let dataList = JSON.parse(localStorage.getItem(\"allData\"));\n\n\n // if(currentMode == showingMode)\n // \treturn ;\n // else\n \tlocalStorage.setItem(\"currentMode\" , showingMode);\n\n\n\n for(let i = 0;i < dataList.length ; ++i){\n\n\n \t if(dataList[i].status == showingMode || showingMode == \"all\"){\n \t \t document.getElementById(dataList[i].task).style.display = 'block' ;\n \t }\n \t else\n document.getElementById(dataList[i].task).style.display = 'none' ;\n\n }\n\n }", "function handleDataForm(){\n\tvar data_table = tabsFrame.datagrpRestriction;\n\tif ((data_table != '') && data_table != undefined) {\n\t\tvar tgrpPanel = 'tgrp' + tgrp_position + 'Panel';\t\n\t\tvar grid = Ab.view.View.getControl('', tgrpPanel);\n\t\tvar action = grid.actions.get('goNext' + tgrp_position);\n\t\taction.enable(true);\t\t\t\t\n\t\thideButtons(grid); \t\n\t}\n}", "open() {\n if (!this.disabled) {\n this.expanded = true;\n }\n }", "function recall() {\n tabs.open({\n \"url\" : self.data.url(\"dashboard.html\"),\n });\n}", "function pulldownRefresh() {\n // 下拉刷新具体业务实现\n console.log('pulldownRefresh')\n page = 1\n $('#memberList').html('')\n orguserList()\n }", "function toggleFill() {\n\t\tfill = !fill;\n\t\tsetUpToDate(false);\n\t}", "toggleViewAllEmployeeTable(){\n\n if(this.viewAllEmployeeTable == false){\n this.viewAllEmployeeTable =true;\n }else {\n this.viewAllEmployeeTable = false;\n }\n\n }", "function simDataSwitch() {\n document.getElementById(\"cbUpdateDataProvider\").disabled = false;\n document.getElementById(\"cbFilterRows\").disabled = false;\n document.getElementById(\"cbSortRows\").disabled = false;\n document.getElementById(\"btnFetch\").disabled = false;\n document.getElementById(\"btnFetch\").innerHTML = \"Start Fetching data\";\n idx = 0;\n grid.setDataProvider(generateData(500));\n}", "function SoalOnReload(){\n $('.soal > .data').hide();\n $('#Soal_1').show();\n $('#daftar1').addClass(' in-active');\n $('#nomor_soal').val('1');\n}", "function fromDb() {\n $(\"#in_csv_tab\").hide();\n $(\"#in_db_tab\").show();\n $(\"#query_db\").show();\n}", "function exploratoryMode() {\n $(\"#start-to-end-fields\").empty();\n}", "function toggleAuto(event) {\n if(autoSwitch.checked) {\n home.enableAutoOff();\n autoTemp.style.display = \"block\";\n }\n else {\n home.disableAutoOff();\n autoTemp.style.display = \"none\"; \n }\n}", "function frmAutoDispatch_Load(){\n \n if($('input[name=\"State1\"]:checked').val() == \"new-release\"){\n $scope.intOption = 0;\n // $(\"#dispatchALL\").show();\n document.getElementById(\"dispatchALL\").setAttribute(\"style\", \"visibility:visible\");\n } else{\n $scope.intOption = 1;\n // $(\"#dispatchALL\").hide();\n document.getElementById(\"dispatchALL\").setAttribute(\"style\", \"visibility:hidden\");\n }\n\n\n GenerateWOList();\n }", "toggleGp1(tab) {\n if (this.state.activeTabGp1 !== tab) {\n this.setState({\n activeTabGp1: tab,\n activeTabGp2: '1',\n activeTabGp3: '1',\n activeTabGp4: '1',\n activeTabGp5: '1',\n activeTabGp6: '1',\n activeTabGp7: '1'\n })\n }\n }", "async function tab(tab) {\n setLoading(true);\n setActiveTab(tab);\n setSecondTab(\"results\");\n setActiveTest(\"\");\n setPatientSelected(null);\n if (tab == \"new\") {\n setPatient(null);\n var result = await client.postApi(`${endpoints.user.getPatients}`, null, true);\n if (result.statusCode === 200) {\n setPatient(result.response);\n setLoading(false);\n } else {\n setLoading(false);\n }\n } else {\n setLoading(false);\n }\n }", "function expandTabsToFill() {\n if (tabArray.length == 0) {\n return;\n }\n $(\".tab\").css(\"width\", \"\");\n var visibleTabWidths = [];\n var availableWidth = $(window).innerWidth() - ($(\".tabScrollButton\").outerWidth(true) * 2);\n for (i = firstVisibleTabIndex; i <= lastVisibleTabIndex; i++) {\n availableWidth -= (tabArray[i].outerWidth(true) - tabArray[i].width());\n visibleTabWidths.push(tabArray[i].width());\n }\n visibleTabWidths = growValuesToMatch(visibleTabWidths, availableWidth);\n for (i = firstVisibleTabIndex; i <= lastVisibleTabIndex; i++) {\n tabArray[i].css(\"width\", visibleTabWidths.shift());\n }\n }", "function initTabs() {\n $('label').click(function (e) {\n e.preventDefault();\n var forEl = $(this).attr('for');\n $('#' + forEl).trigger('click');\n $('.example__content[data-tab=' + forEl + ']').addClass('is-active').siblings().removeClass('is-active');\n });\n }", "function userModeOn(data) {\r\n\tuserMode = true;\r\n\t$(data).css(\"border\", \"solid 2px rgb(66, 244, 244)\");\r\n\t$(\"#mode>button:nth-child(2)\").css(\"border\", \"2px solid black\");\r\n\t$('#container-for-developer').hide();\r\n}", "function toggleTabs() {\n tab.forEach(function (x) {\n x.classList.toggle('tab-selected');\n });\n table.forEach(function (y) {\n y.classList.toggle('hidden');\n });\n populateFooter();\n}", "function showProfile() {\r\n\r\n //$(\"#collapseOne\").attr('aria-expanded', \"false\");\r\n\r\n $(\"#collapseOne\").addClass('collapse show');\r\n\r\n $(\"matchesById\").addClass('d-none');\r\n $(\"#resultHead\").html(``);\r\n $(\"#resultBody\").html(``);\r\n\r\n $(\"#searchWindow\").addClass('d-none');\r\n $(\"#tableWindow\").removeClass('d-none');\r\n $(\"#collapseOne\").addClass('d-none');\r\n // $('.collapseOne').collapse();\r\n $(\"#donateDiv\").addClass('d-none');\r\n\r\n\r\n\r\n\r\n}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "function refreshTabIfOpen() {\n if (pluginSettingsAreOpen(app)) app.setting.openTabById(app.setting.activeTab.id);\n }", "function fhArrival_viewMode() {\n\n\tjQuery('.fhArrival_editMode').hide();\n\tjQuery('.fhArrival_viewMode').show();\n\tif (fhArrival_data.arrival.arrival_archived == 1) {\n\t jQuery('#fhArrival_labelArchived').show();\n\t jQuery('#fhArrival_btnArchivedToggle').html('Annulla archiviazione');\n\t} else {\n\t\tjQuery('#fhArrival_labelArchived').hide();\n\t\tjQuery('#fhArrival_btnArchivedToggle').html('Archivia lista di carico');\n\t}\n\t\n\tfhArrival_data.currentMode = \"VIEW\";\n\t\n}", "function ramplirtabAut(){\n clairtxtBoxAut();\n $('#tableAut').bootstrapTable('refresh');\n} // end ramplir", "function changeDepSelect() {\n displayHouseBtn();\n displayDepDrp();\n removedtRows(); //Remove Exisiting DataTable Rows\n depEmpDt(); //Display House Wise Employees DataTable\n populateDepInfo();\n}", "retabinate_() {\n if (!this.inert_) {\n return;\n }\n\n const elements = this.adapter_.getFocusableElements();\n if (elements) {\n for (let i = 0; i < elements.length; i++) {\n this.adapter_.restoreElementTabState(elements[i]);\n }\n }\n\n this.inert_ = false;\n }", "retabinate_() {\n if (!this.inert_) {\n return;\n }\n\n const elements = this.adapter_.getFocusableElements();\n if (elements) {\n for (let i = 0; i < elements.length; i++) {\n this.adapter_.restoreElementTabState(elements[i]);\n }\n }\n\n this.inert_ = false;\n }", "function tab() {\n let triggerTabList = [].slice.call(document.querySelectorAll('#nav-myProfile-tab, #nav-conundrum-tab'))\n triggerTabList.forEach(function (triggerEl) {\n var tabTrigger = new bootstrap.Tab(triggerEl)\n triggerEl.addEventListener('click', function (event) {\n event.preventDefault()\n tabTrigger.show()\n })\n })\n}", "function clickParams()\n{\n\tvar model_id = getModelId();\n //changeStartTime();\n\n\tif ((model_id == null) || (model_id < 0))\n\t\treturn;\n\tif ((tab1.modelId == null) || (tab1.modelId != model_id)) {\n\t tab1.modelId = model_id;\n\t tab1.enabled = false;\n\t tab2.enabled = false;\n\t\t tab3.enabled = true;\n\t tab4.enabled = false;\n\t tab5.enabled = false;\n\t tab6.enabled = false;\n tab7.enabled = false;\n tab8.enabled = false;\n\t\t\n\t\tonTabClick(\"btn3\");\n\n\t\tshowModelName();\n\t\tclearModelParams();\n\t\tloadModelParams('false');\n\t} else {\n\t\ttab2.enabled = false;\n\t\ttab3.enabled = true;\n\t\tonTabClick(\"btn3\");\n\t}\n}", "function reflowDashboard() {\n loadDashboard(true);\n adjustHeight();\n }", "function toggleHistoryTable() {\n // Get previous state which was saved on the wrapper\n var showOrHide = $('#wrapper').attr('data-history-toggle');\n $('#historydata').collapse(showOrHide);\n }", "function toggleCompleted() {\n let element = document.getElementById('Completed-body');\n if (getLocal(currentMode, \"CompletedVisible\") == \"true\") {\n setLocal(currentMode, \"CompletedVisible\", \"false\");\n element.style.display = \"none\";\n } else {\n setLocal(currentMode, \"CompletedVisible\", \"true\");\n element.style.display = \"block\";\n }\n}", "function facilitesToggle(element, show) {\r\n\r\n var tabContainer = $(element).closest('.functional-toggle-tabs');\r\n var tabSelectorAll = '.' + tabContainer.data('tabs');\r\n if (show) {\r\n $(tabSelectorAll).find('#facilitySubPanel').removeClass('visually-hidden');\r\n $(tabSelectorAll).find('#generalInfoSubPanel').addClass('visually-hidden');\r\n }\r\n else {\r\n $(tabSelectorAll).find('#facilitySubPanel').addClass('visually-hidden');\r\n $(tabSelectorAll).find('#generalInfoSubPanel').removeClass('visually-hidden');\r\n }\r\n}", "function toggleFieldsDisplay(display){\n timeCount.hidden = display;\n relToCount.hidden = display;\n sameOptions.hidden = !display;\n}", "switchAUTO() {\n this.setState({\n AUTOPressed: true,\n MANPressed: false,\n bgAUTO: '#186afa',\n bgMAN: '#b3b3b3',\n arrowUPURL: this.iconImages.arrowUP,\n arrowDOWNURL: this.iconImages.arrowDOWN,\n });\n\n var itemsRef = firebase.database().ref();\n var dbRef = itemsRef.child('Thermostats').child('' + idThermostat).child('UserOptions');\n dbRef.child('automan').set(\n true\n );\n }", "toggle() {\n if (!this.disabled) {\n this.expanded = !this.expanded;\n }\n }", "function handleDataToggling () {\n\t\tvar len,\n\t\t\ti,\n\t\t\tj,\n\t\t\tnumOfPages,\n\t\t\tendIndex,\n\t\t\titem;\n\n\t\t// If the key for data display is changed then just update the anchor blocks \n\t\t// which by default happens in descending order.\n\t\tif (prevStorageKey !== storageKey) {\n\t\t\tupdateGrid(0, scrollElm.length);\n\t\t}\n\t\t// The flow enters this block when the order of the same key against which the\n\t\t// elemnts are displayed is changed.\n\t\telse {\n\t\t\tlen = scrollElm.length;\n\t\t\tnumOfPages = Math.floor(len / maxResult);\n\n\t\t\tendIndex = lastDrawIndex + (maxResult - lastDrawIndex % maxResult);\n\t\t\t// Drawing all the scroll element of the current page\n\t\t\tupdateGrid(lastDrawIndex, endIndex);\n\n\t\t\tfunction helperFN (i, j) {\n\t\t\t\tindex = maxResult * j + i;\n\t\t\t\titem = scrollElm[index];\n\t\t\t\titem && item.appendTo('#scroller');\n\t\t\t}\n\n\t\t\tfor (j = 0; j <= numOfPages; j++) {\n\t\t\t\tif (order === 'ascending') {\n\t\t\t\t\tfor (i = maxResult - 1; i >= 0; i--) {\n\t\t\t\t\t\thelperFN(i, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfor (i = 0; i < maxResult; i++) {\n\t\t\t\t\t\thelperFN(i, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprevStorageKey = storageKey;\n\t}", "function enableDrilldown(id, value){\n var cb = $(id);\n var view = tabsFrame.newView;\n \n if (cb.checked) {\n view.enableChartDrilldown = true;\n }\n else {\n view.enableChartDrilldown = false;\n }\n \n tabsFrame.view = view;\n}", "function pageReset() {\n $('.tab-content').removeClass('expanded');\n $('.student-details').addClass('expanded');\n profileStates.showDetails = true;\n profileStates.editProfile = false;\n profileStates.editEmail = false;\n profileStates.additionalInfo = false;\n profileStates.changePassword = false;\n}", "function refreshCurrentTab() {\r\n chartAnimationReady = true;\r\n showTab(currentPage, true);\r\n}", "function showManagementTab() {\n\tvar doc = document.getElementById('nickname_manage');\n\tvar doc2 = document.getElementById('user_recipes');\n\tif ($(doc2).is(':visible')) {\n doc2.style.display = 'none';\n }\n if ($(doc).is(':visible')) {\n doc.style.display = 'none';\n }\n else {\n doc.style.display = 'block';\n }\n}", "function toggleDisplay(id) {\n // store preference so it persists\n localStorage.setItem('records-layout', id);\n\n // Get the button and ensure it's active\n var button = $('#' + id);\n button.toggleClass('ui-btn-active', true);\n\n // Remove active class from any other buttons\n $.each(button.siblings('a'), function (key, value) {\n $(value).toggleClass('ui-btn-active', false);\n });\n\n var isGrid = id === 'records-grid';\n $('#saved-records-page .ui-listview li').toggleClass('active', isGrid);\n $('.record-extra').toggle(isGrid);\n }", "open() {\n this.expanded = true;\n }", "function enablePatientClaimFields() {\n\n var modalClass = $('.phoneDiv');\n modalClass.removeClass('numberModalDiv');\n\n var modalClass = $('.EmailDiv');\n modalClass.removeClass('importEmailToModal'); \n\n $(\".claimDropDListBeforeEditDisabled\").closest(\".ui-widget\").find(\"input, button\").prop(\"disabled\", false);\n $(\".claimSelect_tab .custom-combobox-input\").autocomplete(\"option\", { disabled: false });\n $(\"#webPageOnNextTab\").attr(\"disabled\", false);\n $('.patientClaimInfoTxtField').attr('disabled', false);\n $('#webPageOnNextTab').attr('onClick', 'openUrlOnTab()');\n $(\".sidenav-trigger\").attr(\"disabled\", false);\n $('#btnPatientClaimInfo').attr(\"disabled\", false);\n}", "function allClick() {\n if (core || career || chosen) { // If any other tab is currently open, set them to false and show all courses\n setAll(true);\n setCore(false);\n setCareer(false);\n setChosen(false);\n }\n }", "function autopop() {\n $(\"#autopop-modal\").modal('show');\n}", "function beginTask() {\n if (environment.isOwnTask()) {\n shared.skipTask();\n return;\n }\n refreshTabs();\n util.attention(ref.addDataButton0, 0, 'focus');\n util.attention(ref.editButton0, 0, 'focus');\n util.attention(ref.creative, 0, 'scrollIntoView');\n }", "function loadAccordionState() {\n if (localStorage['sunjer_enabledAccordions'])\n elements.enabledAccordions = localStorage['sunjer_enabledAccordions'].split(',');\n}", "function ConfigureTabs() {\n\n // hide/show pricing tab\n var priceTab = $find(tabStripId).findTabByValue(\"pricing\");\n var accountsTab = $find(tabStripId).findTabByValue(\"accounting\");\n if (GetRegTypeValue() == \"Fee\") {\n priceTab.set_enabled(true);\n accountsTab.set_enabled(true);\n } else {\n priceTab.set_enabled(false);\n accountsTab.set_enabled(false);\n }\n }", "function switchToggle() {\n\t\t\t\t\t$scope.isToggleOn = !$scope.isToggleOn;\n\t\t\t\t}", "function pageTabs_helm_set(mode) {\n\n var defaultTab = \"\";\n\n if (mode === \"loanDetails\") {\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", true);\n defaultTab = \"LoanDetailsTab_helm\";\n } else if (mode === \"search\") {\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", true);\n defaultTab = \"AdvancedSearchTab_helm\";\n }\n else if (mode === \"recentlyViewedMinimized\") {\n //only show recently viewed tab and disable the tab selected appearance and give it a neutral look.\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false).toggleClass(\"ui-state-active\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", true);\n }\n helm.ActiveTabId = defaultTab; //store the active tab in js property that will be accessible to other functions\n\n var $helmTabs = $(\"#Tabs_helm\");\n $helmTabs.tabs({\n // //active: Compass.Utils.jQueryTabs_GetTabIndex(defaultTab, \"Tabs_helm\"), //Activate Loan Details Tab\n // //beforeActivate: optimizeIE7Rendering,\n activate: jQueryTabs_TabSelect\n });\n\n //set active jquery page tab to helm default tab.\n var activeTabIndex = Compass.Utils.jQueryTabs_GetTabIndex(defaultTab, \"Tabs_helm\");\n $helmTabs.tabs({ active: activeTabIndex });\n $(\"#Tabs_HtmlList_helm\").toggleClass(\"displayNone\", false);\n \n // All Tab Content Area Div's had to be hidden initially otherwise\n // the screen would jumble around during rendering until the jquery \n // page tabs could be intialized. Unhide the tab content with this next line of code.\n $(\".jqPageTabsContent_helm\").toggleClass(\"displayNone\", false);\n }", "function changeTab (tab) {\n $scope.tabName = tab.name;\n tab.active = true;\n if (tab.name === 'filter') {\n getFilter();\n }\n // Hide delete tab if user move from it and selected rows are more than one\n if (tab.name !== 'delete' && appInfo.rowsData.length > 1) {\n $rootScope.$emit('resetRows', appInfo.table.tablename);\n }\n if (tab.name === 'delete') {\n loadDeleteTemplate();\n $rootScope.$emit('enableMultiselect', true, appInfo.table.tablename);\n } else {\n $rootScope.$emit('enableMultiselect', false, appInfo.table.tablename);\n }\n }", "function opentab(tab){\n let tabcontent = $(\".tabcontents\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n $(\"#\"+tab+\"tab\").css(\"display\", \"block\");\n if(tab!=\"options\"){\n $(\"#exportfailsave\").css(\"display\", \"none\")\n }\n}", "function val_flag() {\n if (flag) {\n pag_active = 0;\n Json_ped = {DATA : []};\n Json_ped_pos = {DATA : []};\n Json_sol_ped = {DATA : []};\n Json_sol_ped_pos = {DATA : []};\n Json_sol_ped_pos_lib = {DATA : []}; \n array_pag = new Array();\n $('#sol_ped').empty();\n $('#ped').empty();\n $('#update').empty();\n $('#ped_wrapper').toggle(false);\n $('#sol_ped_wrapper').toggle(false);\n }\n}", "function listUsersButton() {\n listUsers();\n $listUsers.toggle();\n }", "function dashboardSortbyStatus(change,from){\n if(change != 'All'){\n changeSortbyStatus(change,from);\n }\n $(\"#ordtab\").trigger('click');\n}", "tabSet() {\n this._bufferService.buffer.tabs[this._bufferService.buffer.x] = true;\n return true;\n }", "function ToggleEdit(){\n\t\n}", "function activaTab(tab){\n $('.nav-tabs-chart-selector a[href=\"#' + tab + '\"]').tab('show');\n }", "function openAdvanced() {\n\t\tvar fieldId = this.getAttribute( 'data-fid' );\n\t\tautoExpandSettings( document.getElementById( 'field_options_field_key_' + fieldId ) );\n\t}", "function toggle(info, ui) {\n if (info.expanded) {\n let innerForm = document.getElementById(info.innerForm)\n innerForm.style.display = 'none';\n document.getElementById(info.otherToggle).style.display = 'inline';\n info.expanded = false;\n ui.specifyOverallConfigInstructions();\n return;\n }\n\n if (!localStorage.getItem(info.localStorageKey)) return;\n\n if (info.type === 'options') {\n let curr = JSON.parse(localStorage.getItem(info.type));\n let currKeys = Object.keys(curr);\n for (let key of currKeys) {\n let elem = document.getElementById(`${key}Input`);\n if (elem) {\n elem.setAttribute('placeholder', curr[key].toString());\n if (key === 'replace' || key === 'random' || key === 'snap' || key === 'hide' || key === 'words' || key === 'rotate' || key === 'reflect') {elem.checked = curr[key];}\n }\n }\n }\n\n let innerForm = document.getElementById(info.innerForm)\n innerForm.style.display = 'inline';\n document.getElementById(info.otherToggle).style.display = 'none';\n info.expanded = true;\n ui.specifyConfigTabInstructions(info);\n}", "handleTabsItemChange(e){\n // get index\n const {index}=e.detail;\n let {tabs}=this.data;\n\n tabs.forEach((v,i)=>i===index?v.isActive=true:v.isActive=false)\n this.setData({\n tabs\n })\n\n }", "toggle() {\n this.expanded = !this.expanded;\n }", "function activateRespectiveTab(){\n for(var i=0; i<$scope.tabsData.length; i++){\n if($scope.currentQuestionNumber>=$scope.tabsData[i].startIndex\n && $scope.currentQuestionNumber<=$scope.tabsData[i].endIndex){\n if(i!=$scope.currentActiveTab){\n $scope.toggleActive(i,false);\n }\n break;\n }\n }\n }", "onToggleDetail() {\n\n\t\t$(\".account-subscription\").on(\"click\", \".subscription-item .action .btn\", ev => {\n\n\t\t\tconst target = $(ev.currentTarget).closest(\".subscription-item\");\n\t\t\tconst details = $(\".account-subscription-detail\", target);\n\n\t\t\t$(\".btn.show\", target).toggleClass('hidden');\n\t\t\t$(\".btn.close\", target).toggleClass('hidden');\n\n\t\t\tslideToggle(details[0], 300);\n\n\t\t\treturn false;\n\t\t});\n\t}", "onToggleDetail() {\n\n\t\t$(\".account-history\").on(\"click\", \".history-item .action .btn\", ev => {\n\n\t\t\tconst target = $(ev.currentTarget).closest(\".history-item\");\n\t\t\tconst details = $(\".account-history-detail\", target);\n\n\t\t\t$(\".btn.show\", target).toggleClass('hidden');\n\t\t\t$(\".btn.close\", target).toggleClass('hidden');\n\n\t\t\tslideToggle(details[0], 300);\n\n\t\t\treturn false;\n\t\t});\n\t}", "function initialPages($) {\n\t\tDataTables(\"#branches-list-table\", \"branches\");\n\t\tDataTables(\"#items-list-table\", \"items\");\n\t\tDataTables(\"#munits-list-table\", \"measurement-units\");\n\t\tclearInputs();\n\t}", "function DTM_activate(idBase,index,doToogle) {\r\n// Hiding all:\r\n\tif (DTM_array[idBase]) {\r\n\t\tfor(var cnt = 0; cnt < DTM_array[idBase].length ; cnt++) {\r\n\t\t\tif (DTM_array[idBase][cnt] !== idBase + '-' + index) {\r\n\t\t\t\tdocument.getElementById(DTM_array[idBase][cnt]+'-DIV').style.display = 'none';\r\n// Only Overriding when Tab not disabled\r\n\t\t\t\tif (document.getElementById(DTM_array[idBase][cnt]+'-MENU').attributes.getNamedItem('class').nodeValue !== 'disabled') {\r\n\t\t\t\t\tdocument.getElementById(DTM_array[idBase][cnt]+'-MENU').attributes.getNamedItem('class').nodeValue = 'tab';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n// Showing one:\r\n\tif(!document.getElementById(idBase+'-'+index+'-MENU')){\r\n\t\tindex = 1;\r\n\t}\r\n\tif (document.getElementById(idBase+'-'+index+'-DIV')) {\r\n\t\tif (doToogle && document.getElementById(idBase+'-'+index+'-DIV').style.display === 'block') {\r\n\t\t\tdocument.getElementById(idBase+'-'+index+'-DIV').style.display = 'none';\r\n\t\t\tif (DTM_origClass === '') {\r\n\t\t\t\tdocument.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tab';\r\n\t\t\t} else {\r\n\t\t\t\tDTM_origClass = 'tab';\r\n\t\t\t}\r\n\t\t\ttop.DTM_currentTabs[idBase] = -1;\r\n\t\t} else {\r\n\t\t\tdocument.getElementById(idBase+'-'+index+'-DIV').style.display = 'block';\r\n\t\t\tif (DTM_origClass === '') {\r\n\t\t\t\tdocument.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tabact';\r\n\t\t\t} else {\r\n\t\t\t\tDTM_origClass = 'tabact';\r\n\t\t\t}\r\n\t\t\ttop.DTM_currentTabs[idBase] = index;\r\n\t\t}\r\n\t}\r\n\tdocument.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tabact';\r\n}", "ngAfterContentChecked() {\n let activePanel = this._getPanelById(this.activeId);\n this.activeId = activePanel ? activePanel.id : ( this.tabpanels.length ? this.tabpanels.first.id : null);\n activePanel = this._getPanelById(this.activeId);\n activePanel.active = true;\n }", "function mySubmitTab() {\n\n tabMode = \"MySubmit\";\n bindGrid('MySubmit');\n return false;\n}", "ViewAllAccountFields() {\r\n this.showFields = !this.showFields;\r\n }", "toggleListNoPref() {}", "switchTab(tab) {\n for (let a of document.querySelectorAll('article')) {\n a.setAttribute('aria-hidden', true);\n }\n\n let t = document.getElementById(`t-${tab}`);\n if (t) {\n this.activearticle = t;\n this.activearticle.removeAttribute('aria-hidden');\n }\n this.navigation.select(tab);\n\n if (history.pushState) {\n history.pushState(null, null, `#${tab}`);\n } else {\n location.hash = `#${tab}`;\n }\n window.scrollTo(0,0);\n }", "function changementAuto() {\n\t\t if(changement){\n\t\t $.fn.fullpage.moveSectionDown();\n\t\t }\n\t}" ]
[ "0.60708004", "0.602053", "0.59717333", "0.5875353", "0.5814023", "0.57533926", "0.5748533", "0.570951", "0.57019645", "0.56947684", "0.5630799", "0.56304824", "0.562682", "0.5615515", "0.55662537", "0.55248034", "0.55217755", "0.5504217", "0.54916185", "0.54766643", "0.54679626", "0.54470783", "0.543998", "0.54386085", "0.5423293", "0.5422908", "0.54204947", "0.5398028", "0.5393001", "0.53869605", "0.53840387", "0.53838664", "0.5383578", "0.53812385", "0.53808445", "0.53779745", "0.5371163", "0.53687775", "0.53679585", "0.5367141", "0.53608763", "0.5356863", "0.5355122", "0.53548455", "0.53544825", "0.5351308", "0.5351308", "0.5351308", "0.5343133", "0.534261", "0.53334403", "0.532902", "0.53170127", "0.53170127", "0.53077483", "0.52999836", "0.5292983", "0.5283407", "0.52827257", "0.5280432", "0.52780986", "0.5271947", "0.5254134", "0.5252883", "0.5252696", "0.524779", "0.5237687", "0.52361804", "0.5235224", "0.52323884", "0.5220018", "0.5218189", "0.5210699", "0.52094764", "0.52094215", "0.5205001", "0.5204599", "0.51989055", "0.5198185", "0.5196092", "0.5194337", "0.51933295", "0.5188725", "0.5186308", "0.5174825", "0.51689994", "0.5165481", "0.51643884", "0.516348", "0.5162347", "0.51607466", "0.51585406", "0.5154424", "0.5148713", "0.51483107", "0.51359916", "0.5135969", "0.5131891", "0.51301366", "0.5129949", "0.5129645" ]
0.0
-1
Using the httpGetAsync function, we make a call to the API
function getNameGender() { name = document.getElementById("BoyOrGirl").value; // Sets the value of name to what is currently in the text field let fullURL = baseURL + name; // Appends the name to the base URL httpGetAsync(fullURL, assignGender); // Returns the API's response to the function assignGender }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getJSON(){\n console.log(\"GET\");\n\n var api_url = _api_url; \n httpGetAsync(api_url,function(resp){\n console.log(resp);\n console.log(\"data returned successfully\");\n })\n }", "async call(url) {\n let response = await this.instance.get(url)\n return response\n }", "async callApi(opts) {\n console.log(`invoking http call: ${util.inspect(opts)}`);\n\n try {\n var result = await request(opts);\n }\n catch(err) {\n console.error(`error invoking request: ${err.message}, opts: ${opts}`);\n return;\n }\n\n console.log(`got result: ${util.inspect(result)}`);\n return result.response;\n }", "function httpGet (callback) {\n console.log(\"real call of api here\");\n\n var url = getUrlFromForm();\n\n var request = new XMLHttpRequest();\n request.open('GET', url);\n request.onreadystatechange = () => {\n if (request.readyState === XMLHttpRequest.DONE) {\n callback(JSON.parse(request.response));\n }\n }\n\n request.send();\n}", "function httpGetAsync(theUrl, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n\t\tif(xmlHttp.status == 400)\n\t\t\terror();\n\t\tif(xmlHttp.status == 404)\n\t\t\terror();\n }\n xmlHttp.open(\"GET\", \"https://cors-anywhere.herokuapp.com/\" + theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function httpGetAsync(theUrl, keyword) {\n resetVariables();\n currentKeyword = keyword;\n $.getJSON(theUrl + keyword, function(result){\n processJsonResult(result, keyword);\n });\n}", "async function httpGet(url){\n const res = await fetch(url);\n const response = await res.text();\n\n return response;\n}", "httpGetAsync(theUrl, callback){\n var xmlHttp = new XMLHttpRequest()\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText)\n }\n xmlHttp.open(\"GET\", theUrl, true)\n xmlHttp.send(null)\n }", "function httpGetAsync(theUrl, callback) {\n let xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) \n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function httpGet(theUrl, callback){\n request(theUrl, function (error, response, body){\n\n\t\tif (!error && response.statusCode == 200){\n\t\t \tcallback(body) // Call the callback function passed in\n\t\t}else if(response.statusCode == 403){\n\t\t\tconsole.log('ACCESS DENIED: This probably means you ran out of requests on your API key for now.')\n\t\t}\n\t})\n}", "function httpGet(url) {\n return new Promise((resolve, reject) => {\n request(url, (err, res, body) => {\n if (err) {\n reject(err);\n } else {\n resolve(body);\n }\n });\n });\n}", "async sendGetRequestAsync(url, options) {\n const request = coreRestPipeline.createPipelineRequest({\n url,\n method: \"GET\",\n body: options === null || options === void 0 ? void 0 : options.body,\n headers: coreRestPipeline.createHttpHeaders(options === null || options === void 0 ? void 0 : options.headers),\n abortSignal: this.generateAbortSignal(noCorrelationId),\n });\n const response = await this.sendRequest(request);\n this.logIdentifiers(response);\n return {\n body: response.bodyAsText ? JSON.parse(response.bodyAsText) : undefined,\n headers: response.headers.toJSON(),\n status: response.status,\n };\n }", "async getAPI(url) {\n\t\tthis.log.debug('GET API called for : ' + url);\n\t\ttry {\n\t\t\tconst response = await axios.get(url, {timeout: 3000}); // Timout of 3 seconds for API call\n\t\t\tthis.log.debug(JSON.stringify('API response data : ' + response.data));\n\t\t\treturn response.data;\n\t\t} catch (error) {\n\t\t\t// this.log.error(error);\n\t\t}\n\t}", "function httpGetAsync(theUrl, callback) {\n // create the request object\n var xmlHttp = new XMLHttpRequest();\n\n // set the state change callback to capture when the response comes in\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n callback(xmlHttp.responseText);\n }\n }\n\n // open as a GET call, pass in the url and set async = True\n xmlHttp.open(\"GET\", theUrl, true);\n\n // call send with no params as they were passed in on the url string\n xmlHttp.send(null);\n\n return;\n}", "async function getOneThing() {\n var response = await axios.get(\"https://httpbin.org/get\");\n // now I have some data\n }", "function httpGetAsync(url, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n };\n xmlHttp.open('GET', url, true);\n xmlHttp.send(null);\n}", "function http_get(req_url){\n request.get(\n bal_query,\n function(error, response, body) {\n console.log(\"Clickatell GET:\")\n node.send(\"Clickatell GET:\");\n if (!error && response.statusCode == 200) {\n if (DEBUG){\n console.log(body, response)\n }\n console.log(req_url)\n console.log(body)\n node.send(body);\n }\n }\n );\n }", "async function CallApi() {\n\n // Build the search URL. See the api documentation for details of what's allowed\n url = new URL(\"http://api.openweathermap.org/data/2.5/onecall\")\n url.searchParams.append(\"lon\", \"-0.1278\")\n url.searchParams.append(\"lat\", \"51.5074\")\n url.searchParams.append(\"appid\", secret.openweathermap_api_key)\n console.log(url.href)\n\n // Submit the URL and get the response\n await axios.get(url.href).then(response => {\n // Get the api's response\n data = response.data\n\n // Store the data found to the csv, filtering for the info we want\n api_helper.storeCsv(data.hourly, filter)\n });\n}", "async function main() {\n try {\n let response = await GET(url);\n console.log(\"GET: %o\", response);\n } catch (e) {\n console.log(e.name + \": \" + e.message);\n }\n}", "async getUserDetails(){\n const res = await Api.get('url', true);\n }", "function httpGetAsync(theUrl, callback)\n{\n // create the request object\n var xmlHttp = new XMLHttpRequest();\n\n // set the state change callback to capture when the response comes in\n xmlHttp.onreadystatechange = function()\n {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n {\n callback(xmlHttp.responseText);\n }\n }\n\n // open as a GET call, pass in the url and set async = True\n xmlHttp.open(\"GET\", theUrl, true);\n\n // call send with no params as they were passed in on the url string\n xmlHttp.send(null);\n\n return;\n}", "function get(callback) {\n \n webService.get(apiUrl , callback);\n }", "async function performRequest(url) {\r\n return await axios\r\n .get(url)\r\n .then((res) => {\r\n return res.data;\r\n })\r\n .catch((error) => {\r\n console.log(error);\r\n });\r\n}", "sendGetRequest(url) {\n return this.httpClient.get(url);\n }", "async get(options) {\n return await this.axiosClient.request({\n method: 'get',\n url: options.url,\n params: options.params,\n headers: Object.assign({}, this.axiosClient.headers, options.headers)\n }).then((response) => {\n return response.data;\n }).catch((err) => {\n console.log(err);\n return (this.normalizeError(err));\n });\n }", "function httpGetAsync(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n xmlHttp.send(null);\n}", "async get(url) {\n \n // Awaiting for fetch response\n const response = await fetch(url);\n \n // Awaiting for response.json()\n const resData = await response.json();\n \n // Returning result data\n return resData;\n }", "function request(){\n\n var xhr = GethttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function() {\n var status = xhr.status;\n if (status == 200) {\n callback(status, xhr.response);\n } else {\n callback(status);\n }\n };\n xhr.send();\n }", "async function getCurrencyList() {\n let url = \"http://localhost:8080/getCurrencyList\";\n let response = await GetData(url);\n return response;\n}", "async get(url){\n const getData = await fetch(url);\n\n const data = await getData.json();\n return data;\n\n }", "function httpGetAsync(theUrl, callback) {\n\tvar xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function httpGetAsync(theUrl, callback) {\n\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.onreadystatechange = function () {\n\t\tif (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n\t\t\tcallback(xmlHttp.responseText);\n\t}\n\txmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n\txmlHttp.send(null);\n}", "static async get(url) {\n const response = await fetch(url);\n const data = response.json();\n // data below will be call within\n // .then(data => console.log(data))\n return data;\n }", "get(getUrl, httpParameters) {\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n this.http.get(getUrl, { params: httpParameters }).subscribe((response) => {\n resolve(response);\n }, reject);\n }).catch((error) => {\n throw new Error(`ERROR: Unable to retrieve data from ${getUrl} due to ${error}`);\n });\n });\n }", "function httpGetAsync(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n callback(xmlHttp.responseText);\n }\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\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 }", "function httpGetAsync(url, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.response);\n }\n xmlHttp.open(\"GET\", url, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function apiCall(){\r\nxhr.open('GET', url);\r\nxhr.send();\r\n}", "function httpGet(url, callback) {\n\thttp.get(url, function(res) {\n\t\tvar chunks = [];\n\t\tres.on('data', function(chunk) {\n\t\t\tchunks.push(chunk);\n\t\t});\n\t\tres.on('end', function() {\n\t\t\tvar body = chunks.join('');\n\t\t\t//If it is a string, parse to JSON\n\t\t\tif(typeof body === 'string') {\n\t\t\t\tbody = JSON.parse(body);\n\t\t\t}\n\t\t\t//Pass JSON response to callback\n\t\t\tcallback(body);\n\t\t});\n });\n}", "async function ajax() {\n const res = await axios.get('https://jsonplaceholder.typicode.com/todos/1');\n\n console.log(res);\n }", "function callAPI(url,data,callback)\n{\n var formData = JSON.stringify(data);\n Request.get({\n headers: { \"Content-Type\":'application/json',\"Authorization\":\"BEARER 2HQ6xG29mp8kXslCDs8l1BhnSPxN2UdrftzFv8f9VrC1FrZ3RtHnHmDovMBZvPCDyXiEq910aH0VMIogWF61uWdTnZAIYf2ZXHXOiwoqZntbEUpxneq4Seu0BuLibNIwNrvsSt0PanuZphPWFdDyfNmTflUK3lZa8IOtvugkmWXOkb0wMwUgxzXzzbBKOZyqmthekO6e8R8yY6VSbe1csyqVSQCCXKcCfBmuFBHk7CWfkRyhqHvqaReD5rTelaE1\" },\n url: url,\n body: formData\n}, function(err, response) {\n var body = JSON.parse(response.body);\n callback(err, body);\n});\n}", "function _httpGet(url, callback) {\n return http.get(url, function(res) {\n res.setEncoding('utf8');\n var body = '';\n res.on('data', function(d) { body += d; });\n res.on('end', function() { return callback(undefined, body); });\n res.on('error', function(err) { return callback(new Exception({url:url}, \"Failed to execute HTTP request\", err)); });\n });\n }", "async get(url){\n const response=await fetch(url);\n const resData=await response.json();\n return resData;\n }", "get(url,cb){\n fetch(url)\n .then(response=>{\n response.json().then(data=>{\n cb(data)\n })\n })\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 httpGet(url){\n\n return new Promise((resolve, reject)=>{\n // Load XMLHttpRequest module\n // XMLHttpRequest provides an easy way to retrieve data from a URL without having to do a full page refresh.\n var XMLHttpRequest = require(\"xmlhttprequest\").XMLHttpRequest;\n\n // instantiation\n var req = new XMLHttpRequest();\n\n // initializes a request.\n req.open('GET', url);\n\n // Assign funciton for HTTP request returns after successfully fetching content\n // and the load event is received by this object.\n req.onload = function() {\n // check the status\n if (req.status == 200) {\n // Resolve the promise with the response text\n resolve(req);\n }else {\n // Otherwise reject with the status text\n reject(Error(req.status));\n }\n };\n\n // Handle network errors\n req.onerror = function() {\n reject(req)\n };\n\n\n // make the request\n req.send();\n })\n\n}// func", "function get(url){return axios__WEBPACK_IMPORTED_MODULE_0___default.a.get(url);}", "_request() {\n var options = url.parse(this._url);\n options.headers = {\n 'User-Agent': 'Benjamin Tambourine',\n 'If-None-Match': this._etag\n };\n https.get(options, this._onResponse.bind(this));\n }", "async get() {\n\t\treturn await this._run('GET');\n\t}", "async function callApi() {\n try {\n const peopleData = await API.get('mainappapi', '/people');\n console.log('peopleData: ', peopleData)\n updatePeople(peopleData.people)\n const coinsData = await API.get('mainappapi', '/coins');\n console.log('coinsData: ', coinsData)\n updateCoins(coinsData.coins)\n } catch (err) {\n console.log({ err })\n }\n }", "http (url, options) {\n return this.robot.http(url, options)\n }", "get(url, callback) {}", "async dataGet(newurl, authorization) {\n const url = newurl;\n return await new Promise((resolve, reject) => {\n http\n .get(url, {\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n Authorization: 'BWSA ' + authorization,\n 'Access-Control-Allow-Origin': '*',\n SourceSystem: 'WebAdmin',\n },\n })\n\n .then(result => {\n if (result.status === 200) {\n return resolve({\n status: 1,\n result: result,\n });\n } else if (result.status === 212) {\n return resolve({\n status: 4,\n result: result,\n });\n } else {\n if (result) {\n return reject({\n status: 3,\n error: result.data.message,\n });\n } else {\n return reject({\n status: 4,\n error: 'Something went wrong.',\n });\n }\n }\n })\n .catch(err => {\n if (err.response) {\n if (err.response.status !== null && err.response.status !== undefined) {\n if (err.response.status === 401) {\n let unauthorizedStatus = err.response.status;\n if (unauthorizedStatus === 401) {\n logout();\n message.error(ValidationConstants.messageStatus401);\n }\n } else if (err.response.status === 500) {\n // message.error(err.response.data.message)\n return reject({\n status: 5,\n error: 'Something went wrong.',\n });\n }\n }\n } else {\n return reject({\n status: 5,\n error: err,\n });\n }\n });\n });\n }", "get(apiPath, parameters, options, callback) {\n let send = callback ? result.send : result.sendPromised\n return send(apiPath, parameters, 'GET', options, callback)\n }", "function httpGetRequest(url) {\n return new Promise((resolve, reject) => {\n let data = '';\n\n const req = https.get(url, resp => {\n resp.on('data', chunk => (data += chunk));\n resp.on('end', () => resolve(JSON.parse(data)));\n });\n\n req.on('error', err => reject(err));\n });\n}", "async function Put_Get () {\n\n \n await postRequest('https://assets.breatheco.de/apis/fake/todos/user/fpineda1410', list)\n .then(data => console.log(data)) // Result from the `response.json()` call\n .catch(error => console.error(error))\n\n fetch('https://assets.breatheco.de/apis/fake/todos/user/fpineda1410') //Generic GET Method to the 4Geeks API\n .then(response => response.json())\n .then(data => {//console.log(data)\n \n }\n )\n\n \n //setJsonList(data)\n }", "async function getData(url){\n const {data} = await axios.get(url)\n return data;\n}", "requestApi(url) {\n return axios_1.default.get(url)\n .then(res => { return res.data; })\n .catch(err => { return err; });\n }", "get(url) {\n const req = this.client.get(url);\n\n return this.preRequest(req);\n }", "function callApi(cb) {\n var URL =\n \"https://www.omdbapi.com/?apikey=c1466e63&s=\" +\n topic +\n \"&page=\" +\n pageNumber; // Set url for query to api based on topic selected\n var xhr = new XMLHttpRequest();\n // set url based on selected trending item\n xhr.open(\"GET\", URL);\n xhr.send();\n xhr.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n cb(JSON.parse(this.responseText)); // Only call createArray when the data has arrived\n }\n };\n }", "function httpGet( httpOptions, callback ){\n\n\t// Make the request with the given options.\n\tvar request = http.request( httpOptions );\n\n\t// Flush the request (we aren't posting anything to the body).\n\trequest.end();\n\t\n\t// Bind to the response event of the outgoing request - this will\n\t// only fire once when the response is first detected.\n\trequest.on( \n\t\t\"response\",\n\t\tfunction( response ){\n\n\t\t\t// Now that we have a response, create a buffer for our \n\t\t\t// data response - we will use this to aggregate our \n\t\t\t// individual data chunks.\n\t\t\tvar fullData = [ \"\" ];\n\t\t\t\n\t\t\t// Bind to the data event so we can gather the response\n\t\t\t// chunks that come back.\n\t\t\tresponse.on(\n\t\t\t\t\"data\",\n\t\t\t\tfunction( chunk ){\n\n\t\t\t\t\t// Add this to our chunk buffer.\n\t\t\t\t\tfullData.push( chunk );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t);\n\t\t\t\n\t\t\t// When the response has finished coming back, we can \n\t\t\t// flatten our data buffer and pass the response off\n\t\t\t// to our callback.\n\t\t\tresponse.on(\n\t\t\t\t\"end\",\n\t\t\t\tfunction(){\n\n\t\t\t\t\t// Compile our data and pass it off.\n\t\t\t\t\tcallback( fullData.join( \"\" ) );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t);\n\n\t\t}\n\t); \n\t\n}", "function getRequest(data, callback) {\n let headers = {\n 'Content-type': 'application/json'\n };\n if (data.headers.Authentication) {\n headers['Authentication'] = data.headers.Authentication;\n }\n const authOptions = {\n method: 'GET',\n url: data.url,\n headers: headers,\n data: data.body,\n json: true,\n timeout: 60000,\n };\n\n const track = tracker.section(data.url, domain);\n return httpClient(authOptions)\n .then(function (response) {\n try {\n track();\n handleResponse(data.url, data, response.data, callback);\n } catch (e) {\n tracker.print(e, \"error\");\n console.error(e);\n }\n })\n .catch(function (error) {\n console.log(\"################\");\n track(error);\n if (error) tracker.print(error, \"Backend.HttpError\");\n callback(error, data);\n });\n}", "function callApi(method, url, body, callback){\n let xhr = new XMLHttpRequest();\n xhr.open(method, url, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.setRequestHeader('Authorization', 'Bearer ' + localStorage.getItem(accessTokenKey));\n xhr.send(body);\n xhr.onload = callback;\n}", "async function getapi(url)\n {\n const response = await fetch(url);\n\n var data = await response.json();\n console.log(data);\n show(data);\n postMQTT(data);\n }", "function httpGet(url, callback, params){\n \n console.log(\"Http GET to url: \"+url)\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText, params);\n }\n xmlHttp.open(\"GET\", url, true);\n xmlHttp.send(null);\n}", "function getPost() {\n http.get('https://jsonplaceholder.typicode.com/posts/1', function(response) {\n console.clear();\n console.log(response);\n });\n}", "async function do_api_request (url_params) {\n const api_url = await get_api_url();\n const api_info = await get_api_info();\n\n // Append token / timestamp to request\n url_params.append(\"token\", await get_token(api_url, api_info));\n url_params.append(\"t\", Date.now());\n\n // Make request URL from params\n const url = `${api_url}/?${url_params.toString()}`;\n\n const res_body = await fetch(url, api_info);\n const res_json = await res_body.json();\n\n return res_json;\n}", "function httpAsync(httpMethod, url, callback) {\n var httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState == 4 && httpRequest.status == 200) {\n callback(httpRequest.responseText);\n }\n }\n httpRequest.open(httpMethod, url, true);\n httpRequest.send(null);\n}", "async function apiCall() {\n const res = await fetch(\n proxyurl + \"https://backend.daviva.lt/API/InformacijaTestui\",\n {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\"\n }\n }\n );\n\n if (res.ok) {\n const resJson = await res.json();\n setCars([...cars, resJson]);\n } else {\n console.log(res);\n }\n }", "sendGetRequestAsync(url, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const request = createPipelineRequest({\n url,\n method: \"GET\",\n body: options === null || options === void 0 ? void 0 : options.body,\n headers: createHttpHeaders(options === null || options === void 0 ? void 0 : options.headers)\n });\n const response = yield this.sendRequest(request);\n return {\n body: parse(response.bodyAsText),\n headers: response.headers.toJSON(),\n status: response.status\n };\n });\n }", "function asyncGet() {\n return new Promise(function (success, fail) {\n let xhr = new XMLHttpRequest();\n xhr.open(\"GET\", rootURL + \"list\", true);\n xhr.onload = () => {\n if (xhr.status === 200)\n success(JSON.parse(xhr.responseText));\n else fail(alert(xhr.statusText));\n };\n xhr.onerror = () => fail(alert(xhr.statusText));\n xhr.send();\n });\n}", "async function getapi(url) {\n const response = await fetch(url);\n let data = await response.json();\n return data;\n}", "async function getData() {\n let res = output;\n //variable\n let json;\n //api URL\n // const apiUrl = new URL(\"https://www.virustotal.com/vtapi/v2/url/report\");\n //URL Parameters\n let params = {\n apikey: \"c56702292505c0d8e5c0b604ed785a78d383c1c4679bcdd3eadbad8c5daee557\",\n resource: res,\n };\n\n const proxy = \"https://cors-anywhere.herokuapp.com/\";\n const url = `https://www.virustotal.com/vtapi/v2/url/report?apikey=${params.apikey}&resource=${params.resource}`;\n const finalURL = proxy + url;\n\n $.getJSON(finalURL, function (data) {\n console.log(data);\n });\n\n}", "async apiRequest(code) {\n const { lang } = this.state;\n return axios.get(`${API_URL}/track/${code}/${lang}`);\n }", "async getRequestData(id) {\n let response = await axios.get(`${API_URL}/requests/${id}`);\n console.log(response);\n return response;\n }", "function httpGet(url) {\n return {\n type: \"httpGet\",\n url\n };\n}", "async function CalculatorAPI() {\n\n\n //return the operator from the server\n const returnOperationList = await axios.get(\n \"https://localhost:44394/api/calc/getOperation\"\n );\n\n\n\n\n}", "async function GetCurrencyDetails(id){\n let CurrencyDetails = {};\n let response = await $.get(host+\"/api/Currency/GetCurrencyList/\"+id);\n if (response.err) { console.log('error');}\n else { \n console.log('fetched response');\n console.log(response);\n return response;\n }\n}", "function asyncRemoteGet(url) {\n return new Promise(resolve => {\n $http.get({\n url: url,\n handler: ({ data }) => resolve(data)\n });\n });\n}", "async get(url, conf = {}) {\n try {\n const response = await getClient().get(url, conf);\n return await Promise.resolve(response);\n } catch (error) {\n return await Promise.reject(error);\n }\n }", "async getAccount(id){\n // console.log('Getting account...');\n data = {\n URI: `${ACCOUNTS}/${id}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "static async getById(id) {\n try {\n let res = await axios.get(`${url}/${id}`);\n let data = res.data;\n if (data != 'No Task found.')\n return data;\n }\n catch (err) {\n console.log(err);\n }\n return {};\n }", "reqGet(api, sucfn, errfn) { \n let url = this.url+api;\n return axios.get(url)\n \t.then(sucfn)\n .catch(errfn) \n }", "httpGet(url) {\n return new Promise((resolve, reject) => {\n if (this.develop) {\n console.log(\"URL sent to server: \" + this.server + url);\n }\n http.get(this.server + url, (res) => {\n var data = \"\";\n\n res.on('data', (chunk) => {\n data += chunk;\n }).on('end', () => {\n if (res.statusCode === 200) {\n resolve(data);\n } else {\n reject(data);\n }\n }).on('error', (e) => {\n reject(\"Got error: \" + e.message);\n });\n });\n });\n }", "static get (data, callback = f => f) {\n return createRequest({\n url: this.HOST + this.URL,\n data,\n method: 'GET',\n responseType: 'json',\n callback (e, response) {\n if (e === null && response) {\n callback(e, response);\n } else {\n console.error(e);\n };\n }\n });\n }", "function httpGetAsync(theUrl, callback, logenabled)\n{\t\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200){\n \t//Always a JSON ..\n \tvar rpcjson = JSON.parse(xmlHttp.responseText);\n \t\n \t//Do we log it..\n \tif(Minima.logging && logenabled){\n \t\tvar logstring = JSON.stringify(rpcjson, null, 2).replace(/\\\\n/g,\"\\n\");\n \t\tMinima.log(theUrl+\"\\n\"+logstring);\n \t}\n \t\n \t//Send it to the callback function..\n \tif(callback){\n \t\tcallback(rpcjson);\n \t}\n }\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "function httpGet(url, complete) {\n // CAP-0001\n http.get(url, function(response) {\n var content = \"\";\n response.on(\"data\", function(chunk) { content += chunk; });\n response.on(\"end\", function() {\n response.content = content;\n complete(response);\n });\n });\n}", "async function gettingData() {\n let response = await fetch(url);\n let data = await response.json();\n console.log(data);\n }", "get(apiData = {}) {\n return this._api(apiData, 'get');\n }", "function get(url, data) {\n console.log('get', url);\n return request\n .get(url, data)\n .setCommonHeader()\n .then(res => Promise.resolve(res.body))\n .catch(err => errHandler(err, url));\n}", "async get(url) {\n const response = await fetch(url);\n\n const resData = await response.json();\n return resData;\n }", "function callApi ( path )\n{\n\tlet url = myUrlBase () + path;\n\t\n\treturn fetch ( url )\n .then ( response => response.json() );\n}", "get(url, opt = {}) {\n opt.method = 'GET';\n return this.sendRequest(url, opt);\n }", "async get(url) {\n const response = await fetch(url);\n const resData = await response.json();\n return resData;\n }", "get(url, data = {}, succCb = null, errCb = null) {\n return this.request('GET', url, data, succCb, errCb);\n }", "function request(method,url,params,callbackSuccess,callbackError) {\n httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n callbackSuccess(JSON.parse(httpRequest.responseText));\n } else {\n callbackError(httpRequest);\n }\n }\n };\n httpRequest.open(method,'https://api.trello.com/1' + url + (url.includes('?') ? '&' : '?') + 'key=45cb99fb34a85706e8d9a5ea9bcf8571&token='+window._gtToken);\n httpRequest.send();\n}", "function jsonGet(url, args, access_token, cb) {\n if (args != null) {\n url = url + '?' + stringify(args)\n }\n const req = request(\n url,\n {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Authorization': `Bearer ${access_token}`\n }\n },\n (res) => { fetchResult(res, url, cb) }\n )\n\n req.on('error', (e) => {\n logger.error(`Request error for ${url}: ${e}`)\n cb(e, null, null)\n })\n req.end()\n}", "function makeAPICall()\n{\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() { \n if (4 == xhr.readyState && 200 == xhr.status) {\n handleAPICall(xhr.responseText);\n }\n }\n xhr.open(\"GET\", \"https://api.torn.com/user/1643506?selections=&key=SFfDBKRg\", true); \n xhr.send(null);\n}", "async get(url) {\n try {\n const headers = new Headers({});\n const token = await this.getToken();\n headers.set('Authorization', token);\n const request = await fetch(url, {\n method: 'GET',\n headers,\n });\n if (request.status === 401) {\n this.cookies.remove('token');\n return null;\n }\n const response = await request.json();\n console.log(response)\n if (response.status === 200 && response.success) {\n return response;\n } else if (!response.success || !response) {\n toast.error(response.message);\n }\n return null;\n } catch (error) {\n console.log(error)\n return null;\n }\n }", "async function getDataFromApiAsync() {\n let response = await fetch(urlSwapi);\n let data = await response.json();\n console.log(data.results);\n}" ]
[ "0.71720654", "0.69026273", "0.67888665", "0.67399114", "0.6732096", "0.6583978", "0.6529626", "0.65093875", "0.64764583", "0.647266", "0.64715976", "0.64651954", "0.64473623", "0.6402314", "0.63828963", "0.63732713", "0.6365959", "0.63620025", "0.63422495", "0.63290656", "0.63283443", "0.6326779", "0.6305458", "0.63002217", "0.62554806", "0.62528044", "0.624227", "0.623116", "0.6229566", "0.622246", "0.6208104", "0.620563", "0.62050354", "0.6195714", "0.6190022", "0.6187932", "0.6174917", "0.61719304", "0.61698776", "0.6166386", "0.6150703", "0.6148761", "0.61362267", "0.6128634", "0.6117956", "0.6114072", "0.61084706", "0.61060464", "0.6093645", "0.6089591", "0.6086676", "0.60845566", "0.60714054", "0.60627097", "0.6059629", "0.60595846", "0.6054405", "0.6052727", "0.6049179", "0.60448885", "0.60447276", "0.6025726", "0.6024724", "0.6023565", "0.6023048", "0.60186994", "0.60171473", "0.60139704", "0.6000767", "0.60004956", "0.5987794", "0.598647", "0.5985664", "0.5982364", "0.5981439", "0.59807575", "0.5958999", "0.59568185", "0.59554344", "0.5939764", "0.59361666", "0.5931744", "0.59303737", "0.59250814", "0.59087545", "0.5898475", "0.58788717", "0.58760816", "0.5870558", "0.58642495", "0.5859927", "0.58530796", "0.58389336", "0.5838249", "0.58381885", "0.58361655", "0.58360445", "0.58356744", "0.5834377", "0.58280784", "0.58219796" ]
0.0
-1
Makes an async call for JSON (Vanilla Javascript)
function httpGetAsync(theUrl, callback) { let xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) callback(xmlHttp.responseText); } xmlHttp.open("GET", theUrl, true); // true for asynchronous xmlHttp.send(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getJSON(){\n console.log(\"GET\");\n\n var api_url = _api_url; \n httpGetAsync(api_url,function(resp){\n console.log(resp);\n console.log(\"data returned successfully\");\n })\n }", "function jsonGet(url, callback) {\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', url, true);\r\n xhr.setRequestHeader('Content-Type', 'application/json');\r\n\r\n xhr.onreadystatechange = callback;\r\n\r\n xhr.send();\r\n}", "async function FetchJSON(url){\n let response = await fetch(url);\n return response.json();\n}", "function getJSON(script, callback, async){\n\tremoteCall(script, function(r,args){\n\t\tcallback(JSON.parse(r));\n\t}, null, 'get', null, async);\n}", "async function getJSON(path) {\n let json = await fetch(path).then(response => response.json());\n createJSObject(json);\n}", "function getJSON(url) {\n return new Promise((res, rej) => {\n let xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, false);\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4 && xhr.status == 200) {\n res(JSON.parse(xhr.responseText));\n console.log(xhr);\n }\n };\n xhr.send();\n console.log(xhr);\n });\n}", "function requestJSON(url,callback) {\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n var res = JSON.parse(xmlhttp.responseText);\n try {\n callback(res);\n }\n catch (err) {\n console.log(err.message);\n }\n }\n }\n\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n}", "async function getJSON(url) {\n\ttry {\n\t\tconst response = await fetch(url);\n\t\treturn await response.json();\n\t} catch (error) {\n\t\tthrow error;\n\t}\n}", "httpGetAsync(theUrl, callback){\n var xmlHttp = new XMLHttpRequest()\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText)\n }\n xmlHttp.open(\"GET\", theUrl, true)\n xmlHttp.send(null)\n }", "function getJSON(url, sync=true, fn=((response) => {})) {\n return ($.ajax({\n type: 'GET',\n url: url,\n async: !sync,\n dataType: 'json',\n complete: fn\n })).responseJSON;\n}", "function JSONget(url) {\n return new Promise(function (resolve, reject) {\n let xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n let arr = JSON.parse(this.responseText);\n //resolves when recieves json, returns data\n resolve(arr);\n }\n }\n });\n}", "function httpGetAsync(theUrl, callback, logenabled)\n{\t\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200){\n \t//Always a JSON ..\n \tvar rpcjson = JSON.parse(xmlHttp.responseText);\n \t\n \t//Do we log it..\n \tif(Minima.logging && logenabled){\n \t\tvar logstring = JSON.stringify(rpcjson, null, 2).replace(/\\\\n/g,\"\\n\");\n \t\tMinima.log(theUrl+\"\\n\"+logstring);\n \t}\n \t\n \t//Send it to the callback function..\n \tif(callback){\n \t\tcallback(rpcjson);\n \t}\n }\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "async function getJSON(url) {\n try {\n const res = await fetch(url)\n const data = await res.json()\n return data\n } catch(err) {\n console.error(err)\n }\n}", "function getJSON(url) {\n\t // Return a new promise.\n\t return new Promise(function (resolve, reject) {\n\t // Do the usual XHR stuff\n\t var req = new XMLHttpRequest();\n\t req.open('GET', url);\n\n\t req.onload = function () {\n\t // This is called even on 404 etc\n\t // so check the status\n\t if (req.status == 200) {\n\t // Resolve the promise with the response text\n\t resolve(req.response);\n\t } else {\n\t // Otherwise reject with the status text\n\t // which will hopefully be a meaningful error\n\t reject(Error(req.statusText));\n\t }\n\t };\n\n\t // Handle network errors\n\t req.onerror = function () {\n\t reject(Error(\"Network Error\"));\n\t };\n\n\t // Make the request\n\t req.send();\n\t });\n\t}", "function httpGetAsync(theUrl, keyword) {\n resetVariables();\n currentKeyword = keyword;\n $.getJSON(theUrl + keyword, function(result){\n processJsonResult(result, keyword);\n });\n}", "async WebGetJson(url) {\n var r = await this._BaseWebRequest(url, \"json\", \"GET\", null);\n return r;\n }", "async function loadJSON(path,callback) {\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', path, true);\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n callback(xobj.responseText);\n }\n };\n xobj.send(null);\n}", "function jsonrequest(url,cFunction){\t\n\tlet request = new XMLHttpRequest();\n\trequest.responseType = \"json\";\n\trequest.onreadystatechange = function() {\n\t if (this.readyState == 4 && this.status == 200) {\n\t cFunction(this); //send xhr object to callback function\n\t }\n\t};\n\trequest.open(\"GET\", url, true); \n\trequest.send();\n}", "function request(){\n\n var xhr = GethttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function() {\n var status = xhr.status;\n if (status == 200) {\n callback(status, xhr.response);\n } else {\n callback(status);\n }\n };\n xhr.send();\n }", "async function getJSON(url) {\n try {\n const response = await fetch(url);\n return await response.json();\n } catch (error) {\n throw error;\n }\n}", "function asyncGet() {\n return new Promise(function (success, fail) {\n let xhr = new XMLHttpRequest();\n xhr.open(\"GET\", rootURL + \"list\", true);\n xhr.onload = () => {\n if (xhr.status === 200)\n success(JSON.parse(xhr.responseText));\n else fail(alert(xhr.statusText));\n };\n xhr.onerror = () => fail(alert(xhr.statusText));\n xhr.send();\n });\n}", "function getjson(url, method, data) {\n return new Promise(function(resolve, reject) {\n let request = new XMLHttpRequest();\n request.responseType = 'json';\n request.onreadystatechange = function() {\n if (request.readyState === XMLHttpRequest.DONE) {\n if (request.status === 200) {\n resolve(request.response);\n } else {\n reject(Error(request.status));\n }\n }\n };\n request.onerror = function() {\n reject(Error(\"Network Error\"));\n };\n request.open(method, url, true);\n request.send(data);\n });\n}", "function httpGetAsync(url, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n };\n xmlHttp.open('GET', url, true);\n xmlHttp.send(null);\n}", "function httpGetAsync(url, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.response);\n }\n xmlHttp.open(\"GET\", url, true); // true for asynchronous \n xmlHttp.send(null);\n}", "async function getJson(url) {\n const response = await fetch(url);\n const returnedJson = await response.json();\n return returnedJson\n}", "async function loadJSON(url, callback) {\n const response = await fetch(url);\n const data = await response.json();\n callback(data);\n}", "function httpGetAsync(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n callback(xmlHttp.responseText);\n }\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function AsyncAwaitRequest(url) {\n\n return new Promise(function(resolve, reject) {\n\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.send();\n xhr.onreadystatechange = function() {\n if (this.readyState != 4) return;\n\n if (xhr.status != 200) {\n var error = new Error(this.statusText);\n reject(error);\n } else {\n resolve(JSON.parse(this.response))\n }\n }\n })\n}", "static fetchJSON(theURI, theCB, form) {\nvar JSONCB;\nJSONCB = (val, errC, errT, part) => {\nvar err, newJSON;\nif (errC > 0 || val.length === 0) {\nreturn theCB(val, errC, errT, part);\n} else if (val.length === 0) {\nreturn theCB(null, 1, \"No JSON data found\", val);\n} else {\ntry {\nnewJSON = Data.parseJSON(val);\nreturn theCB(newJSON, 0, null, newJSON);\n} catch (error) {\nerr = error;\nreturn theCB(null, 1, err, val);\n}\n}\n};\nreturn Data.fetchURI(theURI, JSONCB, form);\n}", "function jsonRequest(url)\n{\n var script=document.createElement('script');\n script.src=url;\n document.getElementsByTagName('head')[0].appendChild(script);\n}", "async function fetchJson(url) {\n try {\n let response = await fetch(url);\n let text = await request.text();\n return JSON.parse(text);\n } catch (e) {\n console.log(`ERROR: ${e.stack}`)\n }\n}", "function httpGetAsync(theUrl, callback) {\n\tvar xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function httpGetAsync(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n xmlHttp.send(null);\n}", "function fetchJSON(){\n mRequest.onreadystatechange = function(){\n if(this.readyState == 4 && this.status == 200){\n mJson = JSON.parse(mRequest.responseText);\n iterateJSON(mJson)\n }\n }\n mRequest.open(\"GET\",mURL, true);\n mRequest.send();\n}", "function http_GET(url) {\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.open(\"GET\", url, false); // false for synchronous request\n\txmlHttp.send(null);\n\tvar text = xmlHttp.responseText;\n\treturn JSON.parse(text);\n\n\t\n}", "async function hentData(json, callback) {\n const response = await fetch(json);\n let jsonData = await response.json();\n\n callback(jsonData); \n\n}", "function request(url) {\n var req = new XMLHttpRequest();\n req.responseType = 'json';\n req.open('GET', url, false);\n req.send();\n return req.status == 200 ? req.response : null;\n}", "function request(url, callback) {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open('GET', url, true);\n xmlhttp.send();\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n var data = JSON.parse(xmlhttp.responseText);\n callback(data);\n }\n };\n }", "async function jsonladen(_url) {\n let rückgabe = await fetch(_url);\n let serverrückgabe = await rückgabe.json();\n anzeigenlassen(serverrückgabe);\n}", "function asynch_func() {\n // console.log(req.responseText)\n if (req.status >= 200 && req.status < 400) {\n let res_JSON = JSON.parse(req.responseText);\n console.log(res_JSON.args);\n res_span.textContent = \"(*For Grader this message will dissapear in 10 sec) The response we got from our GET Request from https://httpbin.org/get is: \" + JSON.stringify(res_JSON.args)\n } else {\n console.log(\"Error: \" + req.statusText);\n res_span.textContent = req.statusText;\n }\n }", "static getJSON(url) {\n return new Promise((resolve, reject) => {\n const getHTTP = new XMLHttpRequest();\n //URL to GET results with the amount entered by user plus the username found on the menu selected\n getHTTP.open('GET', url, true);\n getHTTP.setRequestHeader('Content-Type', 'application/json');\n getHTTP.onreadystatechange = function () {\n if (getHTTP.readyState === 4 && getHTTP.status === 200) {\n resolve(getHTTP.responseText);\n }\n };\n getHTTP.send();\n });\n }", "function httpGet(url) {\n var xmlHttp = new XMLHttpRequest()\n xmlHttp.open(\"GET\", url, false) // true/false for a-/synchronous request\n xmlHttp.send(null)\n //console.log(xmlHttp.responseText)\n return JSON.parse(xmlHttp.responseText)\n}", "function getJSON(myUrl, view) { // function that allows us to request json from a url; executes when we query our api\n var request = new XMLHttpRequest();\n request.open('GET', myUrl, true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n var data = JSON.parse(request.responseText);\n handleData(data, view); //once the data is parsed handle the data\n } else {\n console.log('The target server returned an error');\n }\n };\n\n request.onerror = function() {\n console.log('There was a connection error');\n };\n request.send()\n }", "function ajaxCall(url, callback) {\n var ajax=new XMLHttpRequest();\n ajax.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n callback(JSON.parse(this.responseText));\n }\n };\n ajax.open(\"GET\", url, true);\n ajax.send();\n}", "async function getJsonDataAsync(url) {\n const response = await fetch(url);\n if (!response.ok) throw new Error('Error in fetching Details');\n const data = await response.json();\n return data;\n}", "function getJSON(url) {\n var deferred = q.defer();\n https.get(url, res => {\n var ret = \"\";\n res.on(\"data\", d => ret += d)\n .on(\"end\", () => deferred.resolve(JSON.parse(ret)));\n });\n return deferred.promise;\n}", "function httpGetAsync(theUrl, callback)\n{\n // create the request object\n var xmlHttp = new XMLHttpRequest();\n\n // set the state change callback to capture when the response comes in\n xmlHttp.onreadystatechange = function()\n {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n {\n callback(xmlHttp.responseText);\n }\n }\n\n // open as a GET call, pass in the url and set async = True\n xmlHttp.open(\"GET\", theUrl, true);\n\n // call send with no params as they were passed in on the url string\n xmlHttp.send(null);\n\n return;\n}", "async function callWeb(url) {\n let response;\n try {\n response = await fetch(url, {\n method: \"GET\",\n });\n } catch (err) {\n return new Response(\"Fetch Error: \" + response.status);\n }\n responseString = await response.text();\n try {\n result = JSON.parse(responseString);\n return result;\n } catch (err) {\n result = responseString;\n return result;\n }\n}", "async function loadJson(url) { \n let response = await fetch(url); \n\n if (response.status == 200) {\n let json = await response.json(); \n return json;\n }\n\n throw new Error(response.status);\n}", "function fetchJSON (url) {\n\treturn new Promise((resolve, reject) => {\n\t\thttps.get(url, response => {\n\t\t\tlet data = '';\n\t\t\tresponse.on('data', d => data += d);\n\t\t\tresponse.on('end', () => resolve(JSON.parse(data)));\n\t\t}).on('error', err => reject(err));\n\t});\n}", "function getJSON(requestURL,process_function, args){\n\n var request = new XMLHttpRequest();\n request.open('GET', requestURL);\n request.responseType = 'json';\n request.send();\n\n request.onload = function() {\n if(request.status != 200) {\n linkError();\n return;\n }\n console.log(request.status);\n }\n \n}", "function getJSON(url, callback){\n // create XMLHttp request\n const xhr = new XMLHttpRequest();\n // open a request\n xhr.open('GET', url);\n // create a callback function for the callback parameter\n xhr.onload = () => {\n // conditional that checks if xhr request was success\n if(xhr.status === 200){\n let data = JSON.parse(xhr.responseText);\n return callback(data);\n }\n };\n // send the request\n xhr.send();\n}", "async function getJSON() {\n const response = await httpRequest(jsonEndPoint);\n if (response.ok) {\n return await response.text();\n } else {\n return { error: `Failed to return`};\n }\n}", "function executeJson(url, json, callback) {\n const postData = JSON.stringify(json)\n makeRequest(url, postData, callback)\n}", "async function getData(url) {\n const response = await fetch(url, { });\n console.log(response);\n return response.json(); // parses JSON response into native JavaScript objects\n}", "function httpGetAsync(theUrl, callback) {\n\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.onreadystatechange = function () {\n\t\tif (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n\t\t\tcallback(xmlHttp.responseText);\n\t}\n\txmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n\txmlHttp.send(null);\n}", "async function orangesFunction() {\r\n\r\n console.log(\"Starting Oranges Function\");\r\n\r\n // VV Trigger Java app.get Handler With\r\n // VV The Path \"/tester\"\r\n let response = await fetch(URL + \"tester\", { } );\r\n\r\n // VV Obtains Data From Java Through ctx.json(<whateverData>);\r\n // VV In This Case We Obtain A String\r\n let data = await response.json();\r\n\r\n console.log(data);\r\n console.log(\"\\n\");\r\n\r\n}", "function httpGetAsync(theUrl, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n\t\tif(xmlHttp.status == 400)\n\t\t\terror();\n\t\tif(xmlHttp.status == 404)\n\t\t\terror();\n }\n xmlHttp.open(\"GET\", \"https://cors-anywhere.herokuapp.com/\" + theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "async function readJson() {\n // $.getJSON reads JSON from a url and deserializes it\n // into a data structure\n // (writing await before $.getJSON pauses the execution\n // of the code until we have hade time to read the json)\n let persons = await $.getJSON('persons.json');\n // If you want to fetch and deserialize som JSON without\n // jQuery this is the syntax instead:\n // let persons = await (await fetch('persons.json')).json();\n console.log(persons);\n showJsonAsHtml(persons);\n}", "function apiGetJsonClbk( fullapilink, callbackfn ) {\n\n const xhr = new XMLHttpRequest();\n\n xhr.responseType = 'json';\n \n xhr.onreadystatechange = () => { if (xhr.readyState === XMLHttpRequest.DONE) { \n\n console.log( xhr.response );\n\n callbackfn( xhr.response ); \n \n } };\n\n xhr.open( 'GET', fullapilink );\n\n xhr.send();\n\n}", "getJson() {\n\n // create the new XMLHttpRequest\n var xhr = new XMLHttpRequest();\n\n // setting up the request\n xhr.open('GET', JSON_PATH, false);\n\n // when the JSON loads, parse it into an object and pass into this.parseEvents()\n xhr.onload = () => {\n this.events = this.parseEvents(JSON.parse(xhr.responseText));\n };\n\n // send the request\n xhr.send();\n\n }", "function jsonGet(url, args, access_token, cb) {\n if (args != null) {\n url = url + '?' + stringify(args)\n }\n const req = request(\n url,\n {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Authorization': `Bearer ${access_token}`\n }\n },\n (res) => { fetchResult(res, url, cb) }\n )\n\n req.on('error', (e) => {\n logger.error(`Request error for ${url}: ${e}`)\n cb(e, null, null)\n })\n req.end()\n}", "function callJson(callback) {\n var directory = window.location.href + '/getJSON';\n var xobj = new XMLHttpRequest();\n xobj.open('GET', directory, true); // Replace 'my_data' with the path to your file\n xobj.onreadystatechange = function() {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n }\n };\n xobj.send(null);\n}", "async json() {\n\t\tconst buffer = await consumeBody(this);\n\t\treturn JSON.parse(buffer.toString());\n\t}", "function httpGetAsync(theUrl, callback) {\n // create the request object\n var xmlHttp = new XMLHttpRequest();\n\n // set the state change callback to capture when the response comes in\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n callback(xmlHttp.responseText);\n }\n }\n\n // open as a GET call, pass in the url and set async = True\n xmlHttp.open(\"GET\", theUrl, true);\n\n // call send with no params as they were passed in on the url string\n xmlHttp.send(null);\n\n return;\n}", "function getJSON(url, success) {\n getUri({url: url, success: function(text) {\n if (success) {\n success(text);\n }\n }});\n}", "function fetchSync(url)\n{\n var data = fetchsync(url).json();\n return data;\n}", "async function fetchJson(url) {\n try {\n // noinspection JSUnresolvedFunction\n const request = await fetch(url);\n const text = request.text();\n return JSON.parse(text);\n }\n catch (error) {\n console.log(`ERROR: ${error.stack}`);\n }\n}", "function ajax_get(url, callback) {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n //console.log('responseText:' + xmlhttp.responseText);\n try {\n var data = JSON.parse(xmlhttp.responseText);\n } catch (err) {\n //console.log(err.message + \" in \" + xmlhttp.responseText);\n return;\n }\n callback(data);\n }\n };\n\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n}", "function getJSON(url, callback)\n{\n this.bindFunction = function(caller, object) {\n return function() {\n return caller.apply(object, [object]);\n };\n };\n\n this.stateChange = function (object) {\n if (this.request.readyState == 4) {\n var json = null;\n try {\n json = JSON.parse(this.request.responseText);\n } catch (e) {\n json = null;\n }\n this.callback(json);\n }\n };\n\n this.getRequest = function() {\n if (window.ActiveXObject)\n return new ActiveXObject('Microsoft.XMLHTTP');\n else if (window.XMLHttpRequest)\n return new XMLHttpRequest();\n return false;\n };\n\n var data = arguments[2];\n var postbody = [];\n if (data) {\n for (var name in data) {\n var value = encodeURIComponent(data[name]);\n postbody.push(name + \"=\" + value);\n }\n }\n\n this.postBody = postbody.join(\"&\");\n this.callback = callback;\n this.url = url;\n this.request = this.getRequest();\n\n if(this.request) {\n var req = this.request;\n req.onreadystatechange = this.bindFunction(this.stateChange, this);\n req.open(\"POST\", url, true);\n req.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n req.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n req.send(this.postBody);\n }\n}", "async function fetchJson(url) {\n let resp;\n try {\n let data = await fetch(url);\n resp = await data.json();\n } catch (e) {\n resp = { err: e.message };\n }\n return resp;\n}", "async function get_data(url) {\n try {\n const response = await fetch(url)\n const json = await response.json()\n return json\n } catch (error) {\n }\n}", "function returnJson(url) {\n return new Promise(function(resolve, reject) {\n return request.get(url, function(err, response, body) {\n return resolve((isJson(body) ? JSON.parse(body) : body));\n });\n });\n}", "function httpSync(url) {\r\n\t\tvar requete = makeHttpObject();\r\n\t\trequete.open(\"GET\", url, false);\r\n\t\trequete.send(null);\r\n\t\treturn requete.responseText;\r\n\t}", "function httpGetAsync(url, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", url, true); // true for asynchronous\n xmlHttp.setRequestHeader('cache-control', 'no-cache, must-revalidate, post-check=0, pre-check=0');\n xmlHttp.setRequestHeader('cache-control', 'max-age=0');\n xmlHttp.send(null);\n}", "async function getData(url){\n let res = await fetch(url);\n let body = await res.json();\n console.log(body);\n displayHTML(body);\n}", "async function loadJson(url) {\n let response = await fetch(url);\n\n if (response.status == 200) {\n let json = await response.json();\n return json;\n }\n\n throw new Error(response.status);\n}", "async get(url) {\n const res = await fetch(url);\n const json = await res.json();\n return json;\n }", "async function fetchJSON(link) {\n\tconst response = await fetch(link.toString(), { mode: \"cors\" });\n\tconst json = await response.json();\n\n\treturn json.main;\n}", "function getJSON (url,callback) {\n 'use strict';\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function () {\n var status = xhr.status;\n if (status === 200){\n callback(null, xhr.response);\n }\n else {\n callback(status, xhr.response);\n }\n };\n xhr.send();\n}", "function createObjectFromJSON(url) {\n return new Promise(function (resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n\n xhr.onload = function () {\n if (this.status == 200) {\n resolve(this.responseText);\n } else {\n var error = new Error(this.statusText);\n error.code = this.status;\n reject(error + \" \" + error.code);\n }\n };\n\n xhr.onerror = function () {\n reject(new Error(\"Network error...\"));\n };\n\n xhr.send();\n });\n}", "function loadJSON(url, callback) { \n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', url, true);\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n callback(JSON.parse(xobj.responseText));\n }\n };\n xobj.send(null); \n }", "function requestJSON(url, callback) {\n $.ajax({\n url: url,\n complete: function(xhr) {\n callback.call(null, xhr.responseJSON);\n }\n });\n }", "function getDataAsync(url, callback) {\n \n /*global XMLHttpRequest: false */\n var httpRequest = new XMLHttpRequest();\n \n httpRequest.onreadystatechange = function () {\n \n // inline function to check the status\n // of our request, this is called on every state change\n if (httpRequest.readyState === 4 && httpRequest.status === 200) {\n\n callback.call(httpRequest.responseXML);\n }\n };\n \n httpRequest.open('GET', url, false);\n httpRequest.send();\n }", "function makeAjaxCall(url, methodType){\n var promiseObj = new Promise(function(resolve, reject){\n var xhr = new XMLHttpRequest();\n xhr.open(methodType, url, true);\n xhr.send();\n xhr.onreadystatechange = function(){\n if (xhr.readyState === 4){\n if (xhr.status === 200){\n var resp = xhr.responseText;\n var respJson = JSON.parse(resp);\n console.log(respJson);\n resolve(respJson);\n } else {\n reject(xhr.status);\n }\n }\n }\n });\n return promiseObj;\n}", "async function getData() {\n let res = output;\n //variable\n let json;\n //api URL\n // const apiUrl = new URL(\"https://www.virustotal.com/vtapi/v2/url/report\");\n //URL Parameters\n let params = {\n apikey: \"c56702292505c0d8e5c0b604ed785a78d383c1c4679bcdd3eadbad8c5daee557\",\n resource: res,\n };\n\n const proxy = \"https://cors-anywhere.herokuapp.com/\";\n const url = `https://www.virustotal.com/vtapi/v2/url/report?apikey=${params.apikey}&resource=${params.resource}`;\n const finalURL = proxy + url;\n\n $.getJSON(finalURL, function (data) {\n console.log(data);\n });\n\n}", "async function getJSON() {\r\n const response = await fetch('http://68.7.7.158:8989/api/calendar?apikey=*************************&start=' \r\n + yyyy + '-' + mm + '-' + dd + '&end=' + yyyy + '-' + mm + '-' + nextdd);\r\n const json = await response.json();\r\n return json;\r\n}", "function makeAjaxRequest(url,cb){\n\t// async simulation\n\tsetTimeout(function(){\n\t\tcb('{\"id\":1, \"url\":\"' + url + '\"}');\n\t},10);\n}", "function jsonData() {\n getJSONP(jsonLink, function(data) {\n fillList(data);\n });\n}", "function httpAsync(httpMethod, url, callback) {\n var httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState == 4 && httpRequest.status == 200) {\n callback(httpRequest.responseText);\n }\n }\n httpRequest.open(httpMethod, url, true);\n httpRequest.send(null);\n}", "async function getData (url='') {\n let response = await fetch(url);\n try {\n let newData = await response.json();\n return newData;\n } catch(error) {\n alert('Something went wrong!');\n console.log(`Error: ${error}`);\n }\n}", "function getJSONdata(url) {\n\t\tvar request = new XMLHttpRequest();\n\t\trequest.open('GET', url);\n\t\trequest.onreadystatechange = function(){\n\t\t\tif((request.status==200) && (request.readyState==4)){\n\t\t\t\tconsole.log(request.responseText);\n\t\t\t}\n\t }\n \t\n\t request(send);\n }", "async function fetchJson(url) {\n const response = await fetch(url)\n if (!response.ok) {\n throw new Error(\n `Something went wrong, server responded with ${response.status}.`\n )\n }\n const json = await response.json()\n return json\n}", "function getJson(url, callback) {\n let httpRequest = new XMLHttpRequest();\n\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n return callback(JSON.parse(httpRequest.responseText));\n } else {\n console.log(\"Error\", httpRequest.status, \"on GET\", url);\n return callback(null);\n }\n }\n };\n httpRequest.open(\"GET\", url);\n httpRequest.setRequestHeader(\"Accept\", \"application/json\");\n httpRequest.send();\n}", "function requestJSON(url, callback) {\r\n $.ajax({\r\n url: url,\r\n complete: function(xhr) {\r\n callback.call(null, xhr.responseJSON);\r\n }\r\n });\r\n }", "static async get(url) {\n const response = await fetch(url);\n const data = response.json();\n // data below will be call within\n // .then(data => console.log(data))\n return data;\n }", "function asyncReq(callback) {\r\n var httpRequest = new XMLHttpRequest();\r\n httpRequest.onload = function(){ // when the request is loaded\r\n callback(httpRequest.responseText);// we're calling our method\r\n };\r\n httpRequest.open('GET', urlobs);\r\n httpRequest.send();\r\n}", "function getJSON(url, callback) { //replacement for $.getJSON\n\thttps.get(url, (response) => {\n\t\tvar body = '';\n\t\tresponse.on('data', function(d) {\n\t\t\tbody += d;\n\t\t});\n\t\tresponse.on('end', function() {\n\t\t\tcallback(null, JSON.parse(body));\n\t\t});\n\t}).on('error', function(e) { //e is a common convention for error, which is why the functino is named e\n\t\tcallback(e);\n\t});\n}", "async function restCall(url, data, method = 'POST', responseType = 'json') {\n\n const xhr = new XMLHttpRequest();\n\n return new Promise(function (resolve, reject) {\n\n xhr.open(method, url);\n\n if (data instanceof Object) {\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n data = JSON.stringify(data);\n }\n else if (typeof data === 'string') {\n xhr.setRequestHeader(\"Content-Type\", \"text/plain\");\n }\n\n xhr.responseType = responseType;\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n resolve(xhr.response);\n }\n };\n\n xhr.onerror = function (err) {\n reject(err);\n }\n\n method === 'POST' ? xhr.send(data) : xhr.send();\n\n });\n}", "async function myAsync(){\n let myVar = await fetch(\"https://swapi.dev/api/starships/9/\");\n myVar = await myVar.json();\n return myVar\n}" ]
[ "0.69577837", "0.6871555", "0.6697894", "0.6639638", "0.66031355", "0.6577278", "0.65710926", "0.65608686", "0.65596676", "0.6525416", "0.650286", "0.64965796", "0.64847726", "0.6478799", "0.64455163", "0.6435472", "0.64192384", "0.64064324", "0.6401296", "0.63964915", "0.6363811", "0.63419455", "0.6333868", "0.6332593", "0.63296884", "0.63255566", "0.6323121", "0.6320394", "0.6315852", "0.63090307", "0.6305901", "0.6291738", "0.6289925", "0.6284825", "0.6281694", "0.6281219", "0.62798905", "0.62783086", "0.6267934", "0.62351775", "0.6232902", "0.6219217", "0.62098134", "0.62020487", "0.6200469", "0.61972123", "0.6196121", "0.6195564", "0.6191583", "0.6188678", "0.61831236", "0.6182244", "0.61722", "0.6159811", "0.61514974", "0.61408174", "0.61351633", "0.6134177", "0.61336005", "0.6121759", "0.61141306", "0.6113761", "0.6113543", "0.61119187", "0.6104839", "0.60942227", "0.6085784", "0.608261", "0.60805047", "0.6078728", "0.6067235", "0.6051508", "0.6049286", "0.6048112", "0.6037577", "0.60348296", "0.6029129", "0.6027221", "0.60225", "0.6022032", "0.6020774", "0.6017911", "0.60176736", "0.6005452", "0.60053706", "0.59987646", "0.5994715", "0.59937996", "0.59910804", "0.5990729", "0.59844804", "0.59817505", "0.5981682", "0.5981457", "0.59784657", "0.5977513", "0.59728765", "0.5951468", "0.59487057", "0.5942814" ]
0.6388427
20
Analyzes the data of the JSON response, then sets the webpage text
function assignGender(data) { let dataJSON = JSON.parse(data); console.log(dataJSON); gender = dataJSON.gender; probability = dataJSON.probability; if(probability == 1) { probability = 100; } else { probability = probability * 100; } setText(name, gender, probability); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleResponse(response) {\n // the key of pages is a number so need to look for it\n if (\n typeof this.searchResponse !== typeof undefined &&\n this.searchResponse.query\n ) {\n for (var key in this.searchResponse.query.pages) {\n // skip anything that's prototype object\n if (!this.searchResponse.query.pages.hasOwnProperty(key)) continue;\n // load object response, double check we have an extract\n if (this.searchResponse.query.pages[key].extract) {\n let html = this.searchResponse.query.pages[key].extract;\n html = html.replace(/<script[\\s\\S]*?>/gi, \"&lt;script&gt;\");\n html = html.replace(/<\\/script>/gi, \"&lt;/script&gt;\");\n html = html.replace(/<style[\\s\\S]*?>/gi, \"&lt;style&gt;\");\n html = html.replace(/<\\/style>/gi, \"&lt;/style&gt;\");\n // need to innerHTML this or it won't set\n this.shadowRoot.querySelector(\"#result\").innerHTML = html;\n }\n }\n }\n }", "function parse() {\n if(this.status >= 200 && this.status < 300){\n let parsedData = JSON.parse(this.responseText);\n renderText(parsedData.message);\n } else {\n console.error(\"Invalid status\" + this.status);\n }\n}", "function handleAddingResponseToHtml(city, weather) {\n console.log(apiUrl.data);\n}", "function extractResponse() {\n // parse user login name, add it to the html\n setLoginName(validUserNameJason.login);\n // create html for repositories, pass repos url api and number of repositories\n setRepositories(validUserNameJason.repos_url, validUserNameJason.public_repos);\n // create html for followers repositories, pass followers url api and number of followers\n setFollowers(validUserNameJason.followers_url, validUserNameJason.followers);\n // show the user info html the was generated from the response\n let userSection = document.getElementById(\"userInfo\");\n showElement(userSection);\n }", "function transformResponseToJSON(details) {\n const filter = browser.webRequest.filterResponseData(details.requestId);\n const dec = new TextDecoder(\"utf-8\");\n const enc = new TextEncoder();\n let content = \"\";\n filter.ondata = (event) => {\n content = content + dec.decode(event.data);\n };\n filter.onstop = (_event) => {\n let outputDoc = '';\n try {\n const jsonObj = JSON.parse(safeStringEncodeNums(content));\n outputDoc = jsonToHTML(jsonObj, details.url);\n }\n catch (e) {\n outputDoc = errorPage(e, content, details.url);\n }\n filter.write(enc.encode(outputDoc));\n filter.disconnect();\n };\n }", "function response(err, data) {\n if (err) {\n console.err(err);\n }\n showText(data[0].label);\n}", "function fetchReport(myLink, scan_id){\n \n if (scan_id !== 'undefined' && scan_id !== null){\n alert(\"scan id not null\")\n alert(scan_id);\n var xhrobj1 = new XMLHttpRequest();\n xhrobj1.open(\"POST\", 'https://www.virustotal.com/vtapi/v2/url/report');\n var formData2 = new FormData();\n formData2.append(\"resource\",scan_id);\n formData2.append(\"format\",'json');\n formData2.append(\"apikey\",'e2d16d1525fc8e9cf957d858b79d5a11196135d9b664330db4c25eb5b1ec7051');\n xhrobj1.onreadystatechange = function() {\n if(xhrobj1.readyState == XMLHttpRequest.DONE && xhrobj1.status == 200) {\n alert(\"2 response received ....\");\n var myresponsejson2 = JSON.parse(this.responseText);\n var detected = \"\";\n alert(JSON.stringify(myresponsejson2));\n //myresponse = xhr.responseText;\n // Use 'this' keyword everywhere if this doesnt work correctly\n //alert(this.responseText);\n scans = myresponsejson2.scans;\n positives = myresponsejson2.positives;\n total = myresponsejson2.total;\n for (var key in scans){\n alert(key + \" -> \" + scans[key]['detected']);\n if (scans[key]['detected'] == true){\n detected += key \n detected += \" \"\n }\n }\n if (detected !== \"\") {\n var opt3 = {\n type: \"basic\",\n title: \"URL Analyzer - Found Suspicios URL\",\n message: \"The URL- '\"+myLink+\"' was found malicious by - \" + detected,\n iconUrl: \"icons/url-48.png\"\n };\n browser.notifications.create(opt3);\n } else{\n var opt5 = {\n type: \"basic\",\n title: \"URL Analyzer: This URL is benign!\",\n message: \"Found \"+ positives+\" positives in \"+total+\" antivirus engines\",\n iconUrl: \"icons/url-48.png\"\n };\n browser.notifications.create(opt5);\n }\n }\n }\n xhrobj1.send(formData2); \n alert(\"2 request sent\") \n }\n \n}", "function fillInResponse(response){\n $(\"#response\").text(response.responseText);\n }", "function setOutput()\n{\n\tif(httpObject.readyState == 4)\n\t\tparseJSON(httpObject.responseText);\n}", "function outputResponse(data, page) {\r\n let output = '';\r\n\r\n if (page === 'films') {\r\n data.results.forEach(item => {\r\n // Append resutls into empty output string\r\n output += `\r\n <div class=\"card m-1 p-4\" style=\"opacity:.8\">\r\n <h3 class=\"card-title text-center\" style=\"width: 18rem;\">${item.title}</h3>\r\n <div class=\"card-content\">\r\n <p class=\"card-text text-center\">Producer: ${item.producer}</p>\r\n <p class=\"card-text text-center\">Director: ${item.director}</p>\r\n <p class=\"card-text text-center\">Release date: ${item.release_date}</p>\r\n <p class=\"card-text text-center\">\r\n <span class=\"quote\">\"</span>\r\n ${item.opening_crawl}\r\n <span class=\"quote\">\"</span>\r\n </p>\r\n </div>\r\n </div>\r\n `;\r\n })\r\n }\r\n if (page === 'people') {\r\n data.results.forEach(item => {\r\n output += `\r\n <div class=\"card m-1 p-2\" style=\"opacity:.8\">\r\n <h3 class=\"card-title text-center\">${item.name}</h3>\r\n <div class=\"card-content\">\r\n <p class=\"card-text\">Gender: ${item.gender}</p>\r\n <p class=\"card-text\">Height: ${item.height}</p>\r\n <p class=\"card-text\">Weight: ${item.mass}</p>\r\n <p class=\"card-text\">Skin Colour: ${item.skin_color}</p>\r\n </div>\r\n </div>\r\n `\r\n })\r\n }\r\n\r\n if (page === 'planets') {\r\n data.results.forEach(item => {\r\n output += `\r\n <div class=\"card m-1 p-2\" style=\"opacity:.8\">\r\n <h3 class=\"card-title text-center\">${item.name}</h3>\r\n <div class=\"card-content\">\r\n <p class=\"card-text\">Diameter: ${item.diameter}</p>\r\n <p class=\"card-text\">Year Length: ${item.orbital_period} days</p>\r\n <p class=\"card-text\">Day Length: ${item.rotation_period} hours</p>\r\n <p class=\"card-text\">Terrain: ${item.terrain}</p>\r\n </div>\r\n </div>\r\n `\r\n })\r\n }\r\n\r\n if (page === 'starships') {\r\n data.results.forEach(item => {\r\n output += `\r\n <div class=\"card m-1 p-2\" style=\"opacity:.8\">\r\n <h3 class=\"card-title text-center\">${item.name}</h3>\r\n <div class=\"card-content\">\r\n <p class=\"card-text\">Crew: ${item.crew}</p>\r\n <p class=\"card-text\">Hyper Drive Class: ${item.hyperdrive_rating}</p>\r\n <p class=\"card-text\">Model: ${item.model} hours</p>\r\n <p class=\"card-text\">Passengers: ${item.passengers}</p>\r\n </div>\r\n </div>\r\n `\r\n })\r\n }\r\n // Add data to page\r\n results.innerHTML = output;\r\n}", "function displayWikiResults(responseJson) {\n const pageid= Object.keys(responseJson.query.pages)[0]\n const { extract } = responseJson.query.pages[pageid]\n $('#wiki-results').html(extract)\n $('#results').removeClass('hidden');\n}", "function processResponse(data) {\n\n if (data.status === constants.PROPERTY_API.status.SUCCESS) {\n showResultsPage(data);\n }\n else if (data.status === constants.PROPERTY_API.status.AMBIGUOUS) {\n showLocationsState(data);\n }\n else { // error\n showErrorState(data);\n }\n }", "function contentApiCallback(){\n\t\n\tvar output = \"\";\n\t\n\tif(myclient.data == null){\n \tvar display = \"<b><font color='red'>return object == null</font></b>\"\n document.getElementById(myclient.divid).innerHTML = output;\n return;\n }\n \n var textJson = gadgets.json.parse(myclient.data);\n if(!textJson){\n var display = \"<b><font color='red'>parsing results returned nothing</font></b>\"\n document.getElementById(myclient.divid).innerHTML = output;\n return;\n }\n \n var entries = textJson['search-results']['entry'];\n \n\t$.each(entries, function(i1, entry){\n \tvar title = entry['dc:title'];\n \toutput = output + (i1+1) + \". \" + title + \"<br>\";\n });\n \n document.getElementById(myclient.divid).innerHTML = \"Search results:<br>\"+output;\n}", "function jsonData(data) {\n console.log(data);\n\n data.query.pages.forEach(function (el) {\n\n var wikiContent = '<a href=\" ' + el.fullurl + ' \" target=\"_blank\"><div class=\"wiki-content\" id=\"card-' + el + '\"><h4>' + el.title + '</h4>' + el.extract + '..' + '</div></a>';\n\n document.querySelector('#search-results').innerHTML += wikiContent;\n });\n\n if (data.hasOwnProperty(\"continue\")) {\n\n document.querySelector('.btn').style.display = 'block';\n\n loadMore = data.continue.gsroffset;\n }\n}", "function getData() {\n if (xhr) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n console.log(xhr.responseText);\n // return;\n var data = JSON.parse(xhr.responseText);\n if (data.status == 1)\n switch (data.action) {\n case \"get_banner\":\n data.links.forEach(element => set_link(element));\n break;\n }\n }\n }\n }", "function handleResponse(dataId, urlId, xhr) {\n const pre = document.getElementById(dataId);\n const response = xhr.responseText;\n const body = JSON.stringify(JSON.parse(response), null, 4);\n pre.textContent = body;\n const url = document.getElementById(urlId);\n url.textContent = xhr.responseURL;\n }", "function useApiData(data) {document.querySelector(\"#content\").innerHTML = `\n<img src=\"${data.hits[0]recipe.image}\">\n<h5>${data.hits[0].recipe.label}</h5>\n<p>Source: ${data.hits[0].recipe.source}</p>\n<a href=\"${data.hits[0].recipe.url}\">Go conferir</a>\n`\n}", "function jsonLoaded(obj) {\n // 6 - if there are no results, print a message and return\n // Here, we don't get an array back, but instead a single object literal with 2 properties\n\n if (obj.status != \"success\") {\n document.querySelector(\"#content\").innerHTML = \"<p><i>There was a problem!</i></p>\";\n return; // Bail out\n }\n\n // 7 - if there is an array of results, loop through them\n let results = obj.message;\n let resultMessage = \"<p><i>Here is the result!</i></p>\";\n let bigString = \"\";\n\n for (let i = 0; i < results.length; i++) {\n let result = results[i];\n let smallURL = result;\n let url = result;\n let line = `<a target='_blank' href='${url}'><div class='result' style='background-image: url(${smallURL})'>`;\n line += `</div></a>`;\n\n bigString += line;\n }\n\n // 8 - display final results to user\n document.querySelector(\"#content\").innerHTML = bigString;\n}", "function handleResponse(resp) {\n let num =resp.data.num.num;\n let num_fact = resp.data.num.fact;\n let year = resp.data.year.year;\n let year_fact =resp.data.year.fact;\n $(\"#lucky-results\").html(`Your lucky number is ${num}. ${num_fact}. Your birth year ${year} fact is ${year_fact}`)\n}", "function showResults(json) {\n document.getElementById('results').innerHTML = `<a href=${json.html_url}>${\n json.html_url\n }</a>`;\n}", "function reqListener () {\n console.log(this.responseText);\n document.getElementById('hits').innerHTML = this.responseText;\n}", "function outputPageContent() {\n \n $('#APIdata').html(outhtml); // this prints the apidata in the blank div section in the html\n }", "function create_report() {\n // send ajax request to server\n var callback = function(responseText) {\n // tmp\n //myT = responseText;\n // end tmp\n // process response from server\n var tests = JSON.parse(responseText);\n google.charts.setOnLoadCallback( function () {\n drawAnnotations(tests);\n });\n }\n httpAsync(\"GET\", window.location.origin + '/star_tests.json' + window.location.search, callback);\n\n}", "function getResponse(data) {\n responseDiv.innerHTML = data;\n}", "function urlResponse(obj, engineTitle) {\n // create placeholder for results\n var su = document.getElementById('results');\n var resultDiv = document.createElement('div');\n su.appendChild(resultDiv);\n // if there are no errors, parse the results\n if (obj.status == 200) {\n resultDiv.className = 'searchEngine';\n var stringDom = obj.content;\n var domdata=opensocial.xmlutil.parseXML(stringDom);\n if (domdata != null) {\n var entries = domdata.getElementsByTagName('entry');\n resultDiv.innerHTML = resultDiv.innerHTML + engineTitle + ':<br/>';\n if (entries.legnth == 0) {\n resultDiv.innerHTML = resultDiv.innerHTML + ('No results found');\n } else {\n var resultCount = entries.length;\n if (resultCount > 15) {\n resultCount = 15;\n }\n for (i = 0; i < resultCount; i++) {\n if (entries[i].getElementsByTagName('title').length > 0) {\n titles = entries[i].getElementsByTagName('title');\n title = titles[0].childNodes[0].nodeValue;\n } else {\n title = 'Untitled';\n }\n var link = null;\n //for standard atom results, we can extract the link\n if (entries[i].getElementsByTagName('link').length > 0) {\n links = entries[i].getElementsByTagName('link');\n link = links[0].attributes.href.nodeValue;\n }\n var summaryNode = entries[i].getElementsByTagName('summary')[0];\n if (summaryNode == null) {\n summaryNode = entries[i].getElementsByTagName('description')[0];\n }\n if (link == null) {\n resultDiv.innerHTML = resultDiv.innerHTML\n + '<p style=\\\"color:blue\\\"/>'\n + gadgets.util.escapeString(title);\n } else {\n resultDiv.innerHTML = resultDiv.innerHTML\n + '<p style=\\\"color:blue\\\"/>'\n + '<a href=\\\"'+ link + '\\\" target=\\\"_blank\\\">'\n + gadgets.util.escapeString(title)\n + '</a>';\n }\n if (summaryNode != null) {\n var summary = summaryNode.textContent;\n if (summary != null) {\n resultDiv.innerHTML = resultDiv.innerHTML\n + gadgets.util.escapeString(summary);\n }\n }\n }\n }\n }\n } else { // errors occured, notify the user.\n resultDiv.innerHTML = resultDiv.innerHTML + engineTitle\n + '<br/> An error has occured:' + obj.status;\n }\n }", "function getJSON () {\n\n var ourRequest = new XMLHttpRequest();\n ourRequest.open('GET', 'https://thesimpsonsquoteapi.glitch.me/quotes?count=30');\n ourRequest.onload = function() {\n\n //all json data inside ourData variable.\n var ourData = JSON.parse(ourRequest.responseText);\n\n //calls function to render HTML using ourData variable.\n renderHTML(ourData);\n };\n\n //sends data request\n ourRequest.send();\n}", "function httpResponseHandler() {\n if(xmlHttp.readyState == 4 && xmlHttp.status==200) {\n responseData = JSON.parse(xmlHttp.response);\n displayAdjectiveCloud(responseData['adjective_cloud']);\n }\n }", "function responseReceivedHandler() {\r\n //this function is called when data is received\r\n if (this.status == 200) {\r\n if (this.response.error) {\r\n //put error message\r\n document.querySelector(\"#quotes\").innerHTML = this.response.error;\r\n } \r\n else {\r\n let html = \"<ol>\";\r\n for (let c = 0; c < this.response.length; c++) {\r\n const quote = this.response[c].quote;\r\n const source = this.response[c].source;\r\n html += `<li>${quote} - ${source}</li>`;\r\n }\r\n html += \"</ol>\";\r\n\r\n document.querySelector(\"#quotes\").innerHTML = html;\r\n }\r\n } \r\n}", "function showResponseText(request, search) {\n if ((request.readyState == 4) &&\n (request.status == 200)) {\n\t var rawData = request.responseText;\n\t //alert(\"raw data get\");\n\t var data = eval(\"(\" + rawData + \")\");\n\t //alert(\"data get\");\n\t search.X = data.X;\n\t search.oldX = data.oldX;\n\t search.oldy = data.oldy;\n\t search.loadModels();\n\t //var table = getTable(data);\n\t //htmlInsert(resultRegion, table);\n\t \n\t //htmlInsert(resultRegion, rawData);\n }\n}", "function page_callback(request, json) {\n\tif (json) {\n\n\t\tvar title = json.resourceURI.split('/').pop();\n\n\t\trender_navigation(d3.select('#breadcrumbs'));\n\t\trender_operations(d3.select('#operations'), json.operations)\n\n\t\td3.select('#resource-title').text(title);\n\t\trender_metadata(d3.select('#metadata'), metadata(json));\n\t\trender_acl(d3.select('#acl'), json.acl)\n\t\tclear_error_dialog();\n\n\t\tvar content_element = d3.select('#content');\n\t\tvar contents = content(json);\n\t\tif (title == 'CloudEntryPoint') {\n\t\t console.log('rendering CEP: ' + contents);\n\t\t\trender_cep(content_element, contents);\n\t\t} else if (title.match(/Collection$/)) {\n\t\t\trender_collection(content_element, contents)\n\t\t} else {\n\t\t\trender_item(content_element, contents);\n\t\t}\n\n /* update the JSON contents in the editor */\n var s = JSON.stringify(json, null, 2);\n if (editor) {\n editor.setValue(s);\n format_json();\n }\n\n\t} else {\n\t\trender_error(request);\n\t}\n}", "function theResponse(response) {\n let jsonObject = JSON.parse(response);\n cityName.innerHTML = jsonObject.name;\n icon.src =\n \"http://openweathermap.org/img/w/\" + jsonObject.weather[0].icon + \".png\";\n temperature.innerHTML = parseInt(jsonObject.main.temp - 273) + \"°\";\n humidity.innerHTML = jsonObject.main.humidity + \"%\";\n}", "async function getData(url){\n let res = await fetch(url);\n let body = await res.json();\n console.log(body);\n displayHTML(body);\n}", "function displayResult1 () {\n if (request1.readyState == 4) {\n /*responseText used to get response from server in string format.\n String format is not easily readable, so JSON.parse() method is used to convert JSON text to JS object which is easy to parse*/\n var jsonI = JSON.parse(request1.responseText); \n document.getElementById(\"outputIn\").innerHTML = jsonI.artist.name;\n document.getElementById(\"outputIs\").innerHTML = jsonI.artist.bio.summary;\n document.getElementById(\"outputIu\").innerHTML = jsonI.artist.url;\n document.getElementById(\"outputIp\").innerHTML = \"<img src = \"+jsonI.artist.image[1]['#text']+\"></img>\";\n }\n}", "function loadInfo() {\r\n\t\tvar info = JSON.parse(this.responseText);\r\n\t\tdocument.getElementById(\"title\").innerHTML = info.title;\r\n\t\tdocument.getElementById(\"author\").innerHTML = info.author;\r\n\t\tdocument.getElementById(\"stars\").innerHTML = info.stars;\r\n\t}", "function setVisitJson() {\r\n $j('#pageTitle').html(\"View Visit\");\r\n var viewdata = getRequestData('/netmd/json/view/viewVisit.json');\r\n\tvar contentForm = new form(viewdata);\r\n\t$j('#visitsInfoTab').html(contentForm.result);\t\r\n }", "function hndlr (response) {\n for (var i = 0; i < response.items.length; i++) {\n let item = response.items[i];\n // in production code, item.htmlTitle should have the HTML entities escaped.\n document.getElementById(\"imgGoogle\").innerHTML += \"<br>\" + item.htmlTitle;\n }\n }", "function fetchDataCallback(data) {\n document.getElementById(\"response\").innerHTML = data.content;\n}", "function req(url) {\n\n let req = new XMLHttpRequest();//Saves a constructor\n req.addEventListener(\"load\", function () { //Sets an eventListener with the anonymous function below, parsing the data.\n let parsedData = JSON.parse(this.responseText); //Parses the JSON-Data.\n let data = parsedData.message; //Creates a variable containing the parsed JSON-data message.\n renderText(data, url);//Calls upon the function renderText. See Chapter 2.2.\n });\n req.open(\"GET\", \"https://dog.ceo/api/breed\" + url); // Makes a GET-call to get the data from the server (itc: a list)\n req.send(); // Sends a HTTP-request to the browser.\n}", "function oneBookInfo(){\r\n\t\tif(this.status == SUCCESS){\r\n\t\t\tvar info = JSON.parse(this.responseText);\r\n\t\t\tvar title = info.title;\r\n\t\t\tdocument.getElementById(\"title\").innerHTML = title;\r\n\t\t\tvar author = info.author;\r\n\t\t\tdocument.getElementById(\"author\").innerHTML = author;\r\n\t\t\tvar stars = info.stars;\r\n\t\t\tdocument.getElementById(\"stars\").innerHTML = stars;\r\n\t\t}\r\n\t}", "function getJSON(myUrl, view) { // function that allows us to request json from a url; executes when we query our api\n var request = new XMLHttpRequest();\n request.open('GET', myUrl, true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n var data = JSON.parse(request.responseText);\n handleData(data, view); //once the data is parsed handle the data\n } else {\n console.log('The target server returned an error');\n }\n };\n\n request.onerror = function() {\n console.log('There was a connection error');\n };\n request.send()\n }", "function formatSearchResults(jsonResults) {\n\n var jsonObject = jsonResults;\n var siteCount = 0;\n\n if (jsonObject.weather.length == 0) {\n setNotFoundMessages();\n }\n else {\n\n $(\"#search-results-heading\").text(\"Search Results\");\n var formatedText = \"\";\n formatedText += \"<div class='dish-Latitude-div'>City: \" + jsonObject.name + \"</div>\";\n jsonObject.weather.forEach(\n function(item, index) {\n\n \n\n siteCount++;\n formatedText += \"<div class='dish-Latitude-div'> Weather: \" + item.main + \"</div>\";\n }\n );\n\n if (siteCount > 0) {\n $(\"#results\").html(formatedText);\n }\n else {\n setNotFoundMessages();\n }\n }\n\n}", "function testGetCharizard() {\n document.getElementById(\"httpRequest\").innerHTML = \"/Charizard\";\n fetch(baseURL + \"/Charizard\")\n .then(res => res.text())\n .then(res => {\n console.log(res);\n document.getElementById(\"httpResponse\").innerHTML = res;\n })\n}", "function websiteGoClick() {\r\n originalText = '<plaintext>';\r\n\r\n let websiteUrl = $('#website-url').val();\r\n\r\n $.get(websiteUrl, function (response) {\r\n let websiteHtml = response.responseText.replace(/&#xd;/g, '').replace(/([\\n\\r][ \\t]*){2,}/g, '\\n');\r\n $('#render').html(websiteHtml);\r\n originalText += websiteHtml;\r\n originalText += '</plaintext>';\r\n getHuffmanCodes(originalText);\r\n calculateCompression();\r\n $('#results').css('visibility', 'visible');\r\n });\r\n \r\n $('.modal-title').html(websiteUrl);\r\n}", "function getAdventureFilmovi() {\n var ruta = \"http://localhost:8080/filmovi/search/adventure\";\n var httprequest = new XMLHttpRequest();\n\n httprequest.onreadystatechange = function() {\n if (httprequest.readyState == 4) {\n\n document.getElementById(\"content\").innerHTML = httprequest.responseType; \n\n var ourAdventureData = JSON.parse(httprequest.responseText);\n renderAdventureHTML(ourAdventureData);\n console.log(ourAdventureData);\n }\n }\n\n httprequest.open(\"GET\", ruta, true);\n httprequest.send();\n}", "function tenorCallback_trending(responsetext)\n{\n // parse the json response\n var response_objects = JSON.parse(responsetext);\n\n var top_21_gifs = response_objects[\"results\"];\n\n // load the GIFs -- for our example we will load the first GIFs preview size (nanogif) and share size (tinygif)\n for(i=1; i<=21; i++){\n //document.getElementById(\"gifSearchResult\"+i).src = top_20_gifs[i-1][\"media\"][0][\"nanogif\"][\"url\"];\n document.getElementById(\"gifSearchResult\"+i).src = top_21_gifs[i-1][\"media\"][0][\"gif\"][\"url\"];\n }\n $('.cover').css('display', 'none');\n\n return;\n\n}", "function doWiki() {\n var URL = 'https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=';\n\n URL += \"&titles=\" + \"motoGP\";\n URL += \"&rvprop=content\";\n URL += \"&callback=?\";\n alert(URL);\n /* $.getJSON */\n $.getJSON(URL, function (data) {\n var obj = data.query.pages;\n var ob = Object.keys(obj)[0];\n console.log(obj[ob][\"extract\"]);\n try{\n document.getElementById(\"results\").textContent = obj[ob][\"extract\"];\n }\n catch (err) {\n document.getElementById(\"results\").textContent = err.message;\n }\n\n });\n }", "function testJson() {\n var baseUrl = 'https://rxnav.nlm.nih.gov/REST/';\n var testUrl = 'https://rxnav.nlm.nih.gov/REST/rxcui?name=xanax'\n var request = Meteor.npmRequire('request');\n request(testUrl, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var info = JSON.parse(body)\n console.log(body);\n }\n });\n }", "function testGetBulbasaur() {\n document.getElementById(\"httpRequest\").innerHTML = \"/Bulbasaur\";\n fetch(baseURL + \"/Bulbasaur\")\n .then(res => res.text())\n .then(res => {\n console.log(res);\n document.getElementById(\"httpResponse\").innerHTML = res;\n })\n}", "function useApiData(data){\n\n for (var i = 0; i < data.hits.length; i++) {\n\ndocument.querySelector(\"#content\").innerHTML+=`\n\n\n<div class=\"w3-card-4\">\n <div class=\"card-group\">\n <div class=\"w3-container w3-center\">\n <img class=\"card-img-top\" src=\"${data.hits[i].recipe.image}\" alt=\"Card image cap\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${data.hits[i].recipe.label}</h5>\n <p class=\"card-text\">${data.hits[i].recipe.healthLabels}</p>\n <br> Calories:\n ${data.hits[i].recipe.calories}\n </p>\n <a href=\"${data.hits[i].recipe.url}\" class=\"w3-button w3-green\">Source</a>\n </div>\n </div>\n </div>\n </div>\n\n <pre class=\"tab\"></pre>\n\n`\ndocument.querySelector(\"#resultnum\").innerHTML=`<p>Number of Results: </p>${data.hits.length}`\n\n}\n\n}", "function processListResponse(result) {\n //console.log(\"res:\" , JSON.parse(result).list);\n console.log(\"res:\" + result);\n // Can grab any DIV or SPAN HTML element and can then manipulate its contents dynamically via javascript\n var js = JSON.parse(result);\n var sitesList = document.getElementById('siteList');\n \n var output = \"\";\n for (var i = 0; i < js.list.length; i++) {\n var siteJson = js.list[i];\n console.log(siteJson);\n \n var url = siteJson[\"url\"];\n \n output = output + \"<div id=\\\"\" + url + \"\\\">\" +\n\t\"<br><b>\" + url + \"</b> \" +\n\t\t\"(<a href='javaScript:requestSiteDelete(\\\"\" + url + \"\\\")' style = 'filter: invert(22%) sepia(95%) saturate(7454%) hue-rotate(360deg) brightness(100%) contrast(117%)'><img src='trashcan.png' height=\" + 14 + \"></img></a>)\" + \"</><br></div>\";\n}\n \n sitesList.innerHTML = output;\n\n}", "function displayResults(responseJson){\r\n console.log(responseJson);\r\n $('#results-list').empty();\r\n for(let i=0; i<responseJson.data.length; i++){\r\n $('#results-list').append(\r\n `<li><h3>${responseJson.data[i].fullName}</h3>\r\n <a href = ${responseJson.data[i].url}>${responseJson.data[i].url}</a>\r\n <p>${responseJson.data[i].description}</p>\r\n `\r\n )};\r\n $('#results').removeClass('hidden');\r\n}", "function handleJsonRequests(index, id, id2) {\n var alchemized = $.getJSON(\"https://access.alchemyapi.com/calls/text/TextGetTextSentiment?text=\" + id + \"&apikey=85e62ad889b1b15314bb96cf6387592215231fc5&outputMode=json\", function() {\n\n })\n\n alchemized.success(function() {\n if (isNaN(Number(alchemized.responseJSON.docSentiment.score))) {\n allSentiments.push({\n id: id,\n id2: id2,\n sentiment: 0.01\n })\n } else {\n allSentiments.push({\n id: id,\n id2: id2,\n sentiment: parseFloat(alchemized.responseJSON.docSentiment.score)\n });\n visualSentiments.push(parseFloat(alchemized.responseJSON.docSentiment.score));\n\n var newHTML2 = [];\n for (var i = 0; i < allSentiments.length; i++) {\n (function(i) {\n\n var vally = allSentiments[i].sentiment;\n var sentColor = \"green\";\n if (vally === undefined || vally === null) {\n vally = 0.001\n }\n if (vally <= 0.01 && vally >= -0.01) {\n newHTML2.push('<li class=\"list-group-item list-group-item\"><h5><span>' + '<i class=\"fa fa-stack-overflow\"></i><font color=\"black\">&nbsp&nbsp' + allSentiments[i].id + '</font></span><br><a href=' + allSentiments[i].id2 + ' target=\"_blank\"><center>View full text</a></center></br></div></h5></li>');\n }\n if (vally > 0.01) {\n newHTML2.push('<li class=\"list-group-item list-group-item-success\"><h5><span>' + '<i class=\"fa fa-stack-overflow\"></i><font color=\"black\">&nbsp&nbsp' + allSentiments[i].id + '</font></span><br><a href=' + allSentiments[i].id2 + ' target=\"_blank\"><center>View full text</a></center></br></div></h5></li>');\n }\n if (vally < -0.01) {\n newHTML2.push('<li class=\"list-group-item list-group-item-danger\"><h5><span>' + '<i class=\"fa fa-stack-overflow\"></i><font color=\"black\">&nbsp&nbsp' + allSentiments[i].id + '</font></span><br><a href=' + allSentiments[i].id2 + ' target=\"_blank\"><center>View full text</a></center></br></div></h5></li>');\n }\n joinedStacks = allSentiments[i].id.join();\n\n })(i);\n\n }\n $(\"#MyEdit2\").html(newHTML2.join(\"\"));\n }\n var dataCleaner = [];\n visualSentimentsT = unique(visualSentimentsT);\n\n for (var i = 0; i < visualSentimentsT.length; i++) {\n var formatted = [visualSentimentsT[i], visualSentimentsT[i]];\n dataCleaner.push(formatted);\n }\n\n var dataCleaner2 = [];\n visualSentiments = unique(visualSentiments);\n\n for (var i = 0; i < visualSentiments.length; i++) {\n var formatted = [visualSentiments[i], visualSentiments[i]];\n dataCleaner2.push(formatted);\n }\n\n $('#container').highcharts({\n chart: {\n backgroundColor: '#ffffff',\n\n type: 'bubble',\n zoomType: 'xy'\n },\n title: {\n text: 'Radius = Sentiment'\n },\n credits: {\n enabled: false\n },\n series: [{\n name: 'Stack Overflow',\n color: '#af8dc3',\n data: dataCleaner2\n }, {\n name: 'Twitter',\n color: '#3d78dd',\n data: dataCleaner\n }]\n });\n $('#container3').highcharts({\n chart: {\n backgroundColor: '#ffffff',\n\n zoomType: 'xy'\n },\n title: {\n text: 'Sentiment Spline'\n },\n credits: {\n enabled: false\n },\n series: [{\n name: 'Stack Overflow',\n type: 'spline',\n color: '#af8dc3',\n data: visualSentiments\n }, {\n name: 'Twitter',\n type: 'spline',\n color: '#3d78dd',\n data: visualSentimentsT\n }]\n });\n twAvg = average(visualSentimentsT);\n sOAvg = average(visualSentiments);\n $('#container2').highcharts({\n chart: {\n\n backgroundColor: '#ffffff',\n type: 'column',\n zoomType: 'xy'\n },\n title: {\n text: 'Average Sentiment'\n },\n\n legend: {\n enabled: false\n },\n xAxis: {\n categories: true\n },\n\n plotOptions: {\n series: {\n borderWidth: 0,\n dataLabels: {\n enabled: false\n }\n }\n },\n\n series: [{\n name: 'All Sentiment Points',\n colorByPoint: true,\n data: [{\n name: 'Twitter',\n color: '#af8dc3',\n y: twAvg,\n drilldown: 'twitter'\n }, {\n name: 'stackoverflow',\n y: sOAvg,\n color: '#3d78dd',\n drilldown: 'stackoverflow'\n }]\n }],\n drilldown: {\n series: [{\n id: 'twitter',\n data: dataCleaner\n }, {\n id: 'stackoverflow',\n data: dataCleaner2\n }]\n }\n });\n\n if (flag === false) {\n var alchemizedEntities = $.getJSON(\"https://access.alchemyapi.com/calls/text/TextGetCombinedData?text=\" + joinedTweets + \"&apikey=85e62ad889b1b15314bb96cf6387592215231fc5&outputMode=json\", function() {})\n alchemizedEntities.complete(function() {\n flag = true;\n if (textAnalyzed.length < 3) {\n\n textAnalyzed.push('<li class=\"list-group-item list-group-item-warning\"><font color=\"black\"><h4>' + 'Keyword : <b><i>' + alchemizedEntities.responseJSON.keywords[0].text + '</b></i><br> Relevance=<b><i> ' + alchemizedEntities.responseJSON.keywords[0].relevance + '</i></b></div></font></h5></li>');\n textAnalyzed.push('<li class=\"list-group-item list-group-item-warning\"><font color=\"black\"><h4>' + 'Keyword : <b><i>' + alchemizedEntities.responseJSON.keywords[1].text + '</b></i><br> Relevance=<b><i> ' + alchemizedEntities.responseJSON.keywords[1].relevance + '</i></b></div></font></h5></li>');\n textAnalyzed.push('<li class=\"list-group-item list-group-item-warning\"><font color=\"black\"><h4>' + 'Keyword : <b><i>' + alchemizedEntities.responseJSON.keywords[2].text + '</b></i><br> Relevance=<b><i> ' + alchemizedEntities.responseJSON.keywords[2].relevance + '</i></b></div></font></h5></li>');\n\n taxonomy.push('<li class=\"list-group-item list-group-item-warning\"><font color=\"black\"><h4>' + 'Grouping : <b><i>' + alchemizedEntities.responseJSON.taxonomy[0].label + '</b></i><br> Score=<b><i> ' + alchemizedEntities.responseJSON.taxonomy[0].score + '</i></b></div></font></h5></li>');\n taxonomy.push('<li class=\"list-group-item list-group-item-warning\"><font color=\"black\"><h4>' + 'Grouping : <b><i>' + alchemizedEntities.responseJSON.taxonomy[1].label + '</b></i><br> Score=<b><i> ' + alchemizedEntities.responseJSON.taxonomy[1].score + '</i></b></div></font></h5></li>');\n taxonomy.push('<li class=\"list-group-item list-group-item-warning\"><font color=\"black\"><h4>' + 'Grouping : <b><i>' + alchemizedEntities.responseJSON.taxonomy[2].label + '</b></i><br> Score=<b><i> ' + alchemizedEntities.responseJSON.taxonomy[2].score + '</i></b></div></font></h5></li>');\n\n\n }\n $(\"#ents1\").html(textAnalyzed.join(\"\"));\n $(\"#ents2\").html(taxonomy.join(\"\"));\n })\n }\n var alchemizedEntities2 = $.getJSON(\"https://access.alchemyapi.com/calls/text/TextGetCombinedData?text=\" + joinedStacks + \"&apikey=85e62ad889b1b15314bb96cf6387592215231fc5&outputMode=json\", function() {})\n alchemizedEntities2.complete(function() {\n if (textAnalyzed2.length < 3) {\n textAnalyzed2.push('<li class=\"list-group-item list-group-item-info\"><font color=\"black\"><h4>' + 'Keyword : <b><i>' + alchemizedEntities2.responseJSON.keywords[0].text + '</b></i><br> Relevance=<b><i> ' + alchemizedEntities2.responseJSON.keywords[0].relevance + '</i></b></div></font></h5></li>');\n textAnalyzed2.push('<li class=\"list-group-item list-group-item-info\"><font color=\"black\"><h4>' + 'Keyword : <b><i>' + alchemizedEntities2.responseJSON.keywords[1].text + '</b></i><br> Relevance=<b><i> ' + alchemizedEntities2.responseJSON.keywords[1].relevance + '</i></b></div></font></h5></li>');\n\n taxonomy2.push('<li class=\"list-group-item list-group-item-info\"><font color=\"black\"><h4>' + 'Grouping : <b><i>' + alchemizedEntities2.responseJSON.taxonomy[0].label + '</b></i><br> Score=<b><i> ' + alchemizedEntities2.responseJSON.taxonomy[0].score + '</i></b></div></font></h5></li>');\n taxonomy2.push('<li class=\"list-group-item list-group-item-info\"><font color=\"black\"><h4>' + 'Grouping : <b><i>' + alchemizedEntities2.responseJSON.taxonomy[1].label + '</b></i><br> Score=<b><i> ' + alchemizedEntities2.responseJSON.taxonomy[1].score + '</i></b></div></font></h5></li>');\n taxonomy2.push('<li class=\"list-group-item list-group-item-info\"><font color=\"black\"><h4>' + 'Grouping : <b><i>' + alchemizedEntities2.responseJSON.taxonomy[2].label + '</b></i><br> Score=<b><i> ' + alchemizedEntities2.responseJSON.taxonomy[2].score + '</i></b></div></font></h5></li>');\n\n }\n $(\"#ents3\").html(textAnalyzed2.join(\"\"));\n $(\"#ents4\").html(taxonomy2.join(\"\"));\n })\n });\n\n }", "function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let content = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = content.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n description = content.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('contentDisplay').innerHTML =description;\r\n //console.log(content); \r\n // access summary brute force \r\n //let summary = page[pageID].revisions[0][\"*\"][10];\r\n //console.log('SUMMARY' + summary);\r\n }", "function displayResults(responseJson) {\n console.log(responseJson);\n $('.js-results').empty();\n // Clears previous results\n for (let i = 0; i < responseJson.data.length; i++) {\n //iterates through the items array\n $('.js-results').append(`\n <li><h2>${responseJson.data[i].fullName}</h2></li>\n <li><p>${responseJson.data[i].description}</p></li>\n <li><h3>Address</h3></li>\n <li><p>${formatAddress(responseJson, i)}</p></li>\n <li><a href=\"${responseJson.data[i].url}\">Click here for ${responseJson.data[i].fullName} website</a></li>\n `);\n $('#results').removeClass('hidden');\n //lists the national park's name, description, address and website url\n }\n}", "function displayResults(responseJson) {\n console.log(responseJson);\n }", "function displaySearchResults(responseJson) {\n console.log(responseJson); // pulling the correct information when testing\n const results = []; \n // \n for (let i = 0; i < responseJson.length; i++) { // for loop to push results into results\n results.push(`\n <p><a href='${responseJson[i].html_url}'>${responseJson[i].name}</a></p><hr>\n `);\n }\n $('#js-search-results').html(results.join('')); // target and generate html string of loop results\n}", "function getData (){\n var carData = JSON.parse(this.responseText).cars;\n carInfo(carData);\n }", "async function getPage() {\n try {\n let response = await fetch(\n `https://stock-exchange-dot-full-stack-course-services.ew.r.appspot.com/api/v3/company/profile/${symbol}`\n );\n // FETCHES THE API ASYNC\n let result = await response.json();\n // RETURNS THE API.JSON\n logo.innerHTML = `<a href= '${result.profile.website}'><img src= '${result.profile.image}' onerror=\"this.onerror=null;this.src='https://financialmodelingprep.com/image-stock/PEER.jpg'\"> </img><br>${result.profile.website}</a>`;\n // LOGO IMAGE AND WEBSITE LINK\n name.innerHTML = `<h1>${result.profile.companyName}<h1>`;\n // COMPANY NAME\n description.innerHTML = `<p>${result.profile.description}</p>`;\n // COMPANY DESCRIPTION\n price.innerHTML = `<h2>$${result.profile.price}<h2>`;\n // RETOOLING OF THE INNERHTML\n let changes = result.profile.changesPercentage;\n let changeDiff = result.profile.changes;\n if (changeDiff < 0) {\n change.classList.add(\"red\");\n } else if (changeDiff === 0) {\n change.classList.add(\"white\");\n } else change.classList.add(\"green\");\n change.innerHTML = `<h3>${changes}<h3>`;\n } catch (error) {\n console.log(error);\n // CONSOLE.LOGS THE ERROR FROM THE FETCH REQUEST, ERROR GIVEN BY API SERVER\n }\n}", "function loadDemoPage_1 () {\n console.log ('\\n ====== loadDemoPage_1 ..3 =======\\n');\n\n \n fetch ('https://jsonplaceholder.typicode.com')\n // input = the fetch reponse which is an html page content\n // output to the next then() ==>> we convert it to text\n .then (response => response.text())\n // input text, which represnts html page\n // & we assign it to the page body\n .then (htmlAsText => {\n document.body.innerHTML = htmlAsText;\n });\n}", "function renderCvtPage(data) { \n // get cvt data from API call...\n $.getJSON(\"api/cvt\", function(data) {\n // generate the proper HTML...\n generateAllCvtHTML(data);\n\n var page = $('.cvt-report');\n page.addClass('visible'); \n });\n }", "function tenorCallback_search(responsetext) {\n // parse the json response\n var response_objects = JSON.parse(responsetext);\n res = response_objects[\"results\"];\n\n // load the GIFs -- for our example we will load the first GIFs preview size (nanogif) and share size (tinygif)\n // document.getElementById(\"preview_gif\").src = top_10_gifs[0][\"media\"][0][\"nanogif\"][\"url\"];\n // document.getElementById(\"share_gif\").src = \n return res[0][\"media\"][0][\"tinygif\"][\"url\"];;\n}", "function UpdateJsonTab(content) {\n var text = \"Language detection:\\n\"\n + JSON.stringify(content[\"language\"], null, 2) + \"\\n\\n\"\n + \"Key phrases:\\n\"\n + JSON.stringify(content[\"keyPhrases\"], null, 2) + \"\\n\\n\"\n + \"Sentiment:\\n\"\n + JSON.stringify(content[\"sentiment\"], null, 2);\n\n $('#AnalysisJsonResults').text(text);\n}", "function detail_result(json_parse) {\n\n document.getElementsByClassName('panel')[0].className = \"panel panel-default show\"\n document.getElementsByClassName('panel-heading')[0].innerHTML = '<strong>' + json_parse.Title + '</strong><br/>(' + json_parse.Released + ')'\n document.getElementsByClassName('panel-body')[0].innerHTML = '<div class=\"detail_holder\">' +\n '<div><strong>Genre:</strong>&nbsp;&nbsp;' + json_parse.Genre + '</div>' +\n '<div><strong>Starring:</strong>&nbsp;&nbsp;' + json_parse.Actors + '</div>' +\n '<div>' + json_parse.Plot + '</div>' +\n '</div>'\n \n \n \n}", "function getHTML(url){\n axios.get(url).then(response => {\n parseHTML(response.data);\n }).catch(error => {\n console.log(error); \n });\n}", "function scrape(url, data, cb) {\n // 1. Create the request\n req(url, (err, body) => {\n if (err) { return cb(err); }\n\n // 2. Parse the HTML\n let $ = cheerio.load(body)\n , pageData = {}\n ;\n // 3. Extract the data\n Object.keys(data).forEach(k => {\n pageData[k] = $(data[k]).text();\n});\n\n // Send the data in the callback\n cb(null, pageData);\n});\n}", "function handleResponse(resp) {\n // console.log(resp)\n if (resp.data.error) {\n for (let err in resp.data.error) {\n $(`#${err}-err`).append(`<p>${resp.data.error[err]}</p>`)\n }\n }\n else {\n $(\"#lucky-results\").append(`<p>Your lucky number is ${resp.data.num.num} (${resp.data.num.fact})</p>`)\n $(\"#lucky-results\").append(`<p>Your birth year is ${resp.data.year.year} (${resp.data.year.fact})</p>`)\n }\n}", "function HandleResponse(response) {\n if (response.status !== 200) {\n console.log('Looks like there was a problem. Status Code: ' +\n response.status);\n return;\n }\n\n // Examine the text in the response\n response.json().then(function (data) {\n console.log(data);\n });\n}", "function handleHttpResponse5() {\r\n if (http5.readyState == 4) {\r\n try {\r\n console.log(http5.responseText);\r\n result = JSON.parse(http5.responseText.trim());\r\n } catch (e) {\r\n console.error(\"Parsing error:\", e); \r\n console.error(\"Response\", http5.responseText); \r\n }\r\n if (result && result.hasOwnProperty(\"return\") && result.return.hasOwnProperty(\"recordsFound\") && result.return.recordsFound != \"0\") {\r\n // initialisation des variables target\r\n var atitle = '';\r\n var authorsf = '';\r\n var journal = '';\r\n var annee = '';\r\n var vol = '';\r\n var no = '';\r\n var pages = '';\r\n var issn = '';\r\n var pmid = '';\r\n var isiid = '';\r\n var doi = '';\r\n var notesn = '';\r\n // fin initialisation\r\n if (result.return.records.hasOwnProperty(\"title\")) {\r\n atitle = result.return.records.title.value;\r\n }\r\n if(result.return.records.hasOwnProperty(\"doctype\")){\r\n doctype = result.return.records.doctype.value.toLowerCase();\r\n }\r\n if (result.return.records.hasOwnProperty(\"authors\")) {\r\n console.log(typeof result.return.records.authors.value);\r\n if(Array.isArray(result.return.records.authors.value)){\r\n authorsf = result.return.records.authors.value.join(\"; \");\r\n }\r\n else{\r\n authorsf = result.return.records.authors.value;\r\n }\r\n }\r\n if (result.return.records.hasOwnProperty(\"source\")) {\r\n var inode;\r\n for (var i in result.return.records.source) {\r\n inode = result.return.records.source[i];\r\n switch(inode.label) {\r\n case \"Volume\":\r\n vol = inode.value;\r\n break;\r\n case \"Issue\":\r\n no = inode.value;\r\n break;\r\n case \"Pages\":\r\n pages = inode.value;\r\n break;\r\n case \"SourceTitle\":\r\n journal = inode.value;\r\n break;\r\n case \"Published.BiblioYear\":\r\n annee = inode.value;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (result.return.records.hasOwnProperty(\"other\"))\r\n {\r\n for (var i in result.return.records.other) {\r\n inode = result.return.records.other[i];\r\n switch(inode.label)\r\n {\r\n case \"Identifier.Doi\":\r\n doi = inode.value;\r\n break;\r\n case \"Identifier.Issn\":\r\n issn = inode.value;\r\n break;\r\n case \"Identifier.Ids\":\r\n isiid = inode.value;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (doi !== '')\r\n {\r\n notesn = \"DOI:\" + doi;\r\n }\r\n\r\n document.commande.genre.value = doctype;\r\n document.commande.atitle.value = atitle;\r\n document.commande.title.value = journal;\r\n document.commande.auteurs.value = authorsf;\r\n document.commande.date.value = annee;\r\n document.commande.volume.value = vol;\r\n document.commande.issue.value = no;\r\n document.commande.pages.value = pages;\r\n document.commande.issn.value = issn;\r\n document.commande.uid.value = \"WOSUT:\" + document.commande.uids.value;\r\n document.commande.remarquespub.value = notesn;\r\n isWorking5 = false;\r\n // entryForm.submit();\r\n }\r\n // Message d'erreur si le WOSID n'est pas valable\r\n else \r\n if ( result && result.hasOwnProperty(\"return\") && result.return.hasOwnProperty(\"recordsFound\") && result.return.recordsFound == \"0\") {\r\n alert('WOS ID not found, please check your reference');\r\n isWorking5 = false;\r\n }\r\n else\r\n {\r\n alert(\"La recherche n'a pas abouti: le service distant n'a pas repondu\");\r\n isWorking5 = false;\r\n }\r\n }\r\n}", "function parse_data(page_text) {\r\n var sub_total = 0;\r\n var rejected_rewards = 0;\r\n var rejected = 0;\r\n var index = 0;\r\n var page_html = document.createElement('div');\r\n var data = { hits: 0, rewards: 0, rejected: 0, rejected_rewards: 0 };\r\n page_html.innerHTML = page_text;\r\n\r\n var amounts = page_html.getElementsByClassName('statusdetailAmountColumnValue');\r\n var statuses = page_html.getElementsByClassName('statusdetailStatusColumnValue');\r\n\r\n for(var k = 0; k < amounts.length; k++)\r\n {\r\n if(statuses[k].innerHTML == 'Rejected') {\r\n data.rejected += 1;\r\n index = amounts[k].innerHTML.indexOf('$');\r\n data.rejected_rewards += parseFloat(amounts[k].innerHTML.substring(index+1));\r\n }\r\n else {\r\n index = amounts[k].innerHTML.indexOf('$');\r\n data.rewards += parseFloat(amounts[k].innerHTML.substring(index+1));\r\n }\r\n }\r\n data.hits = amounts.length;\r\n return data;\r\n}", "function Fill_With_JSON(_url) {\n\t\tvar API_Call = require('ui/apiCalling/call_with_indicator');\n\t\tnew API_Call('GET', _url, null, activityIndicator, function(json) {\n\t\t\trenderJson(json);\n\t\t});\n\t}", "function responseReceivedHandler() {\n if ( !this.response[ \"error\" ] ) {\n let html = \"<ol>\";\n this.response.forEach( elm => {\n html += `<li>${ elm.quote } - ${ elm.source }</li>`;\n });\n html += \"</ol>\";\n document.querySelector(\"#quotes\").innerHTML = html;\n } else {\n document.querySelector(\"#quotes\").innerHTML = this.response[ \"error\" ];\n }\n}", "function managePageJSON(data) {\n var j;\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n var document_id = null;\n for (var key in obj) {\n if (key === \"DocumentId\") {\n document_id = data[i][key];\n }\n }\n\n if (!data[i].Contents) {\n continue;\n }\n var html = $.parseHTML(data[i].Contents);\n var hrefNodes = $(html).find(\"[href]\");\n for (j = 0; j < hrefNodes.length; j++) {\n var node = hrefNodes[j];\n if (!node.attributes[\"href\"]) {\n continue;\n }\n var hrefValue = node.attributes[\"href\"].value;\n if (hrefValue.toLowerCase().indexOf(\"http\") === -1) {\n var newStr = '';\n var splittedArray = '';\n if (hrefValue.toLowerCase().indexOf(\"$filter=contains\") > -1) {\n\n splittedArray = hrefValue.split(\"'\");\n // //var pageTitle = null;\n // //if (splittedArray[1]) {\n // // pageTitle = splittedArray[1];\n // // pageTitle = pageTitle.replace(/ /g, \"_\");\n // //}\n\n // //var docId = null;\n // //if (splittedArray[3]) {\n // // docId = splittedArray[3];\n // //}\n\n // //var pageId = docId + \"_\" + pageTitle;\n // //newStr = \"#/document/\" + docId + \"/page/\" + pageId;\n // //hrefNodes[j].attributes[\"href\"].value = newStr;\n } else {\n splittedArray = hrefValue.split(\"'\");\n var page_id = null;\n if (splittedArray[1]) {\n page_id = splittedArray[1];\n }\n newStr = \"#/document/\" + document_id + \"/page/\" + page_id;\n\n hrefNodes[j].attributes[\"href\"].value = newStr;\n }\n }\n }\n\n //Re-assign to data\n var htmlStr = \"\";\n for (j = 0; j < html.length; j++) {\n if (html[j].nodeName === \"#text\") {\n continue;\n }\n if (html[j].nodeName === \"META\" || html[j].nodeName === \"LINK\") {\n continue;\n }\n var ss = html[j].outerHTML;\n htmlStr += ss;\n }\n data[i].Contents = htmlStr;\n }\n return data;\n }", "function testGetNULLPokemon() {\n document.getElementById(\"httpRequest\").innerHTML = \"/abcde\";\n fetch(baseURL + \"/abcde\")\n .then(res => res.text())\n .then(res => {\n console.log(res);\n document.getElementById(\"httpResponse\").innerHTML = res;\n })\n}", "function reqListener1(){\n var response = JSON.parse(this.responseText);\n var person4Home = document.getElementById('person4HomeWorld');\n person4Home.innerHTML = response.name;\n }", "function jsonToHTML (data) {\n \n var html;\n \n \n \n return html;\n}", "function createHTML(responseJson) {\n $('#results-list').empty();\n for (let i = 0; i < responseJson.data.length; i++){\n const physicalAddress = responseJson.data[i].addresses.find(addy => addy.type === 'Physical');\n $('#results-list').append(\n `<li><h3>${responseJson.data[i].fullName}</h3>\n <p>${responseJson.data[i].description}</p>\n <address>\n <p>${physicalAddress.line1}</p>\n <p>${physicalAddress.line2} ${physicalAddress.line3}</p>\n <p>${physicalAddress.city}, ${physicalAddress.stateCode} ${physicalAddress.postalCode}</p>\n </address>\n <p><a href='${responseJson.data[i].url}'>Click for More Info</a></p>\n </li>`\n );\n }\n $('#results').removeClass('hidden');\n}", "function tenorCallback_search(responsetext)\n{\n // parse the json response\n var response_objects = JSON.parse(responsetext);\n\n top_10_gifs = response_objects[\"results\"];\n\n // load the GIFs -- for our example we will load the first GIFs preview size (nanogif) and share size (tinygif)\n\n // document.getElementById(\"preview_gif\").src = top_10_gifs[0][\"media\"][0][\"nanogif\"][\"url\"];\n\n document.getElementById(\"share_gif\").src = top_10_gifs[0][\"media\"][0][\"tinygif\"][\"url\"];\n\n return;\n\n}", "function alertContents() {\n\tif(httpRequest.readyState === 4) {\n\t\tif (httpRequest.status === 200) {\n\t\t\tJSONObj = JSON.parse(httpRequest.responseText);\n\t\t} else {\n\t\t\talert('There was a problem with the request.'); \n\t\t}\n\t}\n\tJSONObj = filter(JSONObj);\n\tgenerateGistList(JSONObj); \n}", "function TreatResponse(response) {\n console.log(response);\n var text = response.response;\n if (text == GET) {\n showGetTranslation();\n }\n else if (text == NO_THANKS) {\n $(\"#header\").html(NO_THANKS).removeClass(\"hide\").show();\n }\n else {\n $(\"#header\").html(\"This is the current translation. Do you approve?\").removeClass(\"hide\").show();\n $(\"#translation-card\").removeClass(\"hide\").show();\n console.log(text);\n $(\"#content\").html(text);\n }\n}", "function onSuccess(responseData) {\n console.log(responseData)\n responseData.Search.forEach(function(movie)\n {console.log(movie.Title)\n\n $('.movielist').append($('<p>').text(movie.Title));\n\n\n });\n \n //console.log(\"test\");\n // celebrate!\n}", "function getData2()\n{\n\t//alert(xHRObject.responseText);\n\tif ((xHRObject.readyState == 4) &&(xHRObject.status == 200))\n\t{\n\tvar spantag = document.getElementById(\"output1\");\n\tspantag.innerHTML = xHRObject.responseText;\n\t}\n}", "function getData() {\n\n var charURL = \"https://www.anapioficeandfire.com/api/characters?page=\" + defPageNum + \"&pageSize=10\";\n\n \n $.ajax({\n url: charURL,\n method: \"GET\"\n }).done(function (response) {\n // $(\"#div1\").text(JSON.stringify(response));\n\n console.log(response);\n\n //for look will filter through array response & then append with the below code\n for (var i = 0; i < response.length; i++) {\n\n var tableRow = $(\"<tr>\");\n var nameTd = $(\"<td scope = 'col'>\");\n var cultureTd = $(\"<td scope = 'col'>\");\n var bornTd = $(\"<td scope = 'col'>\");\n var diedTd = $(\"<td scope = 'col'>\");\n var titlesTd = $(\"<td scope = 'col'>\");\n var aliasesTd = $(\"<td scope = 'col'>\");\n var allegianceTd = $(\"<td scope = 'col'>\");\n var playedByTd = $(\"<td scope = 'col'>\");\n\n nameTd.text(response[i].name);\n cultureTd.text(response[i].culture);\n bornTd.text(response[i].born);\n diedTd.text(response[i].died);\n titlesTd.text(response[i].titles);\n aliasesTd.text(response[i].aliases);\n allegianceTd.text(response[i].allegiance);\n playedByTd.text(response[i].playedBy);\n\n tableRow.append(nameTd, cultureTd, bornTd, diedTd, titlesTd, aliasesTd, allegianceTd, playedByTd);;\n\n $(\"#tableBody\").append(tableRow);\n\n //character URL with default page size of 10 and page number that can decrease + increase with buttons\n \n //default page number\n\n console.log(charURL);\n };\n });\n}", "function loaded(error, response, body) {\n // Check for errors\n if (!error && response.statusCode == 200) {\n // The raw HTML is in body\n res.send(body);\n } else {\n res.send(response);\n }\n }", "function displayResults(json) {\n let photographer = json;\n let heading = document.createElement('h1');\n section.appendChild(heading);\n heading.textContent = photographer;\n }", "function processResponse() {\n // readyState of 4 signifies request is complete\n if (xhr.readyState == 4) {\n // status of 200 signifies sucessful HTTP call\n if (xhr.status == 200) {\n pageChangeResponseHandler(xhr.responseText);\n }\n }\n }", "function gifts() {\n\tlet gDisplay = document.getElementById('display');\n\tvar xhr = new XMLHttpRequest();\n\txhr.onreadystatechange = function(){\n\t\tconsole.log(xhr.readyState);\n\t\tif((xhr.readyState === 4) & (xhr.status === 200)) {\n\t\t\tgDisplay.innerHTML = xhr.responseText;\n\t\t}\n\t\t\n\t}\n\txhr.open('get', 'https://api.myjson.com/bins/iw60z');\n\txhr.send();\n}", "function display_vt(id, content) {\n try {\n json = JSON.parse(content);\n console.log(json);\n count = json.length; //count how many entries are in the JSON array\n var vt = \"\";\n var i;\n if (count == 0 || count == null) {\n vt = \"No VirusTotal Resolution Entries for IP\";\n } else {\n for (i=0; i < count; i++) {\n vt += \"Resolution \" \n + (i+1) \n + \": <br><div class='lead'>\" \n + json[i].attributes.host_name \n + \"</div><br>\\n\";\n }\n }\n } catch (e) {\n console.log(\"Error \" + e + \"Parsing VT JSON\");\n vt = \"Error retrieving Data\";\n } \n\n document.getElementById(id).innerHTML = vt;\n}", "function processResponse(respObj) {\r\n $(position1).html(respObj);\r\n }", "function displayResults(responseJson) {\n console.log(responseJson);\n for(let i = 0; i < responseJson.length; i++) {\n console.log(responseJson[i].name);\n const listItem = '<li><a href=\"' + responseJson[i].html_url + '\" target=\"_blank\">' \n + responseJson[i].name \n +'</a></li>';\n $('#results-list').append(listItem);\n }\n $('#results').removeClass('hidden');\n}", "function nextResponse() {\n $.ajax({\n url: nextUrl,\n method: \"GET\",\n success: function (response) {\n console.log(\"response log:\", response);\n response = response.artists || response.albums;\n resultsDiv.append(getResultsHtml(response.items));\n handleNextUrl(response.next);\n checkScrollPos();\n },\n });\n }", "function getComedyFilmovi() {\n var ruta = \"http://localhost:8080/filmovi/search/comedy\";\n var httprequest = new XMLHttpRequest();\n\n httprequest.onreadystatechange = function() {\n if (httprequest.readyState == 4) {\n\n document.getElementById(\"content\").innerHTML = httprequest.responseType; \n\n var ourComedyData = JSON.parse(httprequest.responseText);\n renderComedyHTML(ourComedyData);\n console.log(ourComedyData);\n }\n }\n\n httprequest.open(\"GET\", ruta, true);\n httprequest.send();\n}", "function grab_data(data){\n try {\n if (http_req.readyState === XMLHttpRequest.DONE) {\n if (http_req.status === 200) {\n // parse responseText\n db_verguenza = JSON.parse(http_req.responseText)\n } else {\n console.log(\"status problem\");\n }\n }\n } catch (e) {\n console.log(\"Ups! Something's wrong D:\\n\" +e);\n }\n // display data after getting it\n display_data();\n}", "function getJSON() {\n fetch(url_ft2)\n .then(resp => resp.json()) // Transform the data into json\n .then(function(data) {\n // display translation\n document.getElementById(\"translated\").innerHTML =\n data.contents.translated;\n })\n .catch(function(error) {\n document.getElementById(\"translated\").innerHTML =\n \"Error with Fun Translations: \" + error;\n document.getElementById(\"translated\").style.color = \"red\";\n });\n} // getJSON", "function getStudyContent(response, postData) {\n\n\t// Website you wish to allow to connect\n\tresponse.setHeader('Access-Control-Allow-Origin', 'http://localhost:5555');\n\t// Request methods you wish to allow\n\tresponse.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');\n\t// Request headers you wish to allow\n\tresponse.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');\n\n\tresponse.writeHead(200, {\"Content-Type\": \"text/json\"});\n\n\tvar content = '<h2>Stadijas virsraksts</h2><i>Stadijas teksts italic</i>';\n\tresponse.write(content);\n\tresponse.end();\n}", "function onloaded(e){\n\t\t\n\t\tif (this.status == 200) {\n\t\t\t\n\t\t\t// We will need to deserialize the JSON into an object that we can easily work with\n\t\t\tvar results = JSON.parse(this.responseText);\n\t\t\t\n\t\t\t// Let't grab the show title and display on the screen.\n\t\t\t$('#results').text(results.d.Title);\n\t\t\n\t\t}\n\t}", "function alertContents(req){\r\n if(req.readyState==XMLHttpRequest.DONE){\r\n if(req.status == 200){\r\n //variable pour recolter les donnee json\r\n let response = JSON.parse(req.responseText)\r\n document.getElementById(\"quote\").innerHTML = response[\"quote\"];\r\n document.getElementById(\"photo\").innerHTML = `<img class=\"tof\" src = ${response[\"photo\"]}/>`;\r\n document.getElementById(\"auteur\").innerHTML = response[\"author\"];\r\n }\r\n else{\r\n alert(\"Il y a un problème\")\r\n }\r\n }\r\n }", "function displayResults(responseJson) {\n console.log('displayResults ran');\n //When data is ready - hides progress indicator\n $(responseJson).ready(function () {\n $('.loading').addClass('hidden')\n })\n console.log(responseJson)\n //data is an object within the nps JSON that contains the info we want and whose value is an array\n let parkData = responseJson.data\n console.log(parkData.length)\n //initialize string to hold html for DOM manipulation\n let parkHTML = ''\n //Loop through data and extract name, description, website link, and addresses and prep data to be displayed as HTML\n for (let i = 0; i < parkData.length; i++) {\n parkHTML += `\n <div class=\"result-item\"><li><h3>${parkData[i].name}</h3>\n <p class=\"park-description\">${parkData[i].description}</p>\n <a href=\"${parkData[i].url}\">${parkData[i].url}</a>\n <div id=\"addresses\">\n <h4>Addresses</h4>\n `\n for (let x = 0; x < parkData[i].addresses.length; x++) {\n parkHTML += `\n \n <h5>${parkData[i].addresses[x].type}:</h5>\n <p class=\"addresses\">${parkData[i].addresses[x].line1}</p>\n <p class=\"addresses\">${parkData[i].addresses[x].line2}</p>\n <p class=\"addresses\">${parkData[i].addresses[x].line3}</p>\n <p class=\"addresses\">${parkData[i].addresses[x].city}, ${parkData[i].addresses[x].stateCode}, ${parkData[i].addresses[x].postalCode}</p>\n `\n }\n parkHTML += `</div></li></div>`\n }\n // append extracted data \n $('.js-results').append(parkHTML)\n //removes hidden class to display results\n $('.js-results').removeClass('hidden')\n\n}", "function processResponse(html) {\n\t\n\tvar jsonData = $.parseJSON(html);\n\t\n\tif (jsonData.status == 1) {\n\t\twindow.location=\"approvalneeded.html\";\n\t}\n\telse if (jsonData.status == -1) {\n\t\t\n\t\tif (jsonData.errorText == \"Email Taken\") {\n\t\t\temailTaken();\n\t\t} \n\t\telse {\n\t\t\t$(\"body\").html(\"Error loading page. Please contact the administrator with this message: \"+jsonData.errorText);\n\t\t}\n\t}\n\telse {\n\t\t$(\"body\").html(\"Error loading page. Check your internet connection or contact an administrator.\");\n\t}\n\n\treturn;\n}", "function processResponse(text){\r\n\r\n\t\t\tvar tSplit = text.split('<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>')[1];\r\n\t\t\tvar profile = new XML(tSplit);\r\n\t\t\t/*var jsonTracklist = {\r\n\r\n\t\t\t 'title':'ZOMGBBQ!', \r\n\t\t\t 'tracklist':[]\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar i=0;\r\n\t\t\tfor each(var song in profile.playlist.song){\r\n\t\t\t\t\r\n\t\t\t\tjsonTracklist.tracklist[i] = {\r\n\t\t\t\t\t\r\n\t\t\t\t\t'track':{\r\n\r\n\t\t\t\t\t\t'location': song.@durl,\r\n\t\t\t\t\t\t'image':song.@imagename,\r\n\t\t\t\t\t\t'title': song.@title,\r\n\t\t\t\t\t\t'creator':'múm', \r\n\t\t\t\t\t\t'annotation':'',\r\n\t\t\t\t\t\t'info':'http://www.myspace.com/mumtheband' \r\n\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t };\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tjsonTracklist = jsonTracklist.toSource().toString().split('(')[1].split(')')[0];\r\n\t\t\t\t\tunsafeWindow.console.log(jsonTracklist);*/\r\n\t\t\t//var songs = profile.playlist.song;\r\n\t\t\t//unsafeWindow.console.log(songs);\r\n\t\t\tvar i=0;\r\n\t\t\tvar tracks = '';\r\n\t\t\tfor each(var song in profile.playlist.song){\r\n\r\n\t\t\t\ttracks += '<track>'+\r\n\t\t\t\t\t\t\t\t'<title>'+profile.name+'</title>'+\r\n\t\t\t\t\t\t\t\t'<creator>'+song.@title+'</creator>'+\r\n\t\t\t\t\t\t\t\t'<location>'+song.@durl+'</location>'+\r\n\t\t\t\t\t\t\t\t'<image>'+song.@imagename+'</image>'+\r\n\t\t\t\t\t\t\t\t'<info></info>'+\r\n\t\t\t\t\t\t\t\t'<identifier>'+i+'</identifier>'+\r\n\t\t\t\t\t\t\t'</track>';\r\n\t\t\t\ti++;\r\n\r\n\t\t\t}\r\n\t\t\r\n\t\tvar pathN = document.title.split('MySpace.com - ')[1];\r\n\t\tvar tList = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\">'+\r\n\t\t\t\t\t\t'<title>'+pathN+'</title>'+\r\n\t\t\t\t\t\t'<creator>'+pathN+'</creator>'+\r\n\t\t\t\t\t\t'<annotation></annotation>'+\r\n\t\t\t\t\t\t'<info></info>'+\r\n\t\t\t\t\t\t'<location></location>'+\r\n\t\t\t\t\t\t'<identifier></identifier>'+\r\n\t\t\t\t\t\t'<image></image>'+\r\n\t\t\t\t\t\t'<date></date>'+\r\n\t\t\t\t\t\t'<trackList>'+\r\n\t\t\t\t\t\t\ttracks+\r\n\t\t\t\t\t\t'</trackList>'+\r\n\t\t\t\t\t'</playlist>';\r\n\t\t\t\t\r\n\t\t\tvar newPlaya = document.createElement('embed');\r\n\t\t\tnewPlaya.src=\"http://forboden.com/coding/flashtest/myspacealt.swf\";\r\n\t\t\tnewPlaya.width=\"438\";\r\n\t\t\tnewPlaya.height=\"283\";\r\n\t\t\tnewPlaya.id=\"newPlaya\";\r\n\t\t\tnewPlaya.pluginspage=\"http://www.macromedia.com/go/getflashplayer\";\r\n\t\t\tnewPlaya.type=\"application/x-shockwave-flash\";\r\n\t\t\tnewPlaya.scale=\"noscale\";\r\n\t\t\tnewPlaya.wmode=\"opaque\";\r\n\t\t\tnewPlaya.setAttribute(\"allowscriptaccess\",\"always\");\r\n\t\t\tnewPlaya.setAttribute(\"allowfullscreen\",\"true\");\r\n\t\t\tnewPlaya.setAttribute(\"flashvars\",\"js_playlist=yes&playlist_url=\"+encodeURIComponent(tList)); \r\n\r\n\t\t\tvar origPlaya = document.getElementById('profile_mp3Player');\r\n\t\t\tvar origPlayaC = origPlaya.firstChild;\r\n\r\n\t\t\t/*var sS = document.styleSheets;\r\n\t\t\tvar newPlayaStyle = '';\r\n\t\t\tfor(var i=0;i<sS.length;i++){\r\n\r\n\t\t\t\tif(!sS[i].href){\r\n\t\t\t\t\tvar cR = sS[i].cssRules;\r\n\r\n\t\t\t\t\tfor(var j=0;j<cR.length;j++){\r\n\r\n\t\t\t\t\t\tvar o = cR[j].selectorText;\r\n\t\t\t\t\t\tvar nR = new RegExp('object$');\r\n\t\t\t\t\t\tif(nR.test(o)){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tnewPlayaStyle += cR[j].cssText.split('{')[1].split('}')[0];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}*/\r\n\t\t\t\r\n\t\t\t//http://blog.firetree.net/2005/07/04/javascript-find-position/\r\n\t\t\t function findPosX(obj)\r\n\t\t\t {\r\n\t\t\t var curleft = 0;\r\n\t\t\t if(obj.offsetParent)\r\n\t\t\t while(1) \r\n\t\t\t {\r\n\t\t\t curleft += obj.offsetLeft;\r\n\t\t\t if(!obj.offsetParent)\r\n\t\t\t break;\r\n\t\t\t obj = obj.offsetParent;\r\n\t\t\t }\r\n\t\t\t else if(obj.x)\r\n\t\t\t curleft += obj.x;\r\n\t\t\t return curleft;\r\n\t\t\t }\r\n\r\n\t\t\t function findPosY(obj)\r\n\t\t\t {\r\n\t\t\t var curtop = 0;\r\n\t\t\t if(obj.offsetParent)\r\n\t\t\t while(1)\r\n\t\t\t {\r\n\t\t\t curtop += obj.offsetTop;\r\n\t\t\t if(!obj.offsetParent)\r\n\t\t\t break;\r\n\t\t\t obj = obj.offsetParent;\r\n\t\t\t }\r\n\t\t\t else if(obj.y)\r\n\t\t\t curtop += obj.y;\r\n\t\t\t return curtop;\r\n\t\t\t }\r\n\t\t\tvar newStyle = 'left:'+findPosX(origPlayaC)+'px;top:'+findPosY(origPlayaC)+'px;position:absolute;';\r\n\t\t\t\r\n\t\t\tnewPlaya.setAttribute('style',newStyle);\r\n\t\t\torigPlaya.removeChild(origPlayaC);\r\n\t\t\torigPlaya.appendChild(newPlaya);\r\n\r\n\t\t}", "function reqListener3(){\n var response = JSON.parse(this.responseText);\n var person14Species = document.getElementById(\"person14Species\");\n person14Species.innerHTML = response.name;\n }", "function processResponse(responseJSON) {\n var list = JSON.parse(responseJSON);\n var displayText = \"\";\n if(list.items.length == 0){\n displayText = \"You have nothing to do today.\";\n }else{\n displayText = \"<ul class='items'> \";\n for (var i = 0; i < list.items.length; i++) {\n var item = list.items[i];\n var name = item.name;\n var item_mon = item.date.substring(0,2);\n var item_day = item.date.substring(3,5);\n var item_year = item.date.substring(6,);\n var loc = item.location;\n var time = item.time;\n var array = [name, mon, day, year, loc, time];\n if(item_mon == mon && item_day == day && item_year == year){\n displayText += makeListItem(array);\n }\n }\n displayText += \"</ul>\";\n document.getElementById(\"responseArea\").innerHTML = displayText;\n }\n}" ]
[ "0.6448625", "0.63172257", "0.62099475", "0.6195737", "0.6032959", "0.59932435", "0.59388494", "0.592739", "0.5917632", "0.5908263", "0.5878492", "0.5875593", "0.5871572", "0.5838862", "0.5823197", "0.5788406", "0.57790446", "0.57763577", "0.57739234", "0.5770813", "0.5767071", "0.57400304", "0.572792", "0.5717356", "0.5704575", "0.56916654", "0.5677575", "0.5675799", "0.56752074", "0.56721336", "0.5668476", "0.5662674", "0.5654326", "0.5646006", "0.56456673", "0.56371856", "0.5630755", "0.5612582", "0.5608857", "0.5606502", "0.5606097", "0.5604388", "0.55877537", "0.55864877", "0.5585", "0.55806684", "0.55770046", "0.55739534", "0.5573541", "0.5560384", "0.5558344", "0.5557879", "0.5556311", "0.555247", "0.55459845", "0.55408496", "0.5539415", "0.55301696", "0.5527623", "0.5526913", "0.5526348", "0.55252373", "0.5522782", "0.55219847", "0.5521301", "0.5512996", "0.5506258", "0.5502777", "0.54921985", "0.54868793", "0.5482881", "0.5475304", "0.5473421", "0.54703754", "0.5470036", "0.5469875", "0.54692143", "0.5468103", "0.54660285", "0.5462209", "0.54602396", "0.54533285", "0.5449536", "0.54488933", "0.5444965", "0.54396087", "0.5439049", "0.5438068", "0.543793", "0.54363745", "0.5434347", "0.54315776", "0.5431111", "0.54216945", "0.5414433", "0.5412872", "0.5410994", "0.5410915", "0.54106677", "0.54019445", "0.540148" ]
0.0
-1
Replaces color and lives states with their corresponding next states Reset next states for colors and lives
goToNextState() { this.colors = this.nextStateColors this.lives = this.nextStateLives this.nextStateColors = new Array(COLS * ROWS).fill(COLOR.BLANK) this.nextStateLives = new Array(COLS * ROWS).fill(false) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function color_fsm() {\n if (color_stage == 0) {\n if (lorenz_red >= 255) {\n color_stage = 1;\n } else {\n lorenz_red++;\n }\n } else if (color_stage == 1) {\n if (lorenz_green >= 255) {\n color_stage = 2;\n } else {\n lorenz_green++;\n }\n } else if (color_stage == 2) {\n if (lorenz_blue >= 255) {\n color_stage = 3;\n } else {\n lorenz_blue++;\n }\n } else if (color_stage == 3) {\n if (lorenz_red <= 0) {\n color_stage = 4;\n } else {\n lorenz_red--;\n }\n } else if (color_stage == 4) {\n if (lorenz_green <= 0) {\n color_stage = 5;\n } else {\n lorenz_green--;\n }\n } else {\n if (lorenz_blue <= 0) {\n color_stage = 0;\n } else {\n lorenz_blue--;\n }\n }\n}", "function transition() {\n generateNewColour();\n\n for (var key in Colour) {\n if(colour[key] > nextColour[key]) {\n colour[key] -= delta[key];\n if(colour[key] <= nextColour[key]) {\n delta[key] = 0;\n }\n }\n else {\n colour[key] += delta[key];\n if(colour[key] >= nextColour[key]) {\n delta[key] = 0;\n }\n }\n }\n }", "function resetPage() {\n //remove\n var myNode = document.getElementById(\"colorwheel\");\n while (myNode.firstChild) {\n myNode.removeChild(myNode.firstChild);\n }\n //recreate\n for (var i = 0; i < totalColorWheelSteps; i++) {\n var color = document.createElement(\"span\"); //rescope for the for use in reset function\n color.setAttribute(\"id\", \"d\" + i); \n color.style.backgroundColor = \"hsl(\" + (g360a[i]*rangeOfColorsMultiplier) + \", 100%, 50%)\"; //only need to change this part for proper reset.\n color.style.msTransform = \"rotate(\" + i*(colorWheelIndividualSpikesAngleChange) + \"deg)\";//spikes divided by 360?\n color.style.webkitTransform = \"rotate(\"+ i*(colorWheelIndividualSpikesAngleChange) + \"deg)\";\n color.style.MozTransform = \"rotate(\" +i*(colorWheelIndividualSpikesAngleChange) + \"deg)\";\n color.style.OTransform = \"rotate(\" + i*(colorWheelIndividualSpikesAngleChange) + \"deg)\";\n color.style.transform = \"rotate(\" + i*(colorWheelIndividualSpikesAngleChange) + \"deg)\";\n document.getElementById('colorwheel').appendChild(color);\n };\n //reset colors\n for (var i = 0; i < totalColorWheelSteps; i++) {\n document.getElementById(\"d\" + i).style.backgroundColor = \"hsl(\" + g360a[i]*rangeOfColorsMultiplier + \", 100%, 50%)\";\n\n };\n \n //DRY Code Below:\n g360a = generate360array();\n shuffle(g360a);\n console.log(g360a);\n sortingCall.insert(g360a);\n //Change this based on selected algorithm, also, update information. Switch?\n switch(currentlySelectedAlgorithm){\n case 'BubbleSort':\n sortingCall.bubbleSort(); \n break;\n case 'InsertionSort':\n sortingCall.insertionSort(); \n break;\n case 'SelectionSort':\n sortingCall.selectionSort(); \n break;\n default:\n console.error(\"Something went wrong with the algorithm seleciton!\");\n\n }\n \n console.log(sortingCall.toSortedArray());\n console.log(`Reading instructions for state list for bubble sort; follows this pattern:`);\n console.log(`0:index changed,1:what that index is was,2: what that index is changed too. etc`);\n console.log(sortingCall.showStateList());\n stateList = sortingCall.showStateList();\n cTemp = -1;\n}", "function refreshHardColors(){\n\t colors = createHardColors(squares.length , range);\n\t\treset();\n}", "function reset(){\n colors = generateRandomColors(numSquares);\n //pick a new random color from away\n pickedColor = pickColor();\n //change color display to match pickedColor\n colorDisplay.textContent = pickedColor;\n // change the color of the squares\n for(var i = 0; i < squares.length; i++){\n if(colors[i]){\n squares[i].style.display = \"block\";\n squares[i].style.background = colors[i];\n } else{\n squares[i].style.display = \"none\";\n }\n }\n resetButton.textContent = \"New Colors\"\n h1.style.backgroundColor = \"steelblue\";\n}", "function reset_all()\n {\n $states = [];\n $links = [];\n $graph_table = [];\n $end_states = [];\n graph.clear();\n $start_right = [];\n $left = [];\n $current_tape_index = \"\";\n $current_state = \"\";\n $previous_state = \"\";\n $old_current_state = \"\";\n $old_previous_state = \"\";\n $old_tape_index = \"\";\n $error = false;\n $old_tape_head_value = \"\";\n }", "resetInteracts() {\n let i;\n for (i = 0; i < this._objects.intersects.length; i++) {\n this._objects.intersects[i].material.color.setHex(this._objects.intersects[i].originalColor);\n }\n }", "function reset() {\n longestTime = 0;\n for (let n = 0; n < 100; n++) {\n dotData[n][7] = \"#3d405b\";\n movePeople(n, resetData, n);\n }\n writeData();\n resultState = false;\n}", "function setAllLandColor() {\n for (const code in States) {\n {\n if (States[code].is_owned) {\n States[code].fillKey = broughtByPlayer;\n } else {\n States[code].fillKey = \"defaultFill\";\n }\n }\n map.updateChoropleth(States, { reset: true });\n }\n}", "function resetStates(){\n //add all of the cell wrappers to an array\n for(i = 0; i < cells.length; i++){\n cells[i].querySelector('.state-one').style.display = 'none';\n cells[i].querySelector('.state-two').style.display = 'none';\n cells[i].querySelector('.state-three').style.display = 'none';\n cells[i].querySelector('.state-four').style.display = 'none';\n }\n}", "reset() {\r\n this.state=this.initial;\r\n this.statesStack.clear();\r\n\r\n }", "function reset(){\n\t//generate new colors\n\tcolors = generateRandomColor(numSquares);\n\t//pick a new random color from array\n\tpickedColor = pickColor();\n\t//change colorDisplay to match picked Color\n\tcolorDisplay.textContent = pickedColor;\n\n\tresetButton.textContent = \"New Colors\";\n\tmsgDisplay.textContent = \"\";\n\n\t//change colors of squares\n\tfor(var i=0; i<squares.length; i++){\n\t\tif(colors[i]){\n\t\t\tsquares[i].style.display = \"block\";\n\t\t\tsquares[i].style.background = colors[i];\n\t\t} else {\n\t\t\tsquares[i].style.display = \"none\";\n\t\t}\n\t}\n\th1.style.background = \"steelblue\";\n}", "function reset() {\n colors = genRandomColors(numSquares);\n pickedColor = chooseColors();\n colorDisplay.textContent = pickedColor;\n heading.style.backgroundColor = \"steelblue\";\n resetBtn.textContent = \"New colors\";\n message.textContent = \"\";\n\n for (let i = 0; i < squares.length; i++) {\n if (colors[i]) {\n squares[i].style.display = \"block\";\n squares[i].style.backgroundColor = colors[i];\n } else {\n squares[i].style.display = \"none\";\n }\n }\n}", "function reset() {\n colors = generateRandomColors(numSquares);\n pickedColor = pickColor();\n colorDisplay.textContent = pickedColor;\n for (var i = 0; i < squares.length; i++) {\n if (colors[i]) {\n squares[i].style.display = 'block';\n squares[i].style.backgroundColor = colors[i];\n } else {\n squares[i].style.display = 'none';\n }\n }\n messageDisplay.textContent = '';\n newGameButton.textContent = 'New Colors';\n h1.style.backgroundColor = theme;\n}", "reset() {\n state = createGameState();\n notifyListeners();\n }", "function resetColors(){\r\n\t\r\n\tcolors = createSquares(mode);\r\n\r\n\t\r\n\tassignColors();\r\n\r\n\t// update message\r\n\tmessage.textContent = \"\";\r\n\r\n\t// change h1Header\r\n\th1Header.style.backgroundColor=\"rgb(60, 118, 174)\";\r\n\r\n\t// change text of new colors/ reset button\r\n\tresetBtn.textContent = \"New Colors\";\r\n}", "function reset() {\n for (c = 0; c < tileColumnCount; c++) {\n tiles[c] = [];\n for (r = 0; r < tileRowCount; r++) {\n tiles[c][r] = { x: c * (tileW + 3), y: r * (tileH + 3), state: 'e' }; //state is e for empty\n }\n }\n tiles[0][0].state = 's';\n tiles[tileColumnCount - 1][tileRowCount - 1].state = 'f';\n\n output.innerHTML = 'Green is start. Red is finish.';\n}", "reset() {\n for (let node of this.nodes) {\n node.phase = NetworkNode.PHASE.NORMAL;\n }\n for (let l of this.links) {\n l.state = NodeLink.STATES.NORMAL;\n }\n }", "function resetNeutralColors() {\n\t\t$('#virtual-blink').css('background-color', \"#eee\");\n\t\t$('#color-zoom').css({'top': '-190px', 'left': '61px', 'background-color' : '#eee'});\t\t\n\t\t$('.color-swatch').removeClass('.light-off').css('background-image', 'none');\n\t\t$('#color-display #rgb input').val('255');\t\n\t}", "function nextStates(){\r\n var actives=getNumOfActiveNeighbors(rowsData);\r\n var activeCells=[];\r\n for(var i=0;i<rowsData.length;i++){\r\n if(rowsData[i].css(\"backgroundColor\")===\"rgb(0, 0, 255)\"){\r\n activeCells.push(i);\r\n }\r\n }\r\n previousState.push(activeCells); //save the current iteration \r\n //check the game rules\r\n for(var i=0;i<actives.length;i++){\r\n if(rowsData[i].css(\"backgroundColor\")===\"rgb(0, 0, 255)\"){ //check the rules of active cell\r\n if(actives[i]<2){\r\n rowsData[i].css(\"backgroundColor\",\"white\"); \r\n }else if(actives[i]==2 || actives[i]==3){\r\n rowsData[i].css(\"backgroundColor\",\"blue\");\r\n }\r\n else if(actives[i]>3)\r\n {\r\n rowsData[i].css(\"backgroundColor\",\"white\");\r\n }\r\n }\r\n else{ //check the rules of inactive cell\r\n if(actives[i]==3){\r\n rowsData[i].css(\"backgroundColor\",\"blue\");\r\n }\r\n }\r\n \r\n } \r\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 refreshEasyColors(){\n\t\tcolors = createColors(squares.length);\n\t\treset();\n\n}", "handleResetPath() {\n if(!solving) {\n for(let i = 0; i < 800; ++i) {\n if(this.state.squares[i] !== 's' && this.state.squares[i] !== 'e' && this.state.squares[i] !== 'o'){\n document.getElementsByClassName('square')[i].style = 'background-color: white';\n }\n }\n }\n }", "reset() {\n this.makeNormal();\n this.lighten();\n }", "function reset(){\n\tcolors=generateColors(numSquares);\n\tpickedColor= pickColor();\n\tcolorDisplay.textContent=pickedColor;\n\t\n\tfor (var i =0; i <squares.length; i++) {\n\n\t\tif(colors[i]){\n\t\t\tsquares[i].style.background=colors[i];\n\n\t\t\tsquares[i].style.display=\"block\";\n\t\t}\n\t\telse\n\t\t\tsquares[i].style.display=\"none\";\n\t}\n\n\n\th1.style.background=\"steelblue\";\n\tmessageDisplay.textContent=\"\";\n\tresetButton.textContent=\"New colors\";\n}", "function reset () {\n\tcolors = generateRandomColors(colorsNum);\n\tpickedColor = pickRandomColor();\n\tcolorDisplay.textContent = pickedColor;\n\th1.style.backgroundColor = \"steelblue\";\n\tmessage.textContent = \"\";\n\tresetButton.textContent = \"New Colors\";\n\tfor (var i = 0; i < squares.length; i++) {\n\t\tif (colors[i]) {\n\t\t\tsquares[i].style.display = \"block\";\n\t\t\tsquares[i].style.backgroundColor = colors[i];\n\t\t} else {\n\t\t\tsquares[i].style.display = \"none\";\n\t\t}\n\t}\n}", "handleReset() {\n if(!solving) {\n resetStartEnd();\n grid = Array(800).fill(null);\n this.setState({squares: grid});\n for(let i = 0; i < 800; ++i) {\n document.getElementsByClassName('square')[i].style = 'background-color: white';\n }\n }\n }", "changeColor() {\n // wrap around, but should be 7?\n\t\tvar nxtColorIdx = this.current + 1 > 6 ? 0 : this.current + 1;\n var curColorIdx = this.current;\n // color transition, set old color invisible\n var esta = this;\n\t\tANIM.customAnimation.to(this.materials[curColorIdx], 5, {\n\t\t\topacity: 0,\n\t\t\tonComplete: function() {\n\t\t\t\testa.obj.children[curColorIdx].visible = false\n\t\t\t}\n\t\t});\n // set next color visible and gradually switch to new color\n this.obj.children[nxtColorIdx].visible = true\n ANIM.customAnimation.to(this.materials[nxtColorIdx], 4, {\n\t\t\topacity: 1\n\t\t});\n\n this.current = nxtColorIdx;\n }", "eSwitchColor(originalGroup, newGroup) {\n if(!this.stunned && this.health > 0) {\n let originalState = this.state;\n this.switching = true;\n this.body.stop();\n this.moveTimer.paused = true;\n this.setTint(orchid);\n this.body.setImmovable(true);\n this.switchPause = this.scene.time.delayedCall(enemySwitchPause, () => {\n if(!this.stunned) {\n if(this.health > 0) {\n this.switching = false;\n this.body.setImmovable(false);\n originalGroup.remove(this); \n if(this.moving) {\n this.moveTimer.paused = false\n }\n if(originalState == 0){\n this.state = 1;\n } else {\n this.state = 0;\n }\n newGroup.add(this);\n this.clearTint();\n if(this.state == 0){\n this.healthText.setColor('#DC143C');\n this.setTexture(this.redTexture);\n } else {\n this.healthText.setColor('#4169E1');\n this.setTexture(this.blueTexture);\n }\n if(this.x < player.x) {\n this.setFlipX(true);\n } else {\n this.setFlipX(false);\n }\n }\n } else {\n this.switching = false;\n this.body.setImmovable(false);\n if(this.moving) {\n this.moveTimer.paused = false\n }\n this.clearTint();\n }\n }, this.enemy, this.scene);\n }\n }", "reset() {\r\n this.statesDone.clear();\r\n this.statesDone.push(this.initialState);\r\n }", "function resetStates(){\r\n for(var i=0;i<rowsData.length;i++){\r\n if(rowsData[i].css(\"backgroundColor\")===\"rgb(0, 0, 255)\"){\r\n rowsData[i].css(\"backgroundColor\",\"white\"); \r\n }\r\n }\r\n}", "function resetGame() {\n // Generate new colours\n colours = generateRandomColours(gameMode);\n // Select new random colour from array\n colourSet = assignColour();\n // Update display to match set colour\n colourDisplay.textContent = colourSet;\n // Change colours of squares\n for (let i = 0; i < squares.length; i++) {\n if (colours[i]) {\n squares[i].style.display = 'block';\n squares[i].style.backgroundColor = colours[i];\n } else {\n squares[i].style.display = 'none';\n }\n }\n // Reset header background\n header.style.backgroundColor = '#747475';\n // Reset button and message text\n buttonReset.textContent = 'New colours';\n messageDisplay.textContent = '';\n}", "function reset() {\n\tif (soundOn)\n\t\tsounds['buttons'].sound.play();\n\tcolors = generateRandomColors(numCircles);\t\n\tpickedColor = pickColor();\t// pick a new random color from array. It is a string like rgb(r, g, b)\n\tcolorDisplay.textContent = pickedColor; // change colorDisplay to match picked color\n\tresetButton.textContent = \"New Colors\"\n\tmessageDisplay.textContent = \"\";\n\n\t// change colors of circles\n\tfor (var i = 0; i < circles.length; i++){\n\t\tif (colors[i]) {\n\t\t\tcircles[i].style.display = \"block\"\n\t\t\tcircles[i].style.background = colors[i];\n\t\t} else {\n\t\t\tcircles[i].style.display = \"none\";\t// hide other circles if mode is easy\n\t\t}\n\t}\n\n\tbanner.style.background = \"steelblue\";\n}", "function restoreState()\n{\n\tif(state == undefined) return;\n\tvar cola = new Array();\n\tvar x = 0;\n\tfor(i in colorTypes)\n\t{\n\t\tcola[i] = state[i];\n\t\tx=i;\n\t}\n\tcolourNumOnLoad(cola);\n\tdocument.getElementById(\"splash_message\").value = state[i+1];\n\tdocument.getElementById(\"debug\").checked = state[i+2];\n\tselector = state[i+3];\n\tselectColoring(selector);\n document.getElementById(\"onstagelist\").checked = state[i+4];//08/04/2013 -CF- add new component for the state to load\n document.getElementById(\"lockStageCB\").checked = state[i+5];//30/04/2013 -CF- add new component for the state to load\n\t//alert(selector);\t\t\t07/11/20101 PR - Removed, because I couldn't see the point in this\n\tstate = undefined;\n}", "function generateNewGame()\n{\n if(state == \"easy\")\n {\n colors = signColors(3);\n pickedColors = pickColor();\n color = squares[Math.floor(Math.random()*(3))].style.backgroundColor;\n }\n else{\n colors = signColors(6);\n pickedColors = pickColor();\n color = squares[Math.floor(Math.random()*(6))].style.backgroundColor;\n }\n \n \n display.textContent = color;\n document.getElementById(\"upper\").style.backgroundColor = \"rgb(203, 214, 175)\";\n resetButton.textContent = \"reset colors\"\n/*\n if(state == \"hard\")\n {\n for(var i = 3; i < squares.length; i++)\n {\n squares[i].style.display = \"block\"\n }\n }\n */ \n}", "reset() {\n\t\tfor (let i = 0; i < this.tiles.length; i++) {\n\t\t\tthis.tiles[i].unsetPiece();\n\t\t}\n\t\tfor (let i = 0; i < this.whitePieces.length; i++) {\n\t\t\tthis.whitePieces[i].unsetTile();\n\t\t\tthis.whitePieces[i].animation = null;\n\t\t\tthis.blackPieces[i].unsetTile();\n\t\t\tthis.blackPieces[i].animation = null;\n\t\t}\n\t}", "function resetGame(){\t\n\t//play again --> new colors\n\treset.textContent=\"New Colors\";\n\t//change h1 background on reset\n\th1.style.backgroundColor=\"steelblue\";\n\t//remove message try again/correct\n\tmessage.textContent=\"\";\n\t//generate new colors\n\tcolors=generateRandomColors(numOfSquare);\n\t//assign new colors\n\tfor(var i=0;i<squares.length;i++)\n\t{\n\t\t\tif(colors[i]){\n\t\t\t\tsquares[i].style.display=\"block\";\n\t\t\t\tsquares[i].style.backgroundColor=colors[i];\n\t\t\t} \n\t\t\telse squares[i].style.display=\"none\";\n\t}\n\t//set new final color\n\tpickedColor=pickColor();\n\t//set new top RGB\n\tcolorDisplay.textContent=pickedColor;\n}", "async function resetColors() {\n setEditedCustomColors({})\n await saveCustomColors({})\n setShowColorControls(false)\n }", "function reset(){\n\tcolors=generateRandomColors(numSquares);\n\t//pick new random color\n\tpickedColor = pickColor();\n\t//change color display so it resets too\n\tcolorDisplay.textContent = pickedColor;\n\t//remove message after you press play again\n\tmessageDisplay.textContent = \"\";\n\t//change button to \"new colors\" instead of it remaining play again after you win and play again\n\tresetButton.textContent = \"New Colors\";\n\t//change the colors of the squares\n\tfor(var i= 0; i< squares.length;i++){\n\t\tif(colors[i]){\n\t\t\tsquares[i].style.display = \"block\";\n\t\t\tsquares[i].style.background = colors[i];\n\t\t} else {\n\t\t\tsquares[i].style.display = \"none\";\n\t \t}\n\t}\n\t//change background back to it's normal color after you win and play again6\n\th1.style.backgroundColor = \"steelblue\";\n}", "function reset(){\n colours = generateRandomColours(numOfSquares);\n\n // Pick new colour and change displayed colour\n pickedColour = pickColour();\n colourDisplay.textContent = pickedColour;\n\n // Change colours for squares on page\n for(var i = 0; i < squares.length;i++){\n if(colours[i]){\n squares[i].style.display = \"block\";\n squares[i].style.backgroundColor = colours[i];\n }\n else {\n squares[i].style.display = \"none\";\n }\n }\n h1.style.background = \"steelblue\";\n newColour.textContent = \"New Colour\";\n message.textContent = \"\";\n}", "reset() {\r\n this.historyStates.push(this.currentState);\r\n this.currentState = this.historyStates[0];\r\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 colorSwap() {\n bdy.style.background = colorArray[ranNum2[count2]];\n lq.style.background = colorArray[ranNum2[count2]];\n count2++;\n}", "function backToNormal() {\n gPacman.isSuper = false;\n gGhosts.forEach(function changeBackColor(ghost, idx) {\n ghost.color = gOriginalColors[idx];\n })\n while (gGhosts.length < 3) {\n createGhost(gBoard);\n }\n}", "newNextColor() {\n if (this.gameOver) {\n return;\n }\n this.nextBlob1Color = Math.floor(Math.random() * this.puyoVariations) + 1;\n this.nextBlob2Color = Math.floor(Math.random() * this.puyoVariations) + 1;\n this.state.updateNextBlobs();\n }", "function reset(){\n colorMode(HSB, 255);\n circle_color = color(random(0,1)* 255, 50, 255);\n for (let i = 0; i < 200; i++) {\n tree_one.push(new tree_1());\n tree_two.push(new tree_2());\n palm_one.push(new palm_1());\n palm_two.push(new palm_2());\n tree_four.push(new tree_4());\n tree_five.push(new tree_5());\n A[i] = random(0, 1);\n \n rand[i] = random(0, 1);\n rand2[i] = floor(random(0, A.length));\n rand3[i] = 30 * floor(random(-75, 75));\n \n tree_one[i].x = rand3[i];\n tree_one[i].random = rand[i];\n tree_one[i].random3 = rand2[i];\n tree_two[i].x = rand3[i];\n tree_two[i].random = rand[i];\n tree_two[i].random3 = rand2[i];\n tree_four[i].x = rand3[i];\n tree_four[i].random = rand[i];\n tree_four[i].random3 = rand2[i];\n tree_five[i].x = rand3[i];\n tree_five[i].random = rand[i];\n tree_five[i].random3 = rand2[i];\n palm_one[i].x = rand3[i];\n palm_one[i].random = rand[i];\n palm_one[i].random3 = rand2[i];\n palm_two[i].x = rand3[i];\n palm_two[i].random = rand[i];\n palm_two[i].random3 = rand2[i];\n }\n \n foliage = color(200 +30*A[49], 85, 100);\n foliage1= color(200 +30*A[49], 85, 110);\n if(random(0,1)>0.66){\n clouds = cloud1;\n\n }else if (random(0,1)>0.33){\n clouds = cloud2;\n }else{\n clouds = cloud3;\n }\n clouds.resize(width, 19/9*width);\n}", "function reset() {\r\n colors = randomColor(num);\r\n pickedColor = colorPicker();\r\n colorDisplay.text(pickedColor);\r\n resetbtn.text(\"New Colors\");\r\n message.text(\"\");\r\n for (let i = 0; i < sq.length; i++) {\r\n if (colors[i]) {\r\n sq[i].style.display = \"block\";\r\n sq[i].style.background = colors[i];\r\n } else {\r\n sq[i].style.display = \"none\";\r\n }\r\n }\r\n}", "reset (state, resetGameState) {\n state.game = Object.assign({}, resetGameState)\n }", "function resetColor(pieces) {\n\n\t\tfor (var i = 0; i < pieces.length; i++) {\n\t\t\tpieces[i].color = SNAKE_DEFAULT_COLOR;\n\t\t}\n\t}", "function resetColor(el) {\n el.css(\"transition\",\"\");\n el.css(\"transition\");\n el.css(\"background-color\",\"\");\n el.css(\"background-color\");\n}", "function reset(){\n //Change the colors in there by firing the randomization again\n colors = generateRandomColors(numSquare);\n //Change the colorDisplay on the h1\n pickedColor = pickColor();\n colorDisplay.textContent = pickedColor;\n //Change the color of the squares\n for(var i = 0; i < squares.length; i++){\n if(colors[i]){\n squares[i].classList.remove(\"disappear\");\n squares[i].style.backgroundColor = colors[i];\n }else{\n squares[i].classList.add(\"disappear\");\n }\n }\n // Cleaning message after reseting\n messageDisplay.textContent=\"\";\n // Reseting the H1 to original color\n h1.style.backgroundColor = \"steelblue\";\n //Reseting button to \"New Colors\"\n resetButton.textContent = \"New Colors\";\n}", "function resetBoard() {\n resetState()\n renderBoard()\n}", "function changeColor(tmp_stage,tmp_arr){\n tmp_arr.forEach(function (item) {\n tmp_stage.find(\"#\" + item[0]).fill(DICT_COLORS[item[1]]);\n tmp_stage.find(\"#main_l\").draw();\n });\n}", "reset() {\r\n this.prevState=this.currentState;\r\n this.currentState = this.config.initial;\r\n }", "function resetSteps() {\n oModelSteps.forEach(step => {\n step.classList.remove(\"color\");\n })\n}", "function setEndGameColors() {\n\tconst delay = 80;\n\tlet counter = 0;\n\n\tconst titleColor = getBackgroundColor(title);\n\tfadeColor(title, 'background-color', titleColor, colors[correct], 500);\n\tfor (let index=0; index < colors.length; index++) {\n\t\tsquareBorders[index].classList.remove('hovered', 'lower');\n\t\tif (index !== correct) {\n\t\t\tcounter++;\n\t\t\tif (squareBorders[index].classList.contains('disappear')) {\n\t\t\t\tsquareBorders[index].classList.remove('disappear');\n\t\t\t\tsquareBorders[index].classList.add('reappear');\n\t\t\t}\n\n\t\t\tconst duration = 350;\n\t\t\tsetTimeout(() => {\n\t\t\t\tfadeColor(squareDivs[index], 'background-color', colors[index], colors[correct], duration);\n\t\t\t\tfadeColor(squareBorders[index], 'background-color', squares[index].borderColorRaw, squares[correct].borderColorRaw, duration);\n\t\t\t}, delay * counter);\n\t\t}\n\t}\n}", "clear() {\n this.state = new TurtleState(new THREE.Vector3(0,0,0), new THREE.Vector3(0,1,0)); \n stateStack = [];\n }", "function reset () {\n setCurrentlyClicking(false);\n setCounter(1);\n clearInterval(currentInterval);\n setCurrentInterval(\"\");\n setClickingFast(false);\n setColors(initialColors);\n }", "function fillStartingState() {\n for (let i = 0; i < allTapBoxes.length; i++) {\n if (GAME_ORIGINAL_STATE[i] !== '0') {\n allTapBoxes[i].innerHTML = GAME_ORIGINAL_STATE[i];\n allTapBoxes[i].style.color = '#545454';\n allTapBoxes[i].style.animation = 'popBounce 0.2s ease-out forwards';\n } else if (GAME_STATE[i] !== '0') {\n allTapBoxes[i].innerHTML = GAME_STATE[i];\n allTapBoxes[i].style.animation = 'popBounce 0.2s ease-out forwards';\n } else {\n allTapBoxes[i].innerHTML = '';\n }\n }\n}", "function fillStartingState() {\n for (let i = 0; i < allTapBoxes.length; i++) {\n if (GAME_ORIGINAL_STATE[i] !== '0') {\n allTapBoxes[i].innerHTML = GAME_ORIGINAL_STATE[i];\n allTapBoxes[i].style.color = '#545454';\n allTapBoxes[i].style.animation = 'popBounce 0.2s ease-out forwards';\n } else if (GAME_STATE[i] !== '0') {\n allTapBoxes[i].innerHTML = GAME_STATE[i];\n allTapBoxes[i].style.animation = 'popBounce 0.2s ease-out forwards';\n } else {\n allTapBoxes[i].innerHTML = '';\n }\n }\n}", "function state2Left() {\n if (palette == palette0) {\n palette = palette4;\n }\n else if (palette == palette5){\n palette = palette0;\n }\n else if (palette == palette2) {\n palette = palette5;\n }\n else if (palette == palette7) {\n palette = palette2;\n }\n else if (palette == palette4){\n palette = palette7;\n }\n }", "function resetBricks () {\n for (var c = 0; c < store.state.brickColumnCount; c++) {\n for (var r = 0; r < store.state.brickRowCount; r++) {\n store.state.bricks[c][r].status = 1;\n }\n }\n}", "reset(color1, color2) {\n for (let i = 0; i < this.length(); i++) {\n let slot = this.getSlot(i);\n slot.classList.remove(color1);\n slot.classList.remove(color2);\n slot.classList.remove('filled');\n slot.style.border = '2px solid black';\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 }", "resetState() {\n for (let r = 0; r < this.grid.rows; r++) {\n for (let c = 0; c < this.grid.cols; c++) {\n this.grid.nodes[r][c].cameFrom = undefined;\n this.grid.nodes[r][c].f = Infinity;\n this.grid.nodes[r][c].g = Infinity;\n this.grid.nodes[r][c].visited = false;\n }\n }\n this.openSet = [this.grid.startNode];\n this.closedSet = [];\n this.currentNode = this.grid.startNode;\n this.finishStatus = undefined;\n this.finished = false;\n this.grid.startNode.f = 0;\n this.grid.startNode.g = 0;\n }", "function reset(){\r\n gameState = PLAY;\r\n gameOver.visible = false;\r\n // restart.visible = false;\r\n enemiesGroup.destroyEach();\r\n blockGroup.destroyEach();\r\n stars1Group.destroyEach();\r\n stars2Group.destroyEach();\r\n candyGirl.addAnimation(\"running\", candygirl_running);\r\n score = 0;\r\n}", "function resetAll() {\n document.querySelectorAll(\".changeColor\").forEach(function (p) {\n p.style.color = \"rgb(0,0,0)\";\n });\n }", "function reset_scene() {\r\n fov = 0.0;\r\n red = 0.0;\r\n green = 0.0;\r\n blue = 0.0;\r\n a_red = 0.0;\r\n a_green = 0.0;\r\n a_blue = 0.0;\r\n eye_x = 0.0;\r\n eye_y = 0.0;\r\n eye_z = 0.0;\r\n lights = [];\r\n shapes = [];\r\n U = createVector(0, 0, 0);\r\n V = createVector(0, 0, 0);\r\n W = createVector(0, 0, 0);\r\n \r\n areaLights = [];\r\n}", "handleReset() {\n this.setState({\n rubiksArray: cubeUtilities.cleanCubeFaceState()\n }, () => {\n this.handleResetPosition();\n this.handleRenderCubeColorPositions();\n });\n }", "function reset(){\n\tpickedColor = getRandomNumber(squares.length);\n\t\theader.style.backgroundColor = \"lightblue\";\n\t\tmessage.textContent = \"\";\n\t\tcolorDisplay.innerHTML = colors[pickedColor];\n\t\tfor(var i = 0; i<squares.length;i++){\n\t\t\tsquares[i].style.backgroundColor = colors[i];\n\t\t}\n}", "function resetState() {\n gameState = {\n segments: [],\n startSegment: {inner: {x: -1, y: -1}, outer: {x: -1, y: -1}},\n endSegment: {inner: {x: -1, y: -1}, outer: {x: -1, y: -1}},\n click: 1,\n firstPoint: {x: -1, y: -1},\n endPoint: \"start\",\n player: 1\n }\n payload = {};\n}", "function reset() {\n\tdocument.querySelector(\"span\").textContent = currLevel + 1;\n\tcolor = randomRGB();\n\tdocument.querySelector(\".circle\").style.backgroundColor = color;\n\tshuffleArray(randomArr);\n\tfillSquares(levels[currLevel]);\n}", "function nextState(){\n for (var i = 3; i<=91; i++){\n $(\"#MathJax-Span-\"+i).css(\"color\",\"black\"); \n }\n var points = model.get_current_state_array();\n var pointdict = model.get_current_state();\n var numpoints = points.length;\n var newstate = [];\n \n state++;\n updateGraph();\n \n $(\".next-state\").attr(\"disabled\",false);\n $(\".previous-state\").attr(\"disabled\",false);\n \n $(\".span7\").append(\"<a name='bottom'><div class='chart-container chart\"+state+\"'></div></a>\");\n setupGraph(state);\n updateTopBubbles(state);\n setupSideLabels(state);\n $(\".span7\").append(\"<div class='row-fluid continue-row'><button class='arrow-transition btn btn-large'>See Transition Model</button></div>\");\n $(\".arrow-transition\").css(\"visibility\",\"visible\");\n $(\".arrow-transition\").on(\"click\",function(){\n $(this).closest('.row-fluid').remove();\n $('.num-label'+state).remove(); $('.first-prob'+state).remove(); //to remove the duplicate\n firstupdate(state);\n updateFirstInputRow(\"rest\");\n })\n }", "resetInterractionStates() {\n this.mouseIsPressed = false;\n this.f6KeyIsPressed = false;\n this.upArrowKeyIsPressed = false;\n this.downArrowKeyIsPressed = false;\n this.tabKeyIsPressed = false;\n this.tildeKeyIsPressed = false;\n this.enterKeyIsPressed = false;\n this.lKeyIsPressed = false;\n this.lastInputEventIsKeyboard = false;\n }", "function clearStates(model, view) {\n view.group.traverse(function (el) {\n // Not applied on removed elements, it may still in fading.\n if (graphic[\"isElementRemoved\"](el)) {\n return;\n }\n\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine();\n\n if (el.stateTransition) {\n el.stateTransition = null;\n }\n\n if (textContent && textContent.stateTransition) {\n textContent.stateTransition = null;\n }\n\n if (textGuide && textGuide.stateTransition) {\n textGuide.stateTransition = null;\n } // TODO If el is incremental.\n\n\n if (el.hasState()) {\n el.prevStates = el.currentStates;\n el.clearStates();\n } else if (el.prevStates) {\n el.prevStates = null;\n }\n });\n }", "function changeState(i) {\n\tif(Cells[i].state) {\n\t\tdocument.getElementById(Cells[i].id).style.backgroundColor = \"white\";\n\t\tCells[i].state = false;\n\t\tnewCells[i].state = false;\n\t}\n\telse {\n\t\tdocument.getElementById(Cells[i].id).style.backgroundColor = \"black\";\n\t\tCells[i].state = true;\n\t\tnewCells[i].state = true;\n\n\t\t/*if(!isNaN(Cells[i].top))\n\t\t\tdocument.getElementById(Cells[Cells[i].top].id).style.backgroundColor = \"red\";\n\t\tif(!isNaN(Cells[i].bottom))\n\t\t\tdocument.getElementById(Cells[Cells[i].bottom].id).style.backgroundColor = \"orange\";\n\t\tif(!isNaN(Cells[i].left))\n\t\t\tdocument.getElementById(Cells[Cells[i].left].id).style.backgroundColor = \"green\";\n\t\tif(!isNaN(Cells[i].right)) \n\t\t\tdocument.getElementById(Cells[Cells[i].right].id).style.backgroundColor = \"blue\";*/\n\t}\n}", "function resetStateMN() {\n for (var i = 0; i < dataTwentySixteen.length; i++) {\n var cur = dataTwentySixteen[i];\n // Tie precinct ID to stats;\n precinctData[cur[stateSyntax[precinctID_NAME]]] = cur;\n precinctDistricts[cur[stateSyntax[precinctID_NAME]]] = cur[stateSyntax[precinctOrigDist_NAME]];\n }\n}", "function resetSnoozes() {\n\n if (bgHigher(BGUrgentLow+1)) BGUrgentLowSnooze = 0;\n if (bgHigher(BGLow+1)) BGLowSnooze = 0;\n if (bgLower(BGUrgentHigh-1)) BGUrgentHighSnooze = 0;\n if (bgLower(BGHigh-1)) BGHighSnooze = 0;\n}", "function resetAnimations() {\n\tarthur.stand = arthur.right;\n\tarthur.goLeft = false;\n\tarthur.goRight = false;\n\tarthur.duckRight = false;\n\tarthur.atkRight = false;\n\tarthur.jumpRight = false;\n\tarthur.die = false;\n}", "function resetGameBoxes() {\n for(const box of divs.game_boxes) {\n box.setAttribute('state', 0);\n }\n}", "randomizeColors(){\n for (const [key, color] of Object.entries(this.colors)) {\n color.newColor()\n }\n this.updateGradientString()\n }", "function reset() {\n status.gameArr = [];\n status.level = 0;\n topLeft.off();\n topRight.off();\n bottomLeft.off();\n bottomRight.off();\n status.running = false;\n level.html(\"0\").css(\"color\", 'red');\n start.html('<i class=\"fa fa-play\"></i>').css('color', 'red');\n}", "function setState(ctx, ant)\r\n{\r\n\tvar colorpx = ctx.getImageData(ant.x-7, ant.y-7, 1, 1);\r\n\tvar red = colorpx.data[0];\r\n\tvar green = colorpx.data[1];\r\n\tvar blue = colorpx.data[2];\r\n\t\r\n\tif(blue == 255 && red == 255) //if on magenta, we change \"state\" to index of yellow; and turn right;\r\n\t{\r\n\t\tant.state = 2;\r\n\t\tant.orientation = ((ant.orientation + 1) % 4);\r\n\t}\r\n\telse if(green == 255 && red == 255) //if on yellow, move to index of cyan; turn left;\r\n\t{\r\n\t\tant.state = 3;\r\n\t\tif(ant.orientation > 0)\r\n\t\t\tant.orientation = ((ant.orientation - 1) % 4); //turns out javascript's modulo isn't really right, we need to check for negatives so we dont hurt JS's feelings\r\n\t\telse\r\n\t\t\tant.orientation = 3;\r\n\t}\r\n\telse if(blue == 255 && green == 255) //cyan to black; left;\r\n\t{\r\n\t\tant.state = 0;\r\n\t\tif(ant.orientation > 0)\r\n\t\t\tant.orientation = ((ant.orientation - 1) % 4); \r\n\t\telse\r\n\t\t\tant.orientation = 3;\r\n\t}\r\n\telse //black to magenta; right;\r\n\t{\r\n\t\tant.state = 1; \r\n\t\tconsole.log(ant.state);\r\n\t\tant.orientation = ((ant.orientation + 1) % 4);\r\n\t}\r\n}", "resetGame() {\r\n //Copy my state\r\n let btns = this.state.btns.slice();\r\n let xIsNext = this.state.xIsNext;\r\n\r\n //Change value of my copy state\r\n btns.fill(null);\r\n xIsNext = true;\r\n\r\n //Update the actual state\r\n this.setState({ btns: btns, xIsNext: xIsNext });\r\n }", "resetView(resetLabel = true) {\n this.active.classed(\"active\", false);\n this.active = d3.select(null);\n\n if (resetLabel) {\n this.stateInfo(null);\n }\n d3.select(\".states\").transition()\n .duration(500)\n .attr(\"transform\", \"translate(0, 0)\");\n }", "resetStates() {\n Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"tidy\"])(() => {\n this.layers.forEach(layer => {\n // tslint:disable:no-any\n if (layer.stateful) {\n layer.resetStates();\n }\n // tslint:enable:no-any\n });\n });\n }", "function resetStateAll() {\n that.state.all = false;\n }", "function resetState(){\n d3.selectAll(\"button.state_reset\").style(\"display\", \"none\");\n d3.selectAll(\"button.county_reset\").style(\"display\", \"none\");\n selState=\"\";\n d3.select(\"#counties\").remove();\n if (pollClick) {\n mapTitle.text(selRiskString + \" Assessment for \" + selPoll);\n } else {\n mapTitle.text(selRiskString + \" Assessment\");\n }\n countyClick = false;\n countyLoad = false;\n hideTip();\n showStates();\n mapG.transition()\n .delay(50)\n .duration(550)\n .style(\"stroke-width\", \"1.5px\")\n .attr('transform', 'translate('+mapMargin.left+','+mapMargin.top+')');\n}", "function resetObject()\n{\n if (script.api.tweenObjects == null) {\n return;\n }\n\n for ( var i = 0; i < script.api.tweenObjects.length; i++)\n {\n var tweenObject = script.api.tweenObjects[i];\n\n updateColorComponent( tweenObject.component, tweenObject.startValue );\n }\n}", "resetState(state) {\n for (let prop in state) {\n state[prop] = initialState[prop];\n }\n }", "resetState(state) {\n for (let prop in state) {\n state[prop] = initialState[prop];\n }\n }", "function clearStates(model, view) {\n\t view.group.traverse(function (el) {\n\t // Not applied on removed elements, it may still in fading.\n\t if (isElementRemoved(el)) {\n\t return;\n\t }\n\t\n\t var textContent = el.getTextContent();\n\t var textGuide = el.getTextGuideLine();\n\t\n\t if (el.stateTransition) {\n\t el.stateTransition = null;\n\t }\n\t\n\t if (textContent && textContent.stateTransition) {\n\t textContent.stateTransition = null;\n\t }\n\t\n\t if (textGuide && textGuide.stateTransition) {\n\t textGuide.stateTransition = null;\n\t } // TODO If el is incremental.\n\t\n\t\n\t if (el.hasState()) {\n\t el.prevStates = el.currentStates;\n\t el.clearStates();\n\t } else if (el.prevStates) {\n\t el.prevStates = null;\n\t }\n\t });\n\t }", "function undo(){\n undoing = true;\n reset(0);\n\n // Recover last known state\n for (var x = 0; x < 4; x++) {\n for (var y = 0; y < 4; y++) {\n if(blocksLastState[x][y] > 0)\n addBlock(x, y, blocksLastState[x][y]);\n // blocks[x][y] = blocksLastState[x][y];\n };\n };\n\n }", "function reset() {\r\n guessed = [];\r\n lives = 10;\r\n random = pick();\r\n}", "function reset() {\n state.moves = [];\n state.turnCount = 0;\n state.playbackSpeed = 700;\n chooseMove();\n }", "setColours() {\n this.colourNeutral = 'colourNeutral';\n this.colourGo = 'colourGo';\n this.colourNoGo = 'colourNoGo';\n this.setStartColour();\n }", "function reset() {\n round = 0;\n global_nums = [];\n history = [];\n germanProvinces = [];\n britishProvinces = [];\n fleets = [];\n gold = 275;\n points = 0;\n goldPerTurn = 0;\n guessedNums=[];\n }", "changeState(state) {\r\n for (let key in this.states){\r\n // console.log(this.states[key])\r\n if (key==state) {\r\n this.statesStack.append(this.state);\r\n this.state=state;\r\n this.undoStack.clear();\r\n return this;\r\n }\r\n } \r\n throw new Error();\r\n }", "function resetState() {\n var _arr = [before, after];\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var item = _arr[_i];\n if (!item) continue;\n item.parentNode && item.parentNode.removeChild(item);\n }\n before = after = null;\n instances = [];\n}", "function resetState() {\n var _arr = [before, after];\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var item = _arr[_i];\n if (!item) continue;\n item.parentNode && item.parentNode.removeChild(item);\n }\n before = after = null;\n instances = [];\n}" ]
[ "0.6521679", "0.6233091", "0.61860305", "0.6176525", "0.6149748", "0.6134702", "0.6133651", "0.61126596", "0.6107905", "0.609987", "0.6096422", "0.6093109", "0.6082121", "0.60687214", "0.60281116", "0.6026596", "0.6013014", "0.599194", "0.5981862", "0.5972272", "0.59706837", "0.5966791", "0.5956536", "0.5954412", "0.59519494", "0.5946392", "0.59459007", "0.5923262", "0.5913269", "0.5903347", "0.59023017", "0.59002197", "0.5895349", "0.5888967", "0.58885914", "0.5879365", "0.58638877", "0.58587986", "0.5856916", "0.585181", "0.5840102", "0.58275604", "0.58026123", "0.57969445", "0.5787478", "0.5786688", "0.57841235", "0.5783754", "0.57805634", "0.57780886", "0.57734746", "0.57623583", "0.57582873", "0.5750564", "0.5743287", "0.5742118", "0.57199484", "0.57167387", "0.57148093", "0.57148093", "0.57021093", "0.56939125", "0.56780344", "0.56761086", "0.56719095", "0.5661357", "0.5658507", "0.56584996", "0.5658164", "0.56512207", "0.563963", "0.5637174", "0.5629132", "0.56254774", "0.56141007", "0.56062704", "0.5603809", "0.56003535", "0.5600023", "0.559906", "0.5595536", "0.5594833", "0.55919915", "0.55859005", "0.5585562", "0.5584189", "0.5583085", "0.5581203", "0.5580424", "0.55796915", "0.55796915", "0.5579282", "0.5577912", "0.5574449", "0.55735296", "0.5569245", "0.55674237", "0.5564415", "0.55634284", "0.55634284" ]
0.68152267
0
When a player disconnects
function disconnection() { playersOnline-- primus.forEach(spark => spark.emit(GAME_EVENT.PLAYERS_ONLINE, playersOnline)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onClientDisconnect() {\r\n\tconsole.log(\"Client has disconnected: \"+this.id);\r\n\tvar nsp = url.parse(this.handshake.headers.origin).hostname;\r\n\t// Broadcast removed player to connected socket clients\r\n\tio.of(nsp).emit(\"userLeft\",{id: this.id});\r\n}", "async onPlayerRemoved(player) {}", "function onClientDisconnect () {\n num_of_players--;\n util.log('Player has disconnected: ' + this.id)\n\n var removePlayer = playerById(this.id)\n\n // Player not found\n if (!removePlayer) {\n util.log('Player not found: ' + this.id)\n return\n }\n\n // Remove player from players array\n players.splice(players.indexOf(removePlayer), 1)\n\n // Broadcast removed player to connected socket clients\n this.broadcast.emit('remove player', {id: this.id, num_of_players: num_of_players})\n}", "function onClientdisconnect() {\r\n\tconsole.log('disconnect'); \r\n\r\n\tvar removePlayer = find_playerid(this.id); \r\n\t\t\r\n\tif (removePlayer) {\r\n\t\tplayer_lst.splice(player_lst.indexOf(removePlayer), 1);\r\n\t}\r\n\t\r\n\tconsole.log(\"removing player \" + this.id);\r\n\t\r\n\t//send message to every connected client except the sender\r\n\tthis.broadcast.emit('remove_player', {id: this.id});\r\n\t\r\n}", "function onClientdisconnect() {\r\n\tconsole.log('disconnect'); \r\n\r\n\tvar removePlayer = find_playerid(this.id); \r\n\t\t\r\n\tif (removePlayer) {\r\n\t\tplayer_lst.splice(player_lst.indexOf(removePlayer), 1);\r\n\t}\r\n\t\r\n\tconsole.log(\"removing player \" + this.id);\r\n\t\r\n\t//send message to every connected client except the sender\r\n\tthis.broadcast.emit('remove_player', {id: this.id});\r\n\t\r\n}", "function onClientDisconnect () {\n util.log('Player has disconnected: ' + this.id)\n\n var removePlayer = playerById(this.id)\n if (!removePlayer) {\n util.log('Player not found: ' + this.id)\n return\n }\n if (playerQueue.length>0) {\n if(playerQueue[0].id==this.id) playerQueue.shift();\n }\n destroyMatch(removePlayer.id,0)\n players.splice(players.indexOf(removePlayer),1)\n}", "function onClientDisconnect () {\n util.log('Player has disconnected: ' + this.id)\n\n var removePlayer = playerById(this.id)\n\n // Player not found\n if (!removePlayer) {\n util.log('Player not found: ' + this.id)\n return\n }\n\n // Remove player from players array\n players.splice(players.indexOf(removePlayer), 1)\n\n // Broadcast removed player to connected socket clients\n this.broadcast.emit('remove player', {id: this.id})\n}", "function onClientDisconnect () {\n util.log('Player has disconnected: ' + this.id)\n\n var removePlayer = playerById(this.id)\n\n // Player not found\n if (!removePlayer) {\n util.log('Player not found: ' + this.id)\n return\n }\n players.splice(players.indexOf(removePlayer), 1) // Remove player from players array\n\n // Broadcast removed player to connected socket clients\n this.broadcast.emit('remove player', {id: this.id})\n}", "onPlayerDisconnect(event) {\n let playerId = event.playerid;\n if (!this.playerDialogs_.hasOwnProperty(playerId))\n return;\n\n let dialogId = this.playerDialogs_[playerId];\n if (this.dialogs_.hasOwnProperty(dialogId)) {\n this.dialogs_[dialogId].resolve({ response: 1 /* dismissed */, listitem: 0, inputtext: '' });\n delete this.dialogs_[dialogId];\n }\n\n delete this.playerDialogs_[playerId];\n }", "function onDisconnect(socket) {\n\t\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function port_on_disconnect() {\n player = {}; // Clear player state\n time_played = 0;\n num_scrobbles = 0;\n curr_song_title = '';\n chrome.browserAction.setIcon({'path': SETTINGS.main_icon});\n}", "function onClientDisconnect () {\n util.log('Player has disconnected: ' + this.id)\n\n var removePlayer = playerById(this.id)\n\n // Player not found\n if (!removePlayer || !removePlayer.PC) {\n console.log('Removing Player not found: ', this.id)\n return\n }\n\n // Room number not found\n if (!roomById(removePlayer.PC.roomid)){\n console.log('Removing Player Room not found: ', removePlayer.PC.roomid);\n return\n }\n\n this.broadcast.to('room'+removePlayer.PC.roomid).emit('message', {message: removePlayer.PC.name + \" goes to sleep.\", styles: [{color: '#ffffff', weight: 'Bold', position: 0}]});\n\n // Remove player from players array\n players.splice(players.indexOf(removePlayer), 1)\n\n // Broadcast removed player to connected socket clients\n //this.broadcast.emit('remove player', {id: this.id})\n}", "function onDisconnectListener() {\n console.debug(\"cs disconnected\");\n googlemusicport = null;\n googlemusictabId = null;\n connecting = false;\n refreshContextMenu();\n\n song.reset();\n player.reset();\n updateBrowserActionInfo();\n iconClickSettingsChanged();\n\n //try to connect another tab\n while (parkedPorts.length > 0) {\n var parkedPort = parkedPorts.shift();\n try {\n parkedPort.onDisconnect.removeListener(removeParkedPort);\n connectPort(parkedPort);\n break;\n } catch (e) {\n //seems to be disconnected, try next\n }\n }\n }", "_disconnect() {\n this.player.destroy();\n this.cleanup();\n this.status = Constants.VoiceStatus.DISCONNECTED;\n /**\n * Emitted when the voice connection disconnects.\n * @event VoiceConnection#disconnect\n */\n this.emit('disconnect');\n }", "function disconnect() {\r\n\t\t console.log('disconnect!');\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\r\n\t\t onConnectionSuccess);\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_FAILED,\r\n\t\t onConnectionFailed);\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\r\n\t\t disconnect);\r\n\t\t}", "function _onDisconnect(socket) {\n}", "function onDisconnect() {\n disconnected.value = true;\n self.disconnected = disconnected;\n $log.log(\"monitor is disconnected\");\n }", "_onDisconnect () {\n this._disconnectEvents();\n }", "async onPlayerDeath(player, killer, reason) {}", "onDisconnect(socket) {\n\n }", "disconnectedCallback() { }", "disconnectedCallback() {}", "disconnectedCallback() {}", "function onDisconnect(callback){\n\tsocket.on('gamepadleft', function(input){\n\t\tcallback();\n\t});\n}", "function disconnect(){\r\n console.log('Bot disconnected! Disconnecting from server!');\r\n server.close();\r\n}", "disconnectedCallback () {}", "disconnectedCallback(){}", "disconnectedCallback(){}", "disconnectedCallback(){}", "disconnect(){}", "function disconnect(socket) {\n socket.on('disconnect', function() {\n console.log('A player disconnected');\n\n // increment turn\n current_turn = (current_turn + 1) % players.length;\n players[current_turn].emit('your_turn');\n Socketio.emit('turnChange', {turn: current_turn}); // emit to all clients\n\n // remove player socket from server\n players.splice(players.indexOf(socket), 1);\n next_turn(socket);\n });\n}", "function disconnectPlayerOther(player) {\n activePlayerCount--;\n delete playerOthers[player.clientId];\n }", "disconnectedCallback() {\n // Attach callback:\n this._pipeCallback('onDisconnect');\n }", "disconnectedCallback(){\n \n }", "disconnectedCallback(){\n \n }", "disconnectedCallback(){\n \n }", "handleDisconnection() {}", "disconnectedCallback () {\n\n }", "disconnectedCallback () {\n }", "_gamepadDisconnect() {\n console.log(\"Gamepad disconnected\");\n\n if (this.ongamepaddisconneceted !== null) {\n this.ongamepaddisconneceted();\n }\n\n this.send(\"js,d\")\n }", "disconnect() {\n console.log(\"disconnect!\");\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\n this.onConnectionSuccess.bind(this)\n );\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_FAILED,\n this.onConnectionFailed.bind(this)\n );\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\n this.disconnect.bind(this)\n );\n\n this.disconnectedFunction();\n }", "disconnect() {\n this.emit('closing');\n this.sendVoiceStateUpdate({\n channel_id: null,\n });\n this.player.destroy();\n this.cleanup();\n this.status = Constants.VoiceStatus.DISCONNECTED;\n /**\n * Emitted when the voice connection disconnects.\n * @event VoiceConnection#disconnect\n */\n this.emit('disconnect');\n }", "disconnectedCallback() {\n\n }", "disconnectedCallback() {\n\n }", "function disconnecting( connection ) {\n}", "disconnectedCallback()\n\t{\n\n\t}", "disconnectedCallback()\n\t{\n\n\t}", "disconnectedCallback()\n\t{\n\n\t}", "disconnectedCallback()\n\t{\n\n\t}", "function onEnding() {\n player.stop();\n\n Messages.messageReceived.disconnect(onMessageReceived);\n Messages.unsubscribe(ASSIGNMENT_MANAGER_CHANNEL);\n }", "onDisconnect(id) {\n // this.sockets_not_used.delete(id);\n this.sockets.delete(id);\n this.players.delete(id);\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "onPeerDisconnected (peerInfo) {\n this.callbacks.peerDisconnected(peerInfo);\n // Turns out we don't have to do much, because the leave() function\n // called on the other end will terminate the PC which propagates to us\n }", "onDisconnect(delegate) {\n this.disconnected = delegate\n }", "function onSocketDisconnect() {\n console.log('Disconnected from socket server');\n}", "disconnectedCallback() {\n \n }", "disconnectedCallback(){\n console.log(\"vua co 1 meme dc xoa di khi qua nham\");\n }", "DisconnectEvents() {\n\n }", "disconnectCallback() {\n this._disconnectCallback && this._disconnectCallback();\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n //\n }", "function onDisconnect() {\n console.log(\"Disconnected!\");\n process.exit();\n}", "onDisconnect()\n {\n this.connected = false;\n this.clearStates();\n this.emit(Connection.onDisconnect);\n }", "function clientDisconnect() {\r\n delete clients[connection.remoteAddress];\r\n console.log('connection closed: ' + remoteAddress + \" \" + now.getHours() + \":\" + now.getMinutes() + \":\" + now.getSeconds());\r\n\r\n\r\n }", "disconnectedCallback(){\n\t\t\t\n\t\t}", "function Disconnect(socket) {\n players--;\n console.log(\"Disconnected: \" + socket.id);\n for (let i = 0; i < player_id.length; i++) {\n if (player_id[i] === socket.id) {\n socket.broadcast.emit('left', player_id[i]);\n player_id.splice(i, 1);\n break;\n }\n }\n\n}", "disconnect() { }", "disconnect() { }", "disconnect() { }", "function disconnect() {\n console.log('INFO (join.js): Connection disconnect!');\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\n onConnectionSuccess);\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_FAILED,\n onConnectionFailed);\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\n disconnect);\n}", "function onDisconnectedHandler(reason) {\n\twriteToLog(`* Disconnected from Twitch`);\n}", "function notifyDisconnect(playerId) {\n for (let clientId in activeClients) {\n let client = activeClients[clientId];\n if (playerId !== clientId) {\n client.socket.emit('message', {\n type: 'disconnect-other',\n clientId: playerId\n });\n }\n }\n }", "_disconnect() {\n\t\tlet aChannelMembers = this._oConnection.getVoiceChannel().getMembers();\n\t\tif (aChannelMembers.length === 1) {\n\t\t\tthis._oClient.setPresence(\"\");\n\t\t\tconnectionsHandler.unregisterConnection(this.getId().toString());\n\t\t}\n\t}", "function closeListener (e) {\r\n //displayChatMessage(\"Orbiter connection closed.\");\r\n displayChatMessage(\"Connection Lost.\");\r\n}", "disconnectedCallback() {\n /* Remove events listeners for the buttons*/\n this.playBtn.removeEventListener(\"click\", this.play);\n this.updateBtn.removeEventListener(\"click\", this.update);\n this.deleteBtn.removeEventListener(\"click\", this.delete);\n }", "function OnDisconnectAlert()\n{\n}", "disconnectedCallback () {\r\n console.log('Component disconnect!')\r\n }", "disconnectedCallback() {\n this.unsubscribeToMessageChannel();\n }", "function clientDisconnect(data) {\n\tshowNewMessage(\"notification\", {msg: '<b> ~ '+data.username+' left the chatroom. ~</b>'});\n\tMaterialize.toast(data.username+' left the chatroom.', 2000);\n\tremoveUserFromList(data);\n}", "onDisconnected(){\n const message = 'Game ended with disconnected';\n socket.emit('gameEnded', {\n room: this.getRoomId(),\n message: message,\n });\n }", "death(currentPlayer, consequence, channel){//Kills the player\n this.players = this.players.filter(player => {return player.id !== currentPlayer.id})\n channel.send(consequence.description).catch(err => {console.error(err);})\n this.utils.saveUniverse(this)\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 }", "disconnectedCallback() {\n console.log(\"disconnected Callback called\")\n\n }", "onDisconnected() {\n if (!this.connected) return\n this.multiplexer.stop()\n // We need to unset the id in order to receive an immediate response with new\n // client id when reconnecting.\n this.id = undefined\n this.connected = false\n log('disconnected')\n this.emit('disconnected')\n }", "clientDisconnected() {\n this.clear();\n this.emit('disconnect');\n }", "function onDisconnect() {\n pruneConnectionsMap();\n}", "function onDisconnect(evt) {\n\t\tconnected = false;\n\t\t$('.connectionState').text(\"Not connected\");\n\t\t$('.connectionState').removeClass('connected');\n\t\tdoConnect();\n\t}", "_onDisconnected() {\n this._watcher.stop();\n this.emit(\"disconnected\");\n }", "function disconnect() {\n console.log(\"Good Bye!\");\n connection.end(); //// END CONNECTION ////\n}", "disconnectedCallback () {\n this.log_('disconnected');\n\n // Clear all timers.\n this.forEachTimeoutID_((id) => {\n this.clearTimeout(id);\n });\n\n this.connected_ = false;\n }", "disconnectedCallback() {\r\n console.log('disconnectedCallback called')\r\n }", "disconnectedCallback () {\r\n this.removeEventListener('click', this._flipCard)\r\n this.removeEventListener('keydown', this._onkeydown)\r\n }" ]
[ "0.77410567", "0.76328975", "0.7587706", "0.74763983", "0.74763983", "0.74500006", "0.73989964", "0.7319388", "0.72578377", "0.7221466", "0.7197808", "0.7197808", "0.7197808", "0.7197808", "0.71698797", "0.7167089", "0.7140136", "0.70863324", "0.7080301", "0.7052136", "0.70423955", "0.702161", "0.7020805", "0.6996064", "0.69854164", "0.6960962", "0.6960962", "0.6946674", "0.693899", "0.69353837", "0.69308317", "0.69308317", "0.69308317", "0.6918536", "0.68916285", "0.68877035", "0.687508", "0.68719363", "0.68719363", "0.68719363", "0.6869601", "0.68636763", "0.685279", "0.6850759", "0.6844958", "0.6844169", "0.68421525", "0.68421525", "0.6840332", "0.6828232", "0.6828232", "0.6828232", "0.6828232", "0.6817654", "0.681703", "0.6814862", "0.6814862", "0.6814862", "0.6814862", "0.6810253", "0.680995", "0.6808364", "0.68048227", "0.6803625", "0.67963254", "0.6792005", "0.67905015", "0.67905015", "0.67744315", "0.6767742", "0.67673075", "0.6766793", "0.67642874", "0.67619306", "0.6758526", "0.6758526", "0.6758526", "0.6753742", "0.6751465", "0.67312044", "0.6710261", "0.67049634", "0.66833115", "0.66640687", "0.6660195", "0.66539145", "0.66472256", "0.66426253", "0.6638381", "0.6624205", "0.6621482", "0.6618174", "0.6617625", "0.661647", "0.6614442", "0.6609025", "0.6608392", "0.65972203", "0.65952516", "0.658592" ]
0.7418078
6
When player clicks on a pattern
function playerPattern(color, pattern) { const draw = { beehive: drawBeehive, toad: drawToad, lwss: drawLwss, glider: drawGlider, } if (draw[pattern]) { draw[pattern](color) primus.forEach(spark => spark.emit(GAME_EVENT.STATE, game.colors)) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickButton(e) {\n click++;\n for(let i=0; i<buttonArray.length; i++) {\n if (buttonArray[i].name == e.target.id){\n let tBut = buttonArray[i];\n\n // IS IT RIGHT\n if (tBut == pattern[click-1]){\n tBut.highlight(true);\n } else {\n tBut.highlight(false);\n if (useStrict) {\n gameOver();\n } else {\n showPattern();\n turn() \n }\n }\n \n // Is It End\n if (click == pattern.length && gameOn == true) {\n if(pattern.length >= 5) {\n gameWin();\n }\n console.log(pattern);\n document.getElementById('counter').innerText = pattern.length;\n whoseTurn = \"cpu\";\n turn();\n }\n }\n }\n}", "function userButtonPressAction() {\n $(\".btn\").click(function() {\n if(!isClickPatternOrderedSubsetOfGamePattern()) {\n gameOver();\n return;\n }\n if(userClickPattern.length < gamePattern.length)\n return;\n\n /*if user gets to this point, then the clickPattern must equal the\n gamePattern. So, the user will go on to the next level*/\n userClickPattern = [];\n setTimeout(nextLevel, 1000);\n\n });\n}", "function playerClick() {\n playerSequence.push(\"#\" +this.id);\n console.log(\"Player: \" + playerSequence);\n animate(this);\n currentClickCount+=1;\n checkForMatch();\n }", "function startOver() {\n level=0;\n var gamePattern = [];\n var userClickedPattern = [];\n}", "function nextSequence(){\n userClickedPattern = []\n var randomNumber = Math.floor(Math.random()*4);\n var randomChosenColor = buttonColor[randomNumber];\n gamePattern.push(randomChosenColor);\n blink(randomChosenColor);\n setTimeout(blink,5);\n sounds(randomChosenColor);\n $('h1').text('Level ' + level);\n level ++;\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 correctClick() {\n\tlet index = parseInt(this.id);\n\t\n\tplaySound(index);\n\t\t\n\tif (index != pattern[curIndex++]) {\n\t\tconsole.log(\"oh no\");\n\t\t\n\t\t//simon_exec will end the game if result is -1\n\t\tresult = -1;\n\t\tsimon_exec();\n\t}\n\telse if (curIndex >= pattern.length) {\n\t\tconsole.log(\"we did it\");\n\t\tscore++;\n\t\tuserClear();\n\t\tsimon_exec().then(() => {\n\t\t\tuser_run();\n\t\t});\n\t}\n}", "function startGame() {\n removeClicks();\n resetGame();\n addPattern();\n addPattern();\n playPattern();\n}", "function patternHandler() {\n\tif(lockBoard){\n\t\treturn;\n\t}\n\n //Get the id of the cell that was clicked\n var rowcol = this.id.split(\"_\");\n var row = parseInt(rowcol[0]);\n var col = parseInt(rowcol[1]);\n\n var patternOption = getPatternOption();\n\n //Set pattern for the game based on player's selection\n if(patternOption == 2){\n //Still Life: Block\n setCell(grid, row, col);\n setCell(grid, row, col-1);\n setCell(grid, row-1, col);\n setCell(grid, row-1, col-1);\n } else if(patternOption == 3){\n //Still Life: Beehive\n setCell(grid, row, col);\n setCell(grid, row, col-1);\n setCell(grid, row-1, col-2);\n setCell(grid, row-2, col);\n setCell(grid, row-2, col-1);\n setCell(grid, row-1, (col+1));\n } else if(patternOption == 4){\n //Oscillators: Blinker\n setCell(grid, row, col);\n setCell(grid, row, col-1);\n setCell(grid, row, col-2);\n } else if(patternOption == 5){\n //Oscillators: Beacon\n setCell(grid, row, col);\n setCell(grid, row, col-1);\n setCell(grid, row-1, col);\n\n setCell(grid, row-3, col-2);\n setCell(grid, row-3, col-3);\n setCell(grid, row-2, col-3);\n } else if(patternOption == 6){\n //Oscillators: Toad\n setCell(grid, row, col);\n setCell(grid, row, col-1);\n setCell(grid, row, col-2);\n\n setCell(grid, row+1, col-1);\n setCell(grid, row+1, col-2);\n setCell(grid, row+1, col-3);\n } else if(patternOption == 7){\n //Glider\n setCell(grid, row, col);\n setCell(grid, row, col-1);\n setCell(grid, row, col-2);\n setCell(grid, row-1, col);\n setCell(grid, row-2, col-1);\n } else if(patternOption == 8){\n //Lightweight Spaceship\n setCell(grid, row, col);\n setCell(grid, row, col-1);\n setCell(grid, row, col-2);\n setCell(grid, row, col-3);\n\n setCell(grid, row-1, col);\n setCell(grid, row-2, col);\n\n setCell(grid, row-3, col-1);\n setCell(grid, row-1, col-4);\n setCell(grid, row-3, col-4);\n } else{\n \tsetCell(grid, row, col);\n }\n\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}", "handleCanvasClick(e){\n let xpos = 0, ypos = 0;\n if (e.offsetX == undefined){\n xpos = e.pageX-e.target.offsetLeft;\n ypos = e.pageY-e.target.offsetTop;\n }else{\n xpos = e.offsetX;\n ypos = e.offsetY;\n }\n let x = Math.floor(xpos / (e.target.width / this.pattern.width));\n let y = Math.floor(ypos / (e.target.height / this.pattern.width));\n if (e.which == 1){this.drawHandler(x, y, this);}\n if (e.which == 3){this.drawHandlerAlt(x, y, this);}\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}", "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() {\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 onClick() {\n\tdocument.getElementById('text-area').value = '';\n\tconst stoppingPoint = document.getElementById('pattern-input').value;\n\tthis.patternProducer(stoppingPoint);\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 mouseClicked() {\n\tsave('pattern-1.jpg');\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 registerClick(boardClicked) {\n\n var answer = sequence[this.activeIndex];\n \n if (boardClicked == answer)\n {\n this.activeIndex++;\n checkEnd();\n }\n\n //if its not correct\n else {\n\n lockBoard();\n gameOver();\n }\n}", "function nextSequence() {\r\n \r\n // reset userClickPattern to empty array\r\n userClickPattern = [];\r\n \r\n // iterate level variable by one\r\n level++;\r\n \r\n // change title to current level\r\n $(\"#level-title\").text(\"Level \" + level);\r\n \r\n // random number generator to give a number between 0 and 4\r\n var randomNumber = Math.floor(Math.random() * 4);\r\n \r\n // variable that holds the color in the buttonColor at the index equal to the random generated number\r\n var randomChosenColor = buttonColors[randomNumber];\r\n \r\n // then push the random color chosen above into the game pattern array\r\n gamePattern.push(randomChosenColor);\r\n\r\n // fade in/out and play the sound of the button chosen at the ID that matches the random chosen color\r\n $(\"#\" + randomChosenColor)\r\n .fadeIn(200)\r\n .fadeOut(200)\r\n .fadeIn(200);\r\n playSound(randomChosenColor);\r\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}", "clicked(mx,my){\n\n //if( (my == this.y) && (mx <= (this.begin+5)) && (mx >= this.begin) ){\n if( (my <= this.y) && (my >= (this.y)-8) && (mx <= (this.begin+8)) && (mx >= this.begin) ){\n if(this.pressed==0){\n this.pressed = 1;\n console.log(this.begin);\n console.log(this.mirna_sequence);\n console.log(this.mirna_id);\n }\n else{\n this.pressed = 0;\n console.log(this.end);\n }\n }\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 btnValid = true;\n \n // Empty the user's pattern of the previous round;\n userClickedPattern = [];\n\n // Update the level\n level++;\n $(\"h1\").text(\"Level \" + level);\n\n // Make PC choose a random color, then play its sound and show it being pushed\n let randomNumber = Math.floor(Math.random() * 4);\n let buttonChosen = buttonColours[randomNumber];\n buttonPressAnimation(buttonChosen);\n console.log(\"The generated color is \" + buttonChosen);\n\n // Append the generated button click to gamePattern\n gamePattern.push(buttonChosen);\n console.log(\"The gamePattern is \" + gamePattern);\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 nextSequence() {\n //Reset user clcik pattern\n userClickedPattern = [];\n\n //Update header with level number\n level++;\n $(\"#level-title\").text(\"Level \" + level);\n\n var randomNumber = Math.floor(Math.random() * 4);\n\n //Choose a random colour from array of colours\n var randomChosenColour = buttonColours[randomNumber];\n\n //Add random colour to game pattern array\n gamePattern.push(randomChosenColour);\n $(\"#\" + randomChosenColour).fadeIn(\"fast\").fadeOut(\"fast\").fadeIn(\"fast\");\n $(\"#\" + randomChosenColour).on(\"animationend\", playSound(randomChosenColour));\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 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 startOver() {\r\n level = 0;\r\n gamePattern = [];\r\n userClickedPattern = [];\r\n console.log(gamePattern);\r\n $(document).one(\"keydown\", function() {\r\n nextSequence();\r\n $(\"#level-title\").text(\"Level \" + level);\r\n });\r\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}", "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 nextSequence() {\n\n // reset user clicked pattern every level\n userClickedPattern = [];\n\n // increase level\n level += 1;\n $(\"h1\").text(\"Level \" + level);\n\n // generate random number between 0 - 4\n var randomNumber = Math.floor(Math.random() * 4);\n\n // random colour becomes array position of random number\n var randomChosenColour = buttonColours[randomNumber];\n\n // append colour to game pattern array\n gamePattern.push(randomChosenColour);\n\n // flash the element with the ID of respective random colour\n $(\"#\" + randomChosenColour).fadeIn(100).fadeOut(100).fadeIn(100);\n\n // play audio of respective colour\n playSound(randomChosenColour);\n\n}", "function startOver() {\r\n gamePattern = [];\r\n userClickedPattern = [];\r\n level = 0;\r\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 startOver(){\r\n level = 0;\r\n gamePattern = [];\r\n userClickedPattern = [];\r\n}", "function nextSequence() {\r\n // 29. set user click pattern to empty array.\r\n userClickPatterns = [];\r\n// 23. Increasing level by 1 every time.\r\n level++;\r\n// 24. update h1 with this change in value of level\r\n $(\"#level-title\").text(\"level \" + level);\r\n // 1.creating a random number between 1 and 3\r\n\r\n var randomNumber = Math.floor(Math.random() * 4);\r\n // 4. creating a new variable randomChosenColor using randomNumber to select a color.\r\n\r\n var randomChosenColor = buttonColors[randomNumber];\r\n // 6. Adding randomChosenColor using push to the end of game patterns.\r\n gamePattern.push(randomChosenColor);\r\n // 7. selecting same Id as randomChosenColor.\r\n // using jquery to animate a flash.\r\n $(\"#\" + randomChosenColor).fadeIn(100).fadeOut(100).fadeIn(100);\r\n // 8b. attaching the sound to the function next\r\n // sequence with the randomChosenColor.\r\n playSound(randomChosenColor);\r\n\r\n}", "function nextSequence() {\n //once sequence is triggered, reset userClickedPattern to an empty array for the next level\n userClickedPattern = [];\n//increase level by 1 every time nextSequence is called\n level++;\n//update h1 for every change in level\n $(\"#level-title\").text(\"Level \" + level);\n\nvar randomNumber = Math.floor(Math.random() * 4);\n//Use randomNumber to select a button colour\nvar randomChosenColour = buttonColours[randomNumber];\n//Add randomChosenColour to gamePattern\ngamePattern.push(randomChosenColour);\n//1. Use jquery to select the button with same id as randomChosenColour\n//2. animate the button with a flash effect\n//3. play the correct audio file in relation to randomChosenColour\n$(\"#\" + randomChosenColour).fadeIn(100).fadeOut(100).fadeIn(100);\nplaySound(randomChosenColour);\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 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 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 nextSequence() {\n\n//29.Once nextSequence() is triggered, reset the userClickedPattern to an empty array ready for the next level.\n userClickedPattern = [];\n\n//22.Inside nextSequence(), increase the level by 1 every time nextSequence() is called.\n level++;\n\n//23.Inside nextSequence(), update the h1 with this change in the value of level.\n $(\"#level-title\").text(\"Level \" + level);\n\n//2. Inside the new function generate a new random number between 0 and 3, and store it in a variable called randomNumber\n var randomNumber = Math.floor(Math.random() * 4);\n\n//4. Create a new variable called randomChosenColour and use the randomNumber from step 2 to select a random colour from the buttonColours array.\n var randomChosenColor = buttonColors[randomNumber];\n\n//6. Add the new randomChosenColour generated in step 4 to the end of the gamePattern.\n gamePattern.push(randomChosenColor);\n\n//7. Use jQuery to select the button with the same id as the randomChosenColour\n//8.Use Google/Stackoverflow to figure out how you can use jQuery to animate a flash to the button selected in step 7.\n $(\"#\" + randomChosenColor)\n .fadeIn(100)\n .fadeOut(100)\n .fadeIn(100);\n\n playSound(randomChosenColor);\n}", "function mouseClicked(){\n\tloop()\n}", "function checkAnswer(){\r\n var lastClickIndex = userClickedPattern.length;\r\n lastClickIndex -- ;\r\n if(gamePattern[lastClickIndex] == userClickedPattern[lastClickIndex]){\r\n console.log(\"correct\");\r\n\r\n // if the user clicked pattern is equal in length to the game pattern advance to next Level\r\n if(gamePattern.length == userClickedPattern.length){\r\n nextSequence();\r\n }\r\n }\r\n else{\r\n var endGameSound = new Audio(\"sounds/wrong.mp3\");\r\n endGameSound.play();\r\n $(\"#level-title\").html(\"GAME OVER. <br> Press Any Key to RESTART\")\r\n // remember the .html method will include HTML tag <br> which generates a newline\r\n $(\"body\").addClass(\"game-over\");\r\n setTimeout(function(){\r\n $(\"body\").removeClass(\"game-over\");\r\n }, 1000);\r\n\r\n startOver();\r\n }\r\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() //Blink some random colour and add it to Actual order, empty Clicked order and change Level\r\n{\r\n level++;\r\n\r\n $(\"h1\").text(\"Level \" + level);\r\n\r\n var randomNumber = Math.floor(4*Math.random());\r\n \r\n var randomChosenColour = buttonColours[randomNumber];\r\n \r\n gamePattern.push(randomChosenColour);\r\n \r\n $(\"#\" + randomChosenColour).fadeToggle(100).fadeToggle();\r\n \r\n playSound(randomChosenColour);\r\n \r\n userClickedPattern = [];\r\n}", "function Clicked(CellClicked){ \n if (typeof originalBoard[CellClicked.target.id]=='number'){\n if(PlayerDecide%2==1) {\n Show(CellClicked.target.id,FirstPlayer);\n PlayerDecide=PlayerDecide+1;\n }\n else { \n Show(CellClicked.target.id,SecondPlayer);\n PlayerDecide=PlayerDecide+1;\n }\n }\n}", "function onClick(e) {\r\n onPause();\r\n if (getCarrier(e.yValue) == story.getFrameValue()) {\r\n onPlay();\r\n } else {\r\n story.goToFrame(getCarrier(e.yValue));\r\n onPause();\r\n }\r\n }", "function nextSequence() {\r\n userClickedPattern = [];\r\n\r\n let randomNumber = Math.floor(Math.random() * 4);\r\n\r\n let randomChosenColour = buttonColours[randomNumber];\r\n\r\n gamePattern.push(randomChosenColour);\r\n\r\n setTimeout(() => {\r\n if (gamePattern.length < 2) {\r\n computerButtonAnimation(randomChosenColour);\r\n playAudio(randomChosenColour);\r\n }\r\n }, 200);\r\n\r\n document.querySelector(\"#level-title\").innerHTML = \"Level \" + levelCount;\r\n\r\n levelCount++;\r\n}", "function next_sequence() {\n user_clicked_pattern = [];\n level_number++;\n $(\"h1\").text(\"Level \" + level_number);\n\n let random_number = Math.floor(Math.random()*4);\n let random_chosen_color = button_colors[random_number];\n game_pattern.push(random_chosen_color);\n\n $(\"#\" + random_chosen_color).fadeIn(220).fadeOut(220).fadeIn(220);\n\n play_sound(random_chosen_color);\n\n return random_number\n}", "function startOver() {\r\n started = false;\r\n gamePattern = [];\r\n userClickedPattern = [];\r\n level = 0;\r\n}", "function nextSequence() {\n var randomNumber = Math.floor(Math.random() * 4); // Generate random number between 0-3\n var randomChosencolor = buttoncolors[randomNumber]; // From the random number generated, select the coordinating color in the buttoncolors Array\n $(\"#\" + randomChosencolor).fadeOut(300).fadeIn(300); // Select the button with the corresponding color and animate\n gamePattern.push(randomChosencolor); // Push the color into the gamePattern Array\n playsound(randomChosencolor); // Play the audio\n userClickedPattern = []; // Clear userClickedPattern\n pos = 0; // Reset pos to 0\n\n setTimeout(function() {\n // Change instruction after 1 second to let player know to start\n $(\"#instructions\").text(\"Play!\");\n }, 1000);\n\n started = true; // Re-enable the buttons\n}", "function nextSequence() {\n userClickedPattern = [];\n level += 1;\n $(\"#level-title\").text(\"Level \" + level);\n var randomNumber = Math.floor(Math.random() * 4);\n var randomChosenColour = buttonColours[randomNumber];\n gamePattern.push(randomChosenColour);\n\n for (let i =0; i<gamePattern.length;i++ ){\n setTimeout(function(){\n $(\"#\" + gamePattern[i]).fadeToggle(200).fadeToggle(200);\n playSound(gamePattern[i]);\n },i*800)\n\n }\n\n\n\n\n\n}", "clickHandler(event) {\n let p = this.mouse.add(this.cartography._view);\n if (event.shiftKey) {\n this.state.player.data.input.fire = new Vector(p);\n } else {\n this.state.cursor.data.position.set(p);\n this.state.player.data.destination.set(p);\n }\n }", "function clickEvent(){ \r\n const execCode = new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnDoublePickTrigger, (event) => {\r\n if(event.meshUnderPointer.value === null ){\r\n console.log(board.indexOf(event.meshUnderPointer));\r\n if(canPlay){ \r\n if (turn){\r\n event.meshUnderPointer.value = 'x';\r\n makeX(event.meshUnderPointer); \r\n win();\r\n }else{\r\n event.meshUnderPointer.value = 'o';\r\n makeO(event.meshUnderPointer);\r\n win();\r\n }\r\n }\r\n }\r\n });\r\n return execCode;\r\n }", "function startOver() {\n level = 0;\n i = 0;\n gamePattern = [];\n userClickedPattern = [];\n start = false;\n}", "function nextSequence() {\n\n //reset user choice for this round\n currentLevel = 0;\n userClickedPattern = [];\n level++;\n\n //update level header\n $(\"#level-title\").html(\"Level \" + level);\n\n var randomNumber = Math.floor(Math.random() * 4);\n var randomChosenColour = buttonColours[randomNumber];\n gamePattern.push(randomChosenColour);\n\n $(\"#\" + randomChosenColour).fadeOut(100).fadeIn(100);\n\n //play sound of selected color\n playSound(randomChosenColour);\n\n}", "function nextSequence(){\r\n //Clearing array for the next sequence\r\n userClickedPattern=[];\r\n $(\"#level-title\").html(\"Level \"+ level++)\r\n //Chose of a random button \r\n //Adding this random element to the array\r\n var randomNumber=Math.floor(Math.random()*4);\r\n var randomChosenColour=buttonColours[randomNumber];\r\n gamePattern.push(randomChosenColour);\r\n //Creation of animation\r\n $(\"#\"+randomChosenColour).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);\r\n //Sound of initial element\r\n playSound(randomChosenColour);\r\n}", "function takePebbles(holeValue, holeclick){\r\n if (holeValue === 4&&x>0&&pebblesInHand === 0){\r\n PonP_sound.play(); \r\n holeclick.owner = activePlayer;\r\n arr.push(holeclick);\r\n document.querySelector('.hand_pebbles').src = 'pebbles_'+pebblesInHand+'.png';\r\n nextPlayer();\r\n }\r\n x+=1; \r\n}", "handleClick () {\n super.handleClick()\n this.player_.trigger('next')\n }", "function drawPattern(patternName, grid) {\r\n //check what is the type of the pattern an then call corresponding function\r\n newRow = Math.floor(Math.random() * 191829) % NUM_ROWS,\r\n newCol = Math.floor(Math.random() * 8103849204) % NUM_COLS;\r\n\t\tif (patternName === \"Block\" || patternName === \"Beehive\" ||\r\n\t\t\tpatternName === \"Loaf\" || patternName === \"Boat\") {\r\n\t\t\tdrawStillLife(patternName, grid, newRow, newCol);\r\n\t\t}\r\n\t\tif (patternName === \"Blinker\" ||patternName === \"Toad\" ||\r\n \t\tpatternName === \"Beacon\" || patternName === \"Pulsar\") {\r\n \t\tdrawOscillator(patternName, grid, newRow, newCol);\r\n \t}\r\n \tif (patternName === \"Glider\" || patternName === \"LWSS\") {\r\n \t\tdrawSpaceship(patternName, grid, newRow, newCol);\r\n \t}\r\n if (patternName === \"Infected\" || patternName === \"Mine\" ||\r\n patternName === \"Pacman\" || patternName === \"Snake\"){\r\n drawExtra(patternName, grid, newRow, newCol);\r\n }\r\n }", "function onClick(x,y){\n if($scope.timer==undefined){ // Start the timer if has not been started yet\n $scope.timer = $interval(timer, 100);\n }\n if($scope.grid[x][y].state == -1){ // If the case is a mine\n $scope.play = false; // The game stops\n $interval.cancel($scope.timer); // The timer stops\n }\n else if ($scope.grid[x][y].state >= 0) { // Otherwise\n revealCase(x,y); // Potential empty neighbors are also revealed\n $scope.success = isSuccess(); // Test if the game is completed\n }\n }", "function nextSequence() {\n var randNum = Math.floor(Math.random() * 4);\n var pressed_button = buttonColors[randNum];\n game_pattern.push(pressed_button);\n //console.log(game_pattern);\n buttonPressed(pressed_button);\n game_level++;\n updateTitle(\"Level \" + (game_level));\n}", "clicked(x, y) {}", "function pattern() {\n var patternLeds;\n if (tessel) {\n var switches = ['on', 'off', 'off'];\n tessel.led[1][switches[0]]();\n tessel.led[2][switches[1]]();\n tessel.led[3][switches[2]]();\n patternLeds = setInterval(function() {\n // rotate the switches\n switches.unshift(switches.pop())\n tessel.led[1][switches[0]]();\n tessel.led[2][switches[1]]();\n tessel.led[3][switches[2]]();\n }, 100);\n setTimeout(function() {\n clearInterval(patternLeds)\n tessel.led[1].off();\n tessel.led[2].off();\n tessel.led[3].off();\n }, 4500);\n }\n}", "function startOver() {\n level = 0;\n gamePattern = [];\n userClickedPattern = [];\n started = false;\n}", "function clickHandler() {\n if (Player.isShuffled) {\n Player.reshuffleOnClick(\n Main,\n self,\n this.getAttribute('data-file-path')\n );\n return;\n }\n\n Player.play(this.getAttribute('data-file-path'), self, Main);\n }", "function generatePattern() {\n var randomNumber = Math.ceil(Math.random() * 4);\n pattern.push(colors[randomNumber]);\n showMoves();\n}", "function playGamePattern() {\n started = false; // False to disable buttons from being pressed until the sequence has been played.\n $(\"#instructions\").text(\"Watch!\"); //Change instructions\n\n// setInterval to play the gamePattern array items every 1 second\n var player = setInterval(function() {\n playsound(gamePattern[colorIndex]); // Play audio\n $(\"#\" + (gamePattern[colorIndex])).fadeOut(300).fadeIn(300); // Animate button\n colorIndex++; // Increment to move on to the next item in the array\n if (colorIndex >= gamePattern.length) { // When colorIndex is equal to the number of items in gamePattern array\n clearInterval(player); // Clear interval\n }\n }, 1000);\n\n setTimeout(nextSequence, 1000 * (gamePattern.length + 1)); // nextSequence function 1 second after the last item in gamePattern array is played\n}", "function nextSequence() {\r\n // Array is reset ready for next level\r\n userClickedPattern = [];\r\n\r\n // Generating a random number from 0 to 3\r\n var randomNumber = Math.floor(Math.random() * 4);\r\n\r\n // Picking a random color using the number generated from nextSequence()\r\n var randomChosenColour = buttonColours[randomNumber];\r\n\r\n // Pushing the random chosen color to the game pattern\r\n gamePattern.push(randomChosenColour)\r\n\r\n // Variables to be passed as ID selector\r\n var idOfRandomColour = \"#\" + randomChosenColour;\r\n\r\n // Animating the random colour selected to flash \r\n $(idOfRandomColour).fadeOut(200).fadeIn(100);\r\n\r\n // Playing the sound of the random color next in the sequence\r\n playSound(randomChosenColour);\r\n\r\n // Increments level\r\n level++;\r\n\r\n // Change title header according to level\r\n $(\"#level-title\").text(\"Level \" + level);\r\n}", "function nextSequence() {\n\n //Once nextSequence() is triggered, reset the userClickedPattern to an empty array ready for the next level\n userClickedPattern = [];\n\n //Increase the level by 1 every time nextSequence() is called\n level++;\n\n //Update the h1 with the value of the level been played\n $(\"#level-title\").text(\"Level \" + level);\n\n //Generates a random number between 1 and 3\n var randomNumber = buttonColours[Math.floor(Math.random() * 4)];\n\n //New variable randomChosenColour to store the random colour\n var randomChosenColour = randomNumber;\n\n //Add the new randomChosenColour to the end of the gamePattern array\n gamePattern.push(randomChosenColour);\n\n //jQuery select the button with the same ID as the randomChosenColour and animate it with a flash\n $(\"#\" + randomChosenColour).fadeIn(100).fadeOut(100).fadeIn(100);\n\n //Refactoring the code in playSound() so it work for both playing sound in nextSequence() and when the user clicks a button\n playSound(randomChosenColour);\n\n //return randomChosenColour;\n}", "function checkAnswer(patternLen) {\r\n for(var i=0;i<patternLen;i++){\r\n if(userClickedPattern[i] !== gamePattern[i]){\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}", "function nextSequence()\r\n{\r\n // Reset user play for next level\r\n userClickedPatternAR = [];\r\n \r\n // Starts game\r\n level++; \r\n $(\"#level-title\").text(\"Level \" + level);\r\n\r\n // Generate a random number from 0-3\r\n var randomNumber = Math.floor(Math.random() * 4); \r\n var randomChosenColor = buttonColorsAR[randomNumber];\r\n gamePatternAR.push(randomChosenColor);\r\n\r\n // Button sound & effects\r\n $(\"#\" + randomChosenColor).fadeOut(100).fadeIn(100);\r\n playSound(randomChosenColor); \r\n \r\n}", "addClick(e) {\n //console.log(this.m.gameOver)\n if (!this.m.gameOver) {\n let player;\n if (e.target.innerText == \"\") {\n if (!this.m.gameOver) {\n //if tiled has been clicked or not\n if (this.m.beenClicked % 2 == 0) {\n // console.log('x clicked')\n e.target.innerText = \"X\";\n player = this.m.firstPlayer;\n } else {\n e.target.innerText = \"O\";\n //console.log('o clicked')\n player = this.m.secondPlayer;\n }\n\n this.m.beenClicked++;\n // console.log(e);\n // console.log('clicked on', e.target.id)\n //was clicked=true\n if (this.m.beenClicked > 4) {\n this.checkWin();\n }\n this.playerTurn(player);\n\n }\n }\n }\n }", "function mouseClickedOnCanvas() {\n game.click = true;\n}", "playOnClick() {\n const anim = Math.floor(Math.random() * this.possibleAnims.length) + 0;\n this.playModifierAnimation(this._idle, 0.25, this.possibleAnims[anim], 0.25);\n }", "function onBoardClick() {\n if (!hasStarted) {\n startGame();\n } else {\n startPause();\n }\n }", "function mouseClicked() {\n //i cant figure out how to do mouse controls\n //player.mouseControls *= -1\n\n for (b = 0; b < buttons.length; b++){\n switch (buttons[b].shape) {\n case \"rect\":\n if (mouseX >= (buttons[b].x + camOffsetX) * canvasScale &&\n mouseX <= (buttons[b].x + camOffsetX + buttons[b].w) * canvasScale &&\n mouseY >= (buttons[b].y + camOffsetY) * canvasScale &&\n mouseY <= (buttons[b].y + camOffsetY + buttons[b].h) * canvasScale){\n if (options.optionsMenuHidden === -1 && buttons[b].tab === options.optionsMenuTab){\n buttons[b].testClick();\n return;\n }\n }\n break;\n case \"circle\":\n if (Math.sqrt(Math.pow(mouseX - ((buttons[b].x + camOffsetX) * canvasScale), 2)+Math.pow(mouseY - ((buttons[b].y + camOffsetY) * canvasScale),2) < buttons[b].w)){\n if (options.optionsMenuHidden === -1 && buttons[b].tab === options.optionsMenuTab){\n buttons[b].testClick();\n return;\n }\n }\n default:\n break;\n }\n \n }\n}", "function pinkButtonClicked(event) {\n createjs.Sound.play(\"clicked\");\n}", "function pinkButtonClicked(event) {\n createjs.Sound.play(\"clicked\");\n}", "function onClick(p) {\n\t// only allow clicking if it's our turn and the game isn't over\n\tif (!Client.isMyTurn() || Client.isGameOver())\n\t\treturn;\n\n\tvar pieces = Client.getPieces();\n\tvar player = Client.getPlayer();\n\n\tfor (var i = 0; i < grid.length; i++)\n\t\tfor (var j = 0; j < grid[i].length; j++)\n\t\t\t// only make a move if the squre isn't occupied\n\t\t\tif (grid[i][j].containsPoint(p) && pieces[i][j] == -1) {\n\t\t\t\tpieces[i][j] = player.color;\n\t\t\t\tClient.onMove(getStatusUpdate(pieces, i, j));\n\t\t\t\tbreak;\n\t\t\t}\n}", "function isClickPatternOrderedSubsetOfGamePattern() {\n for(var x = 0 ; x < userClickPattern.length; x++) {\n if( userClickPattern[x] != gamePattern[x])\n return false;\n }\n return true;\n}", "function nextSequence() { \n gamePattern.push(buttonColors[Math.floor(Math.random() * 4)]) \n}", "function listenForClick() {\n loopThroughGrid();\n clickTurnBtn();\n }", "function mouse_click_game(mx, my) {\n console.log('Clicked on tile at (' + Math.floor(mx / 32) + ', ' + Math.floor(my / 32) + ').');\n }", "function clickHandler() // play game.\n{\n playGame();\n}", "canvasClick() {\n\t\tthis.bird.jumpBird();\n\t}", "function mouseClicked() {\n \n\nsendChannel1();\n\n}", "function handleClickSeeDerivation() {\n if (state.currentSceneIndex + 1 < state.scenes.length) {\n state.currentSceneIndex = state.currentSceneIndex + 1;\n videoElement.currentTime = state.scenes[state.currentSceneIndex].startTime;\n refreshCanvasVideo();\n }\n}", "function clickHandler()\r\n{\r\n playGame();\r\n}", "onClickRun() {\n\t\tlet tmp = true;\n\t\twhile (tmp == true) {\n\t\t\ttmp = this.cycle();\n\t\t}\n\t}", "function screenThree(){\n \n background(189,211,255);\n fill(255, 255, 0);\n // Draw a circle\n strokeWeight(2);\n stroke(0, 0, 0);\n fill(255, 255, 100, 127);\n circle(120, 250, 100);\n circle(295, 250, 100);\n circle(470, 250, 100);\n circle(645, 250, 100);\n circle(820, 250, 100);\n circle(995,250,100)\n \n stroke(0);\n strokeWeight(2);\n fill('white');\n rect(50,35, 1050, 100, 20);\n textSize(50);\n fill(0, 0, 0);\n text('Remember the pattern! Click to Start!', 100, 100);\n //putting in text in circles\n //check if visual is equal to correct pattern with randomize()\n randomize();\n text(num1, 107, 263);\n text(num2, 282, 263);\n text(num3, 457, 263);\n text(num4, 632, 263);\n text(num5, 807, 263);\n text(num6, 982, 263);\n \n nextScreen = createButton('Next!');\n nextScreen.size(100,40);\n nextScreen.style(\"font-size\", \"30px\");\n nextScreen.position((w2 + 520), (h2 + 400));\n nextScreen.mousePressed(screenFour);\n}", "function handleCanvasClick(_event) {\n if (_event.shiftKey || _event.altKey) {\n getPlayer(_event);\n }\n else if (Soccer.animation == false) {\n shootBall(_event);\n }\n }", "function click1(letter) {\r\n // console.log(letter);\r\n\r\n\r\n let newCell = checkForEmptyCellInTheColum(letter); //into the newcell we enter the show of the specific circle\r\n console.log(newCell.id);\r\n if (counter % 2 == 0) {\r\n newCell.style.backgroundColor = \"red\";\r\n player = 'red';\r\n document.getElementById(\"cursor\").style.backgroundColor = \"yellow\";\r\n } else {\r\n newCell.style.backgroundColor = \"yellow\";\r\n player = 'yellow';\r\n document.getElementById(\"cursor\").style.backgroundColor = \"red\";\r\n }\r\n\r\n counter++; //to know which player is playing right now\r\n checkWin(letter, newCell.id, newCell.getAttribute(\"data-row\"), newCell.getAttribute(\"data-Col\"), newCell, player);\r\n\r\n // checkvictory(newCell);\r\n}", "function mousePressed(event) {\n\t// number below chooses the pitch of the note played\n playNote(62);\n}", "function starsClick() {\n\tif (pub.hoveredBody > -1) {\n\t\tpub.clickedBody = pub.hoveredBody;\n\t\tpub.starsCircleDone = false;\n\t\tpub.starsCenterDone = false;\n\t\tpub.orbitsPhi = [];\n\t\tpub.orbitCoords = [];\n\t}\n}", "handleClick() {\n this.canvas.addEventListener('mousedown', event => {\n if (!this.paused) {\n this.collisionTest(event);\n }\n });\n }", "function checkAnswer(currentLevel)\n{\n if(userClickedPattern[currentLevel]==gamePattern[currentLevel])\n {\n console.log(\"success\");\n if(userClickedPattern.length ===gamePattern.length)\n {\n setTimeout(function(){\n nextSequence()},1000);\n }\n // userClickedPattern=[];\n }\n else{\n playSound(\"wrong\");\n console.log(\"try\");\n $(\"body\").addClass(\"game-over\");\n setTimeout(function()\n {\n $(\"body\").removeClass(\"game-over\");\n },200);\n $(\"#level-title\").text(\"Game Over!\");\n startOver();\n }\n}", "function nextSequence(){\r\n var randomNumber = Math.floor(Math.random()*4);\r\n gamePattern.push(buttonColors[randomNumber]);\r\n $(\"#\" + buttonColors[randomNumber]).fadeOut(200).fadeIn(200).fadeOut(200).fadeIn(200);\r\n\r\n //erase the user's answers\r\n userClickedPattern = [];\r\n\r\n //advance the level and display this in the h1\r\n level++;\r\n $(\"#level-title\").text(\"Level \" + level);\r\n}", "function handleClick() {\n var pressedButton = this.innerHTML;\n buttonAnimation(pressedButton);\n switch (pressedButton) {\n case \"w\":\n tom1.play();\n break;\n case \"a\":\n tom2.play();\n break;\n case \"s\":\n tom3.play();\n break;\n case \"d\":\n tom4.play();\n break;\n case \"j\":\n snare.play();\n break;\n case \"k\":\n crash.play();\n break;\n case \"l\":\n kick.play();\n break;\n default:\n }\n}", "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 }" ]
[ "0.67241156", "0.67115504", "0.65197575", "0.65104765", "0.6507557", "0.6486095", "0.6462057", "0.64502066", "0.6405715", "0.6399276", "0.6349016", "0.6344962", "0.63189083", "0.630866", "0.6296425", "0.6259184", "0.6250643", "0.6241446", "0.62042123", "0.6201719", "0.6200987", "0.62007576", "0.6184793", "0.61829823", "0.6176284", "0.61621684", "0.6154019", "0.6145356", "0.6143307", "0.61408067", "0.61375785", "0.61357534", "0.60930765", "0.6087214", "0.60812587", "0.6056664", "0.6036613", "0.6026357", "0.6014559", "0.6009925", "0.6002373", "0.5966893", "0.59646666", "0.5954271", "0.5951114", "0.59323066", "0.59102607", "0.5900803", "0.58924264", "0.58861935", "0.58852977", "0.58837676", "0.58778113", "0.58528566", "0.5852156", "0.5836667", "0.58316815", "0.5827759", "0.58131444", "0.5806731", "0.57981443", "0.5797922", "0.57926524", "0.5776602", "0.57758176", "0.5737858", "0.5734051", "0.5727187", "0.57266176", "0.5726243", "0.5710625", "0.57021374", "0.56899107", "0.56770533", "0.5664695", "0.56515694", "0.5648579", "0.56469744", "0.56469744", "0.56437534", "0.5641849", "0.56351864", "0.5630458", "0.5629299", "0.5628611", "0.56242365", "0.56126344", "0.56113374", "0.56065387", "0.5604866", "0.56042415", "0.5597042", "0.5592641", "0.5577517", "0.5571432", "0.5556274", "0.55512303", "0.55494064", "0.55452764", "0.55452585" ]
0.6195708
22
Runs Game of Life algorithm every X milliseconds Uses setTimeout to allow for dynamic interval logic e.g. pending timeout is reset and longer interval is applied when a player clicks on the game
function gameTick() { for (let y = 0; y < ROWS; y++) { for (let x = 0; x < COLS; x++) { const { count, colors } = countNeighbors(x, y) // Any live cell with fewer than two live neighbours dies, // as if caused by under-population. if (count < 2 && game.getLife(x, y)) { game.setNextStateColor(x, y, COLOR.BLANK) game.setNextStateLife(x, y, false) } // Any live cell with two or three live neighbours lives on to the next generation. if ((count === 2 || count === 3) && game.getLife(x, y)) { game.setNextStateColor(x, y, game.getColor(x, y)) game.setNextStateLife(x, y, true) } // Any live cell with more than three live neighbours dies, as if by overcrowding. if (count > 3 && game.getLife(x, y)) { game.setNextStateColor(x, y, COLOR.BLANK) game.setNextStateLife(x, y, false) } // Any dead cell with exactly three live neighbours becomes a live cell, // as if by reproduction. if (count === 3 && game.getLife(x, y) === false) { game.setNextStateColor(x, y, averageColor(colors)) game.setNextStateLife(x, y, true) } } } game.goToNextState() primus.forEach(spark => spark.emit(GAME_EVENT.STATE, game.colors)) gameTickTimeoutId = setTimeout(gameTick, GAME_TICK_INTERVAL.DEFAULT) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startGame() {\n this.interval = this.$interval(() => {\n this.loopCellMatrix();\n this.updateCellsFuture();\n this.iteration++;\n }, 300);\n }", "function runLifeGame() {\n gameLifeRunning = setInterval(nextGeneration, parseInt($(\"#input-board-time-between-generations\").val()));\n $(__RUN_BUTTON__).attr(\"disabled\", true);\n $(__STOP_BUTTON__).attr(\"disabled\", false);\n}", "function life(render, loop, initialGame) {\n var loopFn = loop || defaultLoopCallback;\n var renderFn = render || defaultRenderCallback;\n\n // Begin game\n playGame(padGame(fromArray(initialGame)));\n\n // cellId :: Cell -> String\n function cellId(cell) {\n return coordId(getX(cell), getY(cell));\n }\n\n // coordId :: Integer, Integer -> String\n function coordId(x, y) {\n return x + ',' + y;\n }\n\n // countActiveNeighbours :: Game, Cell -> Integer\n function countActiveNeighbours(game, cell) {\n var total = 0;\n iterateArray(neighbouringCells(cell), function countActiveNeighboursIterator(cell) {\n var id = cellId(cell);\n if (game.hasOwnProperty(id) && isActive(game[id])) {\n total += 1;\n }\n });\n return total;\n }\n\n // createCell :: Integer, Integer, Boolean, Boolean -> Cell\n function createCell(x, y, active, padding) {\n return [x, y, active || false, !!padding];\n }\n\n // defaultLoopCallback :: Boolean, Function -> Undefined\n function defaultLoopCallback(changed, next) {\n if (changed) {\n next();\n }\n }\n\n // defaultRenderCallback :: Cell -> Undefined\n function defaultRenderCallback(cell) {\n // Nowhere to render\n }\n\n // enumerateObj :: Object, Function -> Undefined\n function enumerateObj(obj, fn) {\n for (var key in obj) {\n fn(obj[key], key);\n }\n }\n\n // fromArray :: Array -> Game\n function fromArray(arr) {\n var game = {};\n iterateArray(arr, function fromArrayIterator(cell) {\n var newCell = createCell(getX(cell), getY(cell), true);\n game[cellId(newCell)] = newCell;\n });\n return game;\n }\n\n // getX :: Cell -> Integer\n function getX(cell) {\n return cell[0];\n }\n\n // getY :: Cell -> Integer\n function getY(cell) {\n return cell[1];\n }\n\n // isActive :: Cell -> Boolean\n function isActive(cell) {\n return cell[2];\n }\n\n // isPadding :: Cell -> Boolean\n function isPadding(cell) {\n return cell[3];\n }\n\n // isObjDifferent :: Object, Object -> Boolean\n function isObjDifferent(objA, objB) {\n return JSON.stringify(objA) !== JSON.stringify(objB);\n }\n\n // iterateArray :: Array, Function -> Undefined\n function iterateArray(arr, fn) {\n for (var i=0; i < arr.length; i++) {\n fn(arr[i]);\n }\n }\n\n // nextGame :: Game -> Game\n function nextGame(game) {\n var newGame = {};\n enumerateObj(game, function nextGameEnumerator(cell, id) {\n var count = countActiveNeighbours(game, cell);\n var wasActive = isActive(cell);\n if (!(0 === count && !wasActive)) {\n var active = (wasActive === true && count === 2) || count === 3;\n if (active || wasActive) {\n newGame[id] = createCell(getX(cell), getY(cell), active);\n }\n }\n });\n return padGame(newGame);\n }\n\n // neighbouringCells :: Cell -> Cell[]\n function neighbouringCells(cell) {\n var x = getX(cell);\n var y = getY(cell);\n\n return [\n createCell((x - 1), (y - 1), false, true),\n createCell((x ), (y - 1), false, true),\n createCell((x + 1), (y - 1), false, true),\n createCell((x - 1), (y ), false, true),\n createCell((x + 1), (y ), false, true),\n createCell((x - 1), (y + 1), false, true),\n createCell((x ), (y + 1), false, true),\n createCell((x + 1), (y + 1), false, true)\n ];\n }\n\n /**\n * Padding is used to surround active cells with cells that may become\n * active in the next game. The only cells that may become active *must* be\n * surrounded by *at least 2* active cells. A padded Gosper's Glider, for\n * example, would look like:\n *\n * [x][ ]\n * [ ][ ][x][ ]\n * [x][x][x][ ]\n * [ ][ ][ ]\n *\n * Note that every dead cell is surrounded by at least 2 active cells. This\n * means we don't need to represent every single inactive cell in the entire\n * game; just the ones that matter.\n *\n * padGame :: Game -> Game\n */\n function padGame(game) {\n var newGame = {};\n var hasOtherNeighbour = {};\n enumerateObj(game, function padGameEnumerator(cell, id) {\n newGame[id] = cell;\n if (isActive(cell)) {\n iterateArray(neighbouringCells(cell), function padGameNeighbourIterator(cell) {\n var id = cellId(cell);\n if (false === newGame.hasOwnProperty(id)) {\n if (false === hasOtherNeighbour.hasOwnProperty(id)) {\n hasOtherNeighbour[id] = true\n } else {\n newGame[id] = cell;\n }\n }\n });\n }\n });\n return newGame;\n }\n\n // playGame :: Game -> Undefined\n function playGame(game) {\n var renderedGame = renderGame(game);\n var newGame = nextGame(renderedGame);\n loopFn(isObjDifferent(renderedGame, newGame), function playGameClosure() {\n playGame(newGame);\n });\n }\n\n // renderGame :: Game -> Undefined\n function renderGame(game) {\n var renderedGame = {};\n enumerateObj(game, function renderGameEnumerator(cell, id) {\n if(false !== renderFn(getX(cell), getY(cell), isActive(cell), isPadding(cell))) {\n renderedGame[id] = cell;\n }\n });\n return renderedGame;\n }\n}", "function timerola (){\n\tsetInterval(startGame,1000/60);\n}", "function gameLoop() {\n // My idea here is to check the time value and when 2 seconds \n // has passed we update the time variable and also update the\n // game board at the same time.\n //\n //\n}", "function tick() {\n gameLogic();\n drawFrame();\n \n if (gameRunning) setTimeout(tick, 100);\n}", "function ourConstantTimer(){\n let interval = setInterval(() => {\n let i = 1;\n if(finishChecker()){\n clearInterval(interval)\n }\n //console.log('machine', turrets['machineGun'].quantity)\n isNewBoss()\n attackAuto()\n updateAllVisibility()\n drawPage()\n if(i % 300 == 0){\n bossAttack(gameSettings.currentBoss)\n }\n },\n 300)\n}", "function start() {\n isGameActive = true;\n\n var l = 0;\n do {\n setTimeout(function () {\n calculateNextGeneration();\n }, 1000 * l);\n l++;\n console.log(l);\n }\n while (l < 1000);\n\n}", "function loop(){\n Jobs.getAndDraw();\n setTimeout(function(){loop()}, 30000)\n }", "async function runGameLoop() {\n for (let tick = 0; tick <= 2; ++tick) {\n await server.clock.advance(kDefaultTickIntervalMs);\n for (let i = 0; i < 5; ++i)\n await Promise.resolve();\n }\n }", "function refreshGamesEachSec() {\n setInterval(refreshGameStatus, 1000);\n}", "_gameLoop () {\r\n\t\tthis.particleThread = setInterval(() => {\r\n\t\t\tthis._draw();\r\n\t\t}, this._cycleTimer);\r\n\t}", "function tick(lastTime) {\r\n let now = Date.now();\r\n let timeChange = now - lastTime;\r\n let msThreshold = iterationsPerSpawn * scaledMsPerIteration();\r\n if (showFired && now - timeFired > msToShowFired) {\r\n showFired = false;\r\n }\r\n if (count >= msThreshold) {\r\n spawn(Math.floor(Math.random() * 11), obstacles, targets);\r\n count = count % msThreshold;\r\n } else {\r\n count += timeChange;\r\n }\r\n targetHit();\r\n obstacleHit();\r\n move();\r\n moveTargetsAndObstacles(timeChange);\r\n updateUI(\r\n obstacles,\r\n targets,\r\n health,\r\n score,\r\n playerYposition,\r\n showFired,\r\n hitTarget\r\n );\r\n animation = requestAnimationFrame(() => tick(now));\r\n checkForGameOver();\r\n}", "function runGame(){\n\tvar ctx = $(\"#canvas\")[0].getContext(\"2d\");\n\tgs = new GameState(gc.canvasPixWidth, gc.canvasPixHeight);\n\tinitialize();\n\twindow.setInterval(function(){\n\t\trunGameLoop(ctx);\n\t}, 20); // FPS can be changed here\n}", "function startGameLoop (tickCallback, renderCallback, desired_ups) {\n\tsetInterval(function () {\n\t\ttickCallback();\n\t\trenderCallback();\n\t}, (1000 / desired_ups));\n}", "function startGameLoop() {\n loop_interval = setInterval(loop, 300);\n}", "function startGameInterval() {\n drawCard();\n gameInterval = setInterval(drawCard, 3000);\n }", "function run() {\n update();\n setInterval(update, 3600000);\n}", "tick() {\n const newBoard = this.makeBoard();\n\n this.iterate((row, col) => {\n const alive = !!this.board[row][col];\n const dead = !alive;\n const living = this.livingNeighbors(row, col);\n\n if ((alive && living < 2) || (alive && living > 3)) {\n newBoard[row][col] = 0;\n } else if (dead && living === 3) {\n newBoard[row][col] = 1;\n } else if (alive) {\n newBoard[row][col] = 1;\n }\n });\n this.board = newBoard;\n }", "function gameLoop() {\r\n console.log(\"function call\");\r\n setTimeout(gameLoop, 50);\r\n moveMissiles();\r\n drawMissiles();\r\n moveEnemies();\r\n drawEnemies();\r\n collisionDetection();\r\n }", "function startGame () {\n ballGenerator()\n window.setInterval(ballGenerator, 900)\n window.setInterval(countDown, 1000)\n }", "function timer() {\n footballCrowd();\n timerId = setInterval(() => {\n time--;\n $timer.html(time);\n\n if(time === 0) {\n restart();\n lastPage();\n }\n }, 1000);\n highlightTiles();\n }", "function run(){\r\n\tinit();\r\n\trunInterval=setInterval(gameLoop, 100);\r\n\r\n}", "function startGameTimer() {\r\n var mspf = 15;\r\n\r\n function timer() {\r\n gameLoop();\r\n window.setTimeout(timer, mspf);\r\n }\r\n\r\n window.setTimeout(timer, mspf);\r\n}", "function Timer() {\n setTimeout(tick, 5000);\n}", "function gameLoop() {\n // Check for weird refresh rates\n if (m_sampleFramesLeft === 10) {\n m_monitorSampleStartTime = window.performance.now();\n } else if (m_sampleFramesLeft === 0) {\n const timeDiffMs = window.performance.now() - m_monitorSampleStartTime;\n console.log(`Average frame length ${timeDiffMs / 10} ms`);\n if (timeDiffMs / 10 > 25 && m_monitorStatus !== \"slow\") {\n alert(\n \"Your monitor refreshes slower than 60 Hz. The game will run much slower than usual.\"\n );\n m_monitorStatus = \"slow\";\n }\n if (timeDiffMs / 10 < 12) {\n m_monitorStatus = \"fast\";\n }\n } else if (m_sampleFramesLeft < -6000) {\n m_sampleFramesLeft += 6000;\n }\n m_sampleFramesLeft--;\n\n m_gameLoopFrameCount -= m_monitorStatus === \"fast\" ? 0.5 : 1;\n if (m_gameLoopFrameCount == 0) {\n m_gameLoopFrameCount = GameSettings.getFrameSkipCount();\n\n // Run a frame\n const start = window.performance.now();\n runOneFrame();\n const msElapsed = window.performance.now() - start;\n\n // Update debug statistics\n m_numFrames += 1;\n m_totalMsElapsed += msElapsed;\n m_maxMsElapsed = Math.max(m_maxMsElapsed, msElapsed);\n }\n requestAnimationFrame(gameLoop);\n}", "function updateTimer(){\n if(gameOverCount<8){\n timerInterval=setInterval(updateTime,1000);\n }\n}", "function runLife() {\n\n let nextGen = new Array(resolution * resolution);\n\n for (let i = 0; i < cells.length; i++) {\n let x = i % resolution;\n let y = Math.floor(i / resolution);\n\n let neighbors = countNeighbors(cells, x, y);\n if (cells[i] == 0 && neighbors == 3) {\n nextGen[i] = 1;\n } else if ((cells[i] == 1 && neighbors < 2) || (cells[i] == 1 && neighbors > 3)) {\n nextGen[i] = 0;\n } else {\n nextGen[i] = cells[i];\n }\n }\n\n cells = nextGen;\n}", "function beginGame() {\r\n //gameInterval = setInterval(game, 1);\r\n game();\r\n competitorInterval = setInterval(playCompetitor, 10);\r\n countTimeInterval = setInterval(countTime, 100);\r\n}", "doGameTick() {\n setInterval(() => {\n this.incrementCatsFromCatladies();\n this.incrementCatsFromCatnip();\n console.log(\"Cats: \" + this.state.cats);\n }, 1000 / this.state.ticksPerSeconds)\n }", "function gameLoop() {\n var now = Date.now();\n\n if (previousTick + SERVER_GAME_SIMULATION_TICK_RATE_MS <= now) {\n previousTick = now;\n simulateGame();\n }\n\n if (Date.now() - previousTick < tickLengthMs - 16) {\n setTimeout(gameLoop);\n } else {\n setImmediate(gameLoop);\n }\n}", "function make_loop(renderer, time){\n\tsetInterval(function(){ game_draw(renderer)}, time);\n}", "function update(){\n setInterval(gameloop, 20);\n}", "function run() {\n init();\n int = setInterval(gameLoop, interval);\n}", "function startGame(){\n game = setInterval(update, 25);\n}", "function evolve() {\n\n var liveNeighbors;\n\n for (var i = 0; i < 100; i++) {\n for (var j = 0; j < 100; j++) {\n liveNeighbors = getLiveNeighbors(i, j);\n \n // Any live cell with fewer than two live neighbours dies, as if caused by under-population.\n if (world[i][j] === true && liveNeighbors < 2) {\n world[i][j] = false;\n }\n\n // Any live cell with more than three live neighbours dies, as if by over-population.\n else if (world[i][j] === true && liveNeighbors > 3) {\n world[i][j] = false;\n }\n\n // Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.\n else if (world[i][j] === false && liveNeighbors === 3) {\n world[i][j] = true;\n }\n }\n }\n\n window.setTimeout(evolve, 0);\n }", "mainloop() {\n this.repetitions++;\n let now = new Date().getTime();\n let relativeOriginal = now - this.realstartts;\n let relative = relativeOriginal * this.config.timeFactor;\n for (let node of this.nodes) {\n node.check(relative);\n };\n if (this.repetitions % 1000 === 0) {\n console.log(\"Repetition:\", this.repetitions, \"Relative time:\", relative);\n };\n }", "function gameLoop () {\n window.requestAnimationFrame(gameLoop);\n\n // Timing\n let currentTime = (new Date()).getTime();\n let delta = (currentTime - lastTime);\n\n if (delta > interval) {\n update();\n render();\n\n lastTime = currentTime - (delta % interval);\n }\n}", "function startGame() {\r\n console.log(\"in startgame\");\r\n myTimer = setInterval(gameLoop, 16);\r\n}", "function wildInterval(){\n console.log(\"Hello World!\");\n setTimeout(wildInterval, 10000);\n}", "tick() {\n // debugger;\n const newBoard = this.makeBoard();\n console.log(newBoard);\n\n // TODO: Here is where you want to loop through all the cells\n // on the existing board and determine, based on it's neighbors,\n // whether the cell should be dead or alive in the new board\n // (the next iteration of the game)\n //\n // You need to:\n // 1. Count alive neighbors for all cells\n // 2. Set the next state of all cells in newBoard,\n // based on their current alive neighbors\n\n\n for (let i = 0; i < this.height; i++) {\n for (let j = 0; j< this.width; j++) {\n let livingNum = this.livingNeighbors(i, j);\n //if current cell is alive\n if (this.board[i][j] === 1) {\n //current cell has either 2 or 3 living neighbors - LIVE CONDITION\n if (livingNum === 2 || livingNum === 3) {\n newBoard[i][j] = 1;\n }\n } // current cell is dead\n else if (this.board[i][j] === 0) {\n //if cell has exactly 3 live neighbors\n if (livingNum === 3) {\n newBoard[i][j] = 1;\n }\n }\n }\n }\n\n this.board = newBoard;\n }", "function runGoL() {\r\n if (!isRunning) {\r\n return;\r\n }\r\n //counts number of generations.\r\n generation++;\r\n evolveStep(gameGrid);\r\n // evolveStep overwrites grid lines, therefore need to redraw them\r\n drawGridLines();\r\n setTimeout(runGoL, GENERATION_INTERVAL * 1000);\r\n //updates generation count on webpage\r\n setTimeout(document.getElementById(\"gen-num\").innerHTML = generation, GENERATION_INTERVAL * 1000);\r\n }", "function gameLoop() {\r\n\tif (state) {\r\n\t\t//Loop this function at 60 frames per second\r\n\t\trequestAnimationFrame(gameLoop);\r\n\t\r\n\t\t//Render the stage to see the animation\r\n\t\tdisplayBoard(state.board);\r\n\t}\r\n}", "run() {\n this.fillSportListAndTick();\n this.timerID = setInterval(() => {\n this.tick();\n console.log(\"ctr = \"+this.ctr);\n if (this.ctr < (ONE_DAY_IN_MS / LIVE_TICK_INTERVAL)) {\n this.ctr = this.ctr + 1;\n } else {\n this.ctr = 1;\n }\n }, LIVE_TICK_INTERVAL);\n }", "function startGame() {\n const fill_interval_id = window.setInterval(() => {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawAllCell();\n }, 1000);\n return fill_interval_id;\n}", "function launchInterval(){\n update();\n border();\n brickLineTop();\n brickLineBottom();\n brickLineRight();\n brickLineLeft();\n generateBrickTop();\n generateBrickBottom();\n drawSnake();\n generateFood(redFoodCoordinates, \"red\");\n generateFood(blueFoodCoordinates, \"blue\");\n movesAndCollide();\n }", "gameLoop()\n { \n this.currentTime = (new Date()).getTime(); \n this.deltaTime = (this.currentTime - this.lastTime) / 1000; \n\n if (this.deltaTime > this.timePerFrame)\n {\n this.update();\n this.lastTime = (new Date()).getTime(); \n } \n \n this.draw();\n window.requestAnimationFrame(this.boundRecursiveUpdate);\n }", "function tick() {\n\n ///Respond differently based on the game state\n timerID = setTimeout(tick, 33); ///Restart the timer\n\n var currentTime = new Date(); ///Get the current time\n var now = currentTime.getTime(); ///Get the current time in milliseconds\n\n //Update the global model\n update();\n\n\n drawCanvas();\n}", "gameLoop() {\n if (this.stopped) {\n return;\n }\n\n let now = Date.now();\n let dt = (now - this.lastTime) / 1000.0;\n this.fps = 1 / dt;\n\n this.update(dt);\n this.render();\n\n this.lastTime = now;\n\n window.requestAnimationFrame(() => this.gameLoop());\n }", "function timer() {\r\n count ++;\r\n if(count === 31){ //restart Game at the 31st second\r\n context.clearRect(0, 0, canvas.width, canvas.height);\r\n end_screen();\r\n clearInterval(startCounterIntv);\r\n gameStarted = false;\r\n }\r\n }", "function spawnAngrySlimes(spawnRate){\n var angryInterval = setInterval (function(){\n var position = randomCell(cells);\n position.classList.add('angry', 'sprite');\n checkGemTotal(position);\n if (timeLeft <= 0 || lives <= 0){\n clearInterval(angryInterval);\n endGame(); \n }\n else if (timeLeft >= 40 && lives > 0){\n angrySlimeAttack(100, 0.4);\n } \n else if (timeLeft >= 20 && lives > 0){\n angrySlimeAttack(200, 0.5);\n }\n else if (timeLeft > 0 && lives > 0){\n angrySlimeAttack(300, 0.6);\n }\n setTimeout(function(){\n position.classList.remove('angry', 'sprite');\n }, 1000)\n }, spawnRate) \n }", "function tick() {\n // use a timer to update the game and re-call tick\n\n setTimeout(function(){\n if (gameState == 'running') {\n updateGame();\n tick();\n }\n }, msPerTick(snakeSpeed))\n }", "function gameOfLife() {\n // a row-major 2d array of booleans\n // representing wheather the piece is on or off\n var field = [];\n //the width and height of the feild\n const width = 100;\n const height = 50;\n // create a blank filed\n // feild -> feild\n function init(f) {\n //f = new Array();\n for (var row = 0; row < height; row++) {\n f[row] = new Array();\n for (var col = 0; col < width; col++) {\n f[row][col] = false;\n }\n }\n }\n\n // initialize the game function\n init(field);\n //glider();\n document.getElementById(\"GOLCanvas\").addEventListener(\"click\", change);\n document.getElementById(\"pauseBtn\").addEventListener(\"click\", start);\n document.getElementById(\"gliderBtn\").addEventListener(\"click\", glider);\n\n\n // computes all the cells for the next\n // EFFECT mutates the feild\n function nextStep() {\n var next = [];\n init(next);\n for (var row = 0; row < height; row++) {\n for (var col = 0; col < width; col++) {\n next[row][col] = nextState(row, col);\n }\n }\n field = next;\n }\n\n // returns the nest state of a given cell\n // Int Int -> Boolean\n function nextState(r, c) {\n // number of on neightbors to the given call\n var onNeighbors = 0;\n // if given is alive itself count it\n if (field[r][c]) {\n onNeighbors -= 1;\n }\n // count alive neightbors\n for (var row = -1 ; row <= 1; row += 1) {\n for (var col = -1; col <= 1; col += 1) {\n if(field[r + row]) {\n }\n if(field[r + row] && field[r + row][c + col]) {\n onNeighbors += 1;\n }\n }\n }\n // return based on rules\n return (onNeighbors === 3) || ((onNeighbors === 2) && field[r][c]);\n }\n\n // Spawn a glider in a random position\n // Effect updates the board\n function glider() {\n let h = parseInt(Math.random() * (height - 3));\n let w = parseInt(Math.random() * (width - 3));\n field[h][w + 1] = true;\n field[h + 1][w + 2] = true\n field[h + 2][w + 2] = true\n field[h + 2][w + 1] = true\n field[h + 2][w] = true;\n draw();\n }\n\n // change the state of a cell when clicked\n // Event -> void\n // Efect mutates the feild\n function change(e){\n var canvas = document.getElementById(\"GOLCanvas\");\n var rect = canvas.getBoundingClientRect();\n let x = (e.clientX - rect.left) / (rect.right - rect.left) * canvas.width;\n let y = (e.clientY - rect.top) / (rect.bottom - rect.top) * canvas.height;\n var context = canvas.getContext(\"2d\");\n posx = parseInt(x / 10);\n posy = parseInt(y / 10);\n console.log(posy);\n field[posy][posx] = !field[posy][posx];\n draw();\n }\n\n // draw the canvas\n function draw() {\n var canvas = document.getElementById('GOLCanvas');\n if (canvas.getContext) {\n var ctx = canvas.getContext('2d');\n var curx = 0;\n var cury = 0;\n\n for (var arr of field) {\n for (var state of arr) {\n ctx.fillStyle = 'rgba(0, 0, 0)';\n ctx.fillRect(curx, cury, 10, 10 );\n if (state) {\n ctx.fillStyle = 'rgb(200, 0, 0)';\n }\n else {\n ctx.fillStyle = 'rgba(0, 0, 200)';\n }\n ctx.fillRect(curx + 3, cury + 3, 7, 7 );\n curx += 10\n }\n curx = 0;\n cury += 10;\n }\n }\n }\n\n // variables and functions for playpause stuff\n var playing = true;\n var ns = setInterval(nextStep, 100);\n var d = setInterval(draw, 100);\n\n function start() {\n if (playing) {\n clearInterval(ns);\n clearInterval(d);\n playing = false;\n }\n else {\n ns = setInterval(nextStep, 100);\n d = setInterval(draw, 100);\n playing = true;\n }\n }\n}", "function Life(_options) \n{\n // Constructor\n var options = {\n xmax:undefined, // x length required\n ymax:undefined, // y length required\n initial: 'random', // initial values \"zeros\" \"random\"\n random_chance_of_life: 25, // When initial random is chosen this is the chance of it being a 1\n // Callback for when the new board has life given takes (x ,y)\n on_life: undefined,\n // Callback for when a new board gets overpopulated and is not switched back to off\n // Values that never get switched on are never checked and should be assumed dead\n on_death: undefined, \n };\n _.extend(options, _options);\n if (options.xmax === undefined) {\n console.error(\"xmax required in Life\");\n return false;\n }\n if (options.ymax === undefined) {\n console.error(\"ymax required in Life\");\n return false;\n }\n\n // Private variables\n var \n // the current board\n current_board = [], \n // the amount of adjacent live cells a cell has\n counter = [], \n // the new board to replace the old \n new_board = [], \n // values in the current board \n current_values_with_ones = [],\n // values of hte new board that have ones\n new_values_with_ones = []; \n\n // Takes an index \n // returns an array of its x and y values\n // This is used since most graphic based APIs want x and y values\n var convert_to_2d = function(index) {\n var val = [];\n val.push(index % options.xmax);\n val.push(Math.floor(index / options.ymax));\n return val;\n }\n\n current_board.length = options.xmax * options.ymax;\n new_board.length = options.ymax * options.xmax;\n // Set unset, and get allow setting/accessing of the current index\n this.set = function(index)\n {\n current_board[index] = 1;\n current_values_with_ones.push(index);\n // Runs the call back if it exists if a graphical end is attached\n if (options.on_life) {\n var arg = convert_to_2d(index);\n options.on_life(arg[0], arg[1]);\n }\n }\n this.unset = function(index)\n {\n current_board[index] = 0;\n current_values_with_ones = _.without(\n current_values_with_ones, index);\n // Runs the callback if it exists if a graphics are attached\n if (options.on_death) {\n var arg = convert_to_2d(index);\n options.on_death(arg[0], arg[1]);\n }\n }\n // Probably only needed for debugging\n this.get = function(index)\n {\n return current_board[index];\n }\n\n // Runs initialization\n if (options.initial === \"random\") {\n for (var j = 0; j < current_board.length; j++) {\n var chance = Math.floor(Math.random()*100);\n if (chance <= options.random_chance_of_life)\n this.set(j);\n }\n }\n\n // Functions for getting the index of neighboring cells\n // Returns -1 if it would be invalid\n this.left_cell = function(cell)\n {\n if (cell < 0 || cell % options.xmax == 0)\n return -1;\n return cell - 1;\n }\n this.right_cell = function(cell)\n {\n var ret = cell + 1;\n if (ret >= current_board.length\n || ret % options.xmax == 0)\n return -1;\n return ret;\n }\n this.top_cell = function(cell)\n {\n var ret = cell - options.xmax;\n if (ret < 0)\n return -1;\n return ret;\n }\n this.bottom_cell = function(cell)\n {\n var ret = cell + options.xmax;\n if (ret >= current_board.length)\n return -1;\n return ret;\n }\n this.top_left_cell = function(cell)\n {\n var ret = cell - 1;\n if (cell < 0 || cell % options.xmax == 0)\n return -1;\n ret -= options.xmax;\n if (ret < 0)\n return -1;\n return ret;\n }\n this.bottom_left_cell = function(cell)\n {\n var ret = cell - 1;\n if (cell < 0 || cell % options.xmax == 0)\n return -1;\n ret += options.xmax;\n if (ret >= current_board.length)\n return -1;\n return ret;\n }\n this.top_right_cell = function(cell)\n {\n var ret = cell + 1;\n if (ret >= current_board.length\n || ret % options.xmax == 0)\n return -1;\n ret -= options.xmax;\n if (ret < 0)\n return -1;\n return ret;\n }\n this.bottom_right_cell = function(cell)\n {\n var ret = cell + 1\n if (ret >= current_board.length\n || ret % options.xmax == 0)\n return -1;\n ret += options.xmax;\n if (ret >= current_board.length)\n return -1;\n return ret;\n }\n\n // Used for debugging\n // Gets the array of the current board\n this.get_board = function() {\n return current_board;\n }\n\n // Runs the counter\n // It returns the counter which is used for debugging\n this.run_counter = function()\n {\n counter = [];\n // THis is the O(n) complexity where\n // n is the number of live cells\n for (var i = 0; \n i < current_values_with_ones.length;\n i += 1) {\n this.add_valid_cells(\n current_values_with_ones[i]);\n }\n return counter;\n }\n\n // Gets an array of all the valid indexes adjacent\n // to the specific cell\n this.add_valid_cells = function(cell)\n {\n // Adds to the counter if valid\n // Then changes the value on the new board\n // to follow the rules of life\n // This is called for each adjancent cell\n var add_counter_if_valid = function(i) {\n if (i === -1)\n return;\n\n if (!counter[i] \n || counter[i] === 0)\n counter[i] = 1;\n else\n counter[i] += 1;\n\n if (counter[i] === 2 \n && current_board[i] === 1) {\n new_board[i] = 1;\n if (options.on_life) {\n var arg = convert_to_2d(i);\n options.on_life(arg[0], arg[1]);\n }\n new_values_with_ones.push(i);\n }\n else if (counter[i] === 3 && new_board[i] !== 1) {\n new_board[i] = 1;\n if (options.on_life) {\n var arg = convert_to_2d(i);\n options.on_life(arg[0], arg[1]);\n }\n new_values_with_ones.push(i);\n }\n else if (counter[i] > 3 && new_board[i]) {\n new_board[i] = undefined;\n new_values_with_ones =\n _.without(new_values_with_ones, i);\n if (options.on_death) {\n var arg = convert_to_2d(i);\n options.on_death(arg[0], arg[1]);\n }\n }\n }\n add_counter_if_valid(this.left_cell(cell));\n add_counter_if_valid(this.right_cell(cell));\n add_counter_if_valid(this.bottom_cell(cell));\n add_counter_if_valid(this.top_cell(cell));\n add_counter_if_valid(this.top_left_cell(cell));\n add_counter_if_valid(this.bottom_left_cell(cell));\n add_counter_if_valid(this.top_right_cell(cell));\n add_counter_if_valid(this.bottom_right_cell(cell));\n }\n\n\n // Runs life for one iteration\n this.run = function(_settings)\n {\n var start_time = new Date();\n // This is the main function call for the alogrithm\n this.run_counter();\n current_board = new_board;\n current_values_with_ones = new_values_with_ones;\n new_values_with_ones = [];\n new_board = [];\n new_board.length = options.xmax * options.ymax;\n /*\n console.log(\n 'Life ran in', \n new Date() - start_time,\n 'ms');\n */\n }\n\n return this;\n}", "function runEntityTimer() {\n entityTimer = Script.setInterval(function() {\n for (var i = 0; i < fish.length; i++) {\n var curLifeTime = Entities.getEntityProperties(fish[i].entityId).lifetime;\n Entities.editEntity(fish[i].entityId, { lifetime: curLifeTime + 5 });\n }\n var aquariumLifeTime = Entities.getEntityProperties(aquariumModel).lifetime;\n Entities.editEntity(aquariumModel, { lifetime: aquariumLifeTime + 5 });\n }, 5000);\n }", "function startGame()\n{\n\tsetInterval(draw, Math.floor(1000/30));\n}", "function TimerStart()\n{\n\ttimer = window.setInterval(TimerTick, Game.interval);\n}", "function startGameLoop() {\n fpsInterval = 1000 / framerate;\n then = window.performance.now();\n startTime = then;\n gameLoop();\n}", "function step(){\n let newCells = createCells();\n let cellsAlive = 0\n for (let y = 0; y < resolution; y++){\n for (let x = 0; x < resolution; x++){\n const neighbours = getNeightbourCount(x,y);\n if (cells[x][y] && neighbours >= 2 && neighbours <= 3) \n newCells[x][y] = true; //if the cell in cells array that is the las generation can live, the nextgen cell in 'newCell' array will be true\n else if (!cells[x][y] && neighbours === 3) \n newCells[x][y] = true; //a cell that in the canva is death can live if the neighbours are equals to 3\n cellsAlive += cells[x][y] ? 1 : 0 //cellsalive count\n }\n }\n setRetults(generation++,cellsAlive)\n cells = newCells;\n drawCells();\n}", "function changeCulprit() {\n let timerId = null; \n timerId = setInterval(holeRandom, 700) \n}", "function frame() {\n rAF = requestAnimationFrame(frame);\n\n now = performance.now();\n dt = now - last;\n last = now;\n\n // prevent updating the game with a very large dt if the game were to lose focus\n // and then regain focus later\n if (dt > 1E3) {\n return;\n }\n\n emit('tick');\n accumulator += dt;\n\n while (accumulator >= delta) {\n loop.update(step);\n\n accumulator -= delta;\n }\n\n clearFn(context);\n loop.render();\n }", "function game() {\n addRandomSymbolToCard(allCards);\n setInterval(setTime, 1000);\n}", "function main(ctime) {\r\n window.requestAnimationFrame(main);\r\n if ((ctime - lastPaintTime) / 1000 < 1 / speed) return;\r\n lastPaintTime = ctime;\r\n // console.log(ctime);\r\n gameEngine();\r\n\r\n}", "function time_watcher_turn(){\n if(game_content.watcher.turn_watcher){\n // If he is looking, take it down so he is not looking.\n if(game_content.watcher.watcher_looking){\n game_content.watcher.watcher_staring = false;\n game_content.watcher.watcher_frame++;\n if(game_content.watcher.watcher_frame == 6){\n game_content.watcher.turn_watcher = false;\n game_content.watcher.watcher_looking = false;\n }\n } else {\n game_content.watcher.watcher_frame--;\n if (game_content.watcher.watcher_frame == 1){\n game_content.watcher.turn_watcher = false;\n game_content.watcher.watcher_looking = true;\n game_content.watcher.watcher_staring = true;\n }\n }\n }\n setTimeout(time_watcher_turn, interval * 5);\n}", "function beginGame(firstI, firstJ) { //when user clicks a cell the game starts\n gBoard = buildBoard(firstI, firstJ);\n setMinesNegsCout(gBoard);\n renderBoard(gBoard);\n updateState();\n var startTime = new Date();\n gTimerInterval = setInterval(showTimer, 1000, startTime);\n //start timer with interval\n}", "function gameSlow() {\n setInterval(oneFrame, 300);\n setInterval(buff6s, 12000);\n}", "function startGame() {\n hitCount = 0\n\n if (isSettingsInitialized) {\n console.log('Settings initialized')\n loadSettings()\n }\n\n togglePanel(panel.PREGAME)\n generateLayout()\n\n maxSpawns = Math.floor(maxTime / spawnRate)\n remainingSpawns = maxSpawns\n\n for (let s = 0; s < maxSpawns; s++) {\n spawnTimeouts.push(setTimeout(spawnYagoo, spawnRate * s))\n }\n\n startTimer(msToSec(maxTime), document.getElementById('timer-text'))\n}", "function run() { \n if (isGameOver) {\n drawGameOver();\n } else {\n frames++ // Seteamos una variable llamada frames (cuadros) que se va a ir incrementando según el número de cuadros que se ejecuten \n countdown();\n draw(); \n checkCoalitions(); \n }\n window.requestAnimationFrame(run); // Función recursiva para ejecutar lo que necesitemos (varios cuadros por segundo) \n}", "function doubleSpeed() {\r\n\tclearInterval(gameLoop);\r\n\tgameLoop = setInterval(loop, gameSpeed/2); //Doubles the speed of the game\r\n\r\n\tsetTimeout(() => {\r\n\t\tclearInterval(gameLoop);\r\n\t\tgameLoop = setInterval(loop, gameSpeed);\r\n\t}, 5000);\r\n}", "function startGame() {\r\n countUp = 0;\r\n setTimeout(endGame, 120000);\r\n startTimer();\r\n cancelTimer = false;\r\n triggerCrime();\r\n}", "function gameloop(){\n game.processInput()\n if(game.ready){\n game.state();\n }\n game.update()\n setTimeout(gameloop,20);\n}", "gameLoop(timeStamp) {\n this.rafHandle = requestAnimationFrame((ts) => this.gameLoop(ts));\n\n this.deltaTime += timeStamp - this.lastFrameTimeMs;\n this.lastFrameTimeMs = timeStamp;\n\n if (timeStamp > this.lastFpsUpdate + 1000) {\n this.framesPerSecond = this.weightedFPSMultipler * this.framesThisSecond\n + (1 - this.weightedFPSMultipler) * this.framesPerSecond;\n\n this.lastFpsUpdate = timeStamp;\n\n this.framesThisSecond = 0;\n }\n this.framesThisSecond += 1;\n\n let numUpdateSteps = 0;\n while (this.deltaTime >= this.TIME_STEP) {\n this.pollInput();\n this.update(this.TIME_STEP);\n this.deltaTime -= this.TIME_STEP;\n\n numUpdateSteps += 1;\n if (numUpdateSteps >= 240) {\n this.panic();\n break;\n }\n }\n\n this.draw(this.deltaTime / this.TIME_STEP);\n }", "function gameloop() {\n\t\t// compensates for setTimeout drift\n\t\tt._drift = (Date.now() - t._now) - t._period;\n\t\tt._adjPeriod = t._period;\n\t\tif (t._drift >= t._period) // drift matches/exceeds entire period\n\t\t\tt._adjPeriod = t._period;\n\t\telse if (t._drift > 0)\n\t\t\tt._adjPeriod = t._period - t._drift;\n\t\telse if (t.drift < 0)\n\t\t\tt._adjPeriod = t._period + t._drift;\n\t\tt._now = Date.now();\n\n\t\tupdate();\n\n\t\tt._loopTimer = setTimeout(gameloop, t._adjPeriod);\n\t} // end gameloop", "function Timer() {\n this.gameTime = 0;\n this.maxStep = 0.05;\n this.wallLastTimestamp = 0;\n }", "function gameLoop(time) {\r\n\r\n update();\r\n render();\r\n\r\n requestAnimationFrame(gameLoop);\r\n }", "function gameLoop(timestamp) {\n\n // Tracking the amount of time that has passed\n let deltaTime = timestamp - lastTime;\n lastTime = timestamp;\n\n // Clear canvas, update, and draw\n ctx.clearRect(0, 0, GAME_WIDTH, GAME_HEIGHT);\n game.update(deltaTime);\n game.draw(ctx);\n\n // Show latest updates per browser refresh rate\n requestAnimationFrame(gameLoop);\n}", "function gameTime() {\n\tvar ct = 30;\n\tvar igt = setInterval(function() {\n\t\tif(ct == 0) {\n\t\t\t// EndGame\n\t\t\ttime.innerHTML = ct;\n\t\t\tclearInterval(igt);\n\t\t\tendGame();\n\t\t} else {\n\t\t\ttime.innerHTML = ct;\n\t\t}\n\t\tct--;\n\t},1000);\n}", "function gameLoop () {\r\n moveArenaBg();\r\n renderRocket();\r\n moveAndRenderBullet();\r\n setTimeout(gameLoop, 1000/30);\r\n}", "function runTimer() {\n round1timer = 30;\n intervalId = setInterval(timer, 500);\n}", "function startGame(){\r\n console.log(\"GAME START!!!\");\r\n endScreen.style.opacity = \"0\";\r\n endScreen.style.visibility = \"hidden\";\r\n endScreen.style.display = \"none\";\r\n // Generate the clues\r\n generateClues();\r\n // After the clues are generated, populate the game board\r\n setTimeout(() => {\r\n displayGameBoard();\r\n // Start the timer for 10 minutes\r\n startTimer(10);\r\n }, 5000)\r\n // generateClues() ? displayGameBoard() : setTimeout(displayGameBoard(), 1000);\r\n \r\n // Fade out the preview screen\r\n preview.style.opacity = \"0\";\r\n preview.style.visibility = \"hidden\";\r\n \r\n setTimeout(() => {\r\n // Fade in each column\r\n let delay = 0;\r\n for(let i = 0; i < categories.length; i++){\r\n for(let j = 0; j < categories[i].length; j++){\r\n categories[i][j].style.animationName = \"fadeInClues\";\r\n categories[i][j].style.animationDelay = `${delay}s`;\r\n }\r\n delay += 0.25;\r\n }\r\n }, 1500);\r\n}", "function tick() {\n var interval = 40, //TODO: parameterize for user to throttle speed\n canvas = this.canvas,\n grid = this.grid;\n\n var runStep = function () {\n draw(canvas, grid);\n grid = nextStep(grid);\n };\n\n this.isRunning = setInterval(runStep, interval);\n}", "function startsGame() {\n generateMainBoat();\n const intervalRefugees = setInterval(() => {\n if (deathAll >= 750) {\n clearInterval(intervalRefugees);\n endSimulation();\n } else {\n generateRefugees();\n }\n }, 3000);\n }", "function startTimer(){\n gameTimer= setInterval(countUpTimer, 1000);\n}", "function timedGame() {\n\n totalBlank = levelBlank; // fetches number of blank cells to generate\n \n // Create game grid solution\n function solveTimedGrid(solvedTimedGrid, playTimedGrid) {\n\n // Randomly select number of times to add to grid\n let randomNum = Math.floor((Math.random() * 8 - 2) + 1); // Randomise grid by adding 1 for a random amount of times\n\n // Adds 1 to cell for selected random number of times\n for (let i = 0; i < 9; i++) {\n for (let j = 0; j < 9; j++) {\n solvedTimedGrid[i][j] += randomNum;\n solvedTimedGrid[i][j] %= 9;\n solvedTimedGrid[i][j]++;\n playTimedGrid[i][j] = solvedTimedGrid[i][j];\n }\n }\n return solvedTimedGrid, playTimedGrid;\n }\n\n // Creates game grid on load\n solveTimedGrid(solvedTimedGrid, playTimedGrid);\n\n // Create play grid, empty randomly selected cells\n function createTimedGame(playTimedGrid) {\n \n let randCell;\n let selRow;\n let selCol;\n\n // Converts random cell into row and column, replaces selected cell with 0\n for (let m = 0; m < totalBlank; m++) {\n randCell = Math.floor(Math.random() * (81 - 1) + 1);\n\n selRow = Math.floor(randCell / 9);\n selCol = randCell % 9;\n\n playTimedGrid[selRow][selCol] = 0;\n }\n return playTimedGrid;\n }\n createTimedGame(playTimedGrid);\n return solvedTimedGrid, playTimedGrid;\n}", "function startOpponentCheckTimer() {\n nIntervId = setInterval(checkForOpponent, 5000);\n }", "function tiktok() {\n int = setInterval(run, 1000); // configure interval\n}", "gameLoop() {\n var elapsedTime = this.m_Clock.getDelta();\n\n this.m_Lag += elapsedTime;\n\n // perform as many updates as we should do\n // based on the time elapsed from last gameloop call\n while (this.m_Lag >= AlgoMission.UPDATE_TIME_STEP) {\n\n this.update();\n\n this.m_Lag -= AlgoMission.UPDATE_TIME_STEP;\n }\n\n this.render();\n\n requestAnimationFrame(this.gameLoop.bind(this));\n }", "function gameloop(){\n game.processInput()\n if(game.ready){\n game.state();\n }\n game.update()\n setTimeout(gameloop,10);\n}", "startGame() {\n if (!this.paused) {\n this.dropInterval = window.setInterval(() => {\n this.makeDot();\n }, 1000);\n // @TODO: if future me does enhancements, add an input to adjust dot generation delay too? The variable would be used here.\n window.requestAnimationFrame(this.tick.bind(this)); // window so needs scope bound\n }\n }", "function gameLoop(timeStamp) {\n\n //New tick\n ticks++;\n aniPerc += gameBlockSpeed * gameBlockSpeedFall;\n\n // Calculate the number of seconds passed since the last frame\n secondsPassed = (timeStamp - oldTimeStamp) / 1000;\n oldTimeStamp = timeStamp;\n fps = Math.round(1 / secondsPassed);\n\n //Update mos pos\n mouse.xx = Math.floor((mouse.x - areaX) / cellSize);\n mouse.yy = Math.floor((mouse.y - areaY) / cellSize);\n\n //Speed up the falling block\n if (gameQueue.length === 0) {\n if (playerAlive === false) {\n playerAlive = true;\n spawnBlock();\n }\n\n if (hasUnClicked) {\n gameBlockSpeedFall = 40;\n hasUnClicked = !hasUnClicked;\n }\n\n //Update player column, unless the user has sped up the block fall (clicked it), or if the column is blocked\n if (mouse.xx > -1 && mouse.xx < cellsHorizontal && gameBlockSpeedFall === 1) {\n if (playGrid[mouse.xx][player.y] === 0 && playGrid[mouse.xx][player.y + 1] === 0) {\n player.x = mouse.xx;\n }\n }\n\n //Fall the player block\n if (aniPerc > 100) {\n player.y += 1;\n aniPerc -= 100;\n }\n\n //Has the player block hit something?\n if (playGrid[player.x][player.y + 1] !== 0 || player.y >= cellsVertical) {\n\n //Has it hit the top level? Game Over\n if (player.y <= 1) {\n playGrid.forEach((array, x) => {\n array.forEach((cell, y) => {\n playGrid[x][y] = 0;\n return;\n })\n })\n }\n\n //Process block collision\n gameBlockSpeedFall = 1;\n playerAlive = false;\n playGrid[player.x][player.y] = player.num;\n gameQueue.push({ type: \"check\", x: player.x, y: player.y });\n lastCellPos = player.x;\n }\n }\n else if (gameQueue[0].type === \"check\") {\n playerAlive = false;\n\n //X and Y for current cell\n const x = gameQueue[0].x;\n const y = gameQueue[0].y;\n\n //Save positions of all cells that the current cell will be multiplied with\n let matches = [];\n [0, 1, 2, 3].forEach((dir) => {\n const otherCell = getCellByDir(x, y, dir);\n if (isBlockSame(x, y, otherCell.x, otherCell.y)) {\n matches.push(getCellByDir(x, y, dir));\n }\n });\n\n //if any multiplication oppurtunities were found\n if (matches.length > 0) {\n\n //Queue all the blocks to be merged\n const mergeArray = [];\n const fallArray = []\n matches.forEach((cell) => {\n\n mergeArray.push({ oldX: cell.x, oldY: cell.y, newX: x, newY: y, num: playGrid[cell.x][cell.y] });\n //If there is a block above the block-to-be-deleted, add it to the falling queue\n /*if (playGrid[cell.x][cell.y - 1] !== 0) fallArray.push({ x: cell.x, y: cell.y - 1, num: playGrid[cell.x][cell.y - 1] })*/\n playGrid[cell.x][cell.y] = 0;\n\n });\n gameQueuePush({ type: \"merge\", array: mergeArray });\n gameQueuePush({ type: \"multiply\", x: x, y: y, to: Math.pow(2, matches.length) * playGrid[x][y] })\n fallArray.forEach((item) => {\n //gameQueuePush({type: \"fall\", x: item.x, y: item.y, num: item.num});\n });\n\n }\n\n gameQueueShift();\n }\n else if (gameQueue[0].type === \"merge\") {\n playerAlive = false;\n\n percent += mergeSpeed;\n if (percent > 1) {\n percent = 0;\n gameQueue[0].array.forEach((item) => {\n\n //If block has merged into another (moved), check if there was a block on top of it, and add to fall array\n if (playGrid[item.oldX][item.oldY - 1] !== 0 && item.newY !== item.oldY - 1) {\n gameQueuePush({ type: \"fall\", x: item.oldX, y: item.oldY - 1, num: playGrid[item.oldX][item.oldY - 1] })\n }\n })\n\n //Merge is done\n gameQueueShift();\n }\n }\n else if (gameQueue[0].type === \"multiply\") {\n playerAlive = false;\n percent += multiplySpeed;\n\n if (percent > 1) {\n percent = 0;\n playGrid[gameQueue[0].x][gameQueue[0].y] = gameQueue[0].to;\n\n //If, as a result of the merger, the block can now fall, add it to the fall array\n if (playGrid[gameQueue[0].x][gameQueue[0].y + 1] === 0) {\n gameQueuePush({ type: \"fall\", x: gameQueue[0].x, y: gameQueue[0].y, num: playGrid[gameQueue[0].x][gameQueue[0].y] });\n } else {\n //Now that the number on the block is different, check it again for potential new matches\n gameQueuePush({ type: \"check\", x: gameQueue[0].x, y: gameQueue[0].y })\n }\n\n\n\n //Multiply is done\n gameQueueShift();\n }\n\n\n }\n else if (gameQueue[0].type === \"fall\") {\n const x = gameQueue[0].x;\n const y = gameQueue[0].y;\n if (percent === 0) {\n playerAlive = false;\n playGrid[x][y] = 0;\n }\n\n percent += mergeSpeed;\n if (percent > 1) {\n percent = 0;\n playGrid[x][y + 1] = gameQueue[0].num;\n //Add new position to be checked\n gameQueuePush({ type: \"check\", x: x, y: y + 1 })\n\n //If the fall made another block fall as a consequence, add that block to fall\n if (playGrid[x][y - 1] !== 0) {\n gameQueuePush({ type: \"fall\", x: x, y: y - 1, num: playGrid[x][y - 1] });\n }\n\n //Now that the fall is complete, add a check step to see if theres any new mergers to be done in the new position\n gameQueuePush({ type: \"check\", x: x, y: y + 1 })\n\n //Fall is done\n gameQueueShift();\n }\n }\n\n // Perform the drawing operation\n draw();\n\n // The loop function has reached it's end. Keep requesting new frames\n window.requestAnimationFrame(gameLoop);\n}", "function gameLoop(timestamp) {\n // Request the next available animation frame.\n window.requestAnimationFrame(gameLoop);\n\n // Calculate FPS based on each animation frame.\n if (calcFPS)\n calculateFPS(timestamp);\n\n // Clear the canvas.\n clearScreen();\n\n // Draw the FPS counter in the upper right corner.\n if (showFPS)\n drawFPS();\n }", "function handleIntervalSecond(){\n const wait=setInterval(()=>{\n //counter gets +1 every sec\n waits++;\n if(waits>3){\n colorGrid(\"whitesmoke\");\n setGridToClickable(document.getElementById('grid'));\n waits=0;\n clearInterval(wait);\n }\n }, 1000);\n}", "run() {\n runningId = setInterval(() => {\n this.turnFlipStep();\n }, this.interval);\n }", "function runTick(){\n\t\tvar total = 0;\n\t\tfor (var y = 0; y < height; y++){\n\t\t\tvar row = rows[y],\n\t\t\t\t\tcol = row.getElementsByClassName('col');\n\t\t\tfor (var x = 0; x < width; x++){\n\t\t\t\tvar cell = col[x],\n\t\t\t\t cellInfo = grid.get(new Cell(x, y));\n\t\t\t\tif ( cellInfo.state == \"alive\" ){ \n\t\t\t\t\tcell.className = cell.className.replace('dead', 'alive');\n\t\t\t\t\ttotal ++;\n\t\t\t\t}\n\t\t\t\telse cell.className = cell.className.replace('alive', 'dead');\n\t\t\t}\n\t\t}\n\t\tif (total === 0) {\n\t\t\tstopButton.click();\n\t\t\treturn displayGrid();\n\t\t}\n\t}", "function timer() { // time and spawn mechanic\n ++time;\n if (time % 2 === 0 || time % 3 === 0) {\n spawnChaser();\n }\n if (time % 4 === 0 || time % 6 === 0) {\n spawnRunner();\n }\n if (time % 10 === 0 || time % 15 === 0) {\n spawnBigBoi();\n }\n if (time % 25 === 0) {\n spawnTerminator();\n }\n if (time % 40 === 0) {\n spawnLife();\n }\n if (time % 60 === 0) {\n spawnImmunity();\n }\n }", "function gameLoop() {\n\n //Loop this function 60 times per second\n requestAnimationFrame(gameLoop);\n \n // Update the current game state at 60fps\n state();\n \n //Render the stage\n renderer.render(gameStage);\n\n}", "function runClock() {\n setInterval(function() {\n let now = new Date();\n updateClockDisplay(now);\n },60*1000);\n}", "function startGame() {\n gridFix()\n blinks = \"0\";\n totalTider = [];\n updateView();\n blinkID = setInterval(randomOn, 2000); \n}", "function resetLifeGame() {\n if(gameLifeRunning != null) {\n clearInterval(gameLifeRunning);\n gameLifeRunning = null;\n }\n sizeTile = parseInt($(\"#input-board-size-tile\").val());\n nbTiles = parseInt($(\"#input-board-nb-tiles\").val());\n if(nbTiles > 0) {\n nbColumns = parseInt(__WIDTH_BOARD__ / (sizeTile+2));\n nbRows = parseInt(nbTiles / nbColumns);\n resetBoard();\n if($(__RUN_BUTTON__).attr(\"disabled\"))\n $(__RUN_BUTTON__).attr(\"disabled\", false);\n if(!$(__STOP_BUTTON__).attr(\"disabled\"))\n $(__STOP_BUTTON__).attr(\"disabled\", true);\n if($(__SAVE_BUTTON__).attr(\"disabled\"))\n $(__SAVE_BUTTON__).attr(\"disabled\", false);\n numGeneration = 0;\n $(\"#num-generation\").text(\"0\");\n $(\"#num-generation\").attr(\"style\", \"visibility: visible;\");\n }\n}", "function gameLoop(timeStamp) {\n\n //New tick\n ticks++;\n aniPerc += gameBlockSpeed * gameBlockSpeedFall;\n\n // Calculate the number of seconds passed since the last frame\n secondsPassed = (timeStamp - oldTimeStamp) / 1000;\n oldTimeStamp = timeStamp;\n fps = Math.round(1 / secondsPassed);\n\n //Update mos pos\n mouse.xx = Math.floor((mouse.x - areaX) / cellSize);\n mouse.yy = Math.floor((mouse.y - areaY) / cellSize);\n\n //If player is currently positioning a block\n if (playMode === \"player\") {\n\n if (hasClicked) {\n gameBlockSpeedFall = 60;\n hasClicked = !hasClicked;\n }\n\n //Update player column\n if (mouse.xx > -1 && mouse.xx < cellsHorizontal) {\n player.x = mouse.xx;\n }\n\n //Fall the player block\n if (aniPerc > 100) {\n player.y += 1;\n aniPerc -= 100;\n }\n\n //Has the block hit another block / ground?\n if (playGrid[player.x][player.y + 1] !== 0 || player.y >= cellsVertical) {\n\n //Process block collision\n gameBlockSpeedFall = 1;\n console.log(\"Collision!\")\n playGrid[player.x][player.y] = player.num;\n checkArray.push({ x: player.x, y: player.y })\n changeMode(\"multiplying\");\n console.log(\"CheckArray:\");\n console.table(checkArray);\n lastCellPos = player.x;\n playerAlive = false;\n //spawnBlock();\n\n\n }\n }\n else if (playMode === \"multiplying\") {\n //Check for possible multiplications by going through the cells in checkArray\n if (checkArray.length > 0) {\n //x and y for current cell\n const x = checkArray[checkArray.length - 1].x;\n const y = checkArray[checkArray.length - 1].y;\n\n //Save positions of all cell that current cell will be multiplied will\n let matches = [];\n [0, 1, 2, 3].forEach((dir) => {\n const otherCell = getCellByDir(x, y, dir);\n if (isBlockSame(x, y, otherCell.x, otherCell.y)) {\n //Add neighbour cell as a match since its the same number\n matches.push(getCellByDir(x, y, dir));\n }\n });\n\n //if any multiplication oppurtunities were found\n if (matches.length > 0) {console.log(\"Multiplication found\", matches)\n\n //Multiply the current cell the appropriate amount\n playGrid[x][y] = Math.pow(2, matches.length) * playGrid[x][y];\n matches.forEach((cell) => {\n\n //Erase neighbour cell and add it to combineArray, and add the cell above it to fallArray if there is one\n if (playGrid[cell.x][cell.y - 1] !== 0) {\n //fallArray.push();\n }\n combineArray.push({ oldX: cell.x, oldY: cell.y, newX: x, newY: y, num: playGrid[cell.x][cell.y] });\n playGrid[cell.x][cell.y] = 0;\n\n });\n\n changeMode(\"combine\");\n\n } else {console.log(\"No multiplication found\");\n //No multiplication oppurtunities found\n //Mark cell as checked\n if (checkArray.length === 1) checkArray = []; else checkArray = checkArray.pop();\n changeMode(\"player\");\n }\n\n //Drop block down one level if possible\n /*if (playGrid[x][y + 1] === 0) {\n playGrid[x][y + 1] = playGrid[x][y];\n //We now also need to check the cell above us ad infinitum as that might fall as a result\n }*/\n\n\n } else {\n console.log(\"OHNOOOOOO!\")\n playMode = \"player\"\n }\n }\n else if (playMode = \"combine\") {\n aniPerc += combineSpeed;console.log(aniPerc);\n if (aniPerc > 100) {\n aniPerc = 0;\n if (-1 > 0) {\n changeMode(\"fall\");\n }\n else if (checkArray.length > 0) {\n changeMode(\"multiplying\");\n } else {\n changeMode(\"player\");\n }\n }\n }\n/*\n else if (playMode = \"fall\") {\n aniPerc += combineSpeed;\n if (aniPerc > 100) {\n aniPerc = 0;\n if (fallArraylength > 0) {\n changeMode(\"fall\");\n }\n else if (checkArray.length > 0) {\n changeMode(\"multiplying\");\n } else {\n changeMode(\"player\");\n }\n }\n }*/\n\n\n\n\n // Perform the drawing operation\n draw();\n\n // The loop function has reached it's end. Keep requesting new frames\n window.requestAnimationFrame(gameLoop);\n}" ]
[ "0.71145606", "0.6455918", "0.6368944", "0.6345281", "0.6343472", "0.63268125", "0.63065046", "0.62905174", "0.6288947", "0.6288491", "0.6271798", "0.6271258", "0.6206848", "0.6195654", "0.61904025", "0.61895394", "0.6187302", "0.61579275", "0.6148401", "0.6147209", "0.61357147", "0.61194277", "0.6103953", "0.6103213", "0.6095237", "0.60920817", "0.60900515", "0.60873485", "0.60611427", "0.60587484", "0.6051147", "0.60389835", "0.6033136", "0.6030935", "0.6022356", "0.6017875", "0.6014932", "0.601214", "0.6008412", "0.5998159", "0.59941065", "0.5968642", "0.5967373", "0.59502685", "0.59413505", "0.59291047", "0.5903581", "0.5854654", "0.58489966", "0.5846635", "0.58454907", "0.5844845", "0.5840761", "0.58393705", "0.5837747", "0.58355707", "0.5831519", "0.58228666", "0.58228225", "0.582127", "0.5817796", "0.58139634", "0.58138406", "0.5808289", "0.5802914", "0.58013463", "0.580122", "0.57984656", "0.5788509", "0.5786728", "0.5777555", "0.57717097", "0.5765445", "0.57593274", "0.5753136", "0.57470167", "0.5741028", "0.5738882", "0.57294285", "0.57270616", "0.57184523", "0.5715905", "0.5715473", "0.57111794", "0.5710012", "0.5707084", "0.5705277", "0.57020867", "0.570089", "0.569982", "0.5698602", "0.5692671", "0.569138", "0.5686784", "0.5685083", "0.5684774", "0.5683129", "0.56781185", "0.5674721", "0.5662126" ]
0.6970416
1
When an error occurs
function error(err) { console.error(err.stack) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onError() {}", "function OnErr() {\r\n}", "function errorHandler(){\n\tconsole.log (\"Sorry, your data didn't make it. Please try again.\");\n}", "onerror() {}", "onerror() {}", "error(error) {}", "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "error(error) {\n this.__processEvent('error', error);\n }", "function handleError() {\n // TODO handle errors\n // var message = 'Something went wrong...';\n }", "function checkError() {\n if (err && !err.message.match(/response code/)) {\n return when().delay(1000); // chill for a second\n }\n }", "error(error) {\n return true;\n }", "function onFail(message) {\n }", "function handleError(errStat){\n alert(\"this isnt working\" + errStat);\n }", "function dataError(e){\r\n console.log(\"An error occured\");\r\n}", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "handleFailure (error_)\n\t{\n\t\tthrow error_;\n\t}", "function statusError()\n\t{\n\t\tcallback();\n\t}", "function errorCB(err) {\n //alert(\"Error processing SQL: \"+err.code);\n \n }", "isError() { return this.type==Token.ERROR }", "isError() { return this.type==Token.ERROR }", "function newMovieError() {\n\tconsole.log('Unable to add new movie...');\n}", "function wikiError(){\r\n self.errorMessage(\"Error in accessing wikipedia\");\r\n self.apiError(true);\r\n}", "function updateErrHandler(error, result) {\n\tif (error) {\n\t\tlog(\"cannot update data\")\n\t\tthrow error\n\t} else {\n\t\tlog(\"Update Success\") \n\t}\n}", "error() {}", "function handleErrors(error) {\n console.log('Please try again problem occured!');\n}", "function onFail(message) {\n console.log('Failed because: ' + message);\n }", "function processErrors(data){\n \n}", "function showError() {\n console.log(\"error in writing data to the database\")\n}", "onError(error) {\n // console.log('>>ERROR : ', error);\n }", "function mapError(){\r\n self.errorMessage(\"Error in accessing google maps\");\r\n self.apiError(true);\r\n}", "function error() {\n\tTi.App.fireEvent('closeLoading');\n\tTi.API.info(\"error\");\n}", "function failureCB(){}", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "function ErrorHandler() {}", "function onErrorItem(error) { // ensure correct\r\n alert(`Catch Error: ${error}`);\r\n console.error(error);\r\n}", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "function OnErrorCallMaladie(jqXHR, status) {\n\t\t}", "function dbErrorHandler(err) {\r\n// 없앰\r\n}", "function error (err) {\n if(error.err) return;\n callback(error.err = err);\n }", "handleFailure() {\n console.log(\"Failure\");\n }", "function getBlogFailure(error){}", "function failureCB() { }", "function _getJsonError() {\r\n home.error = true;\r\n }", "function error(err) {\n var problem;\n if (err.code == 1) {\n // user said no!\n problem = \"You won't share your location with us.\"\n }\n if (err.code == 2) {\n // location is unavailable - no satellites in range?\n problem = \"Your location is unavailable.\"\n }\n if (err.code == 3) {\n // request timed out\n problem = \"Something was too slow.\"\n }\n document.getElementById('location').innerHTML = \"Something went wrong! \"+problem;\n \n}", "function _detailsFail(err) {\n switch (err.status) {\n case 400:\n //error while getting asset\n $rootScope.back();\n $rootScope.errorModalText(err);\n ModalService.get('errorModal').open();\n break;\n case 404:\n //no assets found\n $rootScope.back();\n $rootScope.errorModalText(err);\n ModalService.get('errorModal').open();\n break;\n case 500:\n //server error\n vm.loadingState = 'networkError';\n break;\n default:\n vm.loadingState = 'networkError';\n break;\n }\n }", "function onFail(d) { console.log(\"ERR:ON FAIL\"+d); logm(\"ERR\",1,\"ON FAIL\",d); }", "function onError(error) {\n throw error;\n}", "gotError (error) {\n\t\tthis.handlers.onError(error) // tell the handler, we got an error\n\t}", "function onError(e) { console.log(e); }", "function onConnectionFailed() {\r\n\t\t console.error('Connection Failed!');\r\n\t\t}", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n requestPhotos(fallBackLocation)\n \n}", "error(err) {\n this.checkDate();\n console.error(`[${red(`ERROR ${dayjs().format(\"HH:mm:ss\")}`)}]: ${err.message + (err.stack ? \"\\n\"+err.stack.split('\\n').splice(1).join('\\n'):\"\")}\\n`);\n }", "function error(err) {\n\t\t// TODO output error message to HTML\n\t\tconsole.warn(`ERROR(${err.code}): ${err.message}`);\n\t\t// let msg = \"If you don't want us to use your location, you can still make a custom search\";\n\t\t// displayErrorMsg(msg);\n\t}", "function connectionError(err) {\n // Record failure in statsd\n statsClient.increment('opentsdb.failure');\n\n log.fatal('OpenTSDB connection error: ' + err);\n process.exit(1);\n }", "function onFail(message) {\n\n}", "function error(err) {\n if (err !== 'cancelled') { //We don't care about cancelled.\n //TODO: It may be useful in some cases to display the error. Which cases?\n console.error(err);\n }\n }", "function errorHandler(err)\n {\n if(err.code == 1)\n {\n console.log(\"error: access is denied!\");\n }\n else if( err.code == 2) {\n console.log(\"error: position is unavailable!\");\n }\n }", "function error(error) {\n console.log(\"Error : \" + error);\n}", "onFailure(error) {\n console.warn(`ERROR(${error.code}): ${error.message}`);\n }", "function OnErrorCallMaladie(jqXHR, status) {\n\t\t\tbrief.save();\n\t\t\tnotif(\"warning\", \"Brief sauvegardé avec <strong>succès</strong> !\");\n\n\t\t}", "function handleError(error) {\n if (error && error.name === 'SheetrockError') {\n if (request && request.update) {\n request.update({ failed: true });\n }\n }\n\n if (userOptions.callback) {\n userOptions.callback(error, options, response);\n return;\n }\n\n if (error) {\n throw error;\n }\n }", "function processError(){\n\t\tconsole.log('Error connecting to twitter API!');\t\n\t}", "static handleErrors(error) {\n\n if (error.response) {\n const message = error.response.data.message;\n const errorMessage = message ? message : 'something went wrong.'\n console.log(errorMessage);\n } else {\n console.log('something went wrong');\n }\n }", "function errorlogging(err) \r\n{\r\n\talert(\"Error processing SQL: Main err\"+err.code);\r\n}", "function loading_error() {\n console.log(\"ERRRR...OR\");\n}", "function handlerError(token, ex) {\n //store the exception\n token.result.exception = ex;\n finalizeTest(token, ex);\n }", "function handleError(err){\n\t //TODO: we need to handle the error correctly here... \n\n\t if (err && err.data) {\n\t //need to set it to .data because this handles the error\n\t //bubbling up from $http and from the taskman event\n\t err = err.data;\n\t }\n\n\t if (err) {\n\t var msg = {\n\t message: err.Message,\n\t exception: err.ExceptionMessage,\n\t type: err.ExceptionType,\n\t stack: err.StackTrace\n\t }\n\t $scope.currentTask.exception = msg;\n\t }\n\t else {\n\t $scope.currentTask.exception = err;\n\t }\n\t }", "function errorHandler(err) {\n //alert(\"An error occured\\n\" + err.message + \"\\n\" + err.details.join(\"\\n\"));\n }", "reportError(error) {\n event.emit(\"error-event\", error)\n }", "function locationError(err) {\n\tif(err.code == 1) {\n\t\tconsole.log(\"Error: Location request declined.\");\n\t} else if(err.code == 2) {\n\t\tconsole.log(\"Error: Position unavailable.\");\n\t} else if(err.code == 3) {\n\t\tconsole.log(\"Error: Network timed out.\");\n\t} else {\n\t\tconsole.log(\"Unknown error.\");\n\t}\n}", "onerror(err) {\n this.emitReserved(\"error\", err);\n }", "function error() {\r\n\t\t\t\talert(\"error\");\r\n\t\t\t}", "function errorCB(err) {\n console.log(\"Error processing SQL: \"+err.code);\n}", "function onError(error) {\n console.log(error);\n }", "function handlerErroe(error){\r\n console.error(error.toString())\r\n this.emit('end');\r\n}", "async function fails () {\n throw new Error('Contrived Error');\n }", "function showError() {}", "function errorHandler(error) { console.log('Error: ' + error.message); }", "function esconderError() {\n setError(null);\n }", "function errorCB(err) {\r\n alert(\"Error processing SQL: \"+err.code);\r\n }", "function fallo() {\n return error(\"Reportar fallo\");\n}", "_importError() {\r\n console.error('IMPORT ERROR!!');\r\n this._notFound();\r\n }", "onInvalid(errors) {\n console.log(errors);\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function errorCB(err) {\n\talert(\"Error processing SQL: \"+err.code+\" msg: \"+err.message);\n}", "function errorCB(err) {\r\n console.log(\"Error occured while executing SQL: \"+err.code);\r\n }", "onError(ex, param) {\n __guardMethod__(param.errHandler, 'err', o => o.err(HMSTATUS.pdfGeneration, ex));\n }", "function errorCallback() {\n\t const activeTransaction = getActiveTransaction();\n\t if (activeTransaction) {\n\t const status = 'internal_error';\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n\t activeTransaction.setStatus(status);\n\t }\n\t}", "function onConnectionFailed(){\n\t\t\tconsole.error(\"Connection Failed!\")\n\t\t}", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "error() {\n if (this.controller) {\n this.controller.set('isLoadError', true);\n }\n return true;//pass up stream\n }", "handleError(error) {\n throw error.response.data;\n }", "isErr() {\n return true;\n }", "function onError(error) {\n self.error('Error : ' + error.status + ' ' + error.statusText);\n }", "function error(){\n return \"Invaild e-mail or password!\";\n }" ]
[ "0.72318196", "0.7045342", "0.69672513", "0.6871869", "0.6871869", "0.68540317", "0.6835327", "0.6827477", "0.68122786", "0.68010694", "0.6767789", "0.6708222", "0.67029554", "0.66992927", "0.66774154", "0.6667396", "0.6632698", "0.66249675", "0.6624722", "0.6624722", "0.6613941", "0.6607662", "0.65957403", "0.65941244", "0.6590258", "0.65843534", "0.6554876", "0.6551175", "0.6527745", "0.6516494", "0.651248", "0.6505067", "0.64982617", "0.64982617", "0.64946806", "0.64810526", "0.6477082", "0.64752984", "0.6473584", "0.6468243", "0.6460775", "0.64579844", "0.64536667", "0.644774", "0.644577", "0.6438196", "0.6434808", "0.64316237", "0.6428371", "0.6418158", "0.64084953", "0.64066005", "0.6394261", "0.63936627", "0.6393008", "0.6365639", "0.63633233", "0.636109", "0.6360309", "0.6358388", "0.63571346", "0.63551366", "0.63466555", "0.63417524", "0.6340996", "0.63335025", "0.63307893", "0.6320561", "0.6317759", "0.6316818", "0.63146347", "0.63133234", "0.63087344", "0.6306481", "0.6306436", "0.63063157", "0.6301928", "0.62997997", "0.62960243", "0.6287522", "0.6283074", "0.6279891", "0.6279313", "0.6270308", "0.62689483", "0.6264907", "0.6264907", "0.6264907", "0.62625015", "0.62539244", "0.62523896", "0.62518764", "0.62464267", "0.62458706", "0.62458706", "0.62458706", "0.62438565", "0.62366724", "0.6236235", "0.6235161", "0.6234017" ]
0.0
-1
Returns a random integer between min (inclusive) and max (inclusive)
function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randInt(min, max) { return Math.random() * (max - min) + min; }", "function randInt(min, max) { return Math.random() * (max - min) + min; }", "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 }", "getRandomInteger(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 }", "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(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n } //max is excluded", "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 }", "getRandomInt(min, max) {\n return 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 }", "static getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min) + min)\n }", "function RandomInt(max, min)\n{\n return Math.floor(Math.random() * ( max + 1 - min) + min);\n}", "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 }", "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 }", "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "function rndInt(min, max) {\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randomInt(min, max) {\n return Math.floor((Math.random() * max) + min);\n}", "function randomInteger (min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function rndInt(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n}", "function get_random_integer(min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "function getRndInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n}", "function getRndInteger(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 }", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + 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}", "randomInt(min, max) {\n\n return Math.floor(Math.random() * (max - min)) + min\n }", "function randomInt(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 }", "function getRndInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) ) + min;\r\n}", "function randInt(min, max){\n return(Math.floor(Math.random() * (+max - +min)) + +min); \n }", "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randomInt(min, max){\r\n\treturn Math.floor(Math.random() * (max - min) + min);\r\n} // END - random value.", "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 return Math.floor(Math.random() * (max - min)) + 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 getRndInteger (min, 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 return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function randomInteger(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}", "function 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 }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min; \n }", "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 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 randomIntFromInterval(min,max)\n{return Math.floor(Math.random()*(max-min+1)+min);}", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n}", "function getRndInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) ) + min;\r\n}", "function getRndInteger(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 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 randomInteger(min, max) {\n return Math.floor(min + Math.random() * (max + 1 - min));\n}", "function randomInt(min,max)\n{\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "function randint(min, max) {\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}", "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 random_int(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "function getRandomInteger(min, max){\r\n return Math.floor(( Math.random() * (max - min + 1)) + min);\r\n}", "function randomInteger(min, max) { \n return 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 + 1)) + min;\n }", "function 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 getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRndInteger(min, max) {\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n}", "function randomInteger(min, max) {\r\n var rand = min + Math.random() * (max + 1 - min);\r\n return Math.floor(rand);\r\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 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) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "function getRandomInt(min, max) {\n min = ceil(min);\n max = floor(max);\n return floor(random() * (max - min + 1)) + min;\n }", "function getRndInteger(min, max) {\n \treturn Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "function 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) {\r\n return Math.floor(Math.random() * (max - min)) + min\r\n}", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min- + 1)) + min;\n}", "function randomInt(min, max){\n return Math.floor( (max - min + 1) * Math.random() ) + min;\n }", "getRandomIntInclusive (min, max) {\n min = Math.ceil(this.min);\n max = Math.floor(this.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) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomInt(min, max) {\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n}", "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function randomInt(min, max){\n return Math.floor(Math.random()* (max-min+1)+min);\n}" ]
[ "0.91688913", "0.91688913", "0.9098652", "0.9098652", "0.9088164", "0.9072013", "0.9070401", "0.907029", "0.907029", "0.9065955", "0.90646225", "0.9064371", "0.90606767", "0.90605736", "0.9057691", "0.905767", "0.90568143", "0.9046989", "0.90434307", "0.9043087", "0.90397924", "0.90382403", "0.9037755", "0.9034635", "0.9034267", "0.9032663", "0.90315163", "0.90290415", "0.90290415", "0.90290415", "0.90290415", "0.90290415", "0.90290415", "0.90290415", "0.90266275", "0.9026068", "0.90255976", "0.9021472", "0.90213513", "0.90213066", "0.90213066", "0.90213066", "0.9020383", "0.90200907", "0.901599", "0.901599", "0.901599", "0.90146726", "0.9014147", "0.9013329", "0.9012832", "0.90126294", "0.9011448", "0.9011079", "0.90105313", "0.9009393", "0.90093267", "0.90065444", "0.90065444", "0.90048623", "0.900352", "0.9003378", "0.9002466", "0.9002466", "0.9002137", "0.9002137", "0.9002137", "0.90019035", "0.9001771", "0.89994085", "0.89978963", "0.8997527", "0.8997397", "0.899729", "0.89947426", "0.8993147", "0.8992682", "0.8992401", "0.8992119", "0.8992037", "0.8991935", "0.89919007", "0.8991661", "0.8991661", "0.8991047", "0.8991047", "0.8991047", "0.8991047", "0.89901733", "0.8989834", "0.8989787", "0.89897555", "0.8989241", "0.8989075", "0.8988522", "0.89877415", "0.89877415", "0.89877415", "0.8987302", "0.89855516", "0.89848554" ]
0.0
-1
tabContent array of contents where we need to highlight single one while clicking on aproppriate headliner info parent element of all headliners tab array of directly headliners
constructor(tabContent, info, tab) { this.tabContent = document.querySelectorAll(tabContent); this.info = document.querySelector(info); this.tab = document.querySelectorAll(tab); this.hideTabContent(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tabActivate( prmCanvasLoc, prmtabHdrLoc, prmtabCntLoc ) \n{\n var i, nChildCount;\n var strChildId;\n var oChild;\n\n //--- get the number of children in canvas\n nChildCount = prmCanvasLoc.children.length;\n \n //--- loop thru the child objects to manage CONTENT-TABS\n for( i = 0; i < nChildCount; i++ ) \n {\n //--- retrive child object and id\n oChild = prmCanvasLoc.children(i);\n strChildId = oChild.id;\n \n //--- process only if object is content tab\n if( strChildId.substr(0,6) == \"tabCnt\" ) \n { \n if( oChild.id==prmtabCntLoc.id )\n {\n oChild.style.visibility= 'inherit';\n oChild.style.zIndex= 2;\n }\n else \n oChild.style.visibility= 'hidden';\n }\n }\n \n //--- loop thru the child objects to manage HEADER-TABS\n for( i = 0; i < nChildCount; i++ ) \n {\n //--- retrive child object and id\n oChild = prmCanvasLoc.children(i); strChildId = oChild.id\n\n //--- process only if object is header tab\n if( strChildId.substr(0,6) == \"tabHdr\" ) \n { \n if(oChild.id==prmtabHdrLoc.id) \n {\n oChild.style.top=\"4px\"; oChild.style.width= \"108px\";\n oChild.style.borderBottomColor= \"buttonface\";\n oChild.style.borderBottomStyle= \"solid\";\n oChild.style.borderBottomWidth= \"1px\";\n oChild.style.cursor= 'default';\n oChild.style.zIndex= 4;\n }\n else \n {\n oChild.style.top=\"8px\"; oChild.style.width= \"100px\";\n oChild.style.cursor= 'hand';\n oChild.style.zIndex= -1;\n }\n }\n }\n}", "function highlightAllTextOnPage(tabId, datawakeInfo) {\n var post_data = JSON.stringify({\n team_id: datawakeInfo.team.id,\n domain_id: datawakeInfo.domain.id,\n trail_id: datawakeInfo.trail.id,\n url: tabs.activeTab.url\n });\n var post_url = addOnPrefs.datawakeDeploymentUrl + \"/selections/get\";\n requestHelper.post(post_url, post_data, function (response) {\n if (response.status != 200){\n // TODO error handling\n console.error(response)\n }\n else{\n tracking.emitHighlightTextToTabWorker(tabId, response.json);\n }\n\n });\n}", "function createTab(name, content) {\n \n // get tabs list and append a new line item for a new tab\n var tabsList = document.getElementById('afd-tabs-list');\n var numTabs = tabsList.children.length;\n var lineItem = document.createElement('li');\n var lineItemAnchor = document.createElement('a');\n\n /*\n * create attributes for line item\n */\n\n var role = document.createAttribute('role');\n role.value = 'tab';\n lineItem.setAttributeNode(role);\n\n var tabIndex = document.createAttribute('tabindex');\n tabIndex.value = '-1';\n lineItem.setAttributeNode(tabIndex);\n\n var cls = document.createAttribute('class');\n cls.value = 'ui-tabs-tab ui-corner-top ui-state-default ui-tab';\n lineItem.setAttributeNode(cls);\n\n var ariaControls = document.createAttribute('aria-controls');\n ariaControls.value = 'tabs-' + (numTabs+1);\n lineItem.setAttributeNode(ariaControls);\n\n var ariaLabelledBy = document.createAttribute('aria-labelledby');\n ariaLabelledBy.value = 'ui-id-' + (numTabs+1);\n lineItem.setAttributeNode(ariaLabelledBy);\n\n var ariaSelected = document.createAttribute('aria-selected');\n ariaSelected.value = 'false';\n lineItem.setAttributeNode(ariaSelected);\n\n var ariaExpanded = document.createAttribute('aria-expanded');\n ariaExpanded.value = 'false';\n lineItem.setAttributeNode(ariaExpanded);\n\n /*\n * create attributes for line item\n */\n\n lineItemAnchor.href = '#tabs-' + (numTabs+1);\n\n var anchorRole = document.createAttribute('role');\n anchorRole.value = 'presentation';\n lineItemAnchor.setAttributeNode(anchorRole);\n\n var anchorTabIndex = document.createAttribute('tabindex');\n anchorTabIndex.value = '-1';\n lineItemAnchor.setAttributeNode(anchorTabIndex);\n\n var anchorCls = document.createAttribute('class');\n anchorCls.value = 'ui-tabs-anchor';\n lineItemAnchor.setAttributeNode(anchorCls);\n\n var anchorId = document.createAttribute('id');\n anchorId.value = 'ui-id-' + (numTabs+1);\n lineItemAnchor.setAttributeNode(anchorId);\n\n // set the name of the tab\n lineItemAnchor.innerHTML = '<b>' + name + '</b>';\n\n // append elements\n lineItem.appendChild(lineItemAnchor);\n tabsList.appendChild(lineItem);\n \n /*\n * create new div to hold tab's content\n */\n\n var tabsList = document.getElementById('afd-tabs');\n var newTabDiv = document.createElement('div'); \n\n // set id and style attributes of div\n newTabDiv.id = 'tabs-' + (numTabs+1);\n newTabDiv.style.height = '100%';\n newTabDiv.style.width = '90%';\n newTabDiv.style.display = 'none';\n\n // set additional attributes of div\n var divAriaLabelledBy = document.createAttribute('aria-labelledby');\n divAriaLabelledBy.value = 'ui-id-' + (numTabs+1);\n newTabDiv.setAttributeNode(divAriaLabelledBy); \n\n divRole = document.createAttribute('role');\n divRole.value = 'tabpanel';\n newTabDiv.setAttributeNode(divRole); \n\n var divCls = document.createAttribute('class');\n divCls.value = 'ui-tabs-panel ui-corner-bottom ui-widget-content';\n newTabDiv.setAttributeNode(divCls); \n\n var divAriaHidden = document.createAttribute('aria-hidden');\n divAriaHidden.value = 'true';\n newTabDiv.setAttributeNode(divAriaHidden);\n\n // set div content\n var paragraph = document.createElement('p');\n paragraph.innerHTML = content;\n newTabDiv.appendChild(paragraph);\n tabsList.appendChild(newTabDiv);\n\n $(\"#afd-tabs\").tabs(\"refresh\");\n\n}", "function SetHeaders(container) {\n let content = container.getElementsByClassName('content')\n let els = container.childNodes;\n console.log(content)\n if (content.length > 0){\n content = content[0]\n els = content.childNodes;\n }\n for (let i = 0; i < els.length; i++) {\n // Only apply this code block to h1, h2, etc\n if (typeof els[i].tagName === 'undefined' || els[i].tagName[0] != 'H' || els[i].tagName == 'HR' ) {\n continue;\n }\n\n // iterate\n let n = 1;\n\n // Test if page is open already in another tab\n anchor_id = els[i].id + '-anchor';\n if (document.getElementById(anchor_id)) {\n let loop = true;\n while (loop) {\n if (document.getElementById(anchor_id + '_' + n)) {\n n++;\n }\n else {\n break;\n }\n }\n anchor_id += '_' + n;\n }\n\n els[i].anchor_id = anchor_id;\n\n // Add link icon + a href to the header\n let href = window.location.origin + container.url + '#!' + els[i].id;\n els[i].innerHTML = '<a id=\"' + anchor_id + '\" class=\"anchor\" href=\"' + href + '\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\"></path></svg></a>\\n' + els[i].innerHTML\n\n // body onload is not called when staying within the page\n // we need to call the load_page() function manually\n let href_el = document.getElementById(anchor_id);\n href_el.onclick = function () {\n window.location.replace(this.href);\n load_page(0);\n }\n\n // Show/hide link icon\n els[i].onmouseover = function () {\n document.getElementById(this.anchor_id).style.visibility = 'visible';\n };\n els[i].onmouseleave = function () {\n document.getElementById(this.anchor_id).style.visibility = 'hidden';\n };\n }\n}", "function setTabAcs(){\n\t$(\".tab-titles\").siblings().wrapAll(\"<div class='tab-content'></div>\");\n\tul = $('.tab-content');\n\tul.children().each(function(i,li){ul.prepend(li)})\n\t\n\t$(document).find(\".tab-titles li\").each(function(i,value){\n\t\tvar elem = $(this).find(\"a\").clone();\n\t\tvar elem_id = $(this).find(\"a\").attr('href');\n\t\telem.addClass(\"ac-panel\");\n\t\t$(this).find(\"a\").attr(\"id\" , elem_id.replace('#', '') + \"_alink\");\n\t\telem.attr(\"id\" , elem_id.replace('#', '') + \"_plink\");\n\t\tsetAccordionPanel(elem, elem_id);\n\t});\n\t/* Set Default active states */\n\t$(\".tab-content>div\").addClass(\"tab-pane\");\n\t$(\".tab-titles\").find(\"li:nth-child(1)\").addClass(\"active\");\n\t$(\".tab-content\").find(\".ac-panel:nth-child(1)\").addClass(\"active\");\n\t$(\".tab-content\").find(\".tab-pane:first\").addClass(\"active\");\n\t/* Show Content */\n\t$(\"#contentBox\").fadeIn(\"slow\");\n}", "showTabContent(tabIndex) {\n\t\tlet scrollToEl;\n\n\t\tswitch(tabIndex) {\n\t\t\tcase 0:\n\t\t\t\tscrollToEl = document.getElementById(\"items\");\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tscrollToEl = document.getElementById(\"classes\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tscrollToEl = document.getElementById(\"champions\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tscrollToEl = document.getElementById(\"items\");\n\t\t}\n\n\t\tlet boundingBox = scrollToEl.getBoundingClientRect();\n\t\twindow.scrollTo(0, window.scrollY + boundingBox.y);\n\t}", "function activateFirstContentElement(parent) {\n let selector = \":scope .jt-content\";\n parent.querySelector(selector).classList.add(activeClass);\n}", "function showTabListing(){\n\tvar tabList = \"<ul class='list-group' id='\"+gTabListId+\"'>\";\n\tvar tempFocus = 0;\n chrome.tabs.query({}, function(tabs) { // blah \n \tfor(var i=0;i<tabs.length;i++){\n \t\tvar title = tabs[i].title.substring(0, 70)+\"..\" //only length x title is added\n \t\ttabList+=\"<li class='list-group-item un-selected' id='\"+tabs[i].id+\"'>\";\n \t\ttabList+=\"<img src='\"+tabs[i].favIconUrl+\"' class='tabFavicon'>&nbsp;\";\n \t\ttabList+=\"<span>\"+title+\"</span>\";\t\n \t\ttabList+=\"<a class='pull-right' id='\"+tabs[i].windowId+\"|\"+tabs[i].id+\t\"' href='\"+tabs[i].url+\"'>Open</a></li>\"; \t\t\t \n\t\ttempFocus++;\n \t}\n \ttabList+=\"</ul>\"\n\n \tdocument.getElementById('tabContents').innerHTML = tabList;\n \t//apply cosmetic improvements for user accessibility\n \tfinalize();\n\n });\n}", "function OuterTab(display_text,url,image)\n{\n\n this.Tabs = [];\n this.DisplayText = display_text;\n this.Url = url;\n this.AddTab = add_tab;\n this.LastTabIndex = '';\n this.Image = image;\n this.line_number = 1;\n\n}", "function display_first_external_tab_content(scale_title){\n var scaled_result = $(scale_title + \"_results\");\n var scaled_all_tabs_count = scaled_result.getElementsByClassName('tabbertab').length;\n var scale_external_tabs_count = scaled_result.getElementsByClassName('external_result').length/2;\n var previous_active_tab = scaled_result.getElementsByClassName('tabberactive')[0];\n if ((scaled_all_tabs_count == scale_external_tabs_count) && (previous_active_tab == null)){\n var click_tab = scaled_result.getElementsByClassName('external_result')[0];\n if (click_tab != null){\n click_tab.click();\n }\n }\n}", "function getActiveTab() {\n var wrapper = document.body.querySelector(\"fs-person-page\").shadowRoot;\n var tabs = [\"fs-tree-person-details\", \"fs-tree-person-sources\"];\n for (var i in tabs) {\n if (wrapper.querySelector(tabs[i]).classList.contains(\"iron-selected\")) {\n return tabs[i];\n }\n }\n return false;\n}", "getCurrentLimerick() {\n const lines = this.state.ancestors.map(ancestor => ancestor.text);\n lines.push(this.state.text);\n return lines;\n }", "get viewMoreStewardsTab_PostRaceInterview() {return browser.element(\"//android.widget.HorizontalScrollView/android.view.ViewGroup/android.view.ViewGroup[4]/android.view.ViewGroup/android.widget.TextView\");}", "function getSectionContents(bookmarkList,query) {\n var section_root = jQuery('<ol>').addClass('section_content');\n // section contents layout \n for ( var i = 0; i < bookmarkList.length; i++ ){\n if ( query == \"\" || bookmarkList[i].title.indexOf(query) >= 0 ){\n section_root.append(\n jQuery('<li>').attr('class','ui-widget-content').append(\n jQuery('<div>').text(bookmarkList[i].title).css('font-size','1em').add(\n jQuery('<input>').attr('type','hidden').val(bookmarkList[i].url)\n )\n )\n )\n \n }//end of if\n }//end of for.\n section_root.selectable({\n filter:'li',\n selected: function(event, ui) {\n chrome.tabs.create({url:$(ui.selected).find(\"input\").val()})\n }\n });\n return section_root;\n}", "function selectTab(group, index)\n{\n let tabContents = group.getElementsByClassName('tabs-content');\n for (let i = 0, count = tabContents.length; i < count; i++)\n {\n let content = tabContents[i];\n if (i == index)\n {\n content.classList.remove('hidden');\n }\n else\n {\n content.classList.add('hidden');\n }\n }\n let titles = group.getElementsByClassName('tabs-title');\n for (let i = 0, count = titles.length; i < count; i++)\n {\n let content = titles[i];\n if (i == index)\n {\n content.classList.add('selected');\n }\n else\n {\n content.classList.remove('selected');\n }\n if (!content.classList.contains('inited'))\n {\n let pos = i;\n content.onclick = () =>\n {\n selectAllTabs(pos, true);\n };\n content.classList.add('inited');\n }\n }\n}", "function makeActive(tab)\n{\n for (i = 0; i < TabView.listTabs.length; i++)\n {\n let tabElement = document.getElementById(TabView.listTabs[i].getIdTab());\n tabElement.className = tabElement.className.replace(ACTIVE_TAB_CLASS, '');\n\n let content = document.getElementById(TabView.listTabs[i].getIdContent());\n content.className = content.className.replace(ACTIVE_CONTENT_CLASS, '');\n }\n\n document.getElementById(tab.getIdTab()).className += ACTIVE_TAB_CLASS;\n document.getElementById(tab.getIdContent()).className += ACTIVE_CONTENT_CLASS;\n}", "get viewMoreStewardsTab_TrialsTab() {return browser.element(\"//android.widget.HorizontalScrollView/android.view.ViewGroup/android.view.ViewGroup[3]/android.view.ViewGroup/android.widget.TextView\");}", "get selectedTab() {\n let children = this.element.querySelectorAll('li.tab a');\n let index = -1;\n let href = null;\n [].forEach.call(children, (a, i) => {\n if (a.classList.contains('active')) {\n index = i;\n href = a.href;\n return;\n }\n });\n return { href, index };\n }", "function breakDownText(text, orig_tab) {\n var copy = orig_tab;\n if (text.length != 2 || Array.isArray(text[0])) { // there are multiple sections here if this is the case\n for (var i = 0; i < text.length; i++) {\n breakDownText(text[i], orig_tab); // break each of these larger sections down\n } // this is likely the beginnining with all tab headers\n } else {\n if (orig_tab === undefined) { // If there is no title for this section, make one.\n var title = text[0];\n var tab = document.getElementById(title);\n var title_element = document.createElement(\"h3\");\n title_element.innerHTML = title;\n tab.appendChild(title_element);\n orig_tab = tab;\n }\n\n if (Array.isArray(text[1])) { // If there is a sub-section under this section, break it down\n breakDownText(text[1], orig_tab);\n } else { // otherwise add to it\n if (copy !== undefined) {\n var title = text[0];\n var title_element = document.createElement(\"h4\");\n title_element.innerHTML = title;\n orig_tab.appendChild(title_element);\n }\n\n var text_element = document.createElement(\"p\");\n text_element.innerHTML = text[1];\n orig_tab.appendChild(text_element);\n }\n }\n\n}", "function tab_code(elem) {\n console.log(\"===TODO===\", 'tab', elem);\n}", "get viewMoreStewardsTab_RaceReplaysTab() {return browser.element(\"//android.widget.HorizontalScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup/android.widget.TextView\");}", "function showTab(tabIndex){\n tabs.forEach(function(tab,i){\n console.log(i)\n console.log(tabIndex)\n if(i=== tabIndex){\n tab.classList.add('active')\n }\n else{\n tab.classList.remove('active')\n }\n })\n \n \n tabContents.forEach(function(content){\n content.style.display=\"none\"\n })\n tabContents[tabIndex].style.display=\"block\"\n}", "processTabTitles() {\n\t\tvar allTabs = this.findAll(/^Source|^Process|^Log/)\n\t\tvar collide = {}\n\t\tfor(var i = 0;i < allTabs.length;i++){\n\t\t\tvar tab = allTabs[i]\n\t\t\tif(!tab.resource) continue\n\t\t\tvar path = tab.resource.path\n\t\t\tvar name = path.slice(path.lastIndexOf('/') + 1)\n\t\t\tif(!collide[name]) collide[name] = {}\n\t\t\tif(!collide[name][path]) collide[name][path] = []\n\t\t\tcollide[name][path].push(tab)\n\t\t}\n\t\tfor(var name in collide){\n\t\t\tvar mergePaths = collide[name]\n\t\t\tvar mergeKeys = Object.keys(mergePaths)\n\t\t\tif(mergeKeys.length > 1) {\n\t\t\t\tfor(var i = 0;i < mergeKeys.length;i++){\n\t\t\t\t\tvar tabs = mergePaths[mergeKeys[i]]\n\t\t\t\t\tfor(var j = 0;j < tabs.length;j++){\n\t\t\t\t\t\tvar tab = tabs[j]\n\t\t\t\t\t\tvar path = tab.resource.path\n\t\t\t\t\t\tvar rest = path.slice(1, path.lastIndexOf('/'))\n\t\t\t\t\t\tvar text = name + (tab.resource.dirty?\"*\":\"\") + '-' + rest\n\t\t\t\t\t\tif(tab.tabTitle !== text) {\n\t\t\t\t\t\t\ttab.tabTitle = text\n\t\t\t\t\t\t\tif(tab.parent) tab.parent.redraw()\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\telse {\n\t\t\t\tvar tabs = mergePaths[mergeKeys[0]]\n\t\t\t\tfor(var i = 0;i < tabs.length;i++){\n\t\t\t\t\tvar tab = tabs[i]\n\t\t\t\t\tvar text = name + (tab.resource.dirty?\"*\":\"\")\n\t\t\t\t\tif(tab.tabTitle !== text) {\n\t\t\t\t\t\ttab.tabTitle = text\n\t\t\t\t\t\tif(tab.parent) tab.parent.redraw()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function selectItem(){\r\n // Add border to current tab\r\n removeBorder();\r\n removeContent();\r\n this.classList.add('tab-border')\r\n //Grab content item from DOM\r\n const content = document.querySelector('#'+this.id+'-content')\r\n console.log(content)\r\n content.classList.add('show')\r\n}", "function renderData(data) {\n data.map((item, index) => {\n var el = document.createElement(\"li\"),\n btn = document.createElement(\"button\");\n el.classList.add(\"item\");\n btn.classList.add(\"tab-btn\");\n btn.setAttribute(\"data-index\", index);\n el.innerHTML = `\n <button class=\"head\" data-title=\"${item.title}\" data-index=\"${index}\">${item.title}</button>\n <div class=\"content\" data-index=\"${index}\">${item.content}</div>\n `;\n btn.innerHTML = item.title;\n parentEl.appendChild(el);\n parentBtn.appendChild(btn);\n });\n\n //Select first index for both tabs and accordion\n function onloadAnim() {\n const nc = document.querySelectorAll(\".content\"),\n content = Array.from(nc),\n bc = document.querySelectorAll(\".tab-btn\"),\n btns = Array.from(bc),\n ab = document.querySelectorAll(\".head\"),\n abBtns = Array.from(ab);\n content.forEach((el, i) => {\n if (i === 0) {\n el.classList.add(\"active\");\n }\n });\n btns.forEach((btn, i) => {\n if (i === 0) {\n btn.classList.add(\"active\");\n }\n btn.addEventListener(\"click\", tabsAnim);\n });\n abBtns.forEach((btn, i) => {\n // if (i === 0) {\n // btn.classList.add(\"active\");\n // }\n btn.addEventListener(\"click\", accordionAnim);\n });\n }\n //Function for tabs\n function tabsAnim() {\n var selectedIndex = parseInt(this.dataset.index);\n Array.prototype.filter.call(this.parentNode.children, (child, i) => {\n if (i === selectedIndex) {\n child.classList.add(\"active\");\n } else {\n child.classList.remove(\"active\");\n }\n });\n Array.prototype.filter.call(\n document.querySelectorAll(\".content\"),\n (content, i) => {\n console.log(i, selectedIndex);\n if (i === selectedIndex) {\n content.classList.add(\"active\");\n } else {\n content.classList.remove(\"active\");\n }\n }\n );\n }\n //Function for accordion\n function accordionAnim() {\n var selectedIndex = parseInt(this.dataset.index),\n content = this.nextElementSibling;\n console.log($(this).parent().siblings())\n content.classList.toggle(\"active\");\n Array.prototype.filter.call(\n document.querySelectorAll(\".content\"),\n (content, i) => {\n console.log(i, selectedIndex);\n if (i === selectedIndex) {\n // content.classList.add(\"active\");\n } else {\n content.classList.remove(\"active\");\n }\n }\n );\n }\n onloadAnim();\n}", "function getContent() {\n var helpTabUrl = 'https://api.cividesk.com/helptab/index.php';\n var getcontent = helpTabUrl + '?action=getContent';\n cj.ajax(getcontent, {\n type: 'post',\n dataType: 'json',\n data: {sid : cividesk_key, ver : civicrm_version, context: civicrm_contex },\n error: function() {\n alert('Could not retrieve data from HelpTab');\n },\n success: function(response) {\n var container = cj('.helptab-container');\n cj(\"#helptab-count\").hide();\n cj('#helptab-map-legend').animate({width: 468, padding: 12}, 1000);\n if(response.counts > 0){\n cj(\"#helptab-count\").text(response.counts).css({'margin-top':'-12px'}).show('slow');\n }\n cj.each(response.result, function(i, obj) {\n //@todo - temporary url for tracking of logging info, which will something like - 'http://api.cividesk.com/redirect.php?itemId=XXX';\n var redirectUrl = helpTabUrl + '?action=redirect&itemId=' + obj.item_id ;\n //var viewData = '<h3><a target=\"_blank\" class=\"helptab-title\" style=\"font-weight: normal;font-size: 1em;\" href=\"' + redirectUrl + '\">' + obj.title + '</a></h3><div class=\"helptab-context\">' + obj.text + '</div>';\n var helptab_iconId = '';\n if(obj.source !== null && obj.source.length > 0){\n var source = obj.source.toLowerCase();\n var helptab_iconId = \"helptab-icon-\"+source;\n }\n \n var viewData = '<h3 class=\"help-tab-title-h3\"><span class=\"helptab_iconClass\" id=\"'+ helptab_iconId +'\" title=\"'+ obj.text +'\"></span><a target=\"_blank\" class=\"helptab-title\" style=\"font-weight: normal;font-size: 1em;\" href=\"' + redirectUrl + '\">' + obj.title + '</a></h3>';\n container.append(viewData)\n });\n if (response.result.length == 0 ) {\n cj('#helptab-map-legend').empty().append('<div style=\"text-align:center;vertical-align: middle;padding-top:100px;\">Help content not available.</div>');\n }\n //cj('#total_record').html(response.total);\n \n //Implemented listing show-hide using jquery UI\n cj(\"#helptab-accordion\").accordion({\n event: \"click hoverintent\",\n heightStyle: \"content\"\n });\n\n //Js custom scroll bar\n cj('.jScrollbar4').jScrollbar();\n\n //Hide scrollbar for short records - set height as per set in css to 209\n var contentHeight = cj(\".jScrollbar_mask\").height();\n if (contentHeight < 209) {\n cj('.jScrollbar_draggable').hide();\n }\n\n //Handle click event for head tag in accordion\n cj(\".helptab-title\").on(\"click\", function(e) {\n\n e.preventDefault();\n //keep track of logging \n //setLogs(cj(this).attr('url'), cj(this).attr('href'), civicrm_contex);\n window.open(cj(this).attr('href') +'&sid='+cividesk_key +'&context='+civicrm_contex +'&ver='+ civicrm_version , '_blank');\n });\n }\n });\n}", "function editTabs() {\n createAlert (\n \"Edit Tabs\",\n \"Create or Edit Section Tabs\",\n \"editTabUI\",\n \"saveEditTabs()\"\n )\n // Focus Tabs in Preview\n document.getElementById(\"previewElementFocuser\").style.display = \"inline\"\n document.getElementsByClassName(\"headerPillSelector\")[0].classList.add(\"focused\")\n}", "insertTabsIntoDocument(tabContainer, selectTabAtIndex) {\n let overflowContainer = tabContainer.querySelector(\"#at_overflow\");\n let len = this.threadCollection.length;\n let maxWidth;\n if (RoKA.Application.currentMediaService() === Service.YouTube) {\n maxWidth = document.getElementById(\"watch7-content\").offsetWidth - 80;\n }\n else if (RoKA.Application.currentMediaService() === Service.KissAnime) {\n maxWidth = parseInt(window.getComputedStyle(document.getElementById(\"disqus_thread\").parentElement.parentElement).getPropertyValue(\"width\")) - 80;\n }\n else if (RoKA.Application.currentMediaService() === Service.KissManga) {\n maxWidth = document.getElementById(\"disqus_thread\").parentElement.parentElement.offsetWidth - 80;\n }\n let width = (21 + this.threadCollection[0].subreddit.length * 7);\n let i = 0;\n /* Calculate the width of tabs and determine how many you can fit without breaking the bounds of the comment section. */\n if (len > 0) {\n for (i = 0; i < len; i += 1) {\n width = width + (21 + (this.threadCollection[i].subreddit.length * 7));\n if (width >= maxWidth) {\n break;\n }\n let tab = document.createElement(\"button\");\n tab.className = \"at_tab\";\n tab.setAttribute(\"data-value\", this.threadCollection[i].subreddit);\n let tabLink = document.createElement(\"a\");\n tabLink.textContent = this.threadCollection[i].subreddit;\n tabLink.setAttribute(\"href\", \"http://reddit.com/r/\" + this.threadCollection[i].subreddit);\n tabLink.setAttribute(\"target\", \"_blank\");\n tab.addEventListener(\"click\", this.onSubredditTabClick.bind(this), false);\n tab.appendChild(tabLink);\n tabContainer.insertBefore(tab, overflowContainer);\n }\n // We can't fit any more tabs. We will now start populating the overflow menu.\n if (i < len) {\n overflowContainer.style.display = \"block\";\n /* Click handler for the overflow menu button, displays the overflow menu. */\n overflowContainer.addEventListener(\"click\", function () {\n let overflowContainerMenu = overflowContainer.querySelector(\"ul\");\n overflowContainer.classList.add(\"show\");\n }, false);\n /* Document body click handler that closes the overflow menu when the user clicks outside of it.\n by defining event bubbling in the third argument we are preventing clicks on the menu from triggering this event */\n document.body.addEventListener(\"click\", function () {\n let overflowContainerMenu = overflowContainer.querySelector(\"ul\");\n overflowContainer.classList.remove(\"show\");\n }, true);\n /* Continue iterating through the items we couldn't fit into tabs and populate the overflow menu. */\n for (i = i; i < len; i += 1) {\n let menuItem = document.createElement(\"li\");\n menuItem.setAttribute(\"data-value\", this.threadCollection[i].subreddit);\n menuItem.addEventListener(\"click\", this.onSubredditOverflowItemClick.bind(this), false);\n let itemName = document.createTextNode(this.threadCollection[i].subreddit);\n menuItem.appendChild(itemName);\n overflowContainer.children[1].appendChild(menuItem);\n }\n }\n else {\n /* If we didn't need the overflow menu there is no reason to show it. */\n overflowContainer.style.display = \"none\";\n }\n }\n else {\n overflowContainer.style.display = \"none\";\n }\n // If there is only one thread available the container should be displayed differently.\n if (this.threadCollection[0].subreddit.length === 1) {\n tabContainer.classList.add(\"single\");\n }\n else {\n tabContainer.classList.remove(\"single\");\n }\n // Set the active tab if provided\n if (selectTabAtIndex != null) {\n let selectedTab = tabContainer.children[selectTabAtIndex];\n selectedTab.classList.add(\"active\");\n }\n }", "function showContent(evento, contenidoDeUnTab) {\nconsole.log(evento);\nconsole.log(evento.target);\n\nlet i, todosLosContenidos, tab_button;\n\ntodosLosContenidos = document.getElementsByClassName(\"Tabs__tab-content\");\nfor (i = 0; i < todosLosContenidos.length; i++) {\ntodosLosContenidos[i].style.display = \"none\";\n} \n\ntab_button = document.getElementsByClassName(\"Tabs__tab\");\nfor (i = 0; i < tab_button.length; i++) {\ntab_button[i].className = tab_button[i].className.replace(\" active\", \"\");\n} \n\n// style.cssText = \"display: block; position: absolute\";\n\ndocument.getElementById(contenidoDeUnTab).style.display = \"block\";\nevento.target.className += \" active\";\n}", "function activeTab(index) {\n tabContent.forEach((section )=>{\n section.classList.remove('ativo');\n })\n tabContent[index].classList.add('ativo');\n }", "function updateContent() {\n function updateTab(tabs) {\n if (tabs[0]) {\n currentTab = tabs[0];\n console.log(\"updateTabs\");\n \n // executeScript(currentTab);\n loadFoundWords(currentTab);\n }\n }\n\n var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});\n gettingActiveTab.then(updateTab);\n}", "function triigletabcontent() {\n $(\".tab-c\").each(function() {\n $(this).removeClass(\"active\");\n });\n }", "function getSelectedText1() {\r\n var text = \"\";\r\n if (window.getSelection) {\r\n text = window.getSelection().toString();\r\n } else if (document.selection) {\r\n text = document.selection.createRange().text;\r\n }\r\n\r\n if (tFlag === 0) {\r\n var a = String('<title id=\"' + text + '\">');\r\n data_arr.push(a);\r\n tFlag = 1;\r\n }\r\n else {\r\n if (mpFlag === 0) {\r\n data_arr.push(String('</title>'));\r\n tFlag = 0;\r\n var a = String('<title id=\"' + text + '\">');\r\n data_arr.push(a);\r\n tFlag = 1;\r\n }\r\n else {\r\n data_arr.push(String('</mp>'));\r\n data_arr.push(String('</title>'));\r\n tFlag = 0;\r\n mpFlag = 0;\r\n var a = String('<title id=\"' + text + '\">');\r\n data_arr.push(a);\r\n tFlag = 1;\r\n }\r\n }\r\n}", "function openContent1(tab,value){\n\tvar tabcontent = document.getElementsByClassName(\"tab-content\");\n \tfor (i = 0; i < tabcontent.length; i++) {\n \ttabcontent[i].style.display = \"none\";\n \t}\n\n \tvar tablinks = document.getElementsByClassName(\"tabLinks\");\n \tfor (i = 0; i < tablinks.length; i++) {\n \ttablinks[i].className = tablinks[i].className.replace(\" active1\", \"\");\n \t}\n\n \t document.getElementById(value).style.display = \"block\";\n \t $(\"#\"+tab).addClass(\"active1\");\n\n}", "function showTabStatus() {\n // console.log(myObject.taps);\n\n // This is for Section 3: clean container:\n document.querySelector(\".status\").innerHTML = \"\";\n // also empty change-tap list!\n document.querySelector(\".change-tap\").innerHTML = \"\";\n\n let taps = myObject.taps;\n\n taps.forEach(tap => {\n\n // console.log(tap.level);\n\n //define template\n let tapTemplate = document.querySelector('.status-temp').content;\n //define clone\n let clone = tapTemplate.cloneNode(true);\n //grab the value of level and set as height of level\n clone.querySelector('.tap-level').style.height = `${tap.level/10}px`;\n //grab the name of beer\n clone.querySelector('.beer-tap-name').textContent = tap.beer;\n\n\n\n\n // SECTION 4 ALERTS\n // 4.1 CHANGE TAP\n if (tap.level <= 500) {\n\n clone.querySelector('.tap-level').style.backgroundColor = \"red\";\n\n // clone template\n let tapListTemplate = document.querySelector('.tap-list-temp').content;\n //define clone\n let tapListClone = tapListTemplate.cloneNode(true);\n\n // set beer-name in this new clone\n tapListClone.querySelector('.tap-name').textContent = `* ${tap.beer}`;\n\n // append the clone to .change-tap\n document.querySelector(\".change-tap\").appendChild(tapListClone);\n };\n\n //append clone to div\n document.querySelector(\".status\").appendChild(clone);\n });\n}", "function tab(cm) {\n var _a;\n var selections = cm.listSelections();\n var beforeCur = [];\n var afterCur = [];\n var selected = [];\n var addIndentTo = {}; // {lineNo: stringIndent}\n var tokenSeeker = new core_1.TokenSeeker(cm);\n /** indicate previous 4 variable changed or not */\n var flag0 = false, flag1 = false, flag2 = false, flag3 = true;\n function setBeforeCur(text) { beforeCur[i] = text; if (text)\n flag1 = true; }\n function setAfterCur(text) { afterCur[i] = text; if (text)\n flag2 = true; }\n function setSelected(text) { selected[i] = text; if (text)\n flag3 = true; }\n for (var i = 0; i < selections.length; i++) {\n beforeCur[i] = afterCur[i] = selected[i] = \"\";\n var range = selections[i];\n var left = range.head;\n var right = range.anchor;\n var rangeEmpty = range.empty();\n if (!rangeEmpty && codemirror_1.cmpPos(left, right) > 0)\n _a = [left, right], right = _a[0], left = _a[1];\n else if (right === left) {\n right = range.anchor = { ch: left.ch, line: left.line };\n }\n var eolState = cm.getStateAfter(left.line);\n var line = cm.getLine(left.line);\n if (eolState.hmdTable) {\n // yeah, we are inside a table\n flag0 = true; // cursor will move\n var isNormalTable = eolState.hmdTable === 2 /* NORMAL */;\n var columns = eolState.hmdTableColumns;\n tokenSeeker.setPos(left.line, left.ch);\n var nextCellLeft = tokenSeeker.findNext(isRealTableSep, tokenSeeker.i_token);\n if (!nextCellLeft) { // already last cell\n var lineSpan = eolState.hmdTableRow === 0 ? 2 : 1; // skip |---|---| line\n if ((left.line + lineSpan) > cm.lastLine() || cm.getStateAfter(left.line + lineSpan).hmdTable != eolState.hmdTable) {\n // insert a row after this line\n left.ch = right.ch = line.length;\n var newline_2 = core_1.repeatStr(\" | \", columns.length - 1);\n // There are always nut users!\n if (eolState.hmdTableRow === 0) {\n right.line = left.line += 1;\n right.ch = left.ch = cm.getLine(left.line).length;\n }\n if (isNormalTable) {\n setBeforeCur(\"\\n| \");\n setAfterCur(newline_2 + \" |\");\n }\n else {\n setBeforeCur(\"\\n\");\n setAfterCur(newline_2.trimRight());\n }\n setSelected(\"\");\n }\n else {\n // move cursor to next line, first cell\n right.line = left.line += lineSpan;\n tokenSeeker.setPos(left.line, 0);\n var line_1 = tokenSeeker.line.text;\n var dummySep = isNormalTable && tokenSeeker.findNext(/hmd-table-sep-dummy/, 0);\n var nextCellRight = tokenSeeker.findNext(/hmd-table-sep/, dummySep ? dummySep.i_token + 1 : 1);\n left.ch = dummySep ? dummySep.token.end : 0;\n right.ch = nextCellRight ? nextCellRight.token.start : line_1.length;\n if (right.ch > left.ch && line_1.charAt(left.ch) === \" \")\n left.ch++;\n if (right.ch > left.ch && line_1.charAt(right.ch - 1) === \" \")\n right.ch--;\n setSelected(right.ch > left.ch ? cm.getRange(left, right) : \"\");\n }\n }\n else {\n var nextCellRight = tokenSeeker.findNext(/hmd-table-sep/, nextCellLeft.i_token + 1);\n left.ch = nextCellLeft.token.end;\n right.ch = nextCellRight ? nextCellRight.token.start : line.length;\n if (right.ch > left.ch && line.charAt(left.ch) === \" \")\n left.ch++;\n if (right.ch > left.ch && line.charAt(right.ch - 1) === \" \")\n right.ch--;\n setSelected(right.ch > left.ch ? cm.getRange(left, right) : \"\");\n }\n // console.log(\"selected cell\", left.ch, right.ch, selected[i])\n }\n else if (eolState.listStack.length > 0) {\n // add indent to current line\n var lineNo = left.line;\n var tmp = void 0; // [\" * \", \" \", \"* \"]\n while (!(tmp = ListRE.exec(cm.getLine(lineNo)))) { // beginning line has no bullet? go up\n lineNo--;\n var isList = cm.getStateAfter(lineNo).listStack.length > 0;\n if (!isList) {\n lineNo++;\n break;\n }\n }\n var firstLine = cm.firstLine();\n var lastLine = cm.lastLine();\n for (; lineNo <= right.line && (tmp = ListRE.exec(cm.getLine(lineNo))); lineNo++) {\n var eolState_1 = cm.getStateAfter(lineNo);\n var listStack = eolState_1.listStack;\n var listStackOfPrevLine = cm.getStateAfter(lineNo - 1).listStack;\n var listLevel = listStack.length;\n var spaces = \"\";\n // avoid uncontinuous list levels\n if (lineNo > firstLine && listLevel <= listStackOfPrevLine.length) {\n if (listLevel == listStackOfPrevLine.length) {\n // tmp[1] is existed leading spaces\n // listStackOfPrevLine[listLevel-1] is desired indentation\n spaces = core_1.repeatStr(\" \", listStackOfPrevLine[listLevel - 1] - tmp[1].length);\n }\n else {\n // make bullets right-aligned\n // tmp[0].length is end pos of current bullet\n spaces = core_1.repeatStr(\" \", listStackOfPrevLine[listLevel] - tmp[0].length);\n }\n }\n addIndentTo[lineNo] = spaces;\n // if current list item is multi-line...\n while (++lineNo <= lastLine) {\n if ( /*corrupted */cm.getStateAfter(lineNo).listStack.length !== listLevel) {\n lineNo = Infinity;\n break;\n }\n if ( /*has bullet*/ListRE.test(cm.getLine(lineNo))) {\n lineNo--;\n break;\n }\n addIndentTo[lineNo] = spaces;\n }\n }\n if (!rangeEmpty) {\n flag3 = false;\n break; // f**k\n }\n }\n else {\n // emulate Tab\n if (rangeEmpty) {\n setBeforeCur(\" \");\n }\n else {\n setSelected(cm.getRange(left, right));\n for (var lineNo = left.line; lineNo <= right.line; lineNo++) {\n if (!(lineNo in addIndentTo))\n addIndentTo[lineNo] = \" \";\n }\n }\n }\n }\n // if (!(flag0 || flag1 || flag2 || flag3)) return cm.execCommand(\"defaultTab\")\n // console.log(flag0, flag1, flag2, flag3)\n for (var lineNo in addIndentTo) {\n if (addIndentTo[lineNo])\n cm.replaceRange(addIndentTo[lineNo], { line: ~~lineNo, ch: 0 });\n }\n if (flag0)\n cm.setSelections(selections);\n if (flag1)\n cm.replaceSelections(beforeCur);\n if (flag2)\n cm.replaceSelections(afterCur, \"start\");\n if (flag3)\n cm.replaceSelections(selected, \"around\");\n }", "get tabs() {\n if (!this.fileID) return [];\n \n const tabs = [];\n for (var i=0;i<this.pdfFiles.length;i++) {\n tabs.push({\n value: this.pdfFiles[i].contentDocumentId,\n label: this.pdfFiles[i].title\n \n });\n this.fileDetails[this.pdfFiles[i].contentDocumentId+'contenBodyId']=this.pdfFiles[i].contentBodyId;\n this.fileDetails[this.pdfFiles[i].contentDocumentId+'versionId']=this.pdfFiles[i].versionId;\n this.fileDetails[this.pdfFiles[i].contentDocumentId+'fileExtension']=this.pdfFiles[i].fileExtension;\n this.fileDetails[this.pdfFiles[i].contentDocumentId+'versionData']=this.pdfFiles[i].versionData;\n }\n return tabs;\n }", "function panelHeader(index) {\n var bar = toggablePanel[index];\n //on return key pressed\n bar.onkeypress = function(e) {\n if (e.which == 13) {\n this.click();\n //console.log('enter key down' + e);\n }\n }\n\n //clicking on tab\n bar.onclick = function() {\n var contentWrapper = this.nextElementSibling;\n //console.log (contentWrapper.clientHeight);\n\n //using firstchild would return #text if there's a white space, so...\n var content = contentWrapper.getElementsByTagName('div')[0];\n\n var contentWrapperHeight = contentWrapper.clientHeight;\n\n\n if (this.classList.contains('whi--panel--collapsed')) {\n //console.log('showing-----------------');\n contentWrapper.classList.remove('whi--panel--collapsed');\n this.classList.remove('whi--panel--collapsed');\n this.setAttribute(\"aria-hidden\", \"false\");\n\n } else {\n //console.log('hiding-----------------');\n contentWrapper.classList.add('whi--panel--collapsed');\n this.classList.add('whi--panel--collapsed');\n this.setAttribute(\"aria-hidden\", \"true\");\n }\n\n }\n\n}", "get raceListTab() {return browser.element(\"~Race List\");}", "activateTabContent(hash, isSticky = false) {\n const $thisTab = $(hash);\n\n if (!isSticky) {\n\n if ($thisTab.is(':visible')) return;\n\n // Locate other tabs that share the same 'tabs-group'\n const tabsGroup = $thisTab.data('tabs-group');\n const $tabsGroup = this.$tabContents.filter(function() {\n return $(this).data('tabs-group') === tabsGroup;\n });\n\n // Disable other tabs in this group\n for (let i = 0; i < $tabsGroup.length; i++) {\n this._defaultToggleContent($tabsGroup[i], false);\n }\n // Enable this tab content\n this._defaultToggleContent($thisTab, true);\n } else {\n // Tabs are sticky, so we only toggle the individual item\n if ($thisTab.is(':visible')) {\n this._defaultToggleContent($thisTab, false);\n } else {\n this._defaultToggleContent($thisTab, true);\n }\n }\n }", "function aanmaken_card_tabs(idx)\n {\n var v_card_tab__html = ''; // deze variable zal de volledige tab structuur bevatten\n var v_card_tab_pgnaam__html = ''; // deze variable bevat de html voor de tab pagina namen\n var v_card_tab_pgcnt__html = ''; // deze variable bevat de html voor de tab content\n var v_card_tab_naam__str = card_tabs_data__arr[idx].card_tab_naam__str; // hier wordt de card tabnaam opgeslagen\n \t var v_card_tab_nr__str = idx + 1;\n\n card_tabs_data__arr[idx].card_tab_pg__arr.map((card_tab_pg__obj, idx2) => {\n\n var titel = card_tab_pg__obj.card_tab_pg_data__obj.titel;\n var viz = card_tab_pg__obj.card_tab_pg_data__obj.visualisatie;\n var info = card_tab_pg__obj.card_tab_pg_data__obj.info;\n\t var iframe_ref = (typeof card_tab_pg__obj.card_tab_pg_data__obj.iframe_ref !== 'undefined') ? card_tab_pg__obj.card_tab_pg_data__obj.iframe_ref : '';\n\n var v_card_tab_pgnr__str = idx2 + 1;\n // deze variable bevat de volledige prmt groepen structuur uit de aanmaken_prmt_groep functie\n\t\tif (typeof card_tab_pg__obj.card_tab_pg_naam__str !== 'undefined') {\n\t\t\tv_card_tab_pgnaam__html += `<li class='${v_card_tab_naam__str}_${v_card_tab_pgnr__str}_pgnaam'><a href=\"#\" class=\"${iframe_ref}\">${card_tab_pg__obj.card_tab_pg_naam__str}</a></li>`;\n\t\t}\n \tv_card_tab_pgcnt__html += `<li class=\"${v_card_tab_naam__str}_${v_card_tab_pgnr__str}_pgcnt\">${card_struct(v_card_tab_nr__str, viz(v_card_tab_nr__str, iframe_ref), titel, info)}</li>`;\n })\n // dit is de volledige tab structuur\n v_card_tab__html += `<div class='${v_card_tab_naam__str}_cnt' style='padding:10px;'><ul class='${v_card_tab_naam__str}_pgnaam' style=\"${v_card_tab_pgnaam__html ? '' : 'display:none;'}\" uk-tab>${v_card_tab_pgnaam__html ? v_card_tab_pgnaam__html : '<li><div></div></li>'}</ul><ul class='uk-switcher ${v_card_tab_naam__str}_pgcnt'>${v_card_tab_pgcnt__html}</ul></div>`;\n return v_card_tab__html; // geeft als resultaat de tab structuur terug\n }", "function changeTab(event){\n let tabs = document.getElementsByClassName('tab');\n for(i=0; i <tabs.length;i++){\n tabs[i].classList.remove(\"active\");\n }\n event.target.parentNode.classList+= \" active\";\n let selelectedtab = event.target.innerHTML;\n let contenttab = document.getElementById('myTabContent');\n let contents = menuobject[selelectedtab];\n contenttab.innerHTML = \"\";\n for(key in contents){\n let newbutton = document.createElement('button');\n newbutton.className = \"col-lg-2 col-md-2 col-xs-4 btn contentbtn\";\n newbutton.innerHTML = key;\n newbutton.addEventListener('click',foodbtnclick);\n contenttab.appendChild(newbutton);\n }\n}", "get expertTipsTab() {return browser.element(\"~Expert Tips\");}", "onClickCity(e){\n\n const TABS = document.getElementsByName(\"tabs\")[0];\n\n let target = e.target;\n\n // USE EVENT DELEGATION SO WE ONLY LISTEN TO CLICKS ON THE PARENT ELEMENT INSTEAD OF EVERY CHILD\n if (target.classList.contains(\"block\")){\n\n let tabIndex = target.dataset.index;\n\n // trigger the click on the tab element\n document.querySelectorAll(\".tabs-header--tab\")[tabIndex].click();\n\n // scroll the page to the tabs section\n window.scroll({\n left: 0,\n top: TABS.offsetTop - 60,\n behavior: \"smooth\"\n });\n\n }\n\n\n\n }", "function display_external_tab_content(scale_title){\n var scaled_result = $(scale_title + \"_results\");\n var chosen_tab = scaled_result.getElementsByClassName('tabberactive')[0];\n var scale_and_type = chosen_tab.childNodes[0].className;\n //the content could come from external search\n if (scale_and_type.match(\"external_result\") != null){\n scale_and_type = scale_and_type.split('external_result')[0];\n var resource_type = scale_and_type.split('_')[1].strip();\n $(resource_type).show();\n }\n\n}", "function displaySelectedCUHybridCompTab(){\n var url = parent.location.href;\n s=url.indexOf(\"summary\");\n if (s!=-1){\n obj= document.getElementById('summary-li');\n if(obj){\n document.getElementById('summary').style.display=\"\";\n }\n }\n if (url.indexOf(\"basiccontrol\")!=-1){\n obj= document.getElementById('basiccontrol-li');\n if(obj){\n document.getElementById('basiccontrol').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"cprating\")!=-1){\n obj= document.getElementById('cprating-li');\n if(obj){\n document.getElementById('cprating').style.display=\"\";\n }\n }\n if (url.indexOf(\"auditreadyasmt\")!=-1){\n obj= document.getElementById('auditreadyasmt-li');\n if(obj){\n document.getElementById('auditreadyasmt').style.display=\"\";\n }\n }\n if (url.indexOf(\"riskmsdcommit\")!=-1){\n obj= document.getElementById('riskmsdcommit-li');\n if(obj){\n document.getElementById('riskmsdcommit').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"auditreview\")!=-1){\n obj= document.getElementById('auditreview-li');\n if(obj){\n document.getElementById('auditreview').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"kctest\")!=-1){\n obj= document.getElementById('kctest-li');\n if(obj){\n document.getElementById('kctest').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"opmetric\")!=-1){\n obj= document.getElementById('opmetric-li');\n if(obj){\n document.getElementById('opmetric').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"other\")!=-1){\n obj= document.getElementById('other-li');\n if(obj){\n document.getElementById('other').style.display=\"\";\n }\n }\n}", "function clickMenuCallback(info, tab) {\n console.log(\"Trying to classify text\");\n textClassifier.classifyText(info.selectionText, tab.id);\n}", "function cp_tab_control() {\n\tvar tabs = [];\n\tvar tabContainers = [];\n\tjQuery('ul.tabnavig a').each(function() {\n\t\tif ( window.location.pathname.match(this.pathname) ) {\n\t\t\ttabs.push(this);\n\t\t\ttabContainers.push( jQuery(this.hash).get(0) );\n\t\t}\n\t});\n\n\t//hide all contrainers except execpt for the one from the URL hash or the first container\n\tif ( window.location.hash !== \"\" && window.location.hash.search('block') >= 0 ) {\n\t\tjQuery(tabContainers).hide().filter(window.location.hash).show();\n\t\t//detecting <a> tab using its \"href\" which should always equal the hash\n\t\tjQuery(tabs).filter( function(index) {\n\t\t\treturn ( jQuery(this).attr('href') === window.location.hash );\n\t\t}).addClass('selected');\n\t\tjQuery('html').scrollTop( jQuery(window.location.hash).parent().position().top );\n\t} else {\n\t\tjQuery(tabContainers).hide().filter(':first').show();\n\t\tjQuery(tabs).filter(':first').addClass('selected');\n\t}\n\n\tjQuery(tabs).click(function() {\n\t\t// hide all tabs\n\t\tjQuery(tabContainers).hide().filter(this.hash).fadeIn(100);\n\t\tjQuery(tabs).removeClass('selected');\n\t\tjQuery(this).addClass('selected');\n\t\treturn false;\n\t});\n}", "_makeTabsFromPfTab() {\n const ul = this.querySelector('ul');\n if (this.children && this.children.length) {\n const pfTabs = [].slice\n .call(this.children)\n .filter(node => node.nodeName === 'PF-TAB');\n [].forEach.call(pfTabs, (pfTab, idx) => {\n const tab = this._makeTab(pfTab);\n ul.appendChild(tab);\n this.tabMap.set(tab, pfTab);\n this.panelMap.set(pfTab, tab);\n\n if (idx === 0) {\n this._makeActive(tab);\n }\n else {\n pfTab.style.display = 'none';\n }\n });\n }\n }", "function organizeTabs(){\n\tchrome.tabs.query({currentWindow:true}, function(tabs) { //selects all tabs from current window\n\t\tconsole.log(tabs);//check the console for more tab information\n\t\t//sorts array of obj's. Source: http://stackoverflow.com/users/43452/stobor\n\t\ttabs.sort(function(a, b) {\n\t\t\treturn a['url'].localeCompare(b['url']);\n\t\t});\n\t\tvar urllist = document.getElementById('tabs');\n\t\tfor(var i in tabs){\n\t\t\tvar tablen = tabs.length;\n\t\t\tif((i%Math.floor(Math.sqrt(tablen)) === 0 && tablen <= 7*7) || (tablen > 7*7 && i%6 === 0)){\n\t\t\t\tvar row = document.createElement('tr');\n\t\t\t\turllist.appendChild(row);//adds a new row to the table\n\t\t\t}\n\t\t\t//tabitem consists of entries in larger table\n\t\t\tvar tabitem = document.createElement('td');\n\t\t\ttabitem.id = String(tabs[i]['id']);//sets <td id='tab.id'>\n\t\t\ttabitem.className = 'clickTab';\n\t\t\trow.appendChild(tabitem);\n\t\t\t//each tabitem has its data formatted in a table\n\t\t\tvar formattedCell = document.createElement('table');\n\t\t\ttabitem.appendChild(formattedCell);\n\n\t\t\tvar cellData = document.createElement('tr');\n\t\t\tformattedCell.appendChild(cellData);//there will only be ONE row per cell\n\n\t\t\tvar iconTd = document.createElement('td');\n\t\t\ticonTd.className = 'icontd';\n\t\t\tcellData.appendChild(iconTd);//adding icon to cell\n\n\t\t\tvar lengthLimit = 12,//max number of characters per line\n\t\t\t\t\tvisibleText = 30,//max visible characters from title\n\t\t\t\t\trawTitle = tabs[i]['title'].length>visibleText? tabs[i]['title'].slice(0,visibleText) + '...' : tabs[i]['title'] ;\n\n\t\t\t//puts space into URLs or other long text that throws off text spacing\n\t\t\tvar cleanOnce = function(raw, visChars){\n\t\t\t\tvar words = raw.split(' ');\n\t\t\t\tfor(var w in words){\n\t\t\t\t\tvar len = words[w].length;\n\t\t\t\t\tif(len > visChars){\n\t\t\t\t\t\twords[w] = words[w].slice(0,len/2) + ' ' + words[w].slice(Math.ceil(len/2),len);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn words.join(' ');\n\t\t\t}\n\t\t\tvar rawTitle = cleanOnce(cleanOnce(rawTitle, lengthLimit),lengthLimit);\n\n\t\t\t//second data entry to cell table. icon on left, textTd on right\n\t\t\tvar textTd = document.createElement('td');\n\t\t\ttextTd.className = \"title\";\n\t\t\tcellData.appendChild(textTd);\n\n\t\t\tvar titleNode = document.createTextNode(rawTitle);\n\t\t\ttextTd.appendChild(titleNode);\n\n\t\t\tvar iconDim = 32,\n\t\t\t\t\timg = new Image(iconDim,iconDim),//width, height\n\t\t\t\t\ticonUrl = tabs[i]['favIconUrl'];\n\n\t\t\tvar pattern = /png|jpg|ico/g;//acceptable icon extensions\n\t\t\tif(pattern.test(iconUrl)){ //only adds icon image if one is found\n\t\t\t\timg.src = iconUrl;\n\t\t\t}else{\n\t\t\t\timg.src = \"/images/default.png\";\n\t\t\t}\n\t\t\ticonTd.appendChild(img);\n\t\t}\n\t\t//iterates through every entry in the table and attaches a listener\n\t\tvar addListeners = function addTableListeners(){\n\t\t\tfor (var i = 0; i < urllist.children.length; i++) {\n\t\t\t\tfor(var j = 0; j < urllist.children[i].children.length; j++){\n\t\t\t\t\tvar childElement = urllist.children[i].children[j];\n\t\t\t\t\tchildElement.addEventListener('click', function(){\n\t\t\t\t\t\tchrome.tabs.get(parseInt(this.id), function(mytab){\n\t\t\t\t\t\t\tif(!mytab['active']){//can't modify/select active tab\n\t\t\t\t\t\t\t\tif(window.kill){\n\t\t\t\t\t\t\t\t\tvar tableCell = document.getElementById(mytab.id);\n\t\t\t\t\t\t\t\t\ttableCell.parentNode.removeChild(tableCell);//removes tab from table in html\n\t\t\t\t\t\t\t\t\tchrome.tabs.remove(parseInt(mytab.id));//removes tab from browser\n\t\t\t\t\t\t\t\t}else{ //select new tab to be active\n\t\t\t\t\t\t\t\t\tchrome.tabs.update(parseInt(mytab.id), {active:true});//no callback necessary\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\taddListeners();//connects mouse clicks on table with browser's tabs\n\t//end of chrome.tabs.query\n\t});\n}", "function titleInfo(trch){\n\tfor (var i = 1; i < trch.length-1; i++){\n\ttrch[i].onmouseover=function(pos){\n\t\tvar content=document.getElementById('content_info_first');\n\t\tif(document.getElementById('info')){\n\t\t\tcontent.removeChild(document.getElementById('info'));\n\t\t}\n\t\tvar text=this.childNodes[0].innerHTML+this.childNodes[1].innerHTML+\"Цена \"+this.childNodes[2].innerHTML+\" руб.\";\n\t\tvar span=document.createElement('span');\t\t\n\t\tspan.setAttribute('id','info');\n\t\tspan.style.left=pos.pageX+10+\"px\";\n\t\tspan.style.top=pos.pageY+10+\"px\";\n\t\tspan.innerHTML=text;\n\t\tcontent.appendChild(span);\n };\n\ttrch[i].onmouseout=function(){\n\t\tvar content=document.getElementById('content_info_first');\n\t\tcontent.removeChild(document.getElementById('info'));\n\t\t}\n };\n\t}", "function multiTabify(el, className) {\n\t\t if ($(el).length) {\n\t\t\t\tif(jQuery.browser.version<=418.8&&$.browser.safari) { \n\t\t\t\t $(\"body\").addClass(\"safari\");\n\t\t\t\t}\n\t\t\t\t$(el).find(\".readmore\").each(function() { \n\t\t\t\t\t\t\t var link = $(this).html();\n\t\t\t\t\t\t\t $(this).parent().find(\"ul\").append(\"<li class=\\\"news-events-link\\\">\"+link+\"</li>\");\n\t\t\t\t\t\t\t $(this).remove();\n\t\t\t\t\t\t });\n\n\t\t\t\tvar container = $(el);\n\t\t\t\tcontainer.attr(\"class\",className);\n\t\t\t\t$(el+\" div h2\").click(function() {\n\t\t\t\t\t\t\t $(this).parent().parent().find(\".showThis\").removeClass(\"showThis\").addClass(\"hideThis\");\n\t\t\t\t\t\t\t $(this).parent().removeClass(\"hideThis\").addClass(\"showThis\");\n\t\t\t\t\t\t\t addJScrollPane(\"#modMultitab .tabListing.showThis>ul\");\n\t\t\t\t\t\t });\n\t\t\t\t//Overlay tabs\n\t\t\t\tvar numTabs=$('.tabListing h2.tab').length;\n\t\t\t\t$('.tabListing h2.tab').each(function(i) {\n\t\t\t\t\t\t\t $(this).attr(\"style\",\"left: \" + 127*i + \"px\");\n\t\t\t\t\t\t\t if (i == 0){\n\t\t\t\t\t\t\t $(this).parent().addClass(\"showThis\");\n\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t $(this).parent().addClass(\"hideThis\");\n\t\t\t\t\t\t\t }\n\t\t\t\t});\n\t\t\t\t$(el).addClass(\"tabs\"+numTabs);\n\t\t\t\t//$(\"#modMultitab .tabListing>ul\").wrap(\"<div/>\");\n\t\t\t\taddJScrollPane(\"#modMultitab .tabListing>ul\");\n\t\t }\n\t\t}", "get viewMoreStewardsTab_StewardsTab() {return browser.element(\"//android.widget.HorizontalScrollView/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.widget.TextView\");}", "function contactTabs(evt, onglet) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(onglet).style.display = \"flex\";\n evt.currentTarget.className += \" active\";\n}", "function f() {\n if ( $('section').hasClass('tabs-notes') ) {\n var $nav = $('.tabs__list'),\n $line = $('<li class=\"active-underline\">').appendTo($nav),\n $activeLi,\n lineWidth,\n liPos;\n \n function refresh() {\n $activeLi = $nav.find('li.active');\n lineWidth = $activeLi.outerWidth();\n liPos = $activeLi.position().left;\n }\n refresh();\n \n $nav.css('position','relative');\n \n //line setup\n function lineSet() {\n $line.css({\n 'position':'absolute',\n 'bottom':'-3px',\n 'height':'4px',\n 'background-color':'#0ec92d',\n 'border-radius': '4px',\n }).animate({\n 'left':liPos,\n 'width':lineWidth\n }, 300);\n }\n lineSet();\n \n //on click\n $nav.find('li').on('click', function() {\n $activeLi.removeClass('active');\n $(this).addClass('active');\n refresh();\n lineSet();\n });\n }\n }", "get overviewTab() {return browser.element(\"~Overview\");}", "function setTablistHighlightBox() {\n \n var $tab\n , offset\n , height\n , width\n , highlightBox = {}\n \n highlightBox.top = 0\n highlightBox.left = 32000\n highlightBox.height = 0\n highlightBox.width = 0\n \n for (var i = 0; i < $tabs.length; i++) {\n $tab = $tabs[i]\n offset = $($tab).offset()\n height = $($tab).height()\n width = $($tab).width()\n \n // console.log(\" Top: \" + offset.top + \" Left: \" + offset.left + \" Height: \" + height + \" Width: \" + width)\n \n if (highlightBox.top < offset.top) {\n highlightBox.top = Math.round(offset.top)\n }\n \n if (highlightBox.height < height) {\n highlightBox.height = Math.round(height)\n }\n \n if (highlightBox.left > offset.left) {\n highlightBox.left = Math.round(offset.left)\n }\n \n var w = (offset.left - highlightBox.left) + Math.round(width)\n \n if (highlightBox.width < w) {\n highlightBox.width = w\n }\n \n } // end for\n \n // console.log(\"[HIGHLIGHT] Top: \" + highlightBox.top + \" Left: \" + highlightBox.left + \" Height: \" + highlightBox.height + \" Width: \" + highlightBox.width)\n \n $tablistHighlight.style.top = (highlightBox.top - 2) + 'px'\n $tablistHighlight.style.left = (highlightBox.left - 2) + 'px'\n $tablistHighlight.style.height = (highlightBox.height + 7) + 'px'\n $tablistHighlight.style.width = (highlightBox.width + 8) + 'px'\n \n } // end function", "function openTab() {\n tabName = createNewTab();\n createContent(tabName);\n var tab = {id: tabName}\n tabs.push(tab);\n\n // Simular o evento do click clicando na nova aba aberta\n document.querySelectorAll(\"[href='#\" + tabName + \"']\")[0].click();\n}", "onSubredditOverflowItemClick(eventObject) {\n let tabContainer = document.getElementById(\"at_tabcontainer\");\n let overflowItemClickedByUser = eventObject.target;\n let currentIndexOfNewTab = 0;\n /* Iterate over the current overflow items to find the index of the one that was just clicked. */\n let listOfExistingOverflowItems = overflowItemClickedByUser.parentNode;\n for (let i = 0, len = listOfExistingOverflowItems.children.length; i < len; i += 1) {\n let overflowElement = listOfExistingOverflowItems.children[i];\n if (overflowElement === overflowItemClickedByUser)\n currentIndexOfNewTab = i;\n }\n /* Derive the total index of the item in the subreddit list from the number we just calculated added\n with the total length of the visible non overflow tabs */\n currentIndexOfNewTab = (tabContainer.children.length) + currentIndexOfNewTab - 1;\n let threadDataForNewTab = this.threadCollection[currentIndexOfNewTab];\n /* Move the new item frontmost in the array so it will be the first tab, and force a re-render of the tab control. */\n this.threadCollection.splice(currentIndexOfNewTab, 1);\n this.threadCollection.splice(0, 0, threadDataForNewTab);\n this.clearTabsFromTabContainer();\n this.insertTabsIntoDocument(tabContainer, 0);\n /* Start downloading the new tab. */\n this.showTab(this.threadCollection[0]);\n eventObject.stopPropagation();\n }", "activeTab(index) {\n this.tabContent.forEach((section) => {\n section.classList.remove(this.activeClass, section.dataset.anime);\n });\n this.tabContent[index].classList.add(\n this.activeClass,\n this.tabContent[index].dataset.anime,\n );\n }", "function getView(content){\n $('#tabView').html(content);\n $('#tabViewLink').css(\"display\",\"block\");\n $('.nav-tabs li:eq(1) a').tab('show');\n}", "activeTab(index) {\n this.tabContent.forEach((section) => {\n section.classList.remove(this.activeClass);\n });\n const direcao = this.tabContent[index].dataset.anime;\n this.tabContent[index].classList.add(this.activeClass, direcao);\n }", "function opentab(evt, punNum) {\n // Declaring variables \n var i, tabContent, tablink;\n tabContent = document.getElementsByClassName(\"tabContent\");\n for (i = 0; i < tabContent.length; i++) {\n tabContent[i].style.display = \"none\";\n }\n tablink = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablink.length; i++) {\n tablink[i].className = tablink[i].className.replace(\"active\", \"\")\n }\n\n document.getElementById(punNum).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "renderTabPanels(arr){\n if(arr.length)\n return arr.map(interaction=><p className='panel-block'>{interaction.description}</p>)\n else return <p className='panel-block'>No known interactions</p>\n }", "function icons_hidden_programs(program_name)\n{\n var tab = \"\";\n var outer_tabs = menu_structure.OuterTabs;\n try\n {\n for(outer_tab in outer_tabs)\n {\n if (outer_tabs.hasOwnProperty(outer_tab))\n {\n if(outer_tab == program_name )\n {\n \n tab +=\"<td background = '\" + l1_menu_tab_image + \"' id='\"+program_name+\"' onclick='badprogramclicked(this);' ><nobr><img src ='\"+ outer_tabs[outer_tab].Image+\"' height='16' width='16'</img><a href='javascript:nothing();'>\" + program_name + \"</a></td>\";\n }\n }\n }\n }\n catch(x)\n {\n alert(x);\n }\n return tab;\n}", "function changeTabs(){\n $('.cruise-section li a').eq($(this).val()).tab('show');\n }", "renderTabsEyebrowText() {\n if (this.eyebrowText) {\n return (core.h(\"p\", { class: \"tabs-eyebrow-text dxp-title-eyebrow dxp-font-size-sm\" }, this.eyebrowText));\n }\n }", "function setToolTab() {\n\tvar toolTabTitle = $('[data-tool-tab-title]');\n\tvar toolTabContent = $('[data-tool-tab-content]');\n\t\ttoolTabContent.attr('hidden', true); // hide all\n\t\t$('[data-tool-tab]').removeClass('active'); // reset active\n\n\t\t// loop all tab content\n\t\ttoolTabContent.each(function(){\n\t\t\tvar $this = $(this);\n\t\t\tvar stringId = $this.attr('data-tool-tab-content'); // Eg. 'design', 'development' etc\n\n\t\t\t// Choose Tab based on URL Hashbang\n\t\t\t// if level1: settings OR if level2: site\n\t\t\tif (stringId == getHashBang().level1 || stringId == getHashBang().level2) {\n\t\t\t\t$this.removeAttr('hidden'); // show selected\n\t\t\t\t$('[data-tool-tab*=\"'+stringId+'\"]').addClass('active'); // mark active\n\n\t\t\t\t// Don't let [site, docs] change title = always parent title (Development)\n\t\t\t\tif (stringId == getHashBang().level1) {\n\t\t\t\t\ttoolTabTitle.text(stringId + \" \"); // space to remove glitch\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t// Funky gradient on header\n\t\tapplyGradientHeader('.lv-context-menu-header .subheader');\n}", "function infoTab1Info(html) {\n var featureRelId = getUrlVars()['transferId'];\n var userSiteId = getUrlVars()['touchId'];\n var featureId = getUrlVars()['mId'];\n\tvar featureName = getUrlVars()['featureName'];\n\tfeatureName = featureName.replace(/\\%20/g,' ');\n\tfeatureNameTitle(featureName);\n\t\n var url = baseUrl + 'web/web/getMenuHtml/' + featureId + '/' + featureRelId + '/' + userSiteId;\n\n var data = '';\n doAjaxCall(url, data, false, function (html) {\n if ($.isEmptyObject(html)) {\n $('#main-content').html('Sorry we have an info Tab data');\n } else {\n var backGroundColor, textColor, description;\n $.each(html, function (i, item) {\n backGroundColor = item.globalBackground;\n textColor = item.globalTextColor;\n description = item.description;\n })\n if (description == '') {\n $('#main-content').html('Sorry We Have An Empty Data');\n } else {\n $('#main-content').html(description);\n }\n $('#main-content').css({ 'background-color': '#' + backGroundColor, 'color': '#' + textColor });\n }\n getUserAppereance();\n });\n\n}", "getTabViewContents(){\n const { context, schemas, windowWidth, windowHeight, href, session } = this.props;\n const { mounted } = this.state;\n\n //context = SET; // Use for testing along with _testing_data\n\n const processedFiles = this.allProcessedFilesFromExperimentSet(context);\n const processedFilesUniqeLen = (processedFiles && processedFiles.length && ProcessedFilesStackedTableSection.allFilesUniqueCount(processedFiles)) || 0;\n const rawFiles = this.allFilesFromExperimentSet(context, false);\n const rawFilesUniqueLen = (rawFiles && rawFiles.length && RawFilesStackedTableSection.allFilesUniqueCount(rawFiles)) || 0;\n const width = this.getTabViewWidth();\n\n const commonProps = { width, context, schemas, windowWidth, href, session, mounted };\n const propsForTableSections = _.extend(SelectedFilesController.pick(this.props), commonProps);\n\n var tabs = [];\n\n // Processed Files Table Tab\n if (processedFilesUniqeLen > 0){\n tabs.push({\n tab : <span><i className=\"icon icon-microchip fas icon-fw\"/>{ ' ' + processedFilesUniqeLen + \" Processed File\" + (processedFilesUniqeLen > 1 ? 's' : '') }</span>,\n key : 'processed-files',\n content : (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={processedFiles}>\n <ProcessedFilesStackedTableSection {...propsForTableSections} files={processedFiles} />\n </SelectedFilesController>\n )\n });\n }\n\n // Raw files tab, if have experiments with raw files\n if (rawFilesUniqueLen > 0){\n tabs.push({\n tab : <span><i className=\"icon icon-leaf fas icon-fw\"/>{ ' ' + rawFilesUniqueLen + \" Raw File\" + (rawFilesUniqueLen > 1 ? 's' : '') }</span>,\n key : 'raw-files',\n content : (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={rawFiles}>\n <RawFilesStackedTableSection {...propsForTableSections} files={rawFiles} />\n </SelectedFilesController>\n )\n });\n }\n\n // Supplementary Files Tab\n if (ExperimentSetView.shouldShowSupplementaryFilesTabView(context)){\n //const referenceFiles = SupplementaryFilesTabView.allReferenceFiles(context) || [];\n //const opfCollections = SupplementaryFilesTabView.combinedOtherProcessedFiles(context) || [];\n //const allOpfFiles = _.reduce(opfCollections, function (memo, coll) { return memo.concat(coll.files || []); }, []);\n //const allFiles = referenceFiles.concat(allOpfFiles);\n tabs.push({\n tab : <span><i className=\"icon icon-copy far icon-fw\"/> Supplementary Files</span>,\n key : 'supplementary-files',\n content: (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={[]/*allFiles*/}>\n <SupplementaryFilesTabView {...propsForTableSections} {...this.state} />\n </SelectedFilesController>\n )\n });\n }\n\n // Graph Section Tab\n if (this.shouldGraphExist()){\n tabs.push(FileViewGraphSection.getTabObject(\n _.extend({}, this.props, { 'isNodeCurrentContext' : this.isWorkflowNodeCurrentContext }),\n this.state,\n this.handleToggleAllRuns,\n width\n ));\n }\n\n return _.map(tabs.concat(this.getCommonTabs()), function(tabObj){\n return _.extend(tabObj, {\n 'style' : {\n 'minHeight' : Math.max(mounted && !isServerSide() && (windowHeight - 180), 100) || 800\n }\n });\n });\n }", "function openInfo(evt, tabName) {\n\n\t// Get all elements with class=\"tabcontent\" and hide them\n\ttabcontent = document.getElementsByClassName(\"tabcontent\");\n\tfor (i = 0; i < tabcontent.length; i++) {\n\t\ttabcontent[i].style.display = \"none\";\n\t}\n\n\t// Get all elements with class=\"tablinks\" and remove the class \"active\"\n\ttablinks = document.getElementsByClassName(\"tablinks\");\n\tfor (i = 0; i < tablinks.length; i++) {\n\t\ttablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n\t}\n\n\t// Show the current tab, and add an \"active\" class to the button that opened the tab\n\tdocument.getElementById(tabName).style.display = \"block\";\n\tevt.currentTarget.className += \" active\";\n\n}", "function openInfo(evt, tabName) {\n\n\t// Get all elements with class=\"tabcontent\" and hide them\n\ttabcontent = document.getElementsByClassName(\"tabcontent\");\n\tfor (i = 0; i < tabcontent.length; i++) {\n\t\ttabcontent[i].style.display = \"none\";\n\t}\n\n\t// Get all elements with class=\"tablinks\" and remove the class \"active\"\n\ttablinks = document.getElementsByClassName(\"tablinks\");\n\tfor (i = 0; i < tablinks.length; i++) {\n\t\ttablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n\t}\n\n\t// Show the current tab, and add an \"active\" class to the button that opened the tab\n\tdocument.getElementById(tabName).style.display = \"block\";\n\tevt.currentTarget.className += \" active\";\n\n}", "function GetFirstTab() {\n return TabList[0];\n}", "function showTabContent(b){//to show the content element we need\n if (tabContent[b].classList.contains('hide')){\n tabContent[b].classList.remove('hide');\n tabContent[b].classList.add('show');\n }\n }", "get tabHeaders() {\n this.tabRefs = [];\n const tabTitles = this.children.map((child, index) => {\n const ref = `${child.props.tabId}-tab`;\n this.tabRefs.push(ref);\n const tabValidationValues = this.getTabValidationValues(child);\n const { tabHasError, tabHasWarning } = tabValidationValues;\n return (\n <TabTitle\n position={ this.props.position }\n className={ child.props.className || '' }\n dataTabId={ child.props.tabId }\n id={ ref }\n key={ child.props.tabId }\n onClick={ this.handleTabClick }\n onKeyDown={ this.handleKeyDown(index) }\n ref={ (node) => {\n this[ref] = node;\n } }\n tabIndex={ this.isTabSelected(child.props.tabId) ? '0' : '-1' }\n title={ child.props.title }\n isTabSelected={ this.isTabSelected(child.props.tabId) }\n tabHasError={ tabHasError }\n tabHasWarning={ tabHasWarning }\n />\n );\n });\n\n return (\n <TabsHeader\n align={ this.props.align } position={ this.props.position }\n role='tablist'\n >\n {tabTitles}\n </TabsHeader>\n );\n }", "getHeaderContent() {\n const element = this.sections.modalHeader;\n I.grabTextFrom(element);\n}", "function onClickHandler(info, tab) {\n\tvar itemId = info.menuItemId;\n\tvar context = itemId.split('_', 1)[0];\n\t\n\tswitch (context) {\n\t\tcase 'selection':\n\t\t\tif (info.selectionText.length > 0) {\n\t\t\t\tconsole.log(JSON.stringify(info.selectionText));\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Other context than selection');\n\t}\n\t\n\n}", "get focusedList()\n {\n return E(\"tabs\").selectedPanel.getElementsByTagName(\"richlistbox\")[0];\n }", "function g_tab(testoh1,elenco_task,color_class)\r\n{\r\n // a) modifico testo in <h1>\r\n const titoloh1= document.getElementById('titolo_tabella'); //id elemento h1\r\n titoloh1.innerText = testoh1; \r\n\r\n // b) Cancello contenuto Tabella\r\n initTable();\r\n\r\n // c) Inserisco nuove righe in tabella\r\n fillTaskTable(elenco_task);\r\n \r\n // d) Modifico stile elenco a sinistra (aside)\r\n //seleziono tutti gli elementi a, dentro al div, dentro all'elemento con id= left-sidebar -> per ognuno degli elementi a, gli rimuovo la classe active, che era quella che lo rendeva in evidenza\r\n //n.b. solo uno dei bottoni aveva la classe active, ma non posso sapere quale, così provo a toglierla a tutti\r\n document.querySelectorAll('#left-sidebar div a ').forEach( node => node.classList.remove('active'));\r\n document.getElementById(color_class).classList.add('active');\r\n //Aggiugno la classe active, solo al bottone che ho appena cliccato: corrisponde a quello sto vedendo in tabella\r\n\r\n}", "setActiveTab(tabTitle){\n this.tabMap.forEach((value, key) => {\n let tabtitle = value.attributes.tabtitle ? value.attributes.tabtitle.value : value.tabtitle;\n if(tabtitle === tabTitle){\n this._setTabStatus(key);\n }\n });\n }", "function openTab(evt, tabName) {\n console.log(evt.currentTarget)\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function jgtContentTabs(){\n\tvar tabsNav = $('#menu'),\n\t\ttabsWrap = $('#main');\n\n\ttabsWrap.find('.main-section:gt(0)').hide();\n\t//~ tabsNav.find('li:first').addClass('active');\n\ttabsNav.find('a').click(function(e){\n\t\ttabsWrap.find('.main-section').hide();\n\t\ttabsWrap.find($($(this).attr('href'))).fadeIn(800);\n\t\t//~ tabsNav.find('li').removeClass('active');\n\t\t//~ $(this).parent().addClass('active');\n\t\te.preventDefault();\n\n\t\t\t$('#keyword').val($(this).attr('title'));\n\t\t\t$.post($('#newsletter-form').attr('action'), $('#newsletter-form').serialize(), function(data){\n\t\t\t\t$('.newsletter').find('.spinner').animate({opacity: 0}, function(){\n\t\t\t\t\t$(this).hide();\n\t\t\t\t\t$('.fadeInRight').html('');\n\t\t\t\t\t$('.fadeInRight').append(data);\n\t\t\t\t\t$(window).Slider();\n\t\t\t\t});\n\t\t\t});\n\n\t\t// Fix background\n\t\t$('.left-wrap .bg').backstretch('resize');\n\n\t});\n}", "function testDailyTopHeadlinesArray() {\n document.getElementById(\"result\").innerHTML += \"Test Top Headlines Array // Top headlines via Guardian API are in array:</br>\";\n test.isEqual(noteController.noteview.notesToPrint[0] === \"<a href=\\\"#note/8\\\">Checkmate 1-2 1-2!!</a>\");\n}", "renderActiveTabContent() {\n // console.log('children...', children)\n const {children} = this.props;\n const {activeTabIndex} = this.state;\n // console.log('children...', children)\n // console.log('active tab ...', activeTabIndex)\n // console.log('children[]...', children[activeTabIndex])\n if(children[activeTabIndex]) {\n return children[activeTabIndex].props.children;\n }\n }", "_tab(event){\n event.preventDefault(); // always?\n\n // get list of all children elements:\n const o = Array.from(this.querySelectorAll('*'));\n\n // get list of focusable items\n const focusableItems = o.filter((e)=>UIDialog._isVisibleElement(e));\n\n // get currently focused item\n const focusedItem = document.activeElement;\n\n // get the number of focusable items\n const numberOfFocusableItems = focusableItems.length;\n\n if (numberOfFocusableItems === 0) return;\n\n // get the index of the currently focused item\n const focusedItemIndex = focusedItem ? focusableItems.indexOf(focusedItem) : -1;\n\n if (event.shiftKey) {\n // back tab\n // if focused on first item and user preses back-tab, go to the last focusable item\n if (focusedItemIndex === 0) {\n focusableItems[numberOfFocusableItems - 1].focus();\n //event.preventDefault();\n }\n } else {\n // forward tab\n // if focused on the last item and user preses tab, go to the first focusable item\n if (focusedItemIndex === numberOfFocusableItems - 1) {\n focusableItems[0].focus();\n //event.preventDefault();\n }\n }\n }", "function foldingTabsMulti() {\n var len = 0;\n ftsets = getElementsByClassName(document, 'div', 'foldtabSet'); //global object array thingy\n if (ftsets.length == 0) return\n\n for (var i = 0; i < ftsets.length; i++) {\n ftsets[i].head = getElementsByClassName(ftsets[i], 'div', 'foldtabHead')[0];\n ftsets[i].links = ftsets[i].head.getElementsByTagName('a');\n ftsets[i].boxen = getElementsByClassName(ftsets[i], 'div', 'foldtabBox');\n\n if (ftsets[i].links.length < ftsets[i].boxen.length) {\n len = ftsets[i].boxen.length;\n } else {\n len = ftsets[i].links.length;\n }\n\n for (var j = 0; j < len; j++) {\n ftsets[i].links[j].href = 'javascript:showmultitab(\\'' + i + '\\',\\'' + j + '\\');';\n ftsets[i].links[j].title = 'click to display tab ' + j + ' of set ' + i;\n }\n showmultitab(i, '0');\n ftsets[i].head.style.display = 'block';\n }\n}", "function libraryLoadTab_home(selectorPattern){\n\t\n\t \n\t\tjQuery(selectorPattern).each(function(index) {\n\t\t\n\t\t\tvar a = jQuery(this);\n\t\t\tvar tabContent_library = {};\n a.bind(\"mouseover\", function (evt) {\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\n\t\t\t\ta.parent().parent().find(\"> li\").removeClass(\"ui-state-active\");\n a.parent().addClass(\"ui-state-active\");\n\t\t\t\t\n\t//MTkwODBA&token=04b5d384f6024ef2fc252e9112309daf&&amp;http://gunnynew.zing.vn/home/danh-sach.hinh-nen.html\n\t\t\t\tvar params = a.attr(\"rel\").replace(/\\r\\n\\s/g,\"\").toString(); // Thay the xuong hang\n\t\t\t\t//alert(params);\n var splitParams = params.split(\"&\");\n var postData = \"block={\\\"\" + splitParams[0] + \"\\\":{}}\\&\"+ splitParams[1];\n var urlInput = splitParams[3] == \"''\" ? '' : splitParams[3];\n\t\t\t\tvar idBlogOutput=splitParams[0];\n\t\t\t\tvar tabName=splitParams[2];\n\t\t\t\t \n\t\t\t\n\t\t\t\t if( !tabContent_library[tabName] ){\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\turl: urlInput,\n\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\tdata: postData,\n\t\t\t\t\t\tsuccess: function(msg){\n\t\t\t\t\t\t\ttabContent_library[tabName]=msg[idBlogOutput]['content'];\n\t\t\t\t\t\t\t$(\"#\"+idBlogOutput).html(tabContent_library[tabName]);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}else{\n\t\t\t\t\t$(\"#\"+idBlogOutput).html(tabContent_library[tabName]);\n\t\t\t\t}\n\t\t\t\n\t\t\t});\n\t\t});\n}", "function openNavTab() {\n console.log(\"OpenNavTab running\");\n console.log();\n // document.getElementById(tab);\n //console.log(tab);\n //var categoryListName = tab.id.replace(\"header\", \"list\"); //subtract \"header\" from string & replace it with \"list\"\n //console.log(categoryListName);\n //document.getElementById(categoryListName).style.display = \"block\";\n}", "updateActiveTabTitle() {\n const tabTitles = this._tabTitlesEl.childNodes\n for (let i = 0; i < tabTitles.length; i++) {\n tabTitles.item(i).classList.add('inactive')\n }\n tabTitles.item(this._activeTab).classList.remove('inactive')\n }", "function tabbbedDeepLinking() {\r\n\t\t\t\r\n\t\t\tif (typeof nectarGetQueryParam['tab'] != 'undefined') {\r\n\t\t\t\t$('.wpb_tabs_nav').each(function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).find('li').each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $currentText = $(this).find('a').clone(),\r\n\t\t\t\t\t\t$getText = nectarGetQueryParam['tab'],\r\n\t\t\t\t\t\t$that = $(this);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$currentText.find('svg').remove();\r\n\t\t\t\t\t\t$currentText = $currentText.text();\r\n\t\t\t\t\t\t$currentText = $currentText.replace(/\\s+/g, '-').toLowerCase();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// SVG icons.\r\n\t\t\t\t\t\tif( $currentText.length > 0 && $currentText.substring(0,1) === '-' ) {\r\n\t\t\t\t\t\t\t$currentText = $currentText.substring(1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$getText = $getText.replace(/\\s+/g, '-').replace(/</g, '&lt;').replace(/\"/g, '&quot;').toLowerCase();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($currentText == $getText) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$(this).find('a').trigger('click');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t$that.find('a').trigger('click');\r\n\t\t\t\t\t\t\t}, 501);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "function parseTabLabels() {\n var tabs = [$stateParams.category];\n for (var i in CATEGORIES) {\n if (CATEGORIES[i][0] === $stateParams.category) {\n CATEGORIES[i][1].forEach(function(element) {\n tabs.push(element);\n });\n break;\n }\n };\n return tabs;\n }", "function getTabIndexByTitle(tabTitle)\r\n\t{\r\n\t\tvar regExp = new RegExp(\"(.*?)&nbsp.*$\",\"gi\"); // first part--> ; \"gi\"--> global and case-insensitive\r\n\t\ttabTitle = tabTitle.replace(regExp,'$1');\r\n\t\tfor(var prop in tabObj){\r\n\t\t\tvar divs = tabObj[prop].getElementsByTagName('DIV');\r\n\t\t\tfor(var no=0;no<divs.length;no++){\r\n\t\t\t\tif(divs[no].id.indexOf('tabTitle')>=0){\r\n\t\t\t\t\tvar span = divs[no].getElementsByTagName('SPAN')[0];\r\n\t\t\t\t\tvar regExp2 = new RegExp(\"(.*?)&nbsp.*$\",\"gi\");\r\n\t\t\t\t\tvar spanTitle = span.innerHTML.replace(regExp2,'$1');\r\n\r\n\t\t\t\t\tif(spanTitle == tabTitle){\r\n\r\n\t\t\t\t\t\tvar tmpId = divs[no].id.split('_');\r\n\t\t\t\t\t\treturn Array(prop,tmpId[tmpId.length-1].replace(/[^0-9]/g,'')/1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn -1;\t\t\t\t\r\n\r\n\t}", "function updateTreeHighlights(hlist) { \n \n \t // clearHighlight();\n idx = 0;\n \n var $concepts = null;\n var conceptSelectors = [];\n \n \t // Select all doc elements with the hid attribute\n \t $alltags=$('htag');\n \t\t $allframetags=$(\".docview_iframe_content\").contents().find('htag');\n\t\t $alltags=$alltags.add($allframetags);\n\t\t $alltags.removeClass('docquery-highlight');\n \t $alltags.removeAttr('highlightNum');\n \t $alltags.removeAttr('hChild');\n \t if($('span').attr('data-field')){\n \t\t$(this).removeClass(\"docquery-highlight\");\n \t\t$(\".data-section\").find(\"span\").removeClass(\".docquery-highlight.active\");\n \t\t$(\".data-section\").find(\"span\").removeClass(\"docquery-highlight.active\")\n \t }\n \t \n\t\t for (k in hlist) {\n var cid = hlist[k];\n \t\t if (hlmap[cid]) {\n \t\t\t for (d in hlmap[cid]) {\n\t\t\t\t\t var $selected;\n\t\t\t\t\t\tvar selector='htag[l=\"' + hlmap[cid][d][1] + '\"]'\n\t\t\t\t\t\tif (hlmap[cid][d][0]==0) {\n\t\t\t\t\t\t\t$selected=$(selector)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$selected=$(\".docview_iframe_content\").contents().find(selector)\t\n\t\t\t\t\t\t}\n \t\t\t \t\t\n\t\t\t\t\t\tif (d==0) {\n \t\t\t \t\t\tconceptSelectors.push($selected);\n \t\t\t\t\t$selected.addClass('docquery-highlight');\n \t\t\t\t\t$selected.attr('hNum',cid);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n \t\t\t\t\t$selected.attr('hNum',cid);\n\t\t\t\t\t\t\t$selected.addClass('docquery-highlight2');\n\t\t\t\t\t\t}\n \t\t\t }\n\t\t\t }\n }\n \n\t\t $concepts = $(conceptSelectors);\n\n toggleHlNavLink($concepts);\n\t\t\tscrollTo(idx); \n }", "function openTab(evt, tabName) {\n let i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n \n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "static get tag() {\n return \"a11y-tabs\";\n }", "function getSelectedTab(tabs) {\n const childId = window.location.hash.split(\"=\")[1];\n return tabs.find((tab) => tab.actor.includes(childId));\n}", "get viewMoreStewardsTab_MenuHeader() {return browser.element(\"//android.view.ViewGroup[1]/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.widget.TextView[1]\");}", "function getBgColors (tab) {\n // But for now, let's just make sure what we have so\n // far is working as expected.\n alert('Selected text: ' + tab);\n}", "getHeader () {\n const textArr = [`### ${this.tag}`, [`### ${this.comment}`]]\n return [...textArr, ...this.lines]\n }", "function foldingTabsMulti() {\n var len=0;\n ftsets = getElementsByClassName(document, 'div', 'foldtabSet'); //global object array thingy\n if(ftsets.length==0) return\n\n for(var i=0;i<ftsets.length;i++) { \n ftsets[i].head = getElementsByClassName(ftsets[i], 'div', 'foldtabHead')[0];\n ftsets[i].links = ftsets[i].head.getElementsByTagName('a');\n ftsets[i].boxen = getElementsByClassName(ftsets[i], 'div', 'foldtabBox');\n\n if(ftsets[i].links.length < ftsets[i].boxen.length) {\n len = ftsets[i].boxen.length;\n } else {\n len = ftsets[i].links.length;\n }\n\n for(var j=0;j<len;j++) {\n ftsets[i].links[j].href = 'javascript:showmultitab(\\'' + i + '\\',\\'' + j + '\\');';\n ftsets[i].links[j].title = 'click to display tab ' + j + ' of set ' + i;\n }\n showmultitab(i,'0');\n ftsets[i].head.style.display = 'block';\n }\n}" ]
[ "0.59540534", "0.56489235", "0.56340986", "0.56049067", "0.5487487", "0.5484926", "0.54815036", "0.5443754", "0.54291767", "0.54273295", "0.54246753", "0.54069763", "0.53767556", "0.5370489", "0.5359896", "0.5335871", "0.53325075", "0.53235507", "0.53230447", "0.5320344", "0.5286862", "0.5270417", "0.5265128", "0.5263701", "0.52553815", "0.52534354", "0.52343184", "0.5226704", "0.52257186", "0.52099824", "0.5209861", "0.5203618", "0.51989424", "0.5193647", "0.5192467", "0.5166601", "0.5160051", "0.5156433", "0.5150749", "0.5144818", "0.5143825", "0.51375854", "0.5122814", "0.511599", "0.51081717", "0.5106795", "0.509464", "0.509421", "0.5094131", "0.5093643", "0.5092238", "0.508729", "0.5079854", "0.50774354", "0.50669265", "0.504911", "0.5043835", "0.5043109", "0.503729", "0.50340825", "0.50236815", "0.50232357", "0.5013923", "0.50116944", "0.50108236", "0.500953", "0.50074756", "0.5007226", "0.50033355", "0.50018984", "0.5000382", "0.5000382", "0.49974197", "0.4997261", "0.49900886", "0.49893036", "0.49889773", "0.49885482", "0.49819043", "0.49779135", "0.4977905", "0.49744776", "0.49722216", "0.49648586", "0.49635482", "0.4963262", "0.49595994", "0.49581963", "0.4957416", "0.49567685", "0.49510455", "0.49504104", "0.4948085", "0.49479493", "0.4946465", "0.4945936", "0.49423358", "0.49420053", "0.49419188", "0.49404672" ]
0.5251374
26
timerId directly id of your HTML timer deadline time point in future wich will be the end of some stoke/offer
constructor(timerId, deadline) { this.timerId = timerId; this.deadline = deadline; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTimer() {\n const time = getTimeDiff(endTime);\n\n days.textContent = `${addZero(time.days)}`;\n hours.textContent = `${addZero(time.hours)}`;\n minutes.textContent = `${addZero(time.minutes)}`;\n seconds.textContent = `${addZero(time.seconds)}`;\n \n //do something then timer expires\n if (time.total < 0) {\n clearInterval(timerId);\n // \n // days.textContent = `00`;\n // hours.textContent = `00`;\n // minutes.textContent = `00`;\n // seconds.textContent = `00`;\n // *** example ***\n // const elem = document.createElement('div');\n // elem.innerHTML = 'sorry time expired, try next time';\n // const parent = document.querySelector('.sale__deadline');\n // parent.append(elem);\n \n //**** automatically add 10 days then date expires ****\n //get temp values\n const day = new Date(endTime).getDate();\n const year = new Date(endTime).getFullYear();\n const month = new Date(endTime).getMonth();\n //add 10 days to deadline\n const newDay = day + 10;\n //setup new deadline\n deadline = new Date(year, month , newDay, 11, 30, 00);\n //show new deadline on page\n showDeadline(deadline);\n //start new timer\n setTimer(deadline);\n }\n }", "function startTimer(deadline){\n let {total, days, hours, minutes, seconds} = getTimeRemaining(deadline);\n if (total >=0){\n // Updating the timer\n // Adding a '0' to the variable if it is less than 10\n setTimer(\n (hours > 9 ? hours : '0' + hours) + ':' +\n (minutes > 9 ? minutes : '0' + minutes) + ':' +\n (seconds > 9 ? seconds : '0' + seconds) \n )\n }else{\n clearInterval(intervalRef.current);\n }\n }", "function setupTimeElapsedObserver(timerId){\n // Show description form when user clicks on timer description\n $('#timer-' + timerId + '-time-elapsed').on('click', (e) => {\n if(timerActive(timerId) == 'true') return;\n $(e.target).hide();\n const form = $('#timer-' + timerId + '-time-elapsed-form');\n form.show();\n\n // replace input with formatted time\n const input = form.find('.time-frames-time-elapsed');\n input.val($(e.target).text().trim());\n input.focus();\n\n // When user clicks somewhere else hide the form and show description again\n form.on('focusout', () => {\n form.hide();\n $(e.target).show();\n });\n replaceTimerOnSuccess(timerId,'timer-time-elapsed-form');\n });\n}", "function clearTimer(timerid) {\n $(timerid+\" .current\").html(time.start());\n }", "function setTimer(time, idForTimer, additionalTime, status){\n\tvar x = setInterval(function() {\n\t\tvar now = new Date().getTime();\n\t\tvar remaining = time - now + additionalTime;\n\t\t// Time calculations for days, hours, minutes and seconds\n\t\tvar days = Math.floor(remaining / (1000 * 60 * 60 * 24));\n\t\tvar hours = Math.floor((remaining % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n\t\tvar minutes = Math.floor((remaining % (1000 * 60 * 60)) / (1000 * 60));\n\t\tvar seconds = Math.floor((remaining % (1000 * 60)) / 1000);\n\n\t\tif(status == \"active\" && document.getElementById(idForTimer) != null){\n\t\t\tif(days >= 1)\n\t\t\t\tdocument.getElementById(idForTimer).innerHTML = days + \"d \" + hours + \"h \" + minutes + \"m \" + seconds + \"s \";\n\t\t\telse if(hours >= 1)\n\t\t\t\tdocument.getElementById(idForTimer).innerHTML = hours + \"h \" + minutes + \"m \" + seconds + \"s \";\n\t\t\telse\n\t\t\t\tdocument.getElementById(idForTimer).innerHTML = minutes + \"m \" + seconds + \"s \";\n\t\t}else if (document.getElementById(idForTimer) != null){\n\t\t\tif(days >= 1)\n\t\t\t\tdocument.getElementById(idForTimer).innerHTML =\"Starts in: \" + days + \"d \" + hours + \"h \" + minutes + \"m \" + seconds + \"s \";\n\t\t\telse if(hours >= 1)\n\t\t\t\tdocument.getElementById(idForTimer).innerHTML =\"Starts in: \" + hours + \"h \" + minutes + \"m \" + seconds + \"s \";\n\t\t\telse\n\t\t\t\tdocument.getElementById(idForTimer).innerHTML =\"Starts in: \" + minutes + \"m \" + seconds + \"s \";\n\t\t}\n\n\t\t// If the count down is over, write some text \n\t\tif (remaining < 0) {\n\t\t\tclearInterval(x);\n\t\t\tif(document.getElementById(idForTimer) != null)\n\t\t\t\tdocument.getElementById(idForTimer).innerHTML = \"EXPIRED\";\n\t\t\tcheckForUpdates(idForTimer);\n\t\t}\n\t}, 1000);\n}", "function updateElapsedTime(timerId){\n if(timerActive(timerId) == \"false\") return;\n const timerContainer = $('#timer-container-' + timerId);\n const now = new Date().getTime(); // current time in miliseconds\n\n // Get start time - uses miliseconds to initialize\n const startTime = new Date(timerContainer.attr('data-start-time') * 1000);\n const timeElapsed = parseInt(timerContainer.attr('data-time-elapsed'));\n\n // set timer to time elapsed on timer stop\n setTimeElapsed(timerId, (now - startTime) / 1000 + timeElapsed); // convert back to seconds\n}", "function startTimer(duration, display) {\n let timer = duration, minutes, seconds;\n timer.id=timer\n count = setInterval(function () {\n minutes = parseInt(timer / 60, 10);\n seconds = parseInt(timer % 60, 10);\n\n // minutes = minutes < 10 ? \"0\" + minutes : minutes;\n seconds = seconds < 10 ? \"0\" + seconds : seconds;\n\n display.innerText = minutes + \":\" + seconds;\n\n if (--timer < 0) {\n showAllAnswers(\"Time ran out!\")\n }\n }, 1000);\n }", "function updateTimer(prodID) {\n let timer = new Timer();\n\n //Get time from server\n $.get(`/items/${prodID}/time`, function (data) {\n // console.log(data.timeRemaining);\n if (data.timeRemaining > 0) {\n timer.start({countdown: true, startValues: {seconds: data.timeRemaining}});\n\n timer.addEventListener(\"secondsUpdated\", function (e) {\n if(timer.getTimeValues().days== '0' && timer.getTimeValues().hours=='0'&& timer.getTimeValues().minutes == '0' && timer.getTimeValues().seconds<50 ) {\n $(`div[data-timer=\"${prodID}\"]`).css('color', 'red');\n $(`div[data-timer=\"${prodID}\"]`).css('font-size', 'large');\n }\n $(`div[data-timer=\"${prodID}\"] .days`).html(timer.getTimeValues().days);\n $(`div[data-timer=\"${prodID}\"] .hours`).html(timer.getTimeValues().hours.zeroPad());\n $(`div[data-timer=\"${prodID}\"] .minutes`).html(timer.getTimeValues().minutes.zeroPad());\n $(`div[data-timer=\"${prodID}\"] .seconds`).html(timer.getTimeValues().seconds.zeroPad());\n });\n\n timer.addEventListener('targetAchieved', function (e) {\n $(`div[data-timer=\"${prodID}\"]`).html(\"Bid Closed\");\n });\n }\n else {\n //If bid already closed\n $(`div[data-timer=\"${prodID}\"]`).html(\"Bid Closed\");\n }\n })\n}", "function countDownTimer(dt, id) {\n\t// Define the goal date\n\tvar end = new Date(dt);\n\n\t// Define each in milliseconds\n\tvar _second = 1000;\n\tvar _minute = _second * 60;\n\tvar _hour = _minute * 60;\n\tvar _day = _hour * 24;\n\tvar _week = _day * 7\n\t// Interval variable\n\tvar timer;\n\n\t// Create another function to show the time remaining\n\tfunction showRemaining() {\n\t\t// Get the current date\n\t\tvar now = new Date();\n\t\t// Get the difference\n\t\tvar distance = end - now;\n\t\t// If the date has passed\n\t\tif(distance <= 0) {\n\t\t\t// Clear the timer \n\t\t\tclearInterval(timer);\n\t\t\t// Print some text\n\t\t\tif(id == 'seniors') {\n\t\t\t\tdocument.getElementById(id).innerHTML = 'GRADUATION!!!';\n\t\t\t} else {\n\t\t\t\tdocument.getElementById(id).innerHTML = 'SUMMER!!!';\n\t\t\t}\n\t\t\t// Don't continue with the rest of the function\n\t\t\treturn;\n\t\t}\n\n\t\t// Obtain the number for each of the following\n\t\tvar weeks = Math.floor(distance / _week);\n\t\tvar days = Math.floor((distance % _week) / _day);\n\t\tvar hours = Math.floor((distance % _day) / _hour);\n\t\tvar minutes = Math.floor((distance % _hour) / _minute);\n\t\tvar seconds = Math.floor((distance % _minute) / _second);\n\n\t\tvar timer = \"\";\n\n\t\t// Print the information on the page\n\t\tif(weeks != 0) timer += weeks + ' weeks, ';\n\t\tif(weeks != 0 || days != 0) timer += days + ' days, ';\n\t\tif(weeks != 0 || days != 0 || hours != 0) timer += hours + ' hrs, ';\n\t\tif(weeks != 0 || days != 0 || hours != 0 || minutes != 0) timer += minutes + ' min, ';\n\t\tif(weeks != 0 || days != 0 || hours != 0 || minutes != 0 || seconds != 0) timer += seconds + ' sec';\n\n\t\tdocument.getElementById(id).innerHTML = timer;\n\t};\n\t// Refresh every second\n\ttimer = setInterval(showRemaining, 1000);\n}", "function setTimeElapsed(timerId, seconds){\n $('#timer-' + timerId + '-time-elapsed').text(formatSeconds(seconds));\n}", "function timerFunction(Id) {\n var spanId = 'timer_' + Id;\n dateObject = new Date();\n var timeObject = dateObject.toLocaleTimeString();\n document.getElementById(spanId).innerHTML = \"| Start time:\" + timeObject;\n}", "function startIdleTimer() { \n \n /* Increment the \n timer seconds */ \n valido = document.getElementById(\"secs\");\n\n if(currSeconds < 30 && currSeconds > 9){\n valido.innerText = \"00:\"+(currSeconds); \n }else{\n if(currSeconds <= 0){\n valido.innerText =\"00:00\"; \n \n }else{\n if(currSeconds == 30){\n valido.innerText =\"00:30\"; \n \n }else{\n valido.innerText =\"00:0\"+(currSeconds); \n }\n \n }\n\n } \n currSeconds--; \n \n \n /* Display the timer text */ \n\n }", "function addTimeEventIntervalAction(Timer){\n\t\t//TIMER\n\t\tif (Timer && Timer.type === Events.TIMER){\n\t\t\t//get all relevant domElements - note: this might come to early here as the elements are not yet added to the DOM :-(\n\t\t\tvar domEles = $(SepiaFW.ui.JQ_RES_VIEW_IDS).find('[data-id=\"' + Timer.data.eventId + '\"]').find(\".sepiaFW-timer-indicator\");\n\t\t\t//start animation\n\t\t\tclearInterval(Timer.animation);\n\t\t\tvar elementsRetrivalRetry = 0;\n\t\t\tTimer.animation = setInterval((function(){\n\t\t\t\tif (elementsRetrivalRetry < 3){\n\t\t\t\t\t//workaround to give elements time to appear in DOM\n\t\t\t\t\tdomEles = $(SepiaFW.ui.JQ_RES_VIEW_IDS).find('[data-id=\"' + Timer.data.eventId + '\"]').find(\".sepiaFW-timer-indicator\");\n\t\t\t\t\telementsRetrivalRetry++;\n\t\t\t\t}\n\t\t\t\t//refresh domEles by visibility check\n\t\t\t\tif (domEles.length > 0){\n\t\t\t\t\tdomEles = domEles.filter(function(index){\n\t\t\t\t\t\tvar cardBody = domEles[index].parentNode.parentNode;\n\t\t\t\t\t\treturn (cardBody && cardBody.parentNode && cardBody.parentNode.parentNode);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (domEles.length < 1){\n\t\t\t\t\tif (elementsRetrivalRetry >= 3){\n\t\t\t\t\t\tclearInterval(this.animation);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t//still at least one visible\n\t\t\t\t\tvar prefix = \"\";\n\t\t\t\t\tvar left_ms = (Timer.targetTime - (new Date().getTime()));\n\t\t\t\t\tif (left_ms <= 0){\n\t\t\t\t\t\tprefix = SepiaFW.local.g('expired') + \": \";\n\t\t\t\t\t\tleft_ms = left_ms * -1.0;\n\t\t\t\t\t}\n\t\t\t\t\tvar dd = Math.floor(left_ms/DAY_MS);\t\tleft_ms = left_ms - (dd * DAY_MS);\n\t\t\t\t\tvar hh = Math.floor(left_ms/HOUR_MS);\t\tleft_ms = left_ms - (hh * HOUR_MS);\n\t\t\t\t\tvar mm = Math.floor(left_ms/MIN_MS);\t\tleft_ms = left_ms - (mm * MIN_MS);\n\t\t\t\t\tvar ss = Math.floor(left_ms/SEC_MS);\n\t\t\t\t\tvar newTime = (prefix + dd + \"d \" + hh + \"h \" + mm + \"min \" + ss + \"s\").trim();\n\t\t\t\t\tdomEles.text(newTime);\n\t\t\t\t\t//console.log(Timer.name + ': refresh');\t\t//DEBUG\n\t\t\t\t}\n\t\t\t}).bind(Timer), 1000);\n\t\t}\n\t}", "function initializeTimer(timerId){\n setupTimerButtonObservers(timerId);\n updateElapsedTime(timerId);\n // Start the timer so that it updates every second when active\n window.setInterval(() => updateElapsedTime(timerId), 1000);\n setupDescriptionObserver(timerId);\n setupTimeElapsedObserver(timerId);\n}", "function startTimer() \r\n{\r\n var time_in_minutes = 10;\r\n var current_time = Date.parse(new Date());\r\n var deadline = new Date(current_time + time_in_minutes*60*1000);\r\n function time_remaining(endtime){\r\n var t = Date.parse(endtime) - Date.parse(new Date());\r\n var seconds = Math.floor( (t/1000) % 60 );\r\n var minutes = Math.floor( (t/1000/60) % 60 );\r\n var hours = Math.floor( (t/(1000*60*60)) % 24 );\r\n var days = Math.floor( t/(1000*60*60*24) );\r\n return {'total':t, 'days':days, 'hours':hours, 'minutes':minutes, 'seconds':seconds};\r\n}\r\n\r\n//function to run timer\r\nfunction run_clock(id,endtime)\r\n{\r\n var clock = document.getElementById('timer');\r\n function update_clock()\r\n {\r\n var t = time_remaining(endtime);\r\n document.getElementById(\"timer\").innerHTML=t.minutes+':'+t.seconds;\r\n\r\n if(t.total<=0)\r\n {\r\n clearInterval(timeinterval);\r\n location.replace(\"index2.html\");\r\n }\r\n }\r\n update_clock();\r\n var timeinterval = setInterval(update_clock,1000);\r\n }\r\n run_clock('timer',deadline);\r\n}", "function countdownTimer() {\n // reduce countdown timer by 1 second\n timer--;\n if (timer === 0) {\n // timer expired\n endTest();\n } else if (timer < 10) {\n // prefix times less than ten seconds with 0\n // update timer on web page\n $('#timer').text('0' + timer);\n } else {\n // update timer on web page\n $('#timer').text(timer);\n }\n }", "function timer() {\n\t\t//get elapsed time, comes as milliseconds\n\t\tlet timeElapsed = Date.now() - timerStart;\n\n\t\tif (timeElapsed >= QUIZDURATION) {\n\t\t\tendQuiz();\n\t\t\treturn;\n\t\t}\n\t\t//convert to seconds\n\t\tlet remaining = (QUIZDURATION - timeElapsed) / 1000;\n\t\tlet h = parseInt(remaining / 3600); //divide to get hours\n\t\tlet m = parseInt( (remaining % 3600) / 60); //divide remainder to get minutes\n\t\tlet s = parseInt( (remaining % 3600) % 60); //divide that remainder to get seconds\n\n\t\t//put on page\n\t\tlet textString = padTimer(h) + \":\" + padTimer(m) + \":\" + padTimer(s);\n\t\ttimeDisplay.innerText = textString;\n\t}", "function initialize_timer(hrs,mins,seconds){\n // Set up expiry time\n expiryTime.setHours( expiryTime.getHours() + hrs );\n expiryTime.setMinutes( expiryTime.getMinutes() + mins );\n expiryTime.setSeconds( expiryTime.getSeconds() + seconds );\n\n timerElement.html(findTimeDifference(startTime,expiryTime));\n //console.log('timerElement.innerHTML:'+timerElement.innerHTML);\n }", "function handleTimer(event) {\n\n var seconds = document.getElementById('seconds');\n var minutes = document.getElementById('minutes');\n var hours = document.getElementById('hours');\n var secondsNum, minutesNum, hoursNum = 0;\n if ( document.getElementsByClassName('active-timer').length === 0 ) {\n document.getElementById('stopwatch').className = 'timer-component active-timer';\n document.getElementById('task-control').className = 'task-control stop timer-component';\n\n //Send new active timer to DB\n addActive(new Date());\n //start timer\n timer = window.setInterval(function() {\n\n secondsNum = Number(seconds.innerHTML);\n secondsNum++;\n seconds.innerHTML = ( secondsNum < 10 ) ? '0' + secondsNum : secondsNum;\n if ( secondsNum >= 60 ) {\n seconds.innerHTML = '00';\n minutesNum = Number(minutes.innerHTML);\n minutesNum++;\n minutes.innerHTML = ( minutesNum < 10 ) ? '0' + minutesNum : minutesNum;\n\n if ( minutesNum >= 60 ) {\n minutes.innerHTML = '00';\n hoursNum = Number(hours.innerHTML);\n hoursNum++;\n hours.innerHTML = ( hoursNum < 10 ) ? '0' + hoursNum : hoursNum;\n }\n\n }\n }, 1000);\n } else {\n window.clearInterval(timer);\n\n var elapsed = {\n hours: document.getElementById('hours').innerHTML,\n minutes: document.getElementById('minutes').innerHTML,\n seconds: document.getElementById('seconds').innerHTML\n };\n\n var timeStamp = {\n end: new Date()\n };\n\n var diffHours = Number(timeStamp.end.getHours()) - Number(elapsed.hours);\n var diffMinutes = Number(timeStamp.end.getMinutes()) - Number(elapsed.minutes);\n var diffSeconds = Number(timeStamp.end.getSeconds()) - Number(elapsed.seconds);\n timeStamp.start = new Date(timeStamp.end.getFullYear(), timeStamp.end.getMonth(), timeStamp.end.getDate(), diffHours, diffMinutes, diffSeconds);\n\n var projectName = document.getElementById('timer-project-inner').innerHTML;\n var startAMPM = ( timeStamp.start.getHours() > 11 ) ? \"pm\" : \"am\";\n var endAMPM = ( timeStamp.end.getHours() > 11 ) ? \"pm\" : \"am\";\n\n //Object containing task data to send to template\n var newTask = {\n task_name: document.getElementById('task-name').value,\n project_name: projectName,\n value: document.getElementById('task-amt').value,\n elapsed: elapsed,\n start_time: ( timeStamp.start.getHours() % 12 ) + \":\",\n end_time: ( timeStamp.end.getHours() % 12 ) + \":\",\n color: window.getComputedStyle(document.getElementById('timer-project')).getPropertyValue('background-color'),\n isNew: true\n };\n\n var uniqueIDs = document.querySelectorAll('[id^=\"checkbox\"]');\n\n if ( uniqueIDs.length <= 0 ) {\n newTask.unique_id = \"checkbox-0\";\n } else {\n newTask.unique_id = uniqueIDs[uniqueIDs.length-1].id;\n }\n newTask.original_start_time = timeStamp.start;\n var uID = newTask.unique_id.substring(newTask.unique_id.indexOf('-') + 1);\n newTask.unique_id = newTask.unique_id.replace(newTask.unique_id.substring(newTask.unique_id.indexOf('-')), \"-\" + (Number(uID) + 1));\n\n if ( timeStamp.start.getMinutes() < 10 ) {\n newTask.start_time += '0';\n }\n\n if ( timeStamp.end.getMinutes() < 10 ) {\n newTask.end_time += '0';\n }\n\n newTask.start_time += timeStamp.start.getMinutes() + startAMPM;\n newTask.end_time += timeStamp.end.getMinutes() + endAMPM;\n\n if ( newTask.task_name.length < 1 ) {\n newTask.task_name = \"(No description)\";\n }\n\n // Delete active timer from DB\n deleteActive();\n\n var currPageProj = document.getElementById('project-name').innerHTML;\n currPageProj = currPageProj.substring(currPageProj.indexOf('\\\"') + 1, currPageProj.lastIndexOf('\\\"'));\n if ( newTask.project_name === currPageProj) {\n renderInOrder(newTask, timeStamp.end); //Insert at top\n }\n var latestTask = document.getElementsByClassName('task')[0];\n\n if ( document.getElementsByClassName('total-time').length > 0 ) {\n document.getElementsByClassName('total-time')[0].innerHTML = calcTotal(latestTask, 2);\n }\n newTask.start_time = timeStamp.start;\n newTask.end_time = timeStamp.end;\n\n if ( uniqueIDs.length <= 0 ) {\n document.getElementById('no-items').style.display = 'none';\n }\n\n addTask(newTask);\n\n document.getElementById('task-name').value = '';\n document.getElementById('task-amt').value = document.getElementById('hidden-value').value;\n document.getElementById('timer-project').style.backgroundColor = '#' + document.getElementById('hidden-color').value;\n document.getElementById('timer-project-inner').style.backgroundColor = '#' + document.getElementById('hidden-color').value;\n\n if ( document.getElementsByClassName('task-project-name').length > 0 ) {\n document.getElementsByClassName('task-project-name')[0].style.color = helpers.computeContrast(newTask.color);\n }\n\n document.getElementById('stopwatch').className = 'timer-component';\n document.getElementById('task-control').className = 'task-control play timer-component';\n document.getElementById('hours').innerHTML = document.getElementById('minutes').innerHTML = document.getElementById('seconds').innerHTML = '00';\n }\n }", "function timerWrapper () {}", "function setTimer(duration, timer_display_block_id, hyperlink_id) {\r\n var duration = parseInt(duration);\r\n if (duration < 0) {\r\n clearInterval(interval)\r\n }\r\n $(\"#\" + hyperlink_id).hide();\r\n window.interval = setInterval(function () {\r\n if (duration < 0) {\r\n clearInterval(interval)\r\n $(\"#\" + timer_display_block_id).parent().hide()\r\n $(\"#\" + hyperlink_id).show();\r\n } else {\r\n $(\"#\" + timer_display_block_id).text(duration);\r\n $(\"#\" + timer_display_block_id).parent().show()\r\n }\r\n duration -= 1;\r\n }, 1000);\r\n}", "function Timers() {\n\n this.timers = {};\n this.idCounter = 0;\n\n}", "function stopTimer(){\n if (angular.isDefined($scope.timerId)) {\n $interval.cancel($scope.timerId);\n $scope.timerId = undefined;\n }\n if (angular.isDefined($scope.timerIdGameStop)) {\n $timeout.cancel($scope.timerIdGameStop);\n $scope.timerIdGameStop = undefined;\n }\n }", "timerExpire() {\n this.next();\n }", "function updateTime() {\n console.log(timer);\n timer--;\n timerEl.textContent = timer;\n if (timer <= 0) {\n endQuiz();\n }\n}", "function domTimer() {\n $(`.timer`).text(`Timer: ${totalMinutes}:${totalSeconds}`);\n }", "function makeTimer() {\r\n\t\tvar endTime = new Date(\"03 July 2021 10:10:30 GMT +0000\");\t\t\t\r\n\t\tendTime = (Date.parse(endTime) / 1000);\r\n\r\n\t\tvar now = new Date();\r\n\t\tnow = (Date.parse(now) / 1000);\r\n\r\n\t\tvar timeLeft = endTime - now;\r\n\r\n\t\tvar days = Math.floor(timeLeft / 86400); \r\n\t\tvar hours = Math.floor((timeLeft - (days * 86400)) / 3600);\r\n\t\tvar minutes = Math.floor((timeLeft - (days * 86400) - (hours * 3600 )) / 60);\r\n\t\tvar seconds = Math.floor((timeLeft - (days * 86400) - (hours * 3600) - (minutes * 60)));\r\n\r\n\t\tif (hours < \"10\") { hours = \"0\" + hours; }\r\n\t\tif (minutes < \"10\") { minutes = \"0\" + minutes; }\r\n\t\tif (seconds < \"10\") { seconds = \"0\" + seconds; }\r\n\r\n\t\t$(\"#days\").html(days + \"<h6>Days</h6>\");\r\n\t\t$(\"#hours\").html(hours + \"<h6>Hrs</h6>\");\r\n\t\t$(\"#minutes\").html(minutes + \"<h6>Min</h6>\");\r\n\t\t$(\"#seconds\").html(seconds + \"<h6>Sec</h6>\");\r\n\t}", "function run_clock(id,endtime)\r\n{\r\n var clock = document.getElementById('timer');\r\n function update_clock()\r\n {\r\n var t = time_remaining(endtime);\r\n document.getElementById(\"timer\").innerHTML=t.minutes+':'+t.seconds;\r\n\r\n if(t.total<=0)\r\n {\r\n clearInterval(timeinterval);\r\n location.replace(\"index2.html\");\r\n }\r\n }\r\n update_clock();\r\n var timeinterval = setInterval(update_clock,1000);\r\n }", "function createOldTimers(oldTimerContent,oldTimerID,newtimer)\n{\t\n\nconsole.log(\"wooooho so fun seeing old jobs\")\t\n\t\nvar $oldTimer=$('<div class=\"timer-old\">'+\t\n'<div class=\"btn delete\"></div>'+\t\n'<div class=\"oldDate\"><p>'+oldTimerContent[0]+'<br>'+oldTimerContent[1]+'</p></div>'+\t\n\t\t\t\t\t\n\t'<div class=\"timer-info\">'+\n\t\t'<p>'+\n\t\t\t\t\t\n\t\t'<span class=\"timer-info-txt\">client:</span>'+\n\t\t'<span class=\"client\" contenteditable=\"false\">'+oldTimerContent[2]+'</span><br>'+\n\n\t\t'<span class=\"timer-info-txt\">job description:</span>'+\n\t\t'<span class=\"job\" contenteditable=\"false\">'+oldTimerContent[3]+'</span><br>'+\n\n\t\t'<span class=\"timer-info-txt\">jobnr:</span>'+\n\t\t'<span class=\"jobnr\" contenteditable=\"false\">'+oldTimerContent[4]+'</span><br>'+\n\n\t\t'<span class=\"timer-info-txt\">Contact person:</span>'+\n\t\t'<span class=\"person\" contenteditable=\"false\">'+oldTimerContent[5]+'</span><br>'+\n\n\t\t'<span class=\"timer-info-txt\">phone:</span>'+\n\t\t'<span class=\"phone\" contenteditable=\"false\">'+oldTimerContent[6]+'</span><br>'+\n\n\t\t'<span class=\"timer-info-txt\">mail:</span>'+\n\t\t'<span class=\"mail\" contenteditable=\"false\">'+oldTimerContent[7]+'</span><br>'+\n\n\t\t'<span class=\"timer-info-txt\">notes:</span>'+\n\t\t'<span class=\"notes\" contenteditable=\"false\">'+oldTimerContent[8]+'</span>'+\n\t\t'</p>'+\t\n\t\t\t\t\t\n\t'</div>'+\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t'<div class=\"timer-dashed-line\"></div>'+\t\n\t'<div class=\"timer-clock\">'+\n\t'<p class=\"timer-total-txt\"><span class=\"datetoday\"></span> you have been working a total time of</p><br>'+\n\t'<p class=\"timer-work-clock\">'+oldTimerContent[9]+'</p><br>'+\n\t'<p class=\"timer-breaktotal-txt\">You took <span class=\"breaks\">'+oldTimerContent[10]+'</span> breaks at the total time of <span class=\"break-clock\">'+oldTimerContent[11]+'</span></p>'+\n\t'</div>'+\n\t\t\t\t\t\n\t'</div>'); \n\t\n\t\n\tif(newtimer){\n\t$('#wrap').prepend($oldTimer);\n\t\tconsole.log('newoldt')\n\t}else{\n\t$('#wrap').append($oldTimer);\n\t\tconsole.log('oldt')\n\t}\n\t\n$oldTimer.data('id',oldTimerID);\nTweenMax.set($oldTimer, {transformOrigin:\"top center\",height:0,transformStyle:\"preserve-3d\",transformPerspective:1500, \t\tperspective:1200,z:500,rotationX:-90,z:900});\n\nshowTimers()\n}", "function setTimer(roomId) {\n const room = rooms[roomId];\n room.currentClaims = [0, 0, 0, 0];\n let sec = turnTime;\n var timer = setInterval(function(){\n io.to(roomId).emit('turn-timer', sec);\n if (sec === 0){\n clearInterval(timer);\n room.timerElapsed = true;\n executeGreatestClaim(roomId);\n }\n sec--;\n }, 1000);\n}", "function setTimer() {\n document.getElementById(\"timer\").textContent = timer;\n }", "function activate_timer() {\n var countdown_timer = window.setInterval(function() {\n timer--;\n document.getElementById(\"remaining_time\").innerHTML = timer;\n\n if (timer == 0 ) {\n clearInterval(countdown_timer);\n showLeaderboard();\n }\n \n },1000);\n\n}", "function addOneToBreakTimer() {\n\tbreakTimer = breakTimer + 1;\n \n document.getElementById(\"break\").innerHTML = breakTimer;\n}", "function timerStarter(){\n timer = 0;\n var timerElement = document.querySelector('.timer');\n timerId = setInterval(() =>{\n timer ++;\n timerElement.innerHTML = `${timer}`;\n }, 1000) \n}", "function timer () {\n \n timerId = setInterval(triviaCount, 1000);\n function triviaCount () {\n if (timerCounter === 0) {\n clearInterval(timerId);\n timeRunsOut();\n }\n else {\n $(\".timer-number\").html(timerCounter);\n timerCounter--;\n }\n\n }\n // console.log(timer);\n \n }", "function setTimer(duration, timer_display_block_id, hyperlink_id) {\r\n var duration = parseInt(duration);\r\n if(duration < 0) {\r\n return false;\r\n }\r\n $(\"#\"+hyperlink_id).hide();\r\n var interval = setInterval(function() {\r\n if(duration < 0) {\r\n clearInterval(interval)\r\n $(\"#\"+timer_display_block_id).parent().hide()\r\n $(\"#\"+hyperlink_id).show();\r\n } else {\r\n $(\"#\"+timer_display_block_id).text(duration);\r\n $(\"#\"+timer_display_block_id).parent().show()\r\n }\r\n duration -= 1;\r\n }, 1000)\r\n}", "function getTimer (btn) {\n $(\"#duration\").val($(\"#time\").text().substring(0,8));\n $(\"#exercise_status\").val(btn.id);\n $(\"#timerContainer\").animate({right: \"100%\"}, \"slow\", function(){\n $(\"#timerContainer\").hide();\n $(\"#pageTitle\").text(\"Your Mood\");\n $(\"#emojiContainer\").show();\n $(\"#emojiContainer\").animate({left: \"0\"},\"slow\");\n });\n}", "function getEndTimer() {\n if (secs >= 10) {\n return `${mins}:${secs}`;\n } else {\n return `${mins}:0${secs}`;\n }\n}", "function setTimer() {\n var elapsedTime = 0\n timerId = setInterval(function () {\n elapsedTime += 1;\n document.getElementById('timer').innerText = elapsedTime.toString().padStart(2, '0');\n }, 1000);\n}", "function startedTimer(timer) {\n\t\tconst id = timer.id;\n\t\tconst start = document.querySelector(id + 'Start')\n\t\tstart.remove();\n\n\t\tconst cutId = id.substring(1);\n\t\tconst buttons = document.getElementById(cutId + \"Buttons\")\n\n\t\tconst stop = new controlButton(timer, \"Stop\");\n\t\tconst reset = new controlButton(timer, \"Reset\");\n\n\t\ttimer.startTimer();\n\n\t\tbuttons.appendChild(stop);\n\t\tbuttons.appendChild(reset);\n\n\t}", "function countdownTimer()\n{\n\tif (typeof chainTimelineObj != \"object\") return;\n\n\tvar end_of_day = new Date();\n\tend_of_day.setHours(23,59,59,999); // End of the day\n\tvar today = new Date(); // The time now\n\n\t// Simple check if the date has changed and we should update the render\n\tif(chainTimelineObj.renderTime != false && \n\t\ttoday.getDate() > chainTimelineObj.renderTime.getDate()) {\n\t\tchainTimelineObj.render();\n\t}\n\n\tfunction timeVal(num) {\n\t\treturn (num < 10 ? \"0\" : \"\" ) + num;\n\t}\n\n\tvar seconds = (end_of_day.getTime()-today.getTime()) / 1000;\n\n\tvar hours = Math.floor(seconds / 3600);\n\tseconds = seconds % 3600;\n\tvar minutes = Math.floor(seconds / 60);\n\tseconds = seconds % 60;\n\tvar seconds = Math.floor(seconds);\n\n\thours = timeVal(hours);\n\tminutes = timeVal(minutes);\n\tseconds = timeVal(seconds);\n\n\t// Check if the day has been completed\n\tvar completed = false;\n\tif(typeof chainTimelineObj.data == \"object\" && \n\t\ttypeof chainTimelineObj.data[today.getFullYear()] == \"object\" &&\n\t\ttypeof chainTimelineObj.data[today.getFullYear()][today.getMonth()] == \"object\" &&\n\t\tchainTimelineObj.data[today.getFullYear()][today.getMonth()].indexOf(today.getDate()-1)!=-1){\n\t\tcompleted = true;\n\t}\n\n\t// We use different text for different situations\n\tif (completed) {\n\t\ttxt_left = \"Completed\";\n\t\t$(\"#time_left_txt\").text(\"Time to relax\");\n\t} else {\n\t\tif (hours<1) {\n\t\t\tvar txt_left = minutes + \":\" + seconds + \"<span>minutes</span>\";\n\t\t} else {\n\t\t\tvar txt_left = hours + \":\" + minutes + \":\" + seconds;\n\t\t}\n\n\t\tif(chainTimelineObj.currentlyInChain == 0) {\n\t\t\t$(\"#time_left_txt\").text(\"left of the day\");\n\t\t} else {\n\t\t\t$(\"#time_left_txt\").text(\"left to keep chain\");\n\t\t}\n\t}\n\n\t// Update the time\n\t$(\"#time_left\").html(txt_left);\n}", "function Timer(minute,timerID,input,crewSpan) {\n\t\tlet min = minute-1;\n\t\tlet sec = 60;\n\t\tconst self = this;\n\t\tthis.minute = minute;\n\t\tthis.timerID = timerID;\n\t\tthis.crewSpan = crewSpan;\n\t\tthis.hasCrew;\t\t\n\t\tthis.running = false;\t\t\t\t\n\t\tthis.done = false;\t\t\t\t\n\t\tthis.startTimer;\n\t\tthis.pause = false;\t\t\t\t\t\n\n\t\tthis.startCountdown = function() {\t\t\t\t\t\t\t\t\t\n\t\t\tthis.startTimer = setInterval(function(){countdown();},1000);\t\t\n\t\t\tthis.running = true;\n\t\t\tthis.done = false;\n\t\t\tthis.pause = false;\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t}\t\t\n\t\t\n\t\tthis.stopCountdown = function() {\t\t\t\n\t\t\tclearInterval(this.startTimer);\n\t\t\tthis.running = false;\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\t//display countdown on timer\n\t\tfunction countdown() {\t\t\t\n\t\t\tsec--;\n\t\t\t\t\t\t\n\t\t\tif(min===0 && sec===0) { // use 'min < 0' for 0:00, 'min===0 && sec===0' for 0:01\t\t\t\t\n\t\t\t\tself.noCrew();\n\t\t\t\t$(timerID).addClass(\"fade-grey\");\n\t\t\t\tself.stopCountdown();\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tself.done = true;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tself.resetTime();\n\t\t\t\ttimerDone();\t\t\t\t\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\telse if(sec === 0) {\n\t\t\t\t$(timerID).html(min+\":0\"+sec)\t\t\t\t\t\t\t\n\t\t\t\tmin--;\n\t\t\t\tsec = 60;\t\t\t\n\t\t\t}\n\t\t\telse if(sec > 9) {\n\t\t\t\t$(timerID).html(min+\":\"+sec);\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(timerID).html(min+\":0\"+sec);\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\tif(timerID != \"#deck-timer\") {\n\t\t\t\t//Make timer red when timer is 1 min or less\n\t\t\t\tif(min === 0) {\n\t\t\t\t\t$(timerID).addClass(\"red-timer\");\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\t$(timerID).removeClass(\"red-timer\");\n\t\t\t\t}\n\t\t\t\t//Flash red at halfway point\t\t\t\t\n\t\t\t\tif(minute > 2) {\n\t\t\t\t\tif(minute%2 != 0 && sec === 30 && min === Math.floor(minute/2) || minute%2 === 0 && sec === 60 && min === minute/2-1) {\n\t\t\t\t\t\t$(timerID).addClass(\"fade-red\");\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}//countdown() end\n\t\t\n\t\t//Adjust time to minutes from input form\n\t\tthis.newTime = function() {\t\t\t\n\t\t\tminute = $(input).val();\n\t\t\tmin = $(input).val()-1;\t\t\t\t\n\t\t\t$(timerID).html(minute+\":00\");\t\t\t\t\t\t\t\t\t\n\t\t}\n\n\t\t//Calculate deckTimer minutes\n\t\tlet deckIn;\t\t\n\t\tlet oneIn;\t\t\t\t\n\t\tthis.deckTime = function() {\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tdeckIn = parseInt($('#deckInput').val());\t\t\t\n\t\t\toneIn = parseInt($('#oneInput').val());\t\t\t\t\t\t\n\t\t\tminute = deckIn + oneIn;\n\t\t\tmin = minute-1;\n\t\t\t$(timerID).html(minute+\":00\");\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t}\t\t\t\t\n\n\t\t//Add one minute to timer\n\t\tthis.addMin = function() {\n\t\t\tmin++;\n\t\t\tif(!this.running) {\n\t\t\t\t$(timerID).html((min+1)+\":00\");\t\n\t\t\t}\t\t\t\n\t\t}\n\n\t\t//Reset times and crew index\n\t\tthis.reset = function()\t{\n\t\t\tthis.resetTime();\n\t\t\tthis.crew = 0;\t\t\t\n\t\t}\n\t\t\n\t\t//Reset times\n\t\tthis.resetTime = function() {\n\t\t\t$(timerID).removeClass(\"red-timer\");\n\t\t\tself.stopCountdown();\t\t\t\n\t\t\tmin = minute-1;\t\t\t\n\t\t\tsec = 60;\t\t\t\n\t\t\t$(timerID).html(minute+\":00\");\n\t\t\t$(timerID).removeClass(\"fade-red\");\n\t\t\tthis.pause = false;\t\t\t\n\t\t}\n\n\t\t//Move crew numbers through stations\n\t\tthis.crew = 0;\n\t\tthis.nextCrew = function() {\t\t\t\n\t\t\tif(crewArray[this.crew] === undefined) {\t\t\t\t\n\t\t\t\tself.noCrew();\n\t\t\t\t$(timerID).addClass(\"fade-grey\");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(crewSpan).html(crewArray[this.crew]);\t\t\t\t\t\t\t\n\t\t\t\tthis.crew++;\n\t\t\t\t$(timerID).removeClass(\"fade-grey\");\n\t\t\t\t$(timerID).removeClass(\"is-grey\");\n\t\t\t\tthis.hasCrew = true;\t\t\t\t\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t\tthis.noCrew = function() {\n\t\t\t$(crewSpan).html(\"\");\t\t\t\n\t\t\tthis.hasCrew = false;\n\t\t\t$(timerID).addClass(\"is-grey\");\t\t\t\n\t\t}\t\t\t\t\n\t}//Timer constructor end\t", "function removeTime() {\n timer = timer > 30 ? timer - 30 : 0;\n}", "addLastHiddenTimerToSlot (slotId) {\n let crono = new nrvideo.Chrono()\n crono.start()\n this._timeSinceLastSlotHiddenBySlot[slotId] = crono\n }", "function answerTimer(number1) {\n intervalId = setInterval(function countDown() {\n $('#time-left').text(number1);\n number1 --;\n if (number1 === 0) {\n stopTimer();\n }; \n }, 1000);\n }", "handleChangeTimer(options) {\n this.setState(options)\n relaxingFive.currentTime = 0;\n relaxingTen.currentTime = 0;\n relaxingFive.pause()\n relaxingTen.pause()\n this.setState({\n timerRunning: false,\n })\n clearInterval(this.timer)\n }", "function undoTimer(id) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n try {\n // Error if the timer is disabled.\n if (changesDisabled.value) {\n throw new Error('Timer changes are disabled');\n }\n // Error if timer is not finished or running.\n if (!['finished', 'running'].includes(timerRep.value.state)) {\n throw new Error('Timer is not finished/running');\n }\n // Error if there's an active run but no UUID was sent.\n if (!id && activeRun.value) {\n throw new Error('A run is active but no team ID was supplied');\n }\n // If we have a UUID and an active run, remove that team's finish time.\n if (id && activeRun.value) {\n delete timerRep.value.teamFinishTimes[id];\n nodecg.log.debug(\"[Timer] Team \" + id + \" finish time undone\");\n }\n // Undo the split if needed.\n if (timerRep.value.state === 'finished') {\n timer.undoSplit();\n timerRep.value.state = 'running';\n if (activeRun.value && runFinishTimes.value[activeRun.value.id]) {\n delete runFinishTimes.value[activeRun.value.id];\n }\n nodecg.log.debug('[Timer] Undone');\n }\n }\n catch (err) {\n nodecg.log.debug('[Timer] Cannot undo timer:', err);\n throw err;\n }\n return [2 /*return*/];\n });\n });\n}", "function timerActive(timerId){\n return $('#timer-container-' + timerId).attr('data-timer-active');\n}", "addTimerToSlot (slotId, timerName) {\n let crono = new nrvideo.Chrono()\n crono.start()\n if (this._slotAttributes[slotId] == undefined) {\n this._slotAttributes[slotId] = {}\n }\n this._slotAttributes[slotId][timerName] = crono\n }", "function mytimerFn(){\n if(startStopCounter>0){\n second--; \n if(second<10){\n // show two digit for seconds\n elecountDownTimer.innerHTML=\"<p> Time Remaining 0\"+minute+\":0 \"+second+\" </p>\";\n }else{\n elecountDownTimer.innerHTML=\"<p> Time Remaining 0\"+minute+\":\"+second+\" </p>\";\n }\n // when second reaches 59 countdown minute by 1, recount seconds from 60;\n if(second===0&&minute!=0){\n second=60;\n minute--;\n } \n \n if(second===0){\n // clearInterval(setIntervalVar);\n startStopCounter=0;\n testCompletedFn();\n\n }\n }\n }", "function createTimer() {\n\n if (typeof this.counter == 'undefined') {\n this.counter = 0;\n } else {\n this.counter++;\n }\n\n // \\\\\n // dangererous function \\\\\n // \\\\\n\n if (globalId) {\n QuestionInterval = setInterval(function () {\n\n askQuestionTimed();\n\n }, 10 * questionTime);\n } else {\n askQuestionTimed();\n }\n //\n //\n //\n}", "constructor(id, duration) {\n\t\t\tthis.id = id;\n\t\t\tthis.duration = duration;\n\t\t\tthis.timer = null;\n\t\t\tthis.hourglasssand = null;\n\t\t\tthis.color = \"#000000\";\n\t\t\tthis.reverse = false;\n\t\t\tthis.size = 1;\n\t\t\tthis.buttoncolor = \"white\";\n\t\t\tthis.buttontextcolor = \"black\";\n\t\t\tthis.buttonsize = \"14px\";\n\t\t\tthis.textcolor = \"black\";\n\t\t\tthis.textsize = \"14px\";\n\t\t\tthis.font = \"'Lucida Console', 'Courier New', monospace\";\n\t\t\tthis.texthidden = false;\n\t\t\tthis.textfixed = null;\n\t\t\tthis.textcompletion = null;\n\t\t\tthis.textalert = null;\n\t\t\tthis.autorepeat = false;\n\t\t\tthis.func = null;\n\t\t}", "function updatetimer(i) {\n var now = new Date();\n var then = timers[i].eventdate;\n var diff = count = Math.floor((then.getTime() - now.getTime()) / 1000);\n \n // catch bad date strings\n if (isNaN(diff)) {\n timers[i].firstChild.nodeValue = '** ' + timers[i].eventdate + ' **';\n return;\n }\n \n // determine plus/minus\n if (diff < 0) {\n diff = -diff;\n var tpm = 'T plus ';\n } else {\n var tpm = '';\n }\n \n // calcuate the diff\n var left = (diff % 60) + ' seconds';\n diff = Math.floor(diff / 60);\n if (diff > 0) left = (diff % 60) + ' minutes ' + left;\n diff = Math.floor(diff / 60);\n if (diff > 0) left = (diff % 24) + ' hours ' + left;\n diff = Math.floor(diff / 24);\n if (diff > 0) left = diff + ' days ' + left\n var diffing = count = Math.floor((then.getTime() - now.getTime()) / 1000);\n if (diffing < 0) {\n timers[i].firstChild.nodeValue = 'Timer has expired';\n } else {\n timers[i].firstChild.nodeValue = tpm + left;\n }\n \n \n // a setInterval() is more efficient, but calling setTimeout()\n // makes errors break the script rather than infinitely recurse\n timeouts[i] = setTimeout('updatetimer(' + i + ')', 1000);\n}", "function updatetimer(i) {\n var now = new Date();\n var then = timers[i].eventdate;\n var diff = count = Math.floor((then.getTime() - now.getTime()) / 1000);\n \n // catch bad date strings\n if (isNaN(diff)) {\n timers[i].firstChild.nodeValue = '** ' + timers[i].eventdate + ' **';\n return;\n }\n \n // determine plus/minus\n if (diff < 0) {\n diff = -diff;\n var tpm = 'T plus ';\n } else {\n var tpm = '';\n }\n \n // calcuate the diff\n var left = (diff % 60) + ' seconds';\n diff = Math.floor(diff / 60);\n if (diff > 0) left = (diff % 60) + ' minutes ' + left;\n diff = Math.floor(diff / 60);\n if (diff > 0) left = (diff % 24) + ' hours ' + left;\n diff = Math.floor(diff / 24);\n if (diff > 0) left = diff + ' days ' + left\n var diffing = count = Math.floor((then.getTime() - now.getTime()) / 1000);\n if (diffing < 0) {\n timers[i].firstChild.nodeValue = 'Timer has expired';\n } else {\n timers[i].firstChild.nodeValue = tpm + left;\n }\n \n \n // a setInterval() is more efficient, but calling setTimeout()\n // makes errors break the script rather than infinitely recurse\n timeouts[i] = setTimeout('updatetimer(' + i + ')', 1000);\n}", "function set_new_timer() {\n var start_seconds = Math.floor(new Date().getTime() / 1000);\n $.post(\n '/server/index.php',\n { action : 'timer_start', start_seconds : start_seconds },\n function() {\n counter();\n }\n );\n }", "chronoStop(){\n clearTimeout(this.timerID);\n }", "function startTurnTimer(timerId, turnDuration) {\n\tconsole.log('\\nInitializing turn timer!');\n\n\t// Initialize or reset time remaining\n\tgameState.nextTurnTimestamp = Date.now() + turnDuration;\n\n\tconsole.log( 'Next turn at: ' + new Date(gameState.nextTurnTimestamp).toString().substring(16,25) );\n\n\t// Every time the timer goes off, update timestamp and change turn!\n\ttimerId = setInterval(() => {\n\t\tconsole.log('\\n >>>>>>>>>>> ' + new Date().toString().substring(16,25)\t+ ' - Time to change turns! <<<<<<<<<<\\n');\n\n\t\t// Update time of next turn change\n\t\tgameState.nextTurnTimestamp = Date.now() + turnDuration;\n\n\t\tchangeTurn();\n\n\t}, turnDuration); // TO DO: enable user-specified turn length\n\n\treturn timerId;\n}", "function setTimer() {\n\t\t if(timerRunning === false) {\n\t\t\t timer = setInterval(minus1, 60000);\ndocument.getElementById(\"counter\").innerHTML= pomoTimer;\n document.getElementById(\"notification\").innerHTML = \"The Timer Is Set For \" + pomoTimer + \" Minutes! Countdown Started!\"\n timerRunning = true;\n hideButtons();\n x.play();\n\t\t }\n \n}", "function startTimer() {\n timerInterval = setInterval(function() {\n timeRemaining--\n $timer.text(timeRemaining)\n if (timeRemaining === 0) {\n endQuiz()\n }\n }, 1000)\n }", "chrono(){\n this.end = new Date();\n this.diff = this.end - this.start;\n this.diff = new Date(this.diff);\n let msec = this.diff.getMilliseconds();\n let sec = this.diff.getSeconds();\n let min = this.diff.getMinutes();\n let hr = this.diff.getHours()-1;\n if (min < 10){\n min = \"0\" + min;\n }\n if (sec < 10){\n sec = \"0\" + sec;\n }\n if(msec < 10){\n msec = \"00\" +msec;\n }\n else if(msec < 100){\n msec = \"0\" +msec;\n }\n document.getElementById(\"chronotime\").innerHTML = min + \":\" + sec + \":\" + msec;\n this.timerID = setTimeout(this.chrono, 100);\n }", "function iClickHandler(id) {\n switch(id) {\n case 'workplus':\n sessionLength += 60;\n if (isSession) {\n timeLeft += 60;\n }\n break;\n case 'workminus':\n sessionLength -= 60;\n if (isSession) {\n timeLeft -= 60;\n }\n break;\n case 'breakplus':\n breakLength += 60;\n if (!isSession) {\n timeLeft += 60;\n }\n break;\n case 'breakminus':\n breakLength -= 60;\n if (!isSession) {\n timeLeft -= 60;\n }\n break;\n }\n updateTimerLengths();\n updateTimer();\n }", "function timer(duration) {\n setInterval(commitmentCheck, duration)\n}", "function quizTimer() {\n var timerInterval = setInterval(function() {\n secondsLeft--;\n timer.textContent = secondsLeft;\n \n if(secondsLeft === 0 || currentQuestion > 4) {\n clearInterval(timerInterval);\n timer.setAttribute(\"class\",\"timer d-none\");\n // alert(\"Thank you for playing, better luck next time\")\n }\n \n }, 750);\n }", "function createTimer() {\n debug(\"createTimer\");\n clock = document.createElement('span');\n clock.setAttribute(\"class\", \"timer\");\n clock.innerHTML = \"0 Seconds\";\n\n document.querySelector('.score-panel').appendChild(clock);\n startTime();\n }", "function setTimer() {\n var countdown = setInterval(function(){\n secondsLeft--;\n timerEl.textContent = \"Time: \" + secondsLeft;\n if (secondsLeft === 0 || questionIndex === questions.length) {\n clearInterval(countdown);\n }\n }, 1000\n ) }", "function cancelTimer() {\n clearInterval(timer);\n paused = true;\n newCountdown = true;\n startBtn.innerHTML = \"start\";\n countdown.style.color = \"black\";\n text.innerHTML = \"Move slider to set your timer, click start & begin studying...\";\n totalSecs = (slider.value)*60;\n clockKey = clockArr.length-1;\n displayTime();\n}", "function initHoursTimer (open, close, id, status, display) {\n var diffClose, diffOpen, closeTimer;\n\n if(display === 'hide') {\n $('[data-timer-id]').hide();\n }\n else if(id === null && status === 'closed') {\n $('[data-lf-pos-hours-timer-open], [data-lf-pos-hours-timer-closing]').hide();\n $('[data-lf-pos-hours-timer-close]').show();\n }\n else if(id !== null && status === 'closed') {\n $('[data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-open], [data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-closing]').hide();\n $('[data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-close]').show();\n }\n else if(status === 'open') {\n if(open.length === 1) {\n diffOpen = moment(open[0], 'HH:mm').diff(moment());\n diffClose = moment(close[0], 'HH:mm').diff(moment());\n }\n else {\n diffOpen = moment(open[0], 'HH:mm').diff(moment());\n diffClose = moment(close[0], 'HH:mm').diff(moment());\n\n if(diffOpen <= 0 && diffClose <= 0) {\n diffOpen = moment(open[1], 'HH:mm').diff(moment());\n }\n if(diffClose <= 0) {\n diffClose = moment(close[1], 'HH:mm').diff(moment());\n }\n }\n\n if(diffOpen > 0 || diffClose < 0 || diffClose <= 60000) {\n if(id === null) {\n $('[data-lf-pos-hours-timer-open], [data-lf-pos-hours-timer-closing]').hide();\n $('[data-lf-pos-hours-timer-close]').show();\n }\n else if(id !== null) {\n $('[data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-open], [data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-closing]').hide();\n $('[data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-close]').show();\n }\n }\n else if (diffClose > 60000 && diffClose < 3600000) {\n closeTimer = moment.utc(diffClose).format('mm');\n if(id === null) {\n $('[data-lf-pos-hours-timer-count]').prepend(closeTimer);\n $('[data-lf-pos-hours-timer-close], [data-lf-pos-hours-timer-open]').hide();\n $('[data-lf-pos-hours-timer-closing]').show();\n }\n else if(id !== null) {\n $('[data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-count]').prepend(closeTimer);\n $('[data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-close], [data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-open]').hide();\n $('[data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-closing]').show();\n }\n }\n else {\n if(id === null) {\n $('[data-lf-pos-hours-timer-close], [data-lf-pos-hours-timer-closing]').hide();\n $('[data-lf-pos-hours-timer-open]').show();\n }\n else if(id !== null) {\n $('[data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-close], [data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-closing]').hide();\n $('[data-timer-id=\"' + id + '\"] [data-lf-pos-hours-timer-open]').show();\n }\n }\n }\n}", "function timerFunction() {\n\t$(\"#timer\").text(timeRemaining);\n\tif(timeRemaining > 0) {\n\ttimeRemaining-=1;\n\t} else {\n\t\tclearInterval(timer)\n\t\tindex = index + 1;\n\t\tsetQuestion()\n\t};\n}", "function createTimer1() {\n\ttimer = setTimeout(function() {\n\t\ttime--;\n\t\t$(\"#timer-count\").html(time);\n\t\tcreateTimer1();\n\t\tif (time <= 0) {\n\t\t\tgame.wrongAnswer(\"Time's up!\");\n\t\t}\n\t}, 1000);\n}", "function setTimer() {\n time--;\n\n timerEl.textContent = time;\n\n if (time <=0)\n endQuiz()\n }", "addTimeoutID_ (id) {\n return this.timeoutIDs_.add(id);\n }", "function beginTimer () {\n setTimeout(function() {\n const seconds = 59\n setInterval(function(){\n if (seconds > 9) {\n document.getElementById('timer').innerHTML = '0:' + seconds;\n seconds-- ;\n }\n else if (seconds < 10 & seconds > 0){\n document.getElementById('timer').innerHTML = '0:0' + seconds;\n seconds-- ;\n }\n else {\n document.getElementById('timer').innerHTML = '&#128128';\n }\n }, 1000);\n }, 5000)\n }", "function removeTimer(obj) {\n if (typeof obj.timer !== 'undefined') {\n clearInterval(obj.timer);\n obj.timer = undefined;\n }\n }", "function startTimer(_timer){\n _timer.start({\n countdown: true,\n startValues: {\n seconds: 30\n }\n });\n }", "function hasTimerRestarted(eventAlias, minutes, timerName){\r\n\tvar timerid=document.getElementById(timers[eventAlias]);\r\n\tvar time=timerid.innerHTML;\r\n\tif((time.length<=5 && time.substring(0,2)>minutes))\r\n\t{\r\n\t\t//alert('reverse timer is working');\r\n\t\tflags[eventAlias]=0;\r\n\t}\r\n}", "function subtractOneFromBreakTimer() { \n if ( breakTimer > 0) {\n breakTimer = breakTimer - 1;\n document.getElementById(\"break\").innerHTML = breakTimer;\n } else {\n document.getElementById(\"txt\").innerHTML = \"The Timer Is At Zero!\";\n }\n}", "function timer(){\r\n secondsTimer++ //Increment the seconds when timer is called each 1second\r\n\r\n //increment minutes and hours in timer display\r\n if(secondsTimer == 60){\r\n secondsTimer = 0\r\n minutesTimer++\r\n if(minutesTimer == 60){\r\n minutesTimer = 0\r\n hourTimer++\r\n }\r\n }\r\n\r\n //Mechanism to format the time in timer\r\n if(secondsTimer<10){\r\n secondsNewTimer = \"0\"+secondsTimer\r\n }else{\r\n secondsNewTimer = secondsTimer\r\n }\r\n if(minutesTimer<10){\r\n minutesNewTimer = \"0\"+minutesTimer\r\n }else{\r\n minutesNewTimer = minutesTimer\r\n }\r\n if(hourTimer < 10){\r\n hourNewTimer = \"0\"+hourTimer\r\n }else{\r\n hourNewTimer = hourTimer\r\n }\r\n\r\n //Format the time in timer and apply this time in web page\r\n var format = hourNewTimer+\":\"+minutesNewTimer+\":\"+secondsNewTimer\r\n document.getElementById(\"timer\").innerHTML = format\r\n}", "function minus1() {\n \n pomoTimer = pomoTimer - 1;\n document.getElementById(\"counter\").innerHTML= pomoTimer;\n document.getElementById(\"notification\").innerHTML = pomoTimer + \" Minutes Left!\";\n if(pomoTimer <= 0) {\n\t clearTimer();\n\t switchTimerOff();\n\t setBreakTimer();\n\t \n }\n }", "function updateTimer(){\r\n timer--\r\n $('.timer').text(`Time: ${timer}`)\r\n if(timer <= 0){\r\n endGame()\r\n }\r\n}", "createTimer() {\n\t\t// set initial in seconds\n\t\tthis.initialTime = 0;\n\n\t\t// display text on Axis with formated Time\n\t\tthis.text = this.add.text(\n\t\t\t16,\n\t\t\t50,\n\t\t\t\"Time: \" + this.formatTime(this.initialTime)\n\t\t);\n\n\t\t// Each 1000 ms call onEvent\n\t\tthis.timedEvent = this.time.addEvent({\n\t\t\tdelay: 1000,\n\t\t\tcallback: this.onEvent,\n\t\t\tcallbackScope: this,\n\t\t\tloop: true,\n\t\t});\n\t}", "timer(key, cb, timing) {\n // always clear dupes\n if (timers[key]) {\n clearTimeout(timers[key]);\n delete timers[key];\n }\n\n if (!cb) {\n return null;\n }\n\n if (timing) {\n timers[key] = setTimeout(cb, timing);\n }\n\n return timers[key];\n }", "function setupDescriptionObserver(timerId){\n // Show description form when user clicks on timer description\n $('#timer-' + timerId + '-description-text').on('click', (e) => {\n $(e.target).hide();\n const form = $('#timer-' + timerId + '-description-form');\n form.show();\n form.find('input').focus();\n\n // When user clicks somewhere else hide the form and show description again\n form.on('focusout', () => {\n form.hide();\n $(e.target).show();\n });\n\n replaceTimerOnSuccess(timerId, 'timer-description-form');\n });\n}", "function startTimer() {\n clearInterval(countdownTimer);\n timeRemaining = timerLength[activeRoundNumber-1];\n postMessageToDisplay({\"message\":\"timerStarted\", \"seconds\":timeRemaining});\n if (timeRemaining == 0) {\n document.getElementById(\"game-timer-cell\").innerHTML = `Unlimited time`;\n return\n }\n document.getElementById(\"game-timer-cell\").innerHTML = `<strong>${timeRemaining}</strong> seconds left`;\n countdownTimer = setInterval(function() {\n timeRemaining -= 1;\n document.getElementById(\"game-timer-cell\").innerHTML = `<strong>${timeRemaining}</strong> seconds left`;\n if (timeRemaining < 0) {\n clearInterval(countdownTimer);\n document.getElementById(\"game-timer-cell\").innerHTML = \"<strong>OUT OF TIME</strong>\";\n postMessageToDisplay({\"message\":\"outOfTime\"});\n }\n }, 1000);\n}", "function breakTimerFive() {\n pending = false;\n pauseTimer();\n resetTimerHelper();\n document.getElementById('timer').innerText = \"5:00\";\n}", "function startGameTimer(){\n var timer = setInterval(() => {\n console.log(GMvariables.timerSecs);\n $(\"#timer\").text(GMvariables.timerSecs);\n if(GMvariables.timerSecs == 0){\n $(\"#timer\").text(\"Go\");\n clearInterval(timer);\n setTimeout(() => {\n $(\"#timer\").css(\"display\", \"none\");\n reset();\n changePositionOfElement();\n headerUpdater();\n }, 1000);\n }\n GMvariables.timerSecs -= 1;\n }, 1000);\n \n}", "function startTimer() {\r\n\tif ($('#time').length > 0) {\r\n\t\tvar presentTime = $('#timer').html();\r\n\t\tvar timeArray = presentTime.split(/[:]+/);\r\n\t\tvar m = timeArray[0];\r\n\t\tvar s = checkSecond((timeArray[1] - 1));\r\n\t\tif (s == 59) {\r\n\t\t\tm = m-1;\r\n\t\t}\r\n\t\t$('#timer').html(m + \":\" + s);\r\n\t\tif (m != 0 || s != 0) {\r\n\t\t\tsetTimeout(startTimer, 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$('#book-the-hub').hide();\r\n\t\t}\r\n\t}\r\n}", "function resetedTimer(timer) {\n\t\tconst id = timer.id;\n\t\tconst reset = document.querySelector(id + 'Reset')\n\t\treset.remove();\n\t\tconst stop = document.querySelector(id + 'Stop')\n\t\tstop.remove();\n\n\t\tconst cutId = id.substring(1);\n\t\tconst buttons = document.getElementById(cutId + \"Buttons\")\n\n\t\tconst start = new controlButton(timer, \"Start\");\n\n\t\ttimer.resetTimer();\n\n\t\tbuttons.appendChild(start);\n\n\t}", "function Timer (options) {\n\toptions = options || {};\n\tthis.timerContainerSelector = options.timerContainer || '[data-timer]';\n\tthis.timerContainer = document.querySelector(this.timerContainerSelector);\n\n\tthis.time = options.startTime || 0;\n\tthis.changeTimeInterval = options.changeTimeInterval * 1000 || 1000;\n\tthis.isRunning = false;\n\n\tthis.countdownIntervalId;\n\tthis.MILLIS_PER_SECOND = 1000;\n\n\tthis.timeDisplay = this.timerContainer.querySelector('[data-time-display]');\n\tthis.incrementElem = this.timerContainer.querySelector('[data-time-changer=increment]');\n\tthis.decrementElem = this.timerContainer.querySelector('[data-time-changer=decrement]');\n\tthis.startElem = this.timerContainer.querySelector('[data-start]');\n\tthis.stopElem = this.timerContainer.querySelector('[data-stop]');\n}", "function setupTimerButtonObservers(timerId){\n // Handle updating timer info when started / stopped\n $('#timer-controls-' + timerId + ' a[data-remote]').on('ajax:success', (event, data) => {\n const timerContainer = $('#timer-container-' + data.id);\n\n // Update timer data from response\n timerContainer.attr('data-start-time', new Date(data.start_time).getTime()/1000);\n timerContainer.attr('data-time-elapsed', data.time_elapsed);\n timerContainer.attr('data-timer-active', data.active);\n\n // Update time elapsed\n setTimeElapsed(data.id, data.time_elapsed);\n\n // setTimerButtonVisibility();\n updateButtons(data.id, data.active);\n });\n}", "function stopTimer() {\n if (timerId != 0) {\n clearInterval (timerId);\n timerId = 0;\n }\n}", "function addTime() {\n timer = timer + 30;\n}", "function timer() {\r\n\ttimerId = window.setInterval(\"updateTime()\", 1000);\r\n}", "function timerStart(){\n\t\n\t\t\n\t}", "timer() {\r\n // Check first if its not running, Note that we set it to null\r\n if (typeof (this.interval) === 'number')\r\n return;\r\n\r\n // Timestamp in millisecond\r\n const now = Date.now();\r\n // Seconds when the test duration is done (60 seconds) converted to millisecond\r\n const done = now + this.duration * 1000;\r\n // Display the timer before interval run\r\n _timer.innerHTML = `${this.duration}<span class=\"small\">s</span>`;\r\n // Set interval\r\n this.interval = setInterval(() => {\r\n // Get seconds left. Note that we ran Date.now() again to update the time\r\n const secondsLeft = Math.round((done - Date.now()) / 1000);\r\n // Display the timer in DOM again \r\n _timer.innerHTML = `${secondsLeft}<span class=\"small\">s</span>`;\r\n // Stop when reach 0 and call finish function\r\n if (secondsLeft === 0) {\r\n this.stop();\r\n this.finish();\r\n }\r\n }, 1000);\r\n }", "function flag_now_timeout() {\n document.getElementById('time_td').innerHTML = date_str();\n clearInterval(now_timeout_timer);\n now_timeout_timer = setInterval(flag_now_timeout, NOW_TIMEOUT_INTERVAL);\n}", "function startTimer(timeLimit) {\n let timeLeft = timeLimit; \n\n document.getElementById(\"countdown-timer\").innerHTML = \n `<svg class = \"timer\" viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class = \"timer-circle\">\n <circle class = \"timer-elapsed\" cx = \"50\" cy = \"50\" r = \"45\" />\n </g>\n </svg>\n <span id = \"timer-label-id\" class = \"timer-label\">\n ${formatTime(timeLeft)}\n </span>`;\n // document.getElementById(\"countdown-timer\").innerHTML = \n // `<span class = \"circle\"></span>\n // <span id = \"timer-label-id\" class = \"timer-label\"> ${formatTime(timeLeft)}</span>`;\n\n let timePassed = 0; \n timerInterval = setInterval(function() {\n if (timeLeft <= 0) clearInterval(timerInterval);\n\n timePassed++; \n timeLeft = timeLimit - timePassed; \n\n document.getElementById(\"timer-label-id\").innerHTML = formatTime(timeLeft);\n }, 1000)\n return timerInterval;\n}", "function logic(){\n //adds one second to clock\n\n\n\n if(add !== 0 && add >= 10 && add < 60 && timer25 !== 0){\n $('#timer').html(timer25 + ':' +add);\n add = add - 1;\n } else if(add == 00 && timer25 !== 0){\n add = 59;\n timer25 = timer25 -1;\n $('#timer').html(timer25 + ':' +add);\n } else if(add !== 0 && add > 0 && add < 10 && timer25 !== 0){\n $('#timer').html(timer25 + ':0' +add);\n add = add - 1;\n }\n // everytime logic is called, set timeout delay's console - log by one second.\n t = setTimeout(logic, 1000);\n console.log(timer25);\n\n }", "function resetTimer(id) {\n\tdebug(\"resetTimer(\" + id + \")\");\n\tclearTimeout(timers[id]);\n\ttimers[id] = setTimeout(function() {\n\t\tsendGoodbye(id);\n\t}, TIMEOUT_DURATION);\n}", "function timeoutTimer() {\n\tTIMEOUT_COUNTER--;\n\tif(TIMEOUT_COUNTER < 0) {\n\t\tclearInterval(TIMEOUT_TIMER);\n\t\tdisableButtons(false);\n\t\tshowFouls(true);\n\n\t\treturn;\n\t}\n\n\tsetTimeoutTimer(TIMEOUT_COUNTER);\n}", "function updateTimer() {\n //if the timer reaches 0, end the quiz and stop the timer\n if (timer < 0.1) {\n clearInterval(interval);\n endQuiz();\n return;\n }\n //otherwise increment time and change DOM\n timer -= 0.1;\n $timer.text(\"Timer: \" + timer.toFixed(1));\n }" ]
[ "0.70178294", "0.6563851", "0.6534657", "0.64944714", "0.646196", "0.63344854", "0.62769777", "0.6259683", "0.6190972", "0.61873555", "0.61490804", "0.6144597", "0.61356187", "0.6126994", "0.6050897", "0.6045961", "0.6030836", "0.5978928", "0.59745365", "0.59099877", "0.58996624", "0.58989984", "0.5880404", "0.5865394", "0.5835862", "0.5827558", "0.5821827", "0.58195424", "0.5812806", "0.5802904", "0.5756458", "0.57542646", "0.57518446", "0.57500535", "0.57499313", "0.57493925", "0.57449895", "0.5739442", "0.5735944", "0.57353586", "0.57289475", "0.571531", "0.57151747", "0.57115835", "0.5702404", "0.57023203", "0.57013506", "0.569908", "0.5692965", "0.5691874", "0.56885517", "0.5688342", "0.5679421", "0.5679421", "0.567843", "0.5672884", "0.56686157", "0.5666642", "0.5666032", "0.5660716", "0.5655416", "0.56493104", "0.56443244", "0.5638485", "0.5634842", "0.56346864", "0.56338674", "0.56331885", "0.5631042", "0.5629021", "0.56268215", "0.5622814", "0.561686", "0.5615126", "0.5611867", "0.5604513", "0.56009024", "0.55981547", "0.5579228", "0.55778766", "0.5574441", "0.556898", "0.5564281", "0.55619246", "0.55591154", "0.5554488", "0.5552725", "0.5552066", "0.55518997", "0.5549158", "0.55488116", "0.55388516", "0.5538676", "0.55369663", "0.5536903", "0.5531141", "0.55277073", "0.5525109", "0.5523564", "0.55212116" ]
0.7397024
0
overlay directly overlay seeMore button "show info" closeOverlay cross "hidde info"
constructor(overlay, seeMore, closeOverlay){ this.overlay = document.querySelector(overlay); this.seeMore = document.querySelector(seeMore); this.closeOverlay = document.querySelector(closeOverlay); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewMoreFalcon() {\n var moreInfo = document.getElementById(\"falconHidden\");\n var buttonText = document.getElementById(\"falconMore\");\n if (moreInfo.style.display === \"none\") {\n moreInfo.style.display = \"block\";\n buttonText.textContent = \"VIEW LESS\"\n } else {\n moreInfo.style.display = \"none\";\n buttonText.textContent = \"VIEW MORE\"\n }\n }", "function toggleInfo() {\n if (infoContainer.style.display === 'none') {\n infoContainer.style.display = 'block';\n infoBtn.innerText = 'Less Info';\n infoContainer.innerText = info;\n } else {\n infoContainer.style.display = 'none';\n infoBtn.innerText = 'More Info';\n infoContainer.innerText = '';\n }\n }", "function showOverlay() {\n $overlay.show();\n checkBuyable();\n checkActiveCross();\n checkMilestones();\n menuVisible = true;\n }", "function showOverlay() {\n getId('overlayContainer').style.display = \"block\";\n getId('quitOverlay').style.display = \"block\";\n getId('buttonLeft').style.display = \"block\";\n getId('buttonRight').style.display = \"block\";\n}", "function hideInfo() {\n\n infoContainer.style.display = 'none';\n infoBtn.innerText = 'More Info';\n infoContainer.innerText = '';\n\n }", "function moreClose() {\n\t$.Wrapper.height = \"60dp\";\n\t$.moreOpen = false;\n}", "function moreInfo() {\n var infoWindowElem = $('.info-window');\n infoWindowElem.css('top', '0');\n infoWindowElem.css('height', '100vh');\n infoWindowElem.css('overflow', 'scroll');\n}", "close(){Overlay.overlayStack.closeOverlay(this.overlayElement);}", "function showOverlay() {\n addClass(overlay, showClass);\n reflow(overlay);\n}", "function expandInfo() {\n if(more.style.display === \"block\"){\n more.style.display = \"none\";\n }\n else{\n more.style.display = \"block\";\n }\n}", "toggleOverlay() {\n if (this.overlay) {this.overlayDiv.style.display = 'none'; this.overlay = false}\n else{\n this.overlayP.innerHTML = this.overlayText\n this.overlayDiv.style.display = 'block'; \n this.overlay = true}\n }", "function _fBeforeShow($overlay) {\n $overlay.find('.icon-button.top-right p').text('CLOSE');\n var $title = $('<div class=\"programs-overlay-title\">PROGRAMS & SERVICES</div>');\n var $searchBar = $('<div class=\"programs-overlay-searchbar\"></div>');\n var $searchIcon = $('<i class=\"ion-android-search\" title=\"Search\"></i>');\n $searchBar.html($searchIcon);\n $overlay.find('.popup-heading').html($title).append($searchBar);\n\n $overlay.find('.popup-text').html(); // TODO: add three guttered columns\n $overlay.find('.subheader').remove();\n $overlay.find('.red-button-container').remove();\n\n $overlay.addClass('fullscreen branch-filter-overlay');\n $overlay.find('.popup-window').addClass('fullscreen');\n }", "function headerGetHelpOpenCLose() { \n $('.header--get-help').on('click', function (e) {\n e.preventDefault();\n\n $(this).toggleClass('active');\n if ($(this).hasClass('active')) {\n $('.get-help-block').css({\n 'visibility': 'visible',\n 'opacity': '1'\n });\n $('.master-wrap--overlay').fadeIn(200);\n } else {\n $('.get-help-block').css({\n 'visibility': 'hidden',\n 'opacity': '0'\n });\n $('.master-wrap--overlay').fadeOut(200);\n }\n });\n\n $('.master-wrap--overlay').on('click', function (e) {\n e.preventDefault();\n\n $('.get-help-block').css({\n 'visibility': 'hidden',\n 'opacity': '0'\n });\n $('.master-wrap--overlay').fadeOut(200);\n\n $('.header--get-help').removeClass('active');\n });\n }", "openPanel() {\n this.overlay.openPanel();\n }", "function showOverlay(){\n\t\t\t$(\"#overlayContainer\").html('<div class=\"darkOverlay\"></div>');\n\t\t\t$(\".darkOverlay\").addClass(\"darkOverlay_on\");\n\t\t\toverlay=true;\n\t\t}", "function Overlay (main_element, options){\n}", "function overlay() {\r\n el = document.getElementById(\"overlay\");\r\n el.style.visibility = (el.style.visibility == \"visible\") ? \"hidden\" : \"visible\";\r\n }", "function show_more_project() {\n\t$('.canhcam-project-1 .wrapper-img figcaption .btn-more ').each(function () {\n\t\t$('.canhcam-project-1 .wrapper-img figcaption .detail .fullcontent').slideUp()\n\t\t$(this).on('click', (function () {\n\n\t\t\t// $('.canhcam-project-1 .wrapper-img figcaption .btn-more ').hide()\n\t\t\t$(this).parents('figcaption').find('.fullcontent').slideToggle()\n\t\t\t$(this).parents('figcaption').toggleClass('active');\n\t\t\t$(this).text('XEM THÊM');\n\t\t\t$('.canhcam-project-1 .wrapper-img figcaption.active .btn-more').text('THU GỌN');\n\t\t}))\n\t})\n}", "function onOverlay() {\n document.getElementById('overlay').style.display = 'block';\n}", "function on(){\n document.getElementById(\"overlay\").style.display = \"block\"\n }", "function on() {\n document.getElementById(\"overlay\").style.display = \"block\";\n }", "function onClickOverlay() {\n if (__WEBPACK_IMPORTED_MODULE_2__context__[\"a\" /* context */].top) {\n var vm = __WEBPACK_IMPORTED_MODULE_2__context__[\"a\" /* context */].top.vm;\n vm.$emit('click-overlay');\n\n if (vm.closeOnClickOverlay) {\n if (vm.onClickOverlay) {\n vm.onClickOverlay();\n } else {\n vm.close();\n }\n }\n }\n}", "function showDetails(e){\r\n\tif(bool==false){\r\n\t\tvar extract_hiddenId = e.substring(e.indexOf(\":\")+1);\r\n\t\tdocument.getElementById(extract_hiddenId).style.display=\"block\";\r\n\t\tdocument.getElementById(e).innerHTML=\"Show Less\";\r\n\t\tbool=true;\r\n\t}else{\r\n\t\tvar extract_hiddenId = e.substring(e.indexOf(\":\")+1);\r\n\t\tdocument.getElementById(extract_hiddenId).style.display=\"none\";\r\n\t\tdocument.getElementById(e).innerHTML=\"Show More\";\r\n\t\tbool=false;\r\n\t}\t\r\n}", "function openClose() {\n\t\t$this = $(this);\n\t\t\n\t\tvar entry = $(this).prev('.entry-content');\n\t\tentry.find('.content').toggle();\n\t\tentry.find('.excerpt.short').toggle();\n\t\t\n\t\tvar text = $this.text() == 'More' ? 'Less' : 'More';\n\t\t$this.text(text);\n\t}", "function on() {\n document.getElementById('overlay').style.display = \"block\";\n}", "toggleOverlay(){\n this.overlay = document.querySelector(\".background-overlay\");\n (this.overlay.classList.contains(\"dis-none\"))?this.overlay.classList.remove(\"dis-none\"):this.overlay.classList.add(\"dis-none\");\n this.overlay.addEventListener(\"click\", (e)=>{\n e.preventDefault();\n this.overlay.classList.add(\"dis-none\");\n [\"file\",\"rotate\",\"brush\",\"outline\",\"fills\",\"size\"].forEach(e=> {\n this.listShow = document.querySelector(`.${e}-list`);\n this.listShow.classList.add(\"dis-none\"); \n this.listShow.classList.remove(\"dis-grid\");\n }) \n })\n }", "displayMoreInformationPopup (item) {\n $(item).popup('show')\n }", "function on() {\n document.getElementById(\"overlay\").style.display = \"block\";\n}", "addOverlay(overlay) {\n this.overlay = overlay;\n }", "show() {\n super.show();\n this.overlay.classList.remove(\"hidden\");\n blurBaseElements(this);\n }", "function overlayOn() {\n document.getElementById(\"overlay\").style.display = \"block\";\n}", "function overlayClick() {\n\toverlay.onclick = function() {\n\t\tcloseOverlay();\n\t}\n}", "showBack() {\n addclass(this._deckFrame, 'frame--reveal-info');\n }", "function showOverlay(){\n overlay.style.display = \"block\";\n}", "function showOverlay(id) {\n currentOverlay = id;\n\n if (id === null) {\n $('overlay').classList.add('hidden');\n return;\n }\n\n $('overlay-title').textContent = navigator.mozL10n.get(id + '2-title');\n $('overlay-text').textContent = navigator.mozL10n.get(id + '2-text');\n $('overlay').classList.remove('hidden');\n}", "function on() \n{\n document.getElementById(\"overlay\").style.display = \"block\";\n}", "showTransparentOverlay() {\n this.$transparentOverlay.show();\n }", "function onClick(ev) {\n if (ev.target.id === overlayId) overlayOff();\n}", "function openSearch() {\n document.getElementById(\"myOverlay\").style.display = \"block\";\n}", "function on() {\n $('.overlay').css('display', 'block');\n}", "function showOverlay() {\n player.overlay({\n content: overlayContent,\n overlays: [{\n start: overlayOptions.start,\n align: overlayOptions.align\n }]\n });\n // handler for timeupdate events\n player.on('timeupdate', endOverlay);\n }", "function closeSearch() {\n document.getElementById(\"myOverlay\").style.display = \"none\";\n \n }", "function on() {\n document.getElementById(\"overlay\").style.display = \"block\";\n}", "function on() {\n document.getElementById(\"overlay\").style.display = \"block\";\n}", "function moreInfo(e) {\n e.preventDefault();\n var color = document.getElementById(\"lost\").style.backgroundColor;\n id = $(this).closest('.individual').attr('id');\n\n // display or hide information in span\n if (clicked == 0) {\n $(\"#\" + id + \" span\").css('display', 'block');\n $(\"#\" + id + \" button\").html(\"<i class='fa fa-angle-up'></i>\");\n clicked = 1;\n } else {\n $(\"#\" + id + \" span\").css('display', 'none');\n $(\"#\" + id + \" button\").html(\"<i class='fa fa-angle-down'></i>\");\n clicked = 0;\n }\n}", "close() {\n this.overlayManager.close(this.overlayName);\n }", "function hideOverlay() {\n getId('levelOverlay').style.display = \"none\";\n getId('quitOverlay').style.display = \"none\";\n getId('buttonLeft').style.display = \"none\";\n getId('buttonRight').style.display = \"none\";\n getId('playAgain').style.display = \"none\";\n}", "function overlay() {\n if (menu.classList.contains('open')) {\n menu.classList.remove('open');\n menuOverlay.classList.remove('open');\n menuOverlay.innerHTML = '';\n escapeButton();\n } else {\n menu.classList.add('open');\n menuOverlay.classList.add('open');\n escapeButton();\n for (var i = 0; i < itemText.length; i++) {\n addText(itemText[i]);\n }\n }\n}", "function onhelpclick() {\r\n\tif (helpON == 0) {\r\n\t\tvar overlay_width = viewWidth + 'px';\r\n\t\tvar overlay_height = viewHeight + 'px';\r\n\r\n\t\t// update help overlay sizes\r\n\t\tdocument.getElementById(\"help\").style.width = overlay_width;\r\n\t\tdocument.getElementById(\"help\").style.height = overlay_height;\r\n\t\t\r\n\t\t// code for opening help overlay\r\n\t\tdocument.getElementById(\"help\").style.display = \"block\";\t\t\r\n\t}\r\n\tdocument.getElementById(\"help-close\").addEventListener(\"click\", function() {\r\n\t\tdocument.getElementById(\"help\").style.display = \"none\";\r\n\t });\r\n}", "function addToggleOverlay(btnToggle, imgOverlay){\r\n btnToggle.addEventListener('click', (e) => {\r\n e.preventDefault();\r\n imgOverlay.classList.toggle('hidden-html-gen');\r\n });\r\n}", "function clickMe (e) {\n overlay.classList.add(\"hidden\");\n}", "function overlayDetector(event) {\n if (!event.popupOpening\n && $(event.target).closest('#success-story').length === 0\n && $(event.target).closest('#thank-you-popup').length === 0) {\n setPopupDisplay(document.getElementById('success-story'), 'none');\n setPopupDisplay(document.getElementById('thank-you-popup'), 'none');\n }\n}", "function showChatHistoryOverlay () {\n document.getElementById('js-accessory-overlay').style.display = \"block\";\n document.getElementById(\"js-chat-history-area\").style.display = \"block\";\n}", "function clickItemForMoreInfo(event) {\n this.classList.toggle(\"active\");\n var content = this.parentElement.parentElement.children[1];\n console.log(content);\n if (content.style.maxHeight){\n content.style.display = 'none';\n content.style.maxHeight = null;\n } else {\n content.style.display = 'block';\n content.style.maxHeight = content.scrollHeight + \"px\";\n }\n}", "function expandInfo() {\n if(aboutContent.style.display === \"block\"){\n aboutContent.style.display = \"none\";\n }\n else{\n aboutContent.style.display = \"block\";\n }\n}", "toggleOverlay(index, y, detailsHeight, entry, rowItems) {\n if (this.openOverlays.some((o) => o.index === index)) {\n this.closeOverlay(index, detailsHeight, rowItems);\n }\n else {\n this.openOverlay(index, y, detailsHeight, entry, rowItems);\n }\n }", "function displayOverlayButton() {\n if (Modernizr.touch) {\n\n // show the close overlay button\n $(\".close-overlay\").removeClass(\"hidden\");\n // handle the adding of hover class when clicked\n $(\".img\").click(function (e) {\n if (!$(this).hasClass(\"hover\")) {\n $(this).addClass(\"hover\");\n }\n });\n // handle the closing of the overlay\n $(\".close-overlay\").click(function (e) {\n e.preventDefault();\n e.stopPropagation();\n if ($(this).closest(\".img\").hasClass(\"hover\")) {\n $(this).closest(\".img\").removeClass(\"hover\");\n }\n });\n } else {\n // handle the mouseenter functionality\n $(\".img\").mouseenter(function () {\n $(this).addClass(\"hover\");\n })\n // handle the mouseleave functionality\n .mouseleave(function () {\n $(this).removeClass(\"hover\");\n });\n }\n}", "function overlay_on(){\n document.getElementById(\"overlay_on\").style.display = \"block\";\n}", "function enableOverlay() {\n\t\tvar el = document.getElementById(\"overlay\");\n\t\tvar ed = document.getElementById(\"editProduct\");\n\t\tel.style.visibility = (el.style.visibility == \"visible\") ? \"hidden\" : \"visible\";\n\t\ted.style.display = (ed.style.display == \"block\") ? \"none\" : \"block\";\n\t}", "showMiddleLayer() {\n super.show();\n this.secondLayerOverlay.classList.remove(\"hidden\");\n if (!this.detailPostPopup.classList.contains(\"hidden\")) {\n this.detailPostPopup.classList.add(\"blur\");\n }\n if (this.menuView.classList.contains(\"open\")) {\n this.menuView.classList.add(\"blur\");\n }\n }", "function makeDescButtonMoreVisible(descBtn) {\n descBtn.appendChild ($(\"<span class='board-header-btn-text'>Project info</span>\")[0]);\n }", "function overlayClick(event) {\n if (event.target === modal) {\n toggleModal();\n }\n }", "function moreReviewsBtn() {\n $(\"#more-reviews\").click(function () {\n $(\"#hidder\").toggle(2000, function () {\n\n // second button at bottom to hide reviews\n $(\"#hide-reviews\").click(function () {\n $(\"#hidder\").hide(2000, function () {\n });\n })\n });\n });\n }", "function showMoreHighScores() {\n\n // Remove the See More Option\n UI.displaySeeMore(false);\n\n // Show all the high scores \n UI.displayHighScores(highScoreConfig.total);\n\n // Add the See Less Option\n UI.displaySeeLess(true);\n}", "function openWomanShoes() {\n products.style.display = \"flex\"\n products.style.zIndex = \"3\"\n overlay.style.opacity = \"1\"\n overlay.style.zIndex = \"2\"\n overlay.addEventListener(\"click\", () => {\n overlay.style.opacity = \"0\"\n overlay.style.zIndex = \"0\"\n products.style.display = \"none\"\n })\n}", "function MoreInfo(props) {\n const [ showInfo, setShowInfo ] = useState(false);\n\n function toggleShowInfo() {\n return setShowInfo(!showInfo);\n };\n\n function renderInfoContent() {\n if(showInfo === false) {\n return(\n <button\n className='InfoButton'\n onClick={toggleShowInfo}\n >\n More Info\n </button>\n );\n } else {\n return(\n <div\n className='ExpandedInfo'\n >\n <button\n className='InfoButton'\n onClick={toggleShowInfo}\n >\n Less Info\n </button>\n <p>\n High: {Math.round(props.weatherReport.daily[0].temp.max)} <br/>\n Low: {Math.round(props.weatherReport.daily[0].temp.min)} <br/>\n Morning: {Math.round(props.weatherReport.daily[0].temp.morn)} <br/>\n Midday: {Math.round(props.weatherReport.daily[0].temp.day)} <br/>\n Evening: {Math.round(props.weatherReport.daily[0].temp.eve)} <br/>\n Night: {Math.round(props.weatherReport.daily[0].temp.night)} <br/>\n Sunrise:\n Sunset:\n </p>\n </div>\n );\n };\n };\n\n return(\n <div\n className='MoreInfo'\n >\n {renderInfoContent()}\n </div>\n );\n}", "function dialogOn() {\n document.getElementById(\"overlay\").style.display = \"block\";\n}", "function closeSearch() {\n document.getElementById(\"myOverlay\").style.display = \"none\";\n}", "function closeSearch() {\n document.getElementById(\"myOverlay\").style.display = \"none\";\n}", "function ShowOverlay()\r\n{\t\t\r\n\tvar overlay = document.createElement('div');\r\n\toverlay[\"id\"] = \"overlay\";\r\n\toverlay[\"class\"] = \"overlay\";\r\n\toverlay[\"className\"] = \"overlay\";\r\n\toverlay.style.width = '100%';\r\n\toverlay.style.height = document.getElementsByTagName(\"body\")[0].offsetHeight;\r\n\toverlay.style.display = 'block';\r\n\toverlay.style.position='absolute';\r\n\toverlay.style.top = getScrollXY()['y'];\r\n\t\r\n\t// if the user has specified a redirect location, another popUp close action or nothing:\r\n\tif ( window.popUpCloseRedirect ) overlay.onclick = function(){ window.location.href = window.popUpCloseRedirect; }; \t\t\r\n\telse if( window.popUpCloseAction )overlay.onclick = window.popUpCloseAction; \r\n\telse overlay.onclick = function(){ HidePopup( window.popUpID ); HideOverlay(); };\r\n\t\r\n\tdocument.getElementsByTagName(\"body\")[0].appendChild(overlay);\r\n}", "moreButton(e) {\n this.setState({\n isHidden: false\n })\n }", "closeOverlay() {\n this.setState({\n showAddEditOverlay: false,\n showDeleteOverlay: false,\n editData: {},\n modeEdit: false,\n projectId: null\n });\n }", "function returntomeni() {\r\n if ($(\".overlay-content\").css(\"display\", \"none\")) {\r\n $(\".closebtn\").removeAttr(\"onclick\");\r\n $(\".closebtn\").click(function () {\r\n $(\".newcntnt\").fadeOut(400);\r\n $(\".overlay-content\").show(500);\r\n $(\".overlay-content\").css(\"display\", \"block\");\r\n if ($(\".overlay-content\").css(\"display\", \"block\")) {\r\n $(\".closebtn\").attr(\"onClick\", \"fclose()\");\r\n }\r\n });\r\n }\r\n}", "function onLoadMore() {\n loadMoreBtnApi.disable();\n showSearchResult();\n}", "function toggleExtended(el){\n\t\t\t\tvar togglePanel = $('#extendedNotePanel').find('ul')\n\t\t\t\tif(togglePanel.is(':visible')){\n\t\t\t\t\tel.html('<span >&#9658;</span> <span class=\"linkdec\">More Options</span>');\n\t\t\t\t}else{\n\t\t\t\t\tel.html('<span >&#9660;</span> <span class=\"linkdec\">Fewer Options</span>');\t\n\t\t\t\t}\n\t\t\t\ttogglePanel.toggle();\n\t\t\t\n\t\t}", "function hideOverlay() {\n $overlay.hide();\n menuVisible = false;\n }", "function showMoreDes(event) {\n\tconsole.log(event);\n\tlet button = event.target;\n\tbutton.style.display = \"none\";\n\tevent.path[1].style.maxHeight = \"100%\";\n}", "function closeOverlay() {\r\n $('.ev-overlay').on('click', function() {\r\n $(this).removeClass('open').fadeOut();\r\n $('body').removeClass('ev-overlay-open');\r\n });\r\n \r\n $('.ev-overlay-content').on('click', function(event) {\r\n event.stopPropagation();\r\n });\r\n $('.ev-vote-cancel').on('click', function() {\r\n $('.ev-overlay').removeClass('open').fadeOut();\r\n $('body').removeClass('ev-overlay-open');\r\n });\r\n $('.ev-vote-yes').on('click', function() {\r\n $('.ev-overlay').removeClass('open').fadeOut();\r\n $('body').removeClass('ev-overlay-open');\r\n });\r\n}", "function showDesc(){\n\tgetOverlay();\n\n\t$(\"#flyin\").show();\n\t$(\"#flyout\").show();\n\n\t$(\".independent\").show();\n\t$(\".independent\").animate({\n\t\t'right' : '0'\n\t}, 100, \"swing\");\n\n\t$(\"#flyout\").animate({\n\t\t'right' : '940'\n\t}, 130, \"swing\");\n}", "function closeInfographic(obj,e){\n closeBtnClicked = true;\n prevClickedDiv = null;\n removeExpandStyle(obj.parentElement,obj.parentElement.id);\n if(screenMedium.matches)\n document.getElementById('container-sliding-panels').style.height = mediumDeviceInfoDivHeight; \n else\n document.getElementById('container-sliding-panels').style.height = largeDeviceInfoDivHeight; \n removeButtonStyle(document.getElementById('top-menu-sliding-panel'));\n removeButtonStyle(document.getElementById('bottom-menu-sliding-panel'));\n}", "function displayInfo(evt)\n {\n // Repérer la feature sous la souris\n var coord= map.getEventPixel(evt.originalEvent);\n var feature = map.forEachFeatureAtPixel(coord, function(feature, layer) {\n return feature;\n });\n\n // si pas de feature on cache le popup & retourne\n if( !feature){\n overlay.setPosition(undefined);\n popup_closer.blur();\n return;\n }\n\n // Si c'est un cluster, on affiche le popup\n if ( feature.get('features') && feature.get('features').length > 0) {\n\n // chaine de caractère du popup\n var str=\"\";\n popup_content.innerHTML= \"\";\n\n // feature contenues dans le cluster\n var features = feature.get('features');\n\n // on parcourt les feature pour les ajouter au popup\n var index= 0;\n var button= null;\n for(var i = 0; i < features.length; i++) {\n\n //id de route représentée par la feature\n id= features[i].get('id_bdd');\n\n // Bouton avec le nom de la route\n button = document.createElement(\"p\");\n button.id = id;\n button.className = \"popup_button\";\n button.innerHTML = liste_routes[id]['nom_route'];\n\n // aajout du parent au popup\n popup_content.appendChild(button);\n\n // lors du click sur un bouton, fonction\n button.onclick= function() {\n\n // on cache le popup\n overlay.setPosition(undefined);\n\n // enregistrement du PI actif\n id_PI_active= this.id; // pour casser les pointeurs\n\n // émission d'un évènement update\n $rootScope.$emit(updateEvent);\n };\n\n // on s'arrête à 4 routes contenues dans le popup\n index++;\n if( index == 5) {\n // bouton\n button = document.createElement(\"p\");\n button.className = \"popup_button\";\n button.innerHTML = '...';\n\n // ajout du bouton au popup\n popup_content.appendChild(button);\n\n break;\n }\n }\n\n // affichage du popup\n overlay.setPosition(evt.coordinate);\n }\n\n //si c'est une feature type point, renvoie un event avec l'id\n else if (feature.getGeometry().getType() == \"Point\")\n {\n // reset du popup\n var str=\"\";\n popup_content.innerHTML= \"\";\n\n // récupération de l'id du point, du type et des images\n var id= feature.get('id_bdd');\n var type= feature.get('type_bdd');\n var img_src= feature.get('images_bdd');\n var index_image= feature.get('index_image');\n\n // si pas d'id, on retourne\n if( !id || id == -1)\n return;\n\n // enregistrement du PI actif\n id_PI_active= id;\n\n // div contenant l'en tête\n var en_tete= document.createElement(\"div\");\n en_tete.className = \"popup_en_tete\";\n\n // texte avec le type\n var titre = document.createElement(\"span\");\n titre.className = \"popup_titre\";\n titre.innerHTML= type;\n\n // ajout du titre à l'en tête\n en_tete.appendChild(titre);\n\n // ajout de l'en tête au popup\n popup_content.appendChild(en_tete);\n\n // récupération de l'image si besoin\n if( type == 'photos'){\n // image dans une div\n var div= document.createElement(\"div\");\n div.className= \"popup_image\"\n var img= document.createElement(\"img\");\n img.id = index_image;\n img.src= \"http://seame.alwaysdata.net/\";\n img.src+= img_src[0];\n div.appendChild(img);\n popup_content.appendChild(div);\n\n // lors du click sur l'image, fonction\n img.onclick= function() {\n\n // enregistrement du PI actif\n index_image_active= this.id;\n\n // émission d'un évènement update: clic image\n $rootScope.$emit(imageEvent);\n };\n }\n\n // affichage du popup\n overlay.setPosition(evt.coordinate);\n\n // émission d'un évènement update\n $rootScope.$emit(updateEvent);\n }\n }", "function offOverlay() {\n document.getElementById('overlay').style.display = 'none';\n}", "openHotspot(hotspot,details){// get everything flat\nvar children=details.shadowRoot.querySelector(\"#desc\").querySelector(\"slot\").assignedNodes({flatten:!0});let c=document.createElement(\"div\");// append clones of the children we found\nfor(var child in children){c.appendChild(children[child].cloneNode(!0))}const evt=new CustomEvent(\"simple-modal-show\",{bubbles:!0,cancelable:!0,detail:{title:details.getAttribute(\"label\"),elements:{content:c},invokedBy:this,clone:!1}});this.dispatchEvent(evt);this.__activeHotspot=hotspot;this.resetHotspots();hotspot.classList.add(\"selected\")}", "function ShowAbstract(key, px, py) {\n\tvar ol = \"#\".concat(key).concat(\"overlay\");\n\tvar dl = \"#\".concat(key).concat(\"dialog\");\n\t$(ol).show();\n\tif((px != 0) && (py !=0 )) {\n\t\t$(dl).css({left:px, top:py }).fadeIn(300);\n\t}else {\n\t\t$(dl).fadeIn(300);\n\t}\n\t\n}", "function showOverlay() {\n // if showing\n if (closeObjShowing) {\n push();\n // draken background\n fill(0, overlayAlpha);\n rect(width / 2, height / 2, width, height);\n // store the image based on id\n let closeObjImg = null;\n if (closeObjId === 2) {\n closeObjImg = CLOSE_CARD;\n } else if (closeObjId === 3) {\n closeObjImg = CLOSE_NEWSPAPER;\n } else if (closeObjId === 4) {\n closeObjImg = CLOSE_MANUAL;\n }\n // if not fading out\n if (!objMoveAway) {\n // if aniamtion not finished\n if (!objInPosition) {\n // opacity transition from 0 to 200\n overlayAlpha = lerp(overlayAlpha, 200, 0.1);\n // height transition from outside of screen to center\n objHeight = lerp(objHeight, height / 2, 0.1);\n // if reaches 199, animation is done\n if (overlayAlpha >= 199) {\n objInPosition = true;\n }\n }\n // if fading out\n } else {\n // if aniamtion not finished\n if (!objInPosition) {\n // opacity transition from 200 to 0\n overlayAlpha = lerp(overlayAlpha, 0, 0.1);\n // height transition from center to outside of the screen\n objHeight = lerp(objHeight, height + height / 2, 0.1);\n // if opacity is less than 1, animation is done\n if (overlayAlpha <= 1) {\n objInPosition = true;\n }\n }\n }\n // if stored image is not null, display it\n if (closeObjImg != null) {\n image(closeObjImg, width / 2, objHeight, ((height / 1.5) / closeObjImg.height) * closeObjImg.width, height / 1.5);\n }\n pop();\n }\n}", "function viewMore (myElt, btn) {\n var startIndex, j;\n for(let i=7; i < myElt.length; i++) {\n if (myElt.eq(i).hasClass('hide')) {\n startIndex=i;\n break;\n }\n }\n for(j=startIndex; j< startIndex + 4; j++) {\n myElt.eq(j).removeClass('hide');\n }\n if(j>=myElt.length) {\n btn.addClass('hide'); \n } \n }", "_makeOverlay() {\n return $('<div></div>')\n .addClass('reveal-overlay')\n .appendTo(this.options.appendTo);\n }", "function openPropertiesBox() {\n $('div#properties-overlay').css('height', $(document).height() + 500);\n $('div#properties-overlay').show('slow');\n}", "function _createOverlay() {\n // overlay when an element is clicked\n const overlay = document.createElement(\"div\");\n overlay.id = \"overlay\";\n\n const prevBtn = document.createElement(\"button\");\n const prevIcon = document.createElement(\"img\");\n prevIcon.classList.add(\"prev-control-icon\");\n prevIcon.src = \"./static/left-chevron.png\";\n prevBtn.appendChild(prevIcon);\n\n const nextBtn = document.createElement(\"button\");\n const nextIcon = document.createElement(\"img\");\n nextIcon.classList.add(\"next-control-icon\");\n nextIcon.src = \"./static/right-chevron.png\";\n nextBtn.appendChild(nextIcon);\n\n overlay.appendChild(prevBtn);\n overlay.appendChild(nextBtn);\n _addPrevControlAction(prevBtn);\n _addNextControlAction(nextBtn);\n document.body.prepend(overlay);\n }", "function CloseDesc() {\n detailContainer.animate({\n left: \"-100%\",\n }, 500, function() {\n detailContainer.css(\"display\", \"none\");\n });\n placesList.css(\"display\", \"block\");\n infoWindowArray[focusMarker].close();\n map.fitBounds(bounds);\n map.panTo(bounds);\n\n}", "function showChart(link) {\n\t//console.log('showing chart');\n\tvar el = document.getElementById(\"overlay\");\n\tvar oc = document.getElementById(\"overlayContent\");\n\tvar closeButton = document.getElementById(\"closeBtn\");\n\tvar chartPopUp = new PolylineInfoWindowControl(link);\n\n\tel.style.visibility = \"visible\";\n\tel.style.opacity = 1;\n\n\t//this is needed for IE9+ since opacity property doest work, instead ie uses filter\n\tel.style.filter = 'alpha(opacity=100)';\n\toc.appendChild(chartPopUp);\n}", "function showMoreDetails(e) {\n const curr_row = e.currentTarget;\n const expand_img = curr_row.querySelector('#expand');\n const details = curr_row.querySelector('.transaction-details');\n const toHide = curr_row.querySelectorAll('.value>span');\n if (curr_row.dataset.close === 'true') {\n //details are closed so we open them\n curr_row.dataset.close = 'false';\n expand_img.src = 'images/icons/expand_less.svg';\n details.classList.add('opened');\n for (let temp of toHide) temp.classList.add('open');\n } else {\n //details are opened so we close them\n curr_row.dataset.close = 'true';\n expand_img.src = 'images/icons/expand_more.svg';\n details.classList.remove('opened');\n for (let temp of toHide) temp.classList.remove('open');\n }\n}", "function openOverlay() {\n document.getElementById(\"fullOverlay\").style.width = \"100%\";\n document.getElementById(\"overlayTeam\").style.display = \"block\";\n document.getElementById(\"overlayProject\").style.display = \"none\";\n}", "function showMore(e) {\n let currentProject = projects.filter(\n (project) => project.title === e.parentElement.children[0].children[0].innerText,\n );\n [currentProject] = currentProject;\n const displayedText = e.parentElement.children[1].children[0];\n // if preview text is displayed, toggle to full text\n if (displayedText.innerText === getPreview(currentProject.description)) {\n displayedText.innerText = currentProject.description;\n e.innerText = 'Show less';\n // otherwise, toggle to preview text\n } else {\n displayedText.innerText = getPreview(currentProject.description);\n e.innerText = 'Show more';\n }\n}", "function toggleMoreLess() {\n\n\t\t\tif (!$nav_panels.children('.page_link:visible').hasClass('last')) {\n\t\t\t\t$nav_panels.children('.more').show();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$nav_panels.children('.more').hide();\n\t\t\t}\n\n\t\t\tif (!$nav_panels.children('.page_link:visible').hasClass('first')) {\n\t\t\t\t$nav_panels.children('.less').show();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$nav_panels.children('.less').hide();\n\t\t\t}\n\t\t}", "function setupOverlay() {\n objHeight = height + height / 2; // outside of the screen\n objInPosition = false;\n objMoveAway = false;\n}", "openOverlay(index, y, detailsHeight, entry, rowItems) {\n if (this.openOverlays.some((o) => o.index === index)) {\n return;\n }\n const self = this;\n const newOverlay = {\n defaultY: y,\n entry,\n index,\n onClose: () => {\n self.closeOverlay(index, detailsHeight, rowItems);\n },\n openTabIndex: 0,\n };\n this.openOverlays.push(newOverlay);\n this.openOverlays = this.openOverlays.sort((a, b) => a.index > b.index ? 1 : -1);\n this.renderOverlays(detailsHeight, rowItems);\n this.context.pubSub.publishToOverlayChanges({\n changedIndex: index,\n combinedOverlayHeight: self.getCombinedOverlayHeight(),\n type: \"open\",\n });\n }", "renderLoadMore() {\n const { isFetching, onLoadMoreClick } = this.props;\n return (\n <div className=\"load-more box-row\">\n <div className=\"see-more\">\n <h1 className=\"see-more-btn\"\n style={{ fontSize: '150%' }}\n onClick={onLoadMoreClick}\n disabled={isFetching}>\n {isFetching ? 'Loading more issues...' : 'see more issues'}\n </h1>\n </div>\n </div>\n );\n }", "function myFunction() {\n var show = document.getElementById(\"show\");\n var moreInfo = document.getElementById(\"more\");\n var btnInfo = document.getElementById(\"btn\");\n\n if (show.style.display === \"none\") {\n show.style.display = \"inline\";\n btnInfo.innerHTML = \"Show more\"; \n moreInfo.style.display = \"none\";\n } else {\n show.style.display = \"none\";\n btnInfo.innerHTML = \"Show less\"; \n moreInfo.style.display = \"inline\";\n }\n}", "function show(overlay) {\n document.getElementById(overlay).style.display = \"block\";\n}" ]
[ "0.6611223", "0.6574282", "0.6565525", "0.65614545", "0.649946", "0.648657", "0.6478878", "0.6437157", "0.6414701", "0.64052093", "0.6360753", "0.6330158", "0.6325318", "0.63181925", "0.6298709", "0.62806916", "0.6241217", "0.61726886", "0.61504227", "0.6112824", "0.61088246", "0.6073676", "0.6071186", "0.60569483", "0.6007248", "0.599934", "0.5997077", "0.5991816", "0.59915006", "0.5986608", "0.59824884", "0.59648746", "0.595729", "0.5954735", "0.5951934", "0.5951371", "0.5949644", "0.5943967", "0.5941881", "0.5936802", "0.5927969", "0.59234494", "0.59225076", "0.59225076", "0.59200734", "0.591879", "0.591766", "0.5916561", "0.59093446", "0.5904456", "0.59024423", "0.58981633", "0.58814657", "0.58778024", "0.5875466", "0.5859729", "0.58559555", "0.5843084", "0.5842361", "0.5831579", "0.58219326", "0.58218414", "0.5819529", "0.5814649", "0.581363", "0.5810734", "0.5808151", "0.5800346", "0.5800346", "0.5796545", "0.5782501", "0.578212", "0.578097", "0.5774439", "0.57587206", "0.5754348", "0.57435626", "0.57426775", "0.5738039", "0.5731219", "0.5731178", "0.5730672", "0.5724018", "0.57171077", "0.5711222", "0.5704841", "0.5702863", "0.5702309", "0.57015693", "0.56896806", "0.56894565", "0.56790584", "0.56735414", "0.5670054", "0.56636745", "0.5650776", "0.56502205", "0.5649311", "0.5646676", "0.56455094" ]
0.63589
11
your properties here, remember the constructor
constructor(newName,newLastName,newBirthDate){ this.name = newName; this.lastName = newLastName; this.birthDate = newBirthDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n\t this.properties = [];\n\t }", "constructor () {\r\n\t\t\r\n\t}", "function _construct()\n\t\t{;\n\t\t}", "constructor(props) {\n // TODO: add pitch\n super(props);\n this.init();\n }", "constructor(props)\n {\n super(props)\n\n }", "consructor() {\n }", "constructor() {\r\n // ohne Inhalt\r\n }", "constructor(props){\n //used to receive props and apply them to the appripriate location\n super(props)\n }", "constructor(props){\r\n\t\tsuper(props);\r\n\t}", "constructor(props) { //Genero al constructor para inicializar propiedas y variables\n super(props); //Declaramos super para adaptar las propiedades en React\n this.state = { //Declaramos los estados de las propiedades\n prop1: 0,\n prop2: 0,\n prop3: 0\n }; \n }", "constructor(props){\n\t\tsuper(props);\n\n\t}", "constructor(props) {\n this.name = props.name;\n this.nationality = props.nationality;\n }", "constructor() {\n // Data / properites / state\n // The difference between the properties and regular\n // variables is that the properies are encapsulated variables.\n this.name = null;\n this.age = null;\n }", "_initializeProperties() {}", "constructor(){\r\n\t}", "constructor(P_props)\n {\n super (P_props);\n }", "constructor() {\n super();\n this._init();\n }", "constructor(props) {\n\t\tsuper(props);\n\t}", "constructor(props) {\n\t\tsuper(props);\n\t}", "constructor() \n { \n \n\n }", "constructor(props) {\n super(props)\n this.cuisine = props.cuisine\n this.type = props.type\n }", "constructor(props) {\n super(props);\n // TODO\n }", "constructor(props) {\n super(props);\n // TODO\n }", "constructor(props) {\n super(props);\n //@TODO\n }", "constructur() {}", "constructor (){}", "constructor(data = {}) {\r\n //super(data);\r\n for (const prop in data) {\r\n this[prop] = data[prop];\r\n }\r\n }", "constructor(config){ super(config) }", "constructor(config){ super(config) }", "constructor () { super() }", "constructor() {\r\n super()\r\n this.init()\r\n }", "constructor(props) {\n // Call the parent constructor with the props object we automatically get\n super(props);\n }", "constructor(props) {\n super(props);\n }", "constructor( title, image, desc, price ) {\n this.title = title; // these fileds are called Property\n this.imageUrl = image;\n this.description = desc;\n this.price = price;\n }", "constructor(data = {}) {\n super(data);\n \n this.init(data);\n }", "constructor() {\n\n\t}", "constructor(){\n \n\n }", "constructor(){\r\n\r\n }", "constructor(data = {}) {\n //super(data);\n for (const prop in data) {\n this[prop] = data[prop];\n }\n }", "constructor() {\n }", "constructor(props){\n\t\tsuper(props);\n\t\tthis.pose = yogaData.getPoseById(props.step.id);\n\t\t// english_name\n\t\t// sanskrit_name\n\t\t// id\n\t\t// img_url\n\t}", "constructor() {\n this.age = 0;\n this.color = 'pink';\n this.food = 'jelly';\n }", "function MyConstructor(){\n\t\tthis.prop1 = \"Maxsuel\";\n\t\tthis.prop2 = \"Storch\";\n\t}", "init() {\n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n\t\t// ...\n\t}", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }" ]
[ "0.7340601", "0.7231188", "0.71833366", "0.71735567", "0.7137835", "0.71242106", "0.70871973", "0.7083722", "0.7034825", "0.7022215", "0.70178336", "0.7006535", "0.69997036", "0.69972163", "0.6995877", "0.6995616", "0.6978119", "0.6957174", "0.6957174", "0.6940146", "0.6933706", "0.6923919", "0.6923919", "0.6921464", "0.69084406", "0.6888358", "0.6882282", "0.6874249", "0.6874249", "0.68739504", "0.6868343", "0.6861613", "0.68534386", "0.6843017", "0.6840569", "0.683454", "0.68337023", "0.6824667", "0.682393", "0.6823029", "0.6812848", "0.6811451", "0.67979187", "0.6790557", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6777873", "0.6762699", "0.67612857", "0.67612857", "0.67612857", "0.67612857", "0.67612857", "0.67612857", "0.67612857", "0.67612857", "0.67612857", "0.67612857", "0.67612857", "0.67612857", "0.67612857", "0.67612857" ]
0.0
-1
FCC first and third solutions:
function fearNotLetter(str) { for(let i = 0; i < str.length; i++) { if (str.charCodeAt(i) != str.charCodeAt(0) + i) { return String.fromCharCode(str.charCodeAt(i) - 1); } } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fpb(angka1, angka2) \n{\n console.log('\\n', 'case for - FPB', angka1, angka2, '\\n ------------------------------------');\n\n var factorAngkaSatu = []\n var factorAngkaDua = []\n\n\n for (var x = 1; x<=angka1; x++)\n {\n if( angka1 % x === 0)\n {\n factorAngkaSatu.push(x)\n }\n }\n \n for (var x = 1; x<=angka2; x++)\n {\n if( angka2 % x === 0)\n {\n factorAngkaDua.push(x)\n }\n }\n \n // console.log(factorAngkaSatu)\n // console.log(factorAngkaDua)\n\n var commonFactor = []\n\n for (var x = 0; x < factorAngkaSatu.length; x++)\n {\n for (var y =0; y < factorAngkaDua.length; y++)\n {\n if( factorAngkaSatu[x] === factorAngkaDua[y])\n {\n commonFactor.push(factorAngkaSatu[x])\n }\n\n }\n\n }\n\n // console.log(commonFactor)\n \n var fpb = commonFactor[0]\n // console.log(fpb)\n \n if ( commonFactor.length === 1)\n {\n return fpb\n }\n else\n {\n\n for( var x = 1; x <= commonFactor.length-1; x++)\n {\n if( commonFactor[x] > fpb)\n {\n fpb = commonFactor[x]\n }\n }\n\n return fpb\n }\n\n}", "function hcf(){\nalert(\"To find the HCF of a set of numbers express each number as a product of its prime factors.To do so divide each number by the first prime factor which does not leave a remainder.Divide the result succesively using this prime factor until it starts leaving a remainder and then move to the next prime factor.Do this until you get 1 as the result.\");\nalert(\"For example find the HCF of 56 and 42.First express each number as a product of its prime factors.To express 52 first divide by 2. 2√56=28 next 2√28=14 next 2√14=7 next 7√7=1 hence 56=2×2×2×7.To express 42 also first divide by 2.That is 2√42=21 next 3√21=7 next 7√7=1 hence 42=2×3×7. Looking at the two numbers 2 and 7 are the common factors hence HCF=2×7=14.\");\n}", "function alg1(){\nalert(\"Sometimes we have to find the HCF and LCM of algebraic expressions.This depends on our ability to identify factors correctly\");\nalert(\"For example lets find the HCF and LCM of a²b,a³b² and a²b³.Now a and b are the common factors in the three terms.Use a and b with the lowest powers for HCF and those with the highest powers for LCM.In this case HCF=a²b(pick out the lowest power of each common factor.LCM=a³b³(pick out the highest power of each factor.)\");\nalert(\"Lets do more examples on HCF and LCM of algebraic expressions\");\nalert(\"Find the HCF and LCM of 3x+3,2x+2,x²-1.First factorise the terms ie 3x+3=3(x+1),2x+2=2(x+1) and x²-1=(x-1)(x+1). Looking at the three terms (x+1) is common hence HCF=(x+1).Now for the LCM take each factor where its most abundant hence LCM=2×3(x-1)(x+1)**Note-no need to expand brackets.\");\nalert(\"Find the HCF and LCM of x²-9,x²+6x+9 and 2x²+7x+3.First factorise the above quadratic expressions ie x²-9=(x+3)(x-3),x²+6x+9=(x+3)(x+3) and 2x²+7x+3=(2x+1)(x+3).Looking at the above terms (x+3) is common hence HCF=(x+3).For LCM take each factor where its most common hence LCM=(x+3)²(x-3)(2x+1).\");\n}", "function cardCompared3(num1, num2, num3, num11, num22, num33){\n if(num1 > num2 && num1 > num3){\n return 1;\n }else if(num2 > num1 && num2 > num3){\n return 2;\n }else if(num3 > num1 && num3 > num2){\n return 3;\n }else{\n if(num11 > num22 && num11 > num33){\n return 1;\n }else if(num22 > num11 && num22 > num33){\n return 2;\n }else if(num33 > num11 && num33 > num22){\n return 3;\n }else{\n\n }\n }\n\n }", "function hcfArr(arr) {\r\n function hcf(a, b) {\r\n if (a == 0) {\r\n return b;\r\n } else if (b == 0) {\r\n return a;\r\n } else if (a > b) {\r\n return hcf(b, a % b);\r\n } else {\r\n return hcf(a, b % a);\r\n }\r\n }\r\n\r\n let a = hcf(arr[0], arr[1])\r\n for (let i = 2; i < arr.length; i++) {\r\n a = hcf(a, arr[i])\r\n } console.log(a)\r\n}", "function dc3(cad){\n\t\n\t//construcción del alfabeto\n\tvar alf=[];\n\tfor(var i=0;i<cad.length;i++){\n\t\talf.push(cad.charCodeAt(i));\n\t}\n\t\n\t//console.log(alf)\n\talf=radixSort(alf);\n\t//console.log(alf)\n\t\n\tvar alfDict={};\n\t\tvar intCad=parseInt(cad)\n\t\t\n\t\tif(!(Number.isNaN(intCad))){\t\t\t\n\t\t\tfor(var i=0;i<alf.length;i++){\n\t\t\t\talfDict[String.fromCharCode(alf[i])]=parseInt(String.fromCharCode(alf[i]));\n\t\t\t} \t\n\t\t}\n\t\telse{\n\t\t\tvar index=0;\n\t\t\tvar lastChar=-1\n\t\t\tfor(var i=0; i<alf.length;i++){\n\t\t\t\tvar a=alf[i];\n\t\t\t\tif(a!=lastChar){\n\t\t\t\t\tindex+=1;\n\t\t\t\t\talfDict[String.fromCharCode(alf[i])]=index;\n\t\t\t\t}\n\t\t\t\tlastChar=a;\n\t\t\t}\n\t\t}\n\tconsole.log(alfDict);\n\tvar alfCad=[];\n\tfor(var i=0;i<cad.length;i++){\n\t\talfCad.push(alfDict[cad.charAt(i)]);\n\t}\n\talfCad.push(0);\n\tconsole.log(alfCad);\n\t\n\t\n\t//SAmple set\n\t\n\tvar b1=[];\n\tvar b2=[];\n\tvar b0=[];\n\tvar b12idx=[];\n\tvar idx=0;\n\t\n\tfor(var i=0; i<alfCad.length;i++){\n\t\tif(idx%3==1){\n\t\t\tb1.push([alfCad[i],idx]);\n\t\t}\n\t\telse if(idx%3==2){\n\t\t\tb2.push([alfCad[i],idx]);\n\t\t}\n\t\telse{\n\t\t\tb0.push([alfCad[i],idx]);\n\t\t}\n\t\tidx+=1;\n\t}\n\tvar b12=b1.concat(b2);\n\t\n\tconsole.log(b12);\n\t\n\tvar thriples=[];\n\tfor(var i=0;i<b12.length;i++){\n\t\tvar thriple=[];\n\t\tvar currentb=b12[i];\n\t\tconsole.log(currentb)\n\t\tif(currentb[1]!=(alfCad.length-1)){\n\t\t\t\tfor(var j=currentb[1];j<currentb[1]+3;j++){\n\t\t\t\t\tif(alfCad[j]!=undefined){\n\t\t\t\t\t\tthriple.push(alfCad[j]);\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tthriple.push(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthriples.push([thriple,currentb[1]]);\n\t\t\t\tthriple=[];\n\t\t}\n\t}\n\tconsole.log(thriples);\n\t\n\tvar thriplesArray=[];\n\t\n\tfor(var i=0;i<thriples.length;i++){\n\t\tvar thrip='';\n\t\tvar currentT=thriples[i];\n\t\tfor (var j=0;j<currentT[0].length;j++){\n\t\t\tthrip+=currentT[0][j].toString();\n\t\t}\n\t\tthriplesArray.push([parseInt(thrip),currentT[1]]);\n\t}\n\t\n\t//console.log(thriplesArray);\n\t\n\tvar sortedThriples=radixSortTuple(thriplesArray);\n\tconsole.log(\"-----------sorted thriples-----------\")\n\tconsole.log(sortedThriples);\n\t\n\tvar tableRankThriple=[];\n\tvar lastThr=[-1,-1];\n\tvar currentRank=0;\n\tvar duplicates=false;\n\tvar b12IndexRank={};\n\t\n\tfor(var i=0;i<sortedThriples.length;i++){\n\t\tcurrentTh=sortedThriples[i];\n\t\tconsole.log(currentTh[0])\n\t\tif(currentTh[0]!=lastThr[0]){\n\t\t\tcurrentRank+=1;\n\t\t\ttableRankThriple.push([currentTh,currentRank]);\n\t\t\tb12IndexRank[currentTh[1].toString()]=currentRank;\n\t\t}\n\t\telse{\n\t\t\ttableRankThriple.push([currentTh,currentRank]);\n\t\t\tb12IndexRank[currentTh[1].toString()]=currentRank;\n\t\t\tduplicates=true;\n\t\t}\n\t\tlastThr=currentTh;\n\t}\n\tconsole.log(\"----------------tableRankThriple----------------\")\n\tconsole.log(tableRankThriple)\n\t\n b12IndexRank[cad.length.toString()]=0\n b12IndexRank[(cad.length+1).toString()]=0\n b12IndexRank[(cad.length+2).toString()]=0\n\t\n\t//console.log(tableRankThriple);\n\t\n\tvar b0Tuples21=[];\n\tconsole.log(duplicates);\n\tif(duplicates){\n\t\tnewArray=new Array(tableRankThriple.length+2);\n\t\t\n\t\tfor(var i=0;i<b12.length+2;i++){\n\t\t\tvar val=b12[i];\n\t\t\tif(val!=NaN && val!=undefined){\n\t\t\tnewArray[i]=b12IndexRank[b12[i][1].toString()];;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tnewArray[i]=0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tconsole.log(newArray);\n\t\tvar str='';\n\t\tfor(var i=0;i<newArray.length;i++){\n\t\t\tstr+=newArray[i].toString();\n\t\t}\n\t\t\n\t\tvar recReturn=dc3(str);\n\t\tconsole.log(\"--------recurse returned-------\");\n\t\tconsole.log(recReturn);\n\t\t\n\t\tvar sortedB12=new Array(b12.length);\n\t\tfor(var i=1;i<recReturn.length;i++){\n\t\t\tb12Val=b12[recReturn[i]];\n\t\t\tsortedB12[i-1]=b12Val;\n\t\t}\n\t\t\n\t\tconsole.log(\"-------IndexRankOld-------\")\n\t\tconsole.log(b12IndexRank);\n\t\tfor(var i=0;i<sortedB12.length;i++){\n\t\t\tconsole.log(sortedB12[i][1].toString());\n\t\t\tb12IndexRank[sortedB12[i][1].toString()]=i+1;\n\t\t}\n\t\tconsole.log(\"-------updatedIndexRank------\")\n\t\tconsole.log(b12IndexRank);\n\t\t\n\t\t\n\t\tconsole.log(\"--------b0-------\");\n\t\tconsole.log(b0);\n\t\t\n\t\tfor(var j=0;j<b0.length;j++){\n\t\t\tvar intB=b12IndexRank[(b0[j][1]+1).toString()];\n\t\t\tvar stringB=intB.toString();\n\t\t\tconsole.log([intB,(b0[j][1]+1).toString()]);\n\t\t\tconsole.log(j)\n\t\t\tb0Tuples21.push([parseInt(((b0[j][0]).toString())+stringB),[ [b0[j][0],intB],b0[j][1] ]]);\n\t\t}\n\t\tconsole.log(\"------b0unsorted------\");\n\t\tconsole.log(b0Tuples21);\n\t\tb0Tuples21=radixSortTuple(b0Tuples21);\n\t\tconsole.log(\"------b0sorted------\");\n\t\tconsole.log(b0Tuples21);\n\t\t\n\t\tvar result=[];\n\t\tvar idx=0;\n\t\tvar idx2=0;\n\t\t\n\t\twhile(idx<b0Tuples21.length && idx2<sortedB12.length){\n\t\t\twhile(idx2<sortedB12.length && idx<b0Tuples21.length){\n\t\t\t\t//console.log(\"idx\",idx)\n\t\t\t\t//console.log(\"idx2\",idx2)\n\t\t\t\tvar currentB0=b0Tuples21[idx];\n\t\t\t\tvar idxB0=currentB0[1][1];\n\t\t\t\tvar currentB12=sortedB12[idx2];\n var idxB12=currentB12[1];\n\t\t\t\t//console.log(idxB12);\n\t\t\t\tif(idxB12%3==2){\n\t\t\t\t\tvar charB12=alfCad[idxB12];\n var charB0=alfCad[idxB0];\n\t\t\t\t\t//console.log(charB12);\n\t\t\t\t\t//console.log(charB0);\n if(charB0>charB12){\n result.push(idxB12);\n idx2=idx2+1;\n\t\t\t\t\t}\n else if(charB0<charB12){\n result.push(idxB0);\n idx=idx+1;\t\n\t\t\t\t\t}\n else{\n\t\t\t\t\t\tvar charB12P1=alfCad[idxB12+1];\n var charB0P1=alfCad[idxB0+1];\n if(charB0P1>charB12P1){\n result.push(idxB12);\n idx2=idx2+1\t;\n\t\t\t\t\t\t}\n else if(charB0P1<charB12P1){\n result.push(idxB0);\n idx=idx+1;\n\t\t\t\t\t\t}\n else{\n\t\t\t\t\t\t\tvar rankB0P2=b12IndexRank[(idxB0+2).toString()];\n var rankB12P2=b12IndexRank[(idxB12+2).toString()];\n\t\t\t\t\t\t\tconsole.log(idxB0+2);\n\t\t\t\t\t\t\tconsole.log(idxB12+2);\n if(rankB0P2>rankB12P2){\n result.push(idxB12);\n idx2=idx2+1;\n\t\t\t\t\t\t\t}\n else if(rankB0P2<rankB12P2){\n result.push(idxB0);\n idx=idx+1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\telse if(idxB12%3==1){\n\t\t\t\t\tvar charB12=alfCad[idxB12];\n var charB0=alfCad[idxB0];\n if(charB0>charB12){\n result.push(idxB12);\n idx2=idx2+1;\n\t\t\t\t\t}\n else if(charB0<charB12){\n result.push(idxB0);\n idx=idx+1;\n\t\t\t\t\t}\n else{\n\t\t\t\t\t\tvar rankB0P1=b12IndexRank[(idxB0+1).toString()];\n var rankB12P1=b12IndexRank[(idxB12+1).toString()];\n if(rankB0P1>rankB12P1){\n result.push(idxB12);\n idx2=idx2+1\t;\n\t\t\t\t\t\t}\n else if(rankB0P1<rankB12P1){\n result.push(idxB0);\n idx=idx+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(idx>=tableRankThriple.length && idx2!=b0Tuples21.length){\n\t\t\tfor (var i=idx;i<b0Tuples21.length;i++){\n\t\t\t\tvar currentB0=b0Tuples21[i];\n var idxB0=currentB0[1][1];\n result.push(idxB0);\t\n\t\t\t}\n\t\t}\n else if(idx!=tableRankThriple.length && idx2>=b0Tuples21.length){\n\t\t\tfor(var i=idx2;i<tableRankThriple.length;i++){\n\t\t\t\tvar currentB12=tableRankThriple[i];\n var idxB12=currentB12[0][1];\n result.push(idxB12);\n\t\t\t}\n\t\t}\n return result; \n\t}\n\telse{\n\t\tb0.pop()\n\t\tfor(var i=0;i<b0.length;i++){\n\t\t\tvar intB=b12IndexRank[(b0[i][1]+1).toString()];\n\t\t\tvar stringB=intB.toString();\n\t\t\tb0Tuples21.push([parseInt((b0[i][0]).toString()+stringB),[[b0[i][0],intB],b0[i][1]]]);\n\t\t}\n\t\tb0Tuples21=radixSortTuple(b0Tuples21);\n\t\tconsole.log(b0Tuples21);\n\t\tvar result=[]\n var idx=0\n var idx2=0\n while(idx<b0Tuples21.length && idx2<tableRankThriple.length){\n\t\t\twhile(idx2<tableRankThriple.length && idx<b0Tuples21.length){\n\t\t\t\tvar currentB0=b0Tuples21[idx];\n var idxB0=currentB0[1][1];\n var currentB12=tableRankThriple[idx2];\n var idxB12=currentB12[0][1];\n if(idxB12%3==2){\n\t\t\t\t\tvar charB12=alfCad[idxB12];\n var charB0=alfCad[idxB0];\n if(charB0>charB12){\n result.push(idxB12);\n idx2=idx2+1;\n\t\t\t\t\t}\n else if(charB0<charB12){\n result.push(idxB0);\n idx=idx+1;\t\n\t\t\t\t\t}\n else{\n\t\t\t\t\t\tvar charB12P1=alfCad[idxB12+1];\n var charB0P1=alfCad[idxB0+1];\n if(charB0P1>charB12P1){\n result.push(idxB12);\n idx2=idx2+1;\t\n\t\t\t\t\t\t}\n else if(charB0P1<charB12P1){\n result.push(idxB0)\n idx=idx+1\t\n\t\t\t\t\t\t}\n else{\n var rankB0P2=b12IndexRank[(idxB0+2).toString()];\n var rankB12P2=b12IndexRank[(idxB12+2).toString()];\n if(rankB0P2>rankB12P2){\n result.push(idxB12);\n idx2=idx2+1;\n\t\t\t\t\t\t\t}\n else if(rankB0P2<rankB12P2){\n result.push(idxB0);\n idx=idx+1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n \n else if(idxB12%3==1){\n\t\t\t\t\tvar currentB12=tableRankThriple[idx2];\n var idxB12=currentB12[0][1];\n var charB12=alfCad[idxB12];\n var charB0=alfCad[idxB0];\n if(charB0>charB12){\n result.push(idxB12);\n idx2=idx2+1;\n\t\t\t\t\t}\n else if(charB0<charB12){\n result.push(idxB0);\n idx=idx+1;\t\n\t\t\t\t\t}\n else{\n\t\t\t\t\t\tvar rankB0P1=b12IndexRank[(idxB0+1).toString()];\n var rankB12P1=b12IndexRank[(idxB12+1).toString()];\n if(rankB0P1>rankB12P1){\n result.push(idxB12);\n idx2=idx2+1;\t\n\t\t\t\t\t\t}\n else if(rankB0P1<rankB12P1){\n result.push(idxB0);\n idx=idx+1;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n \n\t\t\t}\n\t\t}\n\t\tif(idx>=tableRankThriple.length && idx2!=b0Tuples21.length){\n\t\t\tfor (var i=idx;i<b0Tuples21.length;i++){\n\t\t\t\tvar currentB0=b0Tuples21[i];\n var idxB0=currentB0[1][1];\n result.push(idxB0);\t\n\t\t\t}\n\t\t}\n else if(idx!=tableRankThriple.length && idx2>=b0Tuples21.length){\n\t\t\tfor(var i=idx2;i<tableRankThriple.length;i++){\n\t\t\t\tvar currentB12=tableRankThriple[i];\n var idxB12=currentB12[0][1];\n result.push(idxB12);\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"---------result---------------\")\n\t\tconsole.log(result)\n return result; \n\t}\n}", "function proThreeKind(pc, dc, numSame){\n\tif (numSame.num == 3){\n\t\treturn 1.0;\n\t}else if (numSame.twoPair) {\n\t\tvar out1Already = 2 + contain(dc, pc[0].value);\n\t\tvar out2Already = 2 + contain(dc, pc[2].value);\n\t\treturn (4.0+4.0-out1Already-out2Already)/43.0;\t\t\n\t} else if (numSame.num == 2){\n\t\tvar outAlready = 2 + contain(dc, numSame.value);\n\t\treturn (4.0 - outAlready)/43.0;\n\t} else {\n\t\treturn 0.0;\n\t}\n}", "function f(n1,n2,n3)\n{\nif (n1>n2 && n1>n3)\n{\n \n if(n2>n3)\n {\n \t document.write(n1 +\",\"+n2 +\",\"+n3 );\n\n }\n else{\n document.write(n1+ \",\"+n3+ \",\"+n2 );\n }\n}\nelse if (n2>n1 && n2>n3)\n{\n\n if(n1>n3)\n {\n \t document.write(n2+ \",\"+n1 +\",\"+n3 );\n\n }\n else\n {\n document.write(n2 +\",\"+n3+ \",\"+n1);\n }\n \n}\nelse if (n3>n1 && n3>n2) \n{\n if(n2>n1)\n {\n \t document.write(n3 +\",\"+n2+ \",\"+n1);\n\n }\n else\n {\n document.write(n3+ \",\"+n1+ \",\"+n2);\n }\n}\n}", "function firstRecurringCharacter3(input) {\n for(let i = 0; i < input.length - 1; i++ ){\n for (let j = i + 1; j >= 0; j--) {\n if (input[i] === input[j] && i !== j) {\n return input[i];\n }\n }\n }\n return undefined;\n}", "function hcf(a, b) {\r\n if (a == 0) {\r\n return b;\r\n } else if (b == 0) {\r\n return a;\r\n } else if (a > b) {\r\n return hcf(b, a % b);\r\n } else {\r\n return hcf(a, b % a);\r\n }\r\n}", "function ret_mix_mod_idx(o2_fr , he_fr){\n var idx_me = 0;\n for(var cnt = 0 ; cnt < travel_mix_arr.length - 1 ; cnt++){\n\n if(travel_mix_arr[cnt] == o2_fr && travel_mix_arr[cnt+1] == he_fr ){\n break;\n }\n idx_me = idx_me + 1;\n }\n return cnt/2;\n}", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n) --> numbers of inputs\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n) --> numbers of inputs\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function findHCF(a, b) {\r\n while (b > 0) {\r\n var temp = a;\r\n a = b;\r\n b = temp % b;\r\n }\r\n return a;\r\n}", "function repearFirstClassFunction() {\n let years = [1990, 1965, 1937, 2005, 1998];\n\n function arrCalc(arr, fn) {\n let arrResult = [];\n for (let i = 0; i < arr.length; i++)\n arrResult.push(fn(arr[i]));\n return arrResult;\n }\n\n function calculateAge(el) {\n return 2019 - el;\n }\n\n function isFullAge(el) {\n return el >= 18;\n }\n\n function maxHeartRate(el) {\n if (el >= 18 && el <= 81)\n return Math.round(206.9 - (0.67 * el));\n else\n return -1;\n }\n\n let ages = arrCalc(years, calculateAge);\n let fullAges = arrCalc(ages, isFullAge);\n let rates = arrCalc(ages, maxHeartRate);\n console.log(ages, fullAges, rates);\n\n function interviewQuestion(job) {\n if (job === 'designer') {\n return (name) => {\n console.log(name + ', can you please explain what UX design is?');\n }\n } else if (job === 'teacher') {\n return (name) => {\n console.log('What subject do you teach, ' + name + '?');\n }\n } else {\n return (name) => {\n console.log('Hello ' + name + ', what do you do?');\n }\n }\n }\n let teacherQuestion = interviewQuestion('teacher');\n let designerQuestion = interviewQuestion('designer');\n teacherQuestion('John');\n designerQuestion('John');\n interviewQuestion('developer')('Mark');\n}", "got3to6(threes, fours, fives, sixes){\n return threes.length >= 1 &&\n fours.length >= 1 &&\n fives.length >= 1 &&\n sixes.length >= 1;\n }", "function ha(a){var b,c=ia(a),d=c[0];if(ja(c),d){for(b=0;b<d.length;b++)ka(d[b]);for(b=0;b<d.length;b++)la(d[b],0,0)}return ma(c)}", "function partial(n){\n var a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0.0;\n var twothirds = 2.0/3.0;\n var alt = -1.0;\n var k2 = k3 = sk = ck = 0.0;\n \n for (var k = 1; k <= n; k++){\n k2 = k*k;\n k3 = k2*k;\n sk = Math.sin(k);\n ck = Math.cos(k);\n alt = -alt;\n \n a1 += Math.pow(twothirds,k-1);\n a2 += Math.pow(k,-0.5);\n a3 += 1.0/(k*(k+1.0));\n a4 += 1.0/(k3 * sk*sk);\n a5 += 1.0/(k3 * ck*ck);\n a6 += 1.0/k;\n a7 += 1.0/k2;\n a8 += alt/k;\n a9 += alt/(2*k -1);\n }\n\n return [ a1, a2, a3, a4, a5, a6, a7, a8, a9 ];\n}", "function chocolateFeast(n, c, m) {\r\n \r\n if (n / c == m) {\r\n return n / c + 1;\r\n }\r\n else if (n / c < m) {\r\n return n / c;\r\n }\r\n else if (n / c > m) {\r\n \r\n var k = n / c;\r\n var re = k - m;\r\n return k = re + 1 + k\r\n \r\n }\r\n }", "function hcf(){\n let a = 144;\n let b = 96;\n while (b > 0){\n let temp = a;\n a = b;\n b = temp%b;\n };\n console.log('The highest common factor is: '+ a);\n}", "function c(e,n,r,i){function o(e,t){return 1-3*t+3*e}function s(e,t){return 3*t-6*e}function a(e){return 3*e}function l(e,t,n){return((o(t,n)*e+s(t,n))*e+a(t))*e}function u(e,t,n){return 3*o(t,n)*e*e+2*s(t,n)*e+a(t)}function c(t,n){for(var i=0;i<m;++i){var o=u(n,e,r);if(0===o)return n;n-=(l(n,e,r)-t)/o}return n}function f(){for(var t=0;t<b;++t)C[t]=l(t*x,e,r)}function p(t,n,i){var o,s,a=0;do{s=n+(i-n)/2,o=l(s,e,r)-t,o>0?i=s:n=s}while(Math.abs(o)>v&&++a<y);return s}function d(t){for(var n=0,i=1,o=b-1;i!==o&&C[i]<=t;++i)n+=x;--i;var s=(t-C[i])/(C[i+1]-C[i]),a=n+s*x,l=u(a,e,r);return l>=g?c(t,a):0===l?a:p(t,n,n+x)}function h(){T=!0,e===n&&r===i||f()}var m=4,g=.001,v=1e-7,y=10,b=11,x=1/(b-1),w=\"Float32Array\"in t;if(4!==arguments.length)return!1;for(var S=0;S<4;++S)if(\"number\"!=typeof arguments[S]||isNaN(arguments[S])||!isFinite(arguments[S]))return!1;e=Math.min(e,1),r=Math.min(r,1),e=Math.max(e,0),r=Math.max(r,0);var C=w?new Float32Array(b):new Array(b),T=!1,E=function(t){return T||h(),e===n&&r===i?t:0===t?0:1===t?1:l(d(t),n,i)};E.getControlPoints=function(){return[{x:e,y:n},{x:r,y:i}]};var k=\"generateBezier(\"+[e,n,r,i]+\")\";return E.toString=function(){return k},E}", "function greaterOfThree(int1, int2, int3) {\n\tif(int1 > int2 && int1 > int3){return int1}\n\t\telse if (int1 < int2 && int2 > int3){return int2}\n\t\t\telse if(int3 > int2 && int1 < int3){return int3}\n\t\t\t\telse{console.log(\"No repeating numbers!!!!!\")}\n}", "function hebrew_delay_2(year) {\n var last, present, next;\n last = hebrew_delay_1(year - 1);\n present = hebrew_delay_1(year);\n next = hebrew_delay_1(year + 1);\n return ((next - present) == 356) ? 2 : (((present - last) == 382) ? 1 : 0);\n}", "function whatFlavors(cost, money) {\n let mapOfIceCream = new Map(); // to store < cost, [IDs] >\n let iceCream1 = 0 , iceCream2 = 0;\n for ( let i = 0 ; i < cost.length ; i++) {\n let costOfFlavor = cost[i];\n let ids = mapOfIceCream.get(costOfFlavor) || [];\n ids.push(i+1);\n mapOfIceCream.set(costOfFlavor,ids);\n }\n for ( let j = 0 ; j < cost.length ; j++) {\n let costOfFlavor = cost[j];\n let complementLookFor = money - costOfFlavor;\n if (mapOfIceCream.has(complementLookFor)) \n {\n if ( complementLookFor !== costOfFlavor) {\n iceCream1 = mapOfIceCream.get(costOfFlavor)[0];\n iceCream2= mapOfIceCream.get(complementLookFor)[0];\n break;\n } else {\n if ( mapOfIceCream.get(costOfFlavor).length > 1) {\n iceCream1 = mapOfIceCream.get(costOfFlavor)[0];\n iceCream2 = mapOfIceCream.get(costOfFlavor)[1];\n break;\n }\n }\n }\n }\n if(iceCream1<iceCream2){\n console.log(iceCream1 + \" \" + iceCream2);\n }else{\n console.log(iceCream2 + \" \" + iceCream1);\n }\n}", "function threeSamePoints() {\n let threeSame = frequency();\n var points = 0;\n\n for (let i = 0; i < 7; i++) {\n if (threeSame[i] >= 3) {\n points = i * 3;\n break;\n }\n }\n return points;\n}", "function feminineForms(lastChar, inputWord, secondToLastChar) {\n \n if (secondToLastChar === \"c\") {\n newWord = inputWord.slice(0, -2) + \"quita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"k\") {\n newWord = inputWord.slice(0, -1) + \"quita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"g\") {\n newWord = inputWord.slice(0, -1) + \"uita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"z\") {\n newWord = inputWord.slice(0, -1) + \"cecita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"u\") {\n newWord = inputWord.slice(0, -2) + \"üita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"t\") {\n newWord = \"1: \" + inputWord.slice(0, -1) + \"ita\"; \n dimunutive.innerHTML = newWord;\n \n newWord = \"2: \" + inputWord.slice(0, -1) + \"ica\"; \n specialIco.innerHTML = newWord;\n } else if (lastChar === \"a\") {\n newWord = inputWord.slice(0, -1) + \"ita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"l\" || lastChar === \"s\" && secondToLastChar === \"e\") {\n newWord = inputWord + \"ita\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"r\" || lastChar === \"n\" || lastChar === \"e\") {\n newWord = inputWord + \"cita\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"s\") {\n newWord = inputWord.slice(0, -2) + \"itas\"; \n dimunutive.innerHTML = newWord;\n } else {\n newWord = inputWord + \"ita\";\n dimunutive.innerHTML = newWord;\n }\n }", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n)\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n)\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function two_of_three(x, y, z) {\n var max = Math.max(x, y, z);\n if (max == x) {\n return y + z;\n } else if (max == y) {\n return x + z;\n } else {\n return x + y;\n }\n }", "function anotherFunChallenge(input) {\n let a = 5; //O(1)\n let b = 10; //O(1)\n let c = 50; //O(1)\n for (let i = 0; i < input; i++) { //* \n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n\n }\n for (let j = 0; j < input; j++) { //*\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; //O(1)\n}", "function solution2(S, P, Q) {\n // Take two. After some research, realizing I was prefix summing the wrong thing: we don't\n // care about the sum of impact values (all that matters for those is relative min),\n // but we DO care about the counts of each nucleotide (starting with the lowest impact ones)\n\n // Init result array and 2d prefix count array\n const pCounts = [[0],[0],[0]]; // tracks sums of A, C, G nucleotides (don't need highest T)\n const result = [];\n\n // Create prefix counts array, one set of nucleotide counts for each step along the sequence\n for (let i = 0; i < S.length; i++){\n\n // Copy the previous counts for this set of counts - only one will change, done below\n pCounts[0].push(pCounts[0][i]);\n pCounts[1].push(pCounts[1][i]);\n pCounts[2].push(pCounts[2][i]);\n\n // Increment the corresponding nucleotide counter\n switch (S[i]){\n case \"A\":\n pCounts[0][i+1] += 1;\n break;\n case \"C\":\n pCounts[1][i+1] += 1;\n break;\n case \"G\":\n pCounts[2][i+1] += 1;\n break;\n }\n }\n\n // Now that prefix counts are created, for each query,\n // check for differences of each type in the P-Q range,\n // starting from lowest impact value\n for(let i = 0; i < Q.length; i++){\n // Check for A's (impact 1) - any increases in the A counts in range P-Q\n if(pCounts[0][Q[i]+1] - pCounts[0][P[i]] > 0){\n result.push(1);\n } else if(pCounts[1][Q[i]+1] - pCounts[1][P[i]] > 0){\n result.push(2);\n } else if(pCounts[2][Q[i]+1] - pCounts[2][P[i]] > 0){\n result.push(3);\n } else result.push(4)\n }\n return result;\n}", "function proFullhouse(pc, dc, numSame){\n\tif (numSame.num == 3){\n\t\tvar outAlready = 1 + contain(dc, numSame.rem1);\n\t\treturn (4.0 - outAlready)/43.0;\n\t}\n\telse if (numSame.twoPair) {\n\t\tvar out1Already = 2 + contain(dc, pc[0].value);\n\t\tvar out2Already = 2 + contain(dc, pc[2].value);\n\t\treturn (4.0+4.0-out1Already-out2Already)/43.0;\t\t\n\t} else {\n\t\treturn 0.0;\n\t}\n}", "function fEqualsC(){\n let num = 200\n let f = (9/5)*num+32\n let c = (num-32)*5/9\n\n while (f != c){\n f = (9/5)*num+32\n c = (num-32)*5/9\n num--\n }\n return num+1\n}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function fb(a,b,c){return null!=a?a:null!=b?b:c}", "function ft(t, b, c, d)\n{\n if(t < 20) return (b & c) | ((~b) & d);\n if(t < 40) return b ^ c ^ d;\n if(t < 60) return (b & c) | (b & d) | (c & d);\n return b ^ c ^ d;\n}", "function dfaIntersection() {\n let selector1 = document.getElementById('dfa_union_1');\n let selector2 = document.getElementById('dfa_union_2');\n let selected1 = selector1.selectedIndex;\n let selected2 = selector2.selectedIndex;\n\n let dfa1 = array_all_FA[selected1];\n let dfa2 = array_all_FA[selected2];\n\n let number_of_alphabet1 = 0;\n let number_of_alphabet2 = 0;\n\n let leaderLength = (dfa1.length >= dfa2.length) ? dfa1.length : dfa2.length;\n\n for (var key in dfa1[0]) {\n if (dfa1[0].hasOwnProperty(key)) {\n if(key != 'statename' && key != 'final'){\n number_of_alphabet1++;\n }\n }\n }\n\n for (var key in dfa2[0]) {\n if (dfa2[0].hasOwnProperty(key)) {\n if(key != 'statename' && key != 'final'){\n number_of_alphabet2++;\n }\n }\n }\n\n let leaderNumberOfAlphabet;\n\n if (number_of_alphabet1 >= number_of_alphabet2) {\n leaderNumberOfAlphabet;\n\n let letter = '';\n for (let index = number_of_alphabet2; index < number_of_alphabet1; index++) {\n letter = alphabet[index];\n for (let inside_index = 0; inside_index < dfa2.length; inside_index++) {\n dfa2[inside_index] = { ...dfa2[inside_index], letter: ''};\n }\n \n }\n } else {\n leaderNumberOfAlphabet = number_of_alphabet2;\n\n let letter = '';\n for (let index = number_of_alphabet1; index < number_of_alphabet2; index++) {\n letter = alphabet[index];\n console.log(letter);\n for (let inside_index = 0; inside_index < dfa1.length; inside_index++) {\n dfa1[inside_index] = { ...dfa1[inside_index], [letter]: ''};\n } \n }\n }\n\n number_of_alphabet1 = leaderNumberOfAlphabet;\n number_of_alphabet2 = leaderNumberOfAlphabet;\n\n let complementDfa1 = complement(dfa1, number_of_alphabet1);\n let complementDfa2 = complement(dfa2, number_of_alphabet2);\n // NOT WORKING BEYOND THIS, NEED TO TRANSFORM NDFA INTO DFA\n\n // let unionComplement = dfaUnion(complementDfa1, complementDfa2);\n // let unionComplementMinimized = minimizeDFA(unionComplement);\n\n // let intersection = complement(unionComplementMinimized);\n // NOT WORKING BEFORE THIS, NEED TO TRANSFORM NDFA INTO DFA\n\n console.log(intersection);\n // TODO TEST INTERSECTION\n\n // array_all_FA.push(intersection);\n // array_name.push(array_name[selected1] + \"IntersectionWith\" + array_name[selected2]);\n // addToSelector();\n\n // return intersection;\n}", "function sixth() {}", "function findSmallestOnThree(num1, num2, num3) {\n if (num1 < num2 && num1 < num3) {\n return num1;\n }\n else if (num2 < num1 && num2 < num3) {\n return num2;\n }\n return num3;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n // [1,0] . [0,1]\n let f = A[0];\n let count = 0;\n let getOCount = getCount(A, 1);\n let getZCount = getCount(A, 0);\n console.log(getOCount + \" \" + getZCount);\n if (getOCount >= getZCount) {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i] === 1) {\n A[i + 1] = 0;\n } else {\n A[i + 1] = 1;\n }\n count++;\n }\n }\n } else {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i + 1] === 1) {\n A[i] = 0;\n } else {\n A[i] = 1;\n }\n count++;\n }\n }\n }\n return count;\n}", "function getSolution() {\n var sum = 0;\n for (var i = 0; i < 1000; i++) {\n if (i % 3 === 0 || i % 5 === 0) sum += i;\n }\n return sum;\n}", "function calculateFlesch(totalSyllables, totalWords, totalSentences) {\n \tvar f1 = 206.835;\n var f2 = 84.6;\n var f3 = 1.015;\n var r1 = totalSyllables / totalWords;\n var r2 = totalWords / totalSentences;\n flesch = f1 - (f2 * r1) - (f3 * r2);\n return flesch;\n}", "function lucas_3(\n len_n, dig_n,\n len_k, dig_k\n)\n{\n // use modulo product rule:\n // prod[i] % 3 = ((prod[i - 1] % 3) * value[i]) \n var prod = 1;\n for (var i = 0; i < len_n; i++) {\n var n_i = dig_n[i];\n var k_i = (i < len_k) ? dig_k[i] : 0;\n prod = (prod * binom_max_2(n_i, k_i)) % 3;\n }\n return prod % 3;\n}", "function part1() {\n for (let i = 0; i < input.length; i++) {\n for (let j = 0; j < input.length; j++) {\n if (i === j) continue\n\n if (input[i] + input[j] === 2020) {\n return input[i] * input[j]\n }\n }\n }\n}", "function pazymiuVidurkis3(x1,x2,x3) {\n var vidurkis = (x1 + x2 + x3) / 3;\n return vidurkis;\n}", "function smallerNubmer(num1, num2,num3){\r\n if(num1<num2 && num1<num3){\r\n return num1;\r\n }else if (num2<num1 && num2<num3){\r\n return num2;\r\n }else {\r\n return num3;\r\n }\r\n}", "function bez3(a, b, c, t) {\n var r1 = a + (b - a)*t;\n var r2 = b + (c - b)*t;\n \n return r1 + (r2 - r1)*t;\n }", "function Eq_second_degre(a, b, c) {\r\n\tvar rep = new Array();\r\n\tvar delta = b*b - 4*a*c; \r\n\tif(delta < 0) {alert('delta = ' + delta);}\r\n\tif(delta == 0) {rep.push(-b/(2*a));}\r\n\tif(delta > 0) {\r\n\t\t var d = Math.sqrt(delta);\r\n\t\t rep.push((-b -d)/(2*a), (-b + d)/(2*a));\r\n\t\t //alert('rep = ' + rep);\r\n\t\t}\r\n\r\n\treturn rep;\r\n}", "function threeNumberSum(array, targetSum) {\n array.sort((a,b)=>a-b); //0 (nlog n)\n //3rd+2nd=targetSum-1st\n //b+c=t-a\n let answerArray=[]\n let possibleCombos=[]\n\n \n\n for(let i=0;i<array.length-2;i++){\n let firstValue=array[i],secondValue=i+1,thirdValue=array.length-1\n \n while(secondValue<thirdValue){\n possibleCombos.push([firstValue,array[secondValue],array[thirdValue]])\n if(targetSum===firstValue+array[secondValue]+array[thirdValue]){\n answerArray.push([firstValue,array[secondValue],array[thirdValue]])\n secondValue++\n thirdValue--\n } \n else if(firstValue+array[secondValue]+array[thirdValue]>targetSum){\n thirdValue--\n }else{\n secondValue++\n }\n }\n // possibleCombos.push('done',i)\n }\n console.log(possibleCombos)\n return answerArray;\n }", "function Farenheit(C) {\n console.log(((C) * 9 / 5) + 32 + 'F');\n}", "function leastFactor(composite) {\n\n // if (isNaN(n) || !isFinite(n)) return NaN;\n\n if (composite === 0n) return 0n;\n if (composite % 1n || composite*composite < 2n) return 1n;\n if (composite % 2n === 0n) return 2n;\n if (composite % 3n === 0n) return 3n;\n if (composite % 5n === 0n) return 5n;\n\n for (let i = 7n; (i * i) < composite; i += 30n) {\n if (composite % i === 0n) return i;\n if (composite % (i + 4n) === 0n) return i + 4n;\n if (composite % (i + 6n) === 0n) return i + 6n;\n if (composite % (i + 10n) === 0n) return i + 10n;\n if (composite % (i + 12n) === 0n) return i + 12n;\n if (composite % (i + 16n) === 0n) return i + 16n;\n if (composite % (i + 22n) === 0n) return i + 22n;\n if (composite % (i + 24n) === 0n) return i + 24n;\n }\n\n // it is prime\n return composite;\n}", "function fullHousePoints() {\n var twoSame = 0;\n var threeSame = 0;\n let full = frequency();\n\n for (let i = 0; i < 7; i++) {\n if (full[i] >= 3) {\n threeSame = i * 3;\n } else if (full[i] >= 2) {\n twoSame = i * 2;\n }\n }\n\n if (threeSame != 0 && twoSame != 0) {\n return threeSame + twoSame;\n } else {\n return 0;\n }\n if (!inputs[10].locked) {\n inputs[10].selected = true;\n }\n\n}", "function maxOfThree(num1,num2,num3){\r\n if((num1 !== num2) && (num2 !== num3) && (num3 !== num1)){\r\n if(num1 > num2){\r\n if(num1 > num3){\r\n return num1;\r\n } else{\r\n return num3;\r\n }\r\n }else if(num2 > num1){\r\n if(num2 > num3){\r\n return num2;\r\n } else{\r\n return num3;\r\n }\r\n }\r\n } else{\r\n if(num1 === num2){\r\n if(num2 > num3){\r\n return num2;\r\n }else {\r\n return num3;\r\n }\r\n } else if(num2 === num3){\r\n if(num1 > num3){\r\n return num1;\r\n } else{\r\n return num3;\r\n }\r\n } else if(num1 === num3){\r\n if(num3 > num2){\r\n return num3;\r\n } else{\r\n return num2;\r\n }\r\n }\r\n }\r\n}", "function convertToF(celsius) { //1\n let fahrenheit = celsius * 9/5 + 32; //2\n\n return fahrenheit; //3\n}", "function threeSum(nums) {\n nums.sort((a, b) => a - b);\n\n const result = [];\n for (let indexA = 0; indexA < nums.length - 2; indexA++) {\n const a = nums[indexA];\n\n if (a > 0) return result;\n if (a === nums[indexA - 1]) continue;\n\n let indexB = indexA + 1;\n let indexC = nums.length - 1;\n\n while (indexB < indexC) {\n const b = nums[indexB];\n const c = nums[indexC];\n\n if (a + b + c === 0) {\n result.push([a, b, c]);\n }\n\n if (a + b + c >= 0) {\n while (nums[indexC - 1] === c) {\n indexC--;\n }\n indexC--;\n }\n\n if (a + b + c <= 0) {\n while (nums[indexB + 1] === b) {\n indexB++;\n }\n indexB++;\n }\n }\n }\n return result;\n}", "function solution3(n) {\n if (n <= 1) {\n return 0;\n }\n\n if (n === 2) {\n return 1;\n }\n\n let lastTwo = [0, 1];\n let counter = 3;\n\n while(counter <= n) {\n let nextFib = lastTwo[0] + lastTwo[1];\n lastTwo[0] = lastTwo[1];\n lastTwo[1] = nextFib;\n\n counter++;\n }\n\n return lastTwo[1];\n}", "function problem9(){\n for(let a=1; a<1000; a++){\n for(let b=2; b<1000; b++){\n let c = 1000-a-b;\n if(Math.pow(a, 2) + Math.pow(b, 2) == Math.pow(c, 2)){\n if(a+b+c==1000){\n return a*b*c;\n }\n }\n }\n }\n}", "function challenge3() {\n\n}", "function l(e,n,o,r){function i(e,t){return 1-3*t+3*e}function a(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,n){return((i(t,n)*e+a(t,n))*e+s(t))*e}function u(e,t,n){return 3*i(t,n)*e*e+2*a(t,n)*e+s(t)}function c(t,n){for(var r=0;r<h;++r){var i=u(n,e,o);if(0===i)return n;n-=(l(n,e,o)-t)/i}return n}function f(){for(var t=0;t<w;++t)C[t]=l(t*b,e,o)}function d(t,n,r){var i,a,s=0;do{a=n+(r-n)/2,i=l(a,e,o)-t,i>0?r=a:n=a}while(Math.abs(i)>g&&++s<v);return a}function p(t){for(var n=0,r=1,i=w-1;r!=i&&C[r]<=t;++r)n+=b;--r;var a=(t-C[r])/(C[r+1]-C[r]),s=n+a*b,l=u(s,e,o);return l>=y?c(t,s):0==l?s:d(t,n,n+b)}function m(){S=!0,e==n&&o==r||f()}var h=4,y=.001,g=1e-7,v=10,w=11,b=1/(w-1),_=\"Float32Array\"in t;if(4!==arguments.length)return!1;for(var x=0;x<4;++x)if(\"number\"!=typeof arguments[x]||isNaN(arguments[x])||!isFinite(arguments[x]))return!1;e=Math.min(e,1),o=Math.min(o,1),e=Math.max(e,0),o=Math.max(o,0);var C=_?new Float32Array(w):new Array(w),S=!1,T=function(t){return S||m(),e===n&&o===r?t:0===t?0:1===t?1:l(p(t),n,r)};T.getControlPoints=function(){return[{x:e,y:n},{x:o,y:r}]};var k=\"generateBezier(\"+[e,n,o,r]+\")\";return T.toString=function(){return k},T}", "function loneSum (a, b, c){\n var sum = a + b + c\n if (a == c && a == b && c == b){\n return \"0\";\n }\n if (a==b){\n return c;\n }\n if (a==c){\n return b;\n }\n if (b==c){\n return a;\n }\n return sum;\n}", "function proFlushStraight(pc, dc, numSame){\n\tif (numSame.num >= 2 || numSame.twoPair){\n\t\treturn 0;\n\t} else if (! (pc[0].suit == pc[1].suit && pc[0].suit == pc[2].suit && pc[0].suit == pc[3].suit)){\n\t\treturn 0;\n\t} else if ((pc[3].value - pc[0].value <= 3) && pc[0].value != 1){\n\t\tvar vs = findMissingInStraight(pc);\n\t\tvar ret = 0;\n\t\tif (vs.v1 != 0){\n\t\t\tif (containSuit(dc, vs.v1, pc[0].suit)){\n\t\t\t\tret += 0;\n\t\t\t} else {\n\t\t\t\tret += 1.0/43.0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (vs.v2 != 0){\n\t\t\tif (containSuit(dc, vs.v2, pc[0].suit)){\n\t\t\t\tret += 0;\n\t\t\t} else {\n\t\t\t\tret += 1.0/43.0;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\n\t} else if (pc[0].value == 1 && pc[0] == 11){\n\t\tif ( containSuit(dc, 10, pc[0].suit)){\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn 1.0/43.0;\n\t\t\t}\n\t} else if (pc[0].value == 1 && pc[0] == 10){\n\t\tvar o11 = contain(pc, 11);\n\t\tvar o12 = contain(pc, 12);\n\t\tvar o13 = contain(pc, 13);\n\n\t\tvar out = 0;\n\t\tif (o11 == 0 && !containSuit(dc, 11, pc[0].suit)){\n\t\t\tout = 1;\n\t\t} else if (o12 == 0 &&!containSuit(dc, 12, pc[0].suit)){\n\t\t\tout = 1;\n\t\t} else if (o13 == 0 && !containSuit(dc, 13, pc[0].suit)){\n\t\t\tout = 1;\n\t\t}\n\t\treturn out/43.0;\n\t} else if (pc[0].value == 1 && pc[4].value == 5){\n\t\tvar missing = 4;\n\t\tif(pc[1].value == 3){\n\t\t\tmissing = 2;\n\t\t} else if (pc[2] == 4){\n\t\t\tmissing = 3;\n\t\t}\n\n\t\tif (containSuit(dc, missing, pc[0].suit)){\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn 1/43.0;\n\t\t}\n\n\t} else if (pc[0].value == 1 && pc[4].value == 4){\n\t\tif (containSuit(dc, 5, pc[0].suit)){\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn 1/43.0;\n\t\t}\n\t}\n\treturn 0;\n}", "function calcularEscolha(jogador, computador) {\n if (jogador == 1 && computador == 1) {\n return 0;\n }\n else if (jogador == 1 && computador == 2) {\n return 2;\n } \n else if (jogador == 1 && computador == 3) {\n return 1;\n } \n else if (jogador == 2 && computador == 1) {\n return 1;\n } \n else if (jogador == 2 && computador == 2) {\n return 0;\n } \n else if (jogador == 2 && computador == 3) {\n return 2;\n } \n else if (jogador == 3 && computador == 1) {\n return 2;\n } \n else if (jogador == 3 && computador == 2) {\n return 1;\n } \n else if (jogador == 3 && computador == 3) {\n return 0;\n }\n\n}", "function three_numbers(x, y, z) {\n if (x == y && y == z) {\n return 30;\n }\n \n if (x == y || y == z || z == x) {\n return 20;\n }\n \n return 40;\n }", "function choose3(inputArr) {\n var len = inputArr.length;\n \n function combine(arr) {\n var cur = [];\n var result = [];\n\n for (var i = 0; i < len; i++) {\n for (var j = i + 1; j < len; j++) {\n for (var h = j + 1; h < len; h++) {\n cur = [arr[i], arr[j], arr[h]];\n result.push(cur);\n }\n }\n }\n return result;\n }\n\n return combine(inputArr);\n}", "function sha1_ft(t, b, c, d) {\n\t if (t < 20) return b & c | ~b & d;\n\t if (t < 40) return b ^ c ^ d;\n\t if (t < 60) return b & c | b & d | c & d;\n\t return b ^ c ^ d;\n\t }", "function sha1_ft(t, b, c, d) {\n\t if (t < 20) return b & c | ~b & d;\n\t if (t < 40) return b ^ c ^ d;\n\t if (t < 60) return b & c | b & d | c & d;\n\t return b ^ c ^ d;\n\t }", "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0) \n let len =A.length;\n if(len==3) return A[0]*A[1]*A[2];\n let sortedA = A.sort((a,b)=>{return a-b});\n let zeroThree=A[len-1]*A[len-2]*A[len-3];\n let twoOne=A[0]*A[1]*A[len-1];\n //if A has more than two negative numbers, the result will always be positive;\n if(A[0]<0 && A[1]<0) {\n return Math.max(twoOne, zeroThree);\n } else {\n //if A has no more than one negative numbers, the result will always be the product of the largest three; \n return zeroThree\n }\n}", "function composition(f) {\n return forAll(_.Int).satisfy(function(a) {\n function g(x) { return x * 2; }\n function h(x) { return x - 1; }\n\n function returnComposition(b) {\n return g(h(b));\n }\n\n return f(a).map(returnComposition).isEqual(f(a).map(h).map(g));\n });\n }", "function sha1_ft(t, b, c, d) {\n if (t < 20) {\n return b & c | ~b & d;\n }\n\n if (t < 40) {\n return b ^ c ^ d;\n }\n\n if (t < 60) {\n return b & c | b & d | c & d;\n }\n\n return b ^ c ^ d;\n }", "function threeSum(nums){\n // var output = []\n // if(nums.length <=3) return output\n // for(let i=0;i<nums.length;i++){\n // for(let j=0;j<nums.length;j++){\n // for(let k = 0;k<nums.length;k++){\n // if(i!=j&& j!=k && i!=k && nums[i]+nums[j]+nums[k]===0)\n // output.push([nums[i],nums[j],nums[k]])\n // }\n // }\n // }\n // return output\n\n var output = []\n nums = nums.sort((a,b) => a-b)\n for(var i=0;i<nums.length-2;i++){\n if(nums[i]>0) break\n if(i>0 && nums[i]===nums[i-1]) continue\n var left = i+1\n var right = nums.length-1\n while(left<right){\n if(nums[i]+nums[left]+nums[right]<0) left++\n else if(nums[i]+nums[left]+nums[right]>0) right --\n else {\n output.push([nums[i],nums[left],nums[right]])\n \n while(left<right&& nums[left]===nums[left+1]) left++\n while(left<right && nums[right]===nums[right-1]) right--\n left++\n right--\n }\n }\n }\n return output\n}", "function sha1_ft(t, b, c, d) {\n if (t < 20) return b & c | ~b & d;\n if (t < 40) return b ^ c ^ d;\n if (t < 60) return b & c | b & d | c & d;\n return b ^ c ^ d;\n}", "function smallerNubmer(N1, N2, N3) {\r\n if (N1 < N2 && N1 < N3) {\r\n return console.log(N1);\r\n }\r\n if (N2 < N1 && N2 < N3) {\r\n return console.log(N2);\r\n } else {\r\n return console.log(N3);\r\n }\r\n}", "function getDiscount3(people) {\n const [ _, result ] = [\n [ function (valor) { return valor < 10 }, 500 ],\n [ function (valor) { return valor >= 10 && valor < 25}, 350 ],\n [ function (valor) { return valor >= 25 && valor < 100 }, 250 ],\n [ function (valor) { return valor >= 100 }, 200 ],\n ].find(function([ teste ]) {\n return teste(people)\n })\n\n return result\n}", "function LCF(n1, n2) {\n while (n1 !== n2) {\n if (n1 > n2) {\n n1 = n1 - n2;\n } else {\n n2 = n2 - n1;\n }\n }\n return n1;\n}", "function getCofactor(matrix1, temp, p, q, n) {\r\n var i = 0,\r\n j = 0;\r\n for (var row = 0; row < n; row++) {\r\n for (var col = 0; col < n; col++) {\r\n if (row != p && col != q) {\r\n temp[i][j++] = matrix1[row][col];\r\n if (j == n - 1) {\r\n j = 0;\r\n i++;\r\n }\r\n }\r\n }\r\n }\r\n}", "function soma3(a=1, b=1, c=1) {\n return a + b + c\n}", "function solve(arr){\n if (arr[0] === arr[1] && arr[1] === arr[2]) {\n return Math.floor((arr[0] * 3) / 2)\n }\n arr.sort((a, b) => a - b);\n if (arr[0] + arr[1] <= arr[2]) {\n return arr[0] + arr[1];\n }\n else {\n return arr[2] + Math.floor((arr[0] + arr[1] - arr[2]) / 2)\n }\n }", "function am3(i,x,w,j,c,n){var xl=x&0x3fff,xh=x>>14;while(--n>=0){var l=this[i]&0x3fff;var h=this[i++]>>14;var m=xh*l+h*xl;l=xl*l+((m&0x3fff)<<14)+w[j]+c;c=(l>>28)+(m>>14)+xh*h;w[j++]=l&0xfffffff;}return c;}// wtf?", "function P$4(t){return t?[l$b(t[0]),l$b(t[1]),l$b(t[2]),l$b(t[3]),l$b(t[4]),l$b(t[5])]:[l$b(),l$b(),l$b(),l$b(),l$b(),l$b()]}", "function am3(i, x, w, j, c, n) {\n var xl = x & 0x3fff,\n xh = x >> 14;\n\n while (--n >= 0) {\n var l = this[i] & 0x3fff;\n var h = this[i++] >> 14;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;\n c = (l >> 28) + (m >> 14) + xh * h;\n w[j++] = l & 0xfffffff;\n }\n\n return c;\n }", "function sha1_ft(t, b, c, d)\r\n{\r\n if(t < 20) return (b & c) | ((~b) & d);\r\n if(t < 40) return b ^ c ^ d;\r\n if(t < 60) return (b & c) | (b & d) | (c & d);\r\n return b ^ c ^ d;\r\n}", "function smallestCommons(arr) {\n let newArr = [];\n for(let i = Math.max(...arr); i >= Math.min(...arr); i--){\n newArr.push(i);\n }\n let odd = 1;\n if(newArr[0]%2 !== 0){\n odd = newArr[0];\n newArr.splice(0,1);\n }\n if(newArr.length === 2){\n return odd * newArr[0] * newArr[1];\n }\n\n let product = (odd * newArr[0] * newArr[1] * newArr[2]) /2;\n\n if(newArr.length === 3){\n return product;\n }else if(Math.min(...newArr) <= newArr[0]/2){\n newArr = newArr.filter(x => x > newArr[0]/2);\n if(newArr.length <= 3){\n return odd * smallestCommons(newArr);\n }\n }\n for(let i = 3; i < newArr.length; i++){\n var greatestCD = gcd(product, newArr[i]);\n product = product * newArr[i]/greatestCD;\n }\n return product;\n\n function gcd(x, y) {\n // Implements the Euclidean Algorithm\n if (y === 0)\n return x;\n else\n return gcd(y, x%y);\n }\n}", "function ex_7_R(a, b){\n s = 0; k = a;\n for( i = 1; i<b; i++){\n s = s + ex_5_R(a,k);\n k = ex_5_R(a,k);\n}\nreturn s;\n}", "function solution(U, L, C) {\n // write your code in JavaScript (Node.js 8.9.4)\n let u = [];\n let un = 0;\n let l = [];\n let ln = 0;\n for (let i = 0; i < C.length; i++) {\n switch (C[i]) {\n case 0:\n u.push(0);\n l.push(0);\n break;\n case 1:\n if (un + 1 <= U) {\n u.push(1);\n un += 1;\n l.push(0);\n } else if (ln + 1 <= L) {\n l.push(1);\n ln += 1;\n u.push(0);\n } else {\n return \"IMPOSSIBLE\";\n }\n break;\n case 2:\n u.push(1);\n un += 1;\n l.push(1);\n ln += 1;\n break;\n default:\n break;\n }\n }\n if (un === U && ln === L) return u.join(\"\") + \",\" + l.join(\"\");\n if (ln === U && un === L) return l.join(\"\") + \",\" + u.join(\"\");\n let diff = Math.abs(un - U);\n for (let i = 0; i < C.length; i++) {\n if (C[i] === 1) {\n u[i] = Number(u[i]) ? 0 : 1;\n l[i] = Number(l[i]) ? 0 : 1;\n diff--;\n }\n if (!diff) {\n break;\n }\n }\n if (!diff) {\n return u.join(\"\") + \",\" + l.join(\"\");\n }\n return \"IMPOSSIBLE\";\n}", "function findShortestOfThreeWords(word1, word2, word3) {\n if (word1.length <= word2.length && word1.length <= word3.length) {\n return word1;\n }\n\n if (word2.length < word1.length && word2.length <= word3.length) {\n return word2;\n }\n\n if (word3.length < word1.length && word3.length < word2.length) {\n return word3;\n }\n}", "function findLargestOnThree(num1, num2, num3) {\n if (num1 > num2 && num1 > num3) {\n return num1;\n }\n else if (num2 > num1 && num2 > num3) {\n return num2;\n }\n return num3;\n}", "function f_g(x) { //Вычисление нужной функции\n //window.alert(document.getElementById('a_1').value);\n //window.alert(Math.sin(document.getElementById('b_1').value * Math.PI * document.getElementById('c_1').value * x))\n //window.alert(document.getElementById('a_1').value * Math.sin(document.getElementById('b_1').value * Math.PI * document.getElementById('c_1').value));\n var x_t;\n if (x == document.getElementById('c_1').value) {\n x_t = document.getElementById('a_1').value;\n } else if (x == document.getElementById('c_2').value) {\n x_t = document.getElementById('a_2').value;\n } else {\n x_t = 0;\n }\n return x_t;\n // switch (x) {\n\n // case (document.getElementById('a_1').value):\n // window.alert(\"Прошло\");\n // return document.getElementById('c_1').value;\n // break;\n\n // case (document.getElementById('a_2').value):\n // return document.getElementById('c_2').value;\n // break;\n // default:\n // return 0;\n // break;\n\n}", "function am3(i,x,w,j,c,n) {\n\t var xl = x&0x3fff, xh = x>>14;\n\t while(--n >= 0) {\n\t var l = this[i]&0x3fff;\n\t var h = this[i++]>>14;\n\t var m = xh*l+h*xl;\n\t l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n\t c = (l>>28)+(m>>14)+xh*h;\n\t w[j++] = l&0xfffffff;\n\t }\n\t return c;\n\t }", "function am3(i,x,w,j,c,n) {\n\t var xl = x&0x3fff, xh = x>>14;\n\t while(--n >= 0) {\n\t var l = this[i]&0x3fff;\n\t var h = this[i++]>>14;\n\t var m = xh*l+h*xl;\n\t l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n\t c = (l>>28)+(m>>14)+xh*h;\n\t w[j++] = l&0xfffffff;\n\t }\n\t return c;\n\t }", "function sha1_ft(t, b, c, d) {\n if (t < 20) return (b & c) | ((~b) & d);\n if (t < 40) return b ^ c ^ d;\n if (t < 60) return (b & c) | (b & d) | (c & d);\n return b ^ c ^ d;\n}", "function f3(a) {\n return a * 3;\n}", "function threeSumProblem(arr, target) {\n arr.sort((a, b) => a - b);\n //console.log(arr);\n for (let i = 0; i < arr.length; i++) {\n let part1 = arr[i];\n\n if (part1 * 3 === target) return true;\n\n let j = 0;\n let k = arr.length - 1;\n let part2 = arr[j];\n let part3 = arr[k];\n let remainder = target - part1;\n\n while (part2 <= part3) {\n if (part2 + part3 === remainder) return true;\n else if (part2 + part3 < remainder) part2 = arr[k++];\n else part3 = arr[j--];\n }\n }\n\n return false;\n}", "function l(e,i,n,r){function o(e,t){return 1-3*t+3*e}function a(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,i){return((o(t,i)*e+a(t,i))*e+s(t))*e}function c(e,t,i){return 3*o(t,i)*e*e+2*a(t,i)*e+s(t)}function u(t,i){for(var r=0;f>r;++r){var o=c(i,e,n);if(0===o)return i;var a=l(i,e,n)-t;i-=a/o}return i}function d(){for(var t=0;C>t;++t)A[t]=l(t*w,e,n)}function h(t,i,r){var o,a,s=0;do a=i+(r-i)/2,o=l(a,e,n)-t,o>0?r=a:i=a;while(Math.abs(o)>v&&++s<b);return a}function g(t){for(var i=0,r=1,o=C-1;r!=o&&A[r]<=t;++r)i+=w;--r;var a=(t-A[r])/(A[r+1]-A[r]),s=i+a*w,l=c(s,e,n);return l>=m?u(t,s):0==l?s:h(t,i,i+w)}function p(){S=!0,(e!=i||n!=r)&&d()}var f=4,m=.001,v=1e-7,b=10,C=11,w=1/(C-1),y=\"Float32Array\"in t;if(4!==arguments.length)return!1;for(var x=0;4>x;++x)if(\"number\"!=typeof arguments[x]||isNaN(arguments[x])||!isFinite(arguments[x]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var A=y?new Float32Array(C):new Array(C),S=!1,E=function(t){return S||p(),e===i&&n===r?t:0===t?0:1===t?1:l(g(t),i,r)};E.getControlPoints=function(){return[{x:e,y:i},{x:n,y:r}]};var _=\"generateBezier(\"+[e,i,n,r]+\")\";return E.toString=function(){return _},E}", "function am3(i, x, w, j, c, n) {\r\n\t var xl = x & 0x3fff, xh = x >> 14;\r\n\t while (--n >= 0) {\r\n\t var l = this[i] & 0x3fff;\r\n\t var h = this[i++] >> 14;\r\n\t var m = xh * l + h * xl;\r\n\t l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;\r\n\t c = (l >> 28) + (m >> 14) + xh * h;\r\n\t w[j++] = l & 0xfffffff;\r\n\t }\r\n\t return c;\r\n\t}", "function am3(i, x, w, j, c, n) {\r\n\t var xl = x & 0x3fff, xh = x >> 14;\r\n\t while (--n >= 0) {\r\n\t var l = this[i] & 0x3fff;\r\n\t var h = this[i++] >> 14;\r\n\t var m = xh * l + h * xl;\r\n\t l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;\r\n\t c = (l >> 28) + (m >> 14) + xh * h;\r\n\t w[j++] = l & 0xfffffff;\r\n\t }\r\n\t return c;\r\n\t}", "function ex_3_R(a){\n m = 0;\n if ( a.length == 0 ) m = 0;\n else m = (ex_3_R(a.slice(1))*(a.length-1) + a[0])/a.length;\nreturn m;\n}", "function realFft(input, output) {\n\n var n = input.length,\n x = output, \n TWO_PI = 2*Math.PI,\n sqrt = Math.sqrt,\n n2, n4, n8, nn, \n t1, t2, t3, t4, \n i1, i2, i3, i4, i5, i6, i7, i8, \n st1, cc1, ss1, cc3, ss3,\n e, \n a,\n rval, ival, mag; \n\n _reverseBinPermute(output, input);\n\n for (var ix = 0, id = 4; ix < n; id *= 4) {\n for (var i0 = ix; i0 < n; i0 += id) {\n //sumdiff(x[i0], x[i0+1]); // {a, b} <--| {a+b, a-b}\n st1 = x[i0] - x[i0+1];\n x[i0] += x[i0+1];\n x[i0+1] = st1;\n } \n ix = 2*(id-1);\n }\n\n n2 = 2;\n nn = n >>> 1;\n\n while((nn = nn >>> 1)) {\n ix = 0;\n n2 = n2 << 1;\n id = n2 << 1;\n n4 = n2 >>> 2;\n n8 = n2 >>> 3;\n do {\n if(n4 !== 1) {\n for(i0 = ix; i0 < n; i0 += id) {\n i1 = i0;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n \n //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}\n t1 = x[i3] + x[i4];\n x[i4] -= x[i3];\n //sumdiff3(x[i1], t1, x[i3]); // {a, b, d} <--| {a+b, b, a-b}\n x[i3] = x[i1] - t1; \n x[i1] += t1;\n \n i1 += n8;\n i2 += n8;\n i3 += n8;\n i4 += n8;\n \n //sumdiff(x[i3], x[i4], t1, t2); // {s, d} <--| {a+b, a-b}\n t1 = x[i3] + x[i4];\n t2 = x[i3] - x[i4];\n \n t1 = -t1 * Math.SQRT1_2;\n t2 *= Math.SQRT1_2;\n \n // sumdiff(t1, x[i2], x[i4], x[i3]); // {s, d} <--| {a+b, a-b}\n st1 = x[i2];\n x[i4] = t1 + st1; \n x[i3] = t1 - st1;\n \n //sumdiff3(x[i1], t2, x[i2]); // {a, b, d} <--| {a+b, b, a-b}\n x[i2] = x[i1] - t2;\n x[i1] += t2;\n }\n } else {\n for(i0 = ix; i0 < n; i0 += id) {\n i1 = i0;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n \n //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}\n t1 = x[i3] + x[i4]; \n x[i4] -= x[i3];\n \n //sumdiff3(x[i1], t1, x[i3]); // {a, b, d} <--| {a+b, b, a-b}\n x[i3] = x[i1] - t1; \n x[i1] += t1;\n }\n }\n \n ix = (id << 1) - n2;\n id = id << 2;\n } while (ix < n);\n \n e = TWO_PI / n2;\n\n for (var j = 1; j < n8; j++) {\n a = j * e;\n ss1 = Math.sin(a);\n cc1 = Math.cos(a);\n\n //ss3 = sin(3*a); cc3 = cos(3*a);\n cc3 = 4*cc1*(cc1*cc1-0.75);\n ss3 = 4*ss1*(0.75-ss1*ss1);\n \n ix = 0; id = n2 << 1;\n do {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0 + j;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n \n i5 = i0 + n4 - j;\n i6 = i5 + n4;\n i7 = i6 + n4;\n i8 = i7 + n4;\n \n //cmult(c, s, x, y, &u, &v)\n //cmult(cc1, ss1, x[i7], x[i3], t2, t1); // {u,v} <--| {x*c-y*s, x*s+y*c}\n t2 = x[i7]*cc1 - x[i3]*ss1; \n t1 = x[i7]*ss1 + x[i3]*cc1;\n \n //cmult(cc3, ss3, x[i8], x[i4], t4, t3);\n t4 = x[i8]*cc3 - x[i4]*ss3; \n t3 = x[i8]*ss3 + x[i4]*cc3;\n \n //sumdiff(t2, t4); // {a, b} <--| {a+b, a-b}\n st1 = t2 - t4;\n t2 += t4;\n t4 = st1;\n \n //sumdiff(t2, x[i6], x[i8], x[i3]); // {s, d} <--| {a+b, a-b}\n //st1 = x[i6]; x[i8] = t2 + st1; x[i3] = t2 - st1;\n x[i8] = t2 + x[i6]; \n x[i3] = t2 - x[i6];\n \n //sumdiff_r(t1, t3); // {a, b} <--| {a+b, b-a}\n st1 = t3 - t1;\n t1 += t3;\n t3 = st1;\n \n //sumdiff(t3, x[i2], x[i4], x[i7]); // {s, d} <--| {a+b, a-b}\n //st1 = x[i2]; x[i4] = t3 + st1; x[i7] = t3 - st1;\n x[i4] = t3 + x[i2]; \n x[i7] = t3 - x[i2];\n \n //sumdiff3(x[i1], t1, x[i6]); // {a, b, d} <--| {a+b, b, a-b}\n x[i6] = x[i1] - t1; \n x[i1] += t1;\n \n //diffsum3_r(t4, x[i5], x[i2]); // {a, b, s} <--| {a, b-a, a+b}\n x[i2] = t4 + x[i5]; \n x[i5] -= t4;\n }\n \n ix = (id << 1) - n2;\n id = id << 2;\n \n } while (ix < n);\n }\n }\n \n /* Scale output to have same norm as input. */\n var f = 1 / sqrt(n);\n for (var i = 0; i < n; i++)\n\t x[i] *= f;\n\n}" ]
[ "0.614259", "0.5963369", "0.56967306", "0.56478345", "0.56116265", "0.5596889", "0.55865747", "0.5432951", "0.5354453", "0.53440905", "0.5309049", "0.5304373", "0.52926075", "0.52814436", "0.5281253", "0.52663386", "0.526267", "0.52441716", "0.5233243", "0.52302456", "0.52232695", "0.52208096", "0.52146447", "0.5203195", "0.5201473", "0.520048", "0.51851606", "0.5179184", "0.5166517", "0.51625174", "0.5162234", "0.51565343", "0.51565343", "0.51565343", "0.51565343", "0.51565343", "0.51565343", "0.51565343", "0.51565343", "0.51408523", "0.5140213", "0.5139018", "0.5133774", "0.5129692", "0.51214397", "0.5112319", "0.51067525", "0.51062727", "0.5103946", "0.5095308", "0.5088914", "0.5086776", "0.5081562", "0.5079103", "0.5077534", "0.5074738", "0.507221", "0.5062352", "0.50559884", "0.5054183", "0.50521886", "0.50482047", "0.50457615", "0.5041971", "0.50412935", "0.50360215", "0.5035405", "0.50346553", "0.5033395", "0.5033395", "0.5022108", "0.50110006", "0.50099015", "0.500984", "0.500826", "0.50080687", "0.500416", "0.50013864", "0.50012934", "0.50000346", "0.49993196", "0.49958846", "0.49912864", "0.4982663", "0.49823415", "0.4981538", "0.4980608", "0.49800614", "0.49799472", "0.4979929", "0.49797", "0.49789068", "0.49789068", "0.49774867", "0.497739", "0.49766913", "0.49736962", "0.49734467", "0.49734467", "0.49721023", "0.49705786" ]
0.0
-1
AJAX call to the include directory to delete an item from a package
function deletePackageItem() { $.ajax({ type: "GET", url: '../include/getPackageItems.php?action=deletePackageItem&packageID='+globalPackageID+'&categoryID='+globalCategoryID, success: function (data) { getPackageItems(globalPackageID); }, failure: function(data) { alert("Delete Failed."); }, dataType: "json" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteItemData() {\n var options = {\n url: \"http://localhost:3000/projects\" + \"/\" + Itemid,\n method: \"DELETE\",\n data: \"\",\n success: function() {\n deleteItem();\n },\n error: function(error) {\n console.log(\"error\",error);\n }\n }\n ajax(options);\n}", "function deleteItem(itemId) {\n $.ajax({\n method: 'DELETE',\n url: `/todo/${itemId}`\n })\n .then(response => {\n console.log('deleted item');\n getList();\n })\n .catch(error => {\n alert(`Error on delete`, error);\n });\n} // end deleteItem", "function deleteItem() {\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n var text = this.responseText;\n $(\"#confirmDel\").text(text);\n }\n }\n\n xmlhttp.open(\"POST\", \"../stock/AdminDeleteFromStock.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(collectData());\n }", "function deleteItem(id) {\n $.ajax({\n url: \"api/ingredientsDb/\" + id,\n type: \"DELETE\",\n success: function() {\n $(\"#row\" + id).remove();\n alert('Item removed from database!');\n },\n error: function() {\n alert('ERROR: Not deleted!');\n }\n });\n}", "function deleteItem(pokemonId) {\n $.ajax({\n method: 'DELETE',\n url: 'http://localhost:8080/pokemon/' + pokemonId\n }).done(function (pokemon) {\n })\n}", "function deleteResortAjax(path){\n $.ajax({\n url: path,\n type: 'DELETE',\n headers: { Authorization: 'Token token=' + sessionStorage.getItem('powder-token')}\n })\n .done(function() {\n console.log(\"Deleted\");\n loadResortsAjax();\n })\n .fail(function() {\n console.log(\"error\");\n });\n }", "function deleteItem(id){\r\n $.ajax(\r\n {\r\n url: 'http://157.230.17.132:3019/todos/' + id,\r\n method: 'DELETE',\r\n success: function(dataResponse){\r\n getList();\r\n },\r\n error: function(){\r\n alert(\"Non è possibile cancellare l'elemento!\")\r\n }\r\n }\r\n );\r\n }", "function deleteService(url) {\n $.ajax({\n url: url,\n type: 'DELETE',\n success: function(result) {\n alert(\"your request has been accepted!\", result)\n updateIbpList(uid, jenkinsBase, apacheBase)\n },\n error: function(err) {\n alert(\"error deleting ibp service:\", err)\n }\n });\n}", "function DelVendor(id){\n $.ajax({\n url:`/vendors/${id}`,\n method: 'DELETE',\n contentType:'application/json',\n success: function(data){\n refreshList()\n },\n error: function(request, msg, error){\n alert('Oops...Something went wrong...!')\n refreshList()\n }\n })\n refreshList()\n}", "function deleteFixum(fixumID) {\n\n //alert(fixumID.toString());\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n\n $('#' + fixumID).remove();\n }\n };\n xhttp.open(\"DELETE\", \"../controller/fixumController.php/?id=\" + fixumID, false);\n xhttp.send();\n return false;\n}", "function deleteRecipe(rrid) {\n $.ajax({\n url: _lcarsAPI + \"responserecipes/\" + rrid,\n type: 'DELETE',\n contentType: 'application/json',\n success: function() { populateRecipes(); populateOrchestration(); }\n });\n}", "function deleteItem() {\n var id = $(this).parent().attr('data-id');\n\n $.ajax(\n {\n url: 'http://157.230.17.132:3017/todos/' + id,\n method: 'DELETE',\n success: function() {\n getAllItemsSaved();\n },\n error: function() {\n alert(\"Attenzione, non sono riuscito a eliminare l'elemento\");\n }\n }\n );\n}", "function deleteQuestion(qid, packageName) {\n\n $.ajaxSetup({\n beforeSend: function (xhr, settings) {\n if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) {\n // Send the token to same-origin, relative URLs only.\n // Send the token only if the method warrants CSRF protection\n // Using the CSRFToken value acquired earlier\n xhr.setRequestHeader(\"X-CSRFToken\", csrftoken);\n }\n }\n });\n data = {\n 'id': qid,\n 'packageName': packageName\n }\n $.ajax({\n url: 'deletequestion',\n type: 'POST',\n dataType: \"json\",\n data: data,\n success: function (data) {\n // window.location.reload();\n changePackage(packageName);\n }\n\n });\n }", "function deleteTask_click()\n{\n var taskId = $('#findTaskId').text()\n //Kall mot xmlHttp delete funksjon\n deleteTask(taskId)\n //Unmouter detaljevisning etter at kalenderinnslag er slettet\n m.mount(taskRoot, null)\n}", "function deleteTaiChi() {\r\n deleteAJAX('tai_chi', 'Tai Chi');\r\n}", "function actionDelete(p){\n\tsrc = collection[p].name;\n\t\n\tif($('#'+src).hasClass('isLocked')){\n\t\talert(\"Ce dossier est protégé contre la suppression\");\n\t\treturn false;\n\t}\n\n\tmessage = $('#'+src).hasClass('isDir')\n\t\t? \"Voulez vous supprimer ce dosssier et TOUT son contenu ?\"\n\t\t: \"Voulez vous supprimer ce fichier ?\";\n\n\tif(!confirm(message)){\n\t\t//log_(\"REMOVE CANCELED BY USER\");\n\t\treturn false;\n\t}\n\t\n\tvar get = $.ajax({\n\t\turl: 'helper/action',\n\t\tdataType: 'json',\n\t\tdata: {'action':'remove', 'src':collection[p].url}\n\t});\n\t\n\tget.done(function(r) {\n//\t\tif(r.callBack != null) eval(r.callBack);\n\t\tif(r.success == 'true'){\n\t\t\t$('div[id=\"'+src+'\"]').fadeTo(218,0, function() {\n\t\t\t\t$(this).remove();\n\t\t\t});\n\t\t\tmakeDragAndDrop();\n\t\t}\n\t});\n}", "function deleteItems(id) {\n $.ajax(\"/api/delete/\" + id, {\n type: \"PUT\"\n }).then(function (result) {\n console.log(result);\n console.log(\"Deleted\");\n location.reload();\n })\n }", "function deleteItem(id) {\n executeHTTPRequest(id, 'DELETE', '/remove')\n}", "function delete_file (file_name, reload_flag, media_id)\n{\n var params = {};\n params ['file'] = file_name;\n if (media_id !== undefined)\n params ['media_id'] = media_id; \n $.ajax ({url: '/admin/index/remove',type: 'POST', data: params,\n complete : function (response, status) {if (reload_flag === true) {$.fancybox.close ();reload_list ();}} \n }); \n}", "function deleteElement(id){\n\n jQuery.ajax({\n url : 'http://127.0.0.1:8000/elements/'+id,\n async : true,\n contentType: \"application/json\",\n dataType: 'json',\n type : 'DELETE'\n }).done(function(response) {\n\n alert(\"Element supprimée avec succée\");\n\n location.reload();\n\n }).fail(function(xhr, status, error) {\n alert(status);\n });\n}", "function AdminPromotionsActionDeletePromotion() {\n var data = [];\n data[\"templateFolder\"] = AdminPromotionsTemplateFolder();\n data[\"promotionId\"] = $(this).attr('promotionId');\n var confirmVal = confirm(\"Вы уверены что хотите удалить эту акцию со всеми ее ревизиями?\");\n if (confirmVal == true) {\n BX.ajax({\n url: data[\"templateFolder\"] + \"/ajax/action/DeletePromotion.php\",\n data: data,\n method: 'POST',\n dataType: 'html',\n onsuccess: function (rezult) {\n if(rezult !== \"yes\") {\n alert(\"Не удалось удалить акцию, возможно у вас нет прав.\\nОбратитеть к администратору\");\n } else {\n alert(\"Акция и все ее ревизии были удалены\");\n }\n AdminPromotionsUiShowPromotionsList();\n },\n onfailure: function (rezult) {\n alert(\"Произошла ошибка выполнения скрипта\");\n },\n });\n }\n}", "function deleteFile(file_id, utente_id){\n $.ajax({\n url: \"php/query.php\",\n data: {\n \"command\": 'deleteFile',\n \"file_id\": file_id\n },\n cache:false,\n type: \"GET\"\n }).always(function() {\n getFiles(utente_id);\n alert('File eliminato con successo.');\n });\n}", "function removeItem(id,type){\n $.ajax({\n url: Routing.generate('fly_platform_package_calendar_events_remove',{id: id, type: type}),\n type: 'POST',\n format: 'json',\n async: false,\n data: {},\n success: function (res, textStatus, xhr) {\n // console.log(res.data);\n if(res.asc == 'success'){\n $('#calendar').fullCalendar( 'refetchEvents' );\n showHideModal('#newPkgModal','hide');\n }else{\n alert(res.msg);\n }\n\n },\n error: function(){\n alert('errors');\n }\n });\n}", "function ajaxDelete(id, url) {\n\t\t$.ajax({\n\t\t\turl: url,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tdata:{\n\t\t\t\t'id':id\n\t\t\t},\n\t\t\tasync: true,\n\t\t\tsuccess: function(){\n\t\t\t\t$work = $('#listWork button[data-id='+id+']').closest('.my-work');\n\t\t\t\t$('#deleteModal .btn-close').click();\n\t\t\t\t$work.fadeOut('slow').remove();\n\t\t\t},\n\t\t\terror: function(error){\n\t\t\t\t$('#deleteModal .btn-close').click();\n\t\t\t\t$('#errorModal #contentError').html(error.responseText);\n\t\t\t\t$('#errorModal').modal('toggle');\n\t\t\t}\n\t\t});\n\t}", "function deleteClick() {\r\n if (!confirm('Delete this group?'))\r\n return;\r\n var groupId = Number(hdnGroupId.value);\r\n var o = {\r\n url: groupsUrl + groupId,\r\n success: function (data) {\r\n refreshData();\r\n },\r\n error: function (xhr) {\r\n divMessage.innerText = \"An Error Occurred. Please Try Again.\";\r\n }\r\n };\r\n meta.del(o);\r\n}", "function deleteItem(itemId) {\n $.ajax({\n url: '/products/delete/' + itemId,\n type: 'DELETE',\n\n }).then(data => {\n console.log(data);\n window.location.reload();\n })\n }", "function removeItem(itemId) {\n $.ajax({\n type:'DELETE',\n url:'/items',\n data:`itemId=${itemId}`,\n success:function(data) {\n if(data) {\n $(`#item_${itemId}`).remove();\n\n // [TODO] - add visual notification on page\n } else { alert(\"Sorry.. you can't do that\") }\n }\n });\n}", "function deleteItem(i) {\n var xhr = new XMLHttpRequest();\n var itemId = itemDatas[i][5]\n var url = 'http://fa19server.appspot.com/api/wishlists/' + itemId+ '/' + '?access_token=' + sessionId\n xhr.onreadystatechange = function () {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n refreshItemsPara();\n }\n }\n xhr.open(\"DELETE\", url, true);\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xhr.send(null)\n\n document.getElementById(\"deleteBox\").style.display = \"none\";\n document.getElementById(\"editBox\").style.display = \"none\";\n document.getElementById(\"editBox\").style.zIndex = '1001';\n document.getElementById(\"over\").style.display = \"none\";\n\n}", "function onDeleteArtifact() {\n let id = $(this).data('id');\n\n let body = new FormData();\n body.append('action', 'deleteArtifact');\n body.append('artifactId', id);\n body.append('projectId', $('#projectId').val());\n\n api.post('/artifacts.php', body, true)\n .then(res => {\n snackbar(res.message, 'success');\n $(`#${id}`).remove();\n })\n .catch(err => {\n snackbar(err.message, 'error');\n });\n}", "function deleteTodo(self, apiUrl, template, todosList){\n var todoId = self.data('id');\n//console.log(todoId);\n\n$.ajax({\n url: apiUrl + '/' + todoId,\n method: 'DELETE',\n success: function(){\n printAllTodos(apiUrl, template, todosList);\n },\n error: function() {\n console.log('errore cancellazione todo');\n \n }\n});\n}", "deleteItem() {\n if (window.confirm('Etes-vous sur de vouloir effacer cet outil ?')) {\n sendEzApiRequest(this.DELETE_ITEM_URI + this.props.id, \"DELETE\")\n .then((response) => {\n this.props.deleteButtonCB(this.props.tool)\n }, error => {\n alert(\"Impossible de suprimer l'outil\")\n\n console.log(error)\n })\n }\n }", "function Delete_Wishlist_item(id) {\n $.ajax({\n url: '/wishlist/delete_item',\n method:\"GET\",\n data:{ \n pid:id,\n },\n success: function (response) {\n if(response['deleteSts'] == 1){\n $(\"#WishlistTr\"+id).remove();\n total_wishlist_itmes()\n Toastify({\n text: response['status'],\n backgroundColor: \"linear-gradient(to right, #F50057, #1B1F85)\",\n className: \"error\",\n }).showToast();\n }\n }\n });\n}", "function deleteDownloadedFiles(company_id){\n\t$('.checked_files').attr('checked', false);\n\t$url = '/client/dashboard/removedownloadedfolders?id=' + company_id;\n\t\t\n\t$.ajax({ \n\t\turl: $url,\n\t\ttype: 'GET',\n\t\tsuccess: function(html) {\t\t\t\t\n\t\t\tconsole.log(html);\n\t\t}\t\t\t\t\t\n\t});\n}", "function DeleteItem(id) {\n ajaxCall(\"DELETE\", \"../api/items/\" + id, \"\", deleteSuccess, error);\n }", "function _sendRemoveItemAjax(url, id) {\n fetch(url, {\n method: \"post\",\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n body: `id=${id}`\n })\n .then(response => {\n if (!response.ok) {\n throw new Error('There was a network error!');\n }\n return response.json();\n })\n .then(result => {\n if (result?.message === \"item-removed\") {\n console.log('Success: the item was removed');\n _notifyConnectedClientsTwoParts(\"ITEM-REMOVED\", result.id, result.listId);\n }\n else if (result?.message === \"not-valid\") {\n $('#messageArea').html(\"The Item or List no longer exists!\");\n $('#alertArea').show(400);\n }\n else {\n _reportErrors(result);\n }\n })\n .catch(error => {\n console.error('Error:', error);\n });\n }", "function delArtist(e) {\n $.ajax({\n type: 'DELETE',\n url: 'http://localhost:3001/artists/' + e.target.id,\n processData: false,\n encode: true,\n success: function(data, textStatus, jQxhr) {\n console.log(data);\n get_artists();\n },\n error: function(jqXhr, textStatus, errorThrown) {\n alert(errorThrown);\n }\n });\n}", "function delete_data(id){\n $.ajax({\n url : product_api + id,\n type: 'DELETE',\n success: (data) => {\n load_data_json();\n },\n error: (e) => {\n $('.msg.error.error.api').html('<h4>Erro ao acessar a api</h4>')\n }\n })\n}", "function remove(element,event) {\n event.preventDefault();\n var href;\n if (window.location.search)\n {\n href = element.search.replace('?', '&');\n } else\n {\n href = element.search;\n }\n var url_string = window.location.href + href;\n var url = new URL(url_string);\n var path = url.searchParams.get('path');\n $.ajax({\n url:\"delete.php\",\n type:\"POST\",\n data: {path: path},\n success:function(response)\n {\n $('.cont').html(response);\n }\n })\n\n}", "function perform_deletion(value_passed){\nlet current_id=document.getElementsByClassName('hidden_value')[value_passed].value;\nlet confirmation=confirm(\"Are you sure?\");\nif (confirmation===true){\n$.ajax({\nmethod: \"DELETE\",\nurl: \"http://localhost:3000/user/\"+current_id,\n\n})\n.done(function( msg ) {\n //console.log(msg);\n alert( \"User file successfully Deleted\" );\n location.reload();\n});\n\n}\n}", "function getPackageItems(packageID) {\n document.getElementById(\"packageItemsList\" + packageID).innerHTML = \"\";\n $.ajax({\n type: \"GET\",\n url: '../include/getPackageItems.php?action=getOnePackageItems&packageID='+packageID,\n success: function (data) {\n if (data.length > 0) {\n for (var i = 0; i < data.length; i++) {\n deleteString = \"<a class='deletePackageItem' data-packageID=\" + data[i]['packageID'] + \" data-categoryID=\" + data[i]['pCategory'] + \" title='Delete from package'><i class='zmdi zmdi-delete'></i><a>\";\n document.getElementById(\"packageItemsList\" + packageID).innerHTML += '<li class=\"list-group-item\">' + data[i]['pName']+ \", \" + data[i][\"pDescription\"] + \" \" + deleteString + '</li>';\n }\n }\n },\n failure: function(data) {\n console.log(\"failure\");\n },\n dataType: \"json\"\n });\n}", "function DeleteItemFromMyQuestList(event) {\n\n //event.preventDefault();\n\n // Pop up a confirmation dialog\n var confirmation = confirm('Are you sure you want to remove this Quest from your list?');\n\n // Check and make sure the user confirmed\n if (confirmation === true) {\n \n \n\n // If they did, do our delete\n $.ajax({\n type: 'DELETE',\n url: '/AppEngine/deleteQuestFromMyList/' + localStorage.getItem('QuestToDelete')\n }).done(function( response ) {\n\n // Check for a successful (blank) response\n if (response.msg === '') {\n }\n else {\n alert('Error: ' + response.msg);\n }\n\n // Update the table\n //populateQuestsTable();\n\n });\n\n }\n else {\n\n // If they said no to the confirm, do nothing\n return false;\n\n }\n\n}", "function deleteMe(item){\n fetch(\"/remove/\" + item.innerText,{\n method: \"delete\"\n }).then(res=>res.json())\n .then(res2 => {\n // console.log(res2)\n location.reload()\n });\n }", "function BtnDelete() {\n transacionAjax_D_elete(\"D_elete\");\n}", "function deleteFile(fileID) {\n $(\"#fileList div[data-id='\" + fileID + \"']\").remove();\n\n // Remove visual of the file in other clients\n var taskID = $(\"#btnSubmitComment\").attr(\"data-task-id\");\n\n $.ajax({\n url: \"Handler/FileHandler.ashx\",\n data: {\n action: \"deleteTaskFile\",\n projectID: projectID,\n taskID: taskID,\n fileID: fileID\n },\n type: \"get\",\n success: function () {\n proxyTC.invoke(\"deleteFile\", taskID, fileID)\n }\n });\n}", "function remove(id){\r\n\t$.get('/cartpurchase/unique/'+id,function(data){\r\n\t\t$('#cartProduct'+id).remove();\r\n\t\t$.post('/cartpurchase/delete',data).done(function(response){\r\n\t\t\tif(data.data.ok == true){\r\n\t\t\t\tconsole.log(\"cartpurchase deleted\");\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function feDel() {\n var fe_item = $('.sublist input[name=new]:checked');\n var fe_name = fe_item.attr('value');\n \n jQuery.ajax({url: '/delete_frameelement/', type: 'POST', dataType: 'text',\n data: {\n fe_name: fe_name,\n frame_name: frameName\n },\n success: function(data) {\n location.reload();\n },\n error: errorFunc\n });\n}", "function deletee() {\n\tdocument.getElementById(\"deletebtn\").disabled = true;\t\t//Prevent sapm or misclick\n\t$.ajax({\n\t\turl: getapi(),\n\t\ttype: \"POST\",\n\t\tdata: {\n\t\t\tdelete:$('#deleteid').html(),\n\t\t},\n\t\tsuccess:function(){\n\t\t\tlocation.reload();\n\t\t},\n\t\terror:function(xhr){\n\t\t\tvar err = eval(\"(\" + xhr.responseText + \")\");\n\t\t\talert(err.error);\n\t\t\tdocument.getElementById(\"deletebtn\").disabled = false;\n\t\t}\n\t});\n}", "function delete_node(e) {\n node = e.title.split('_')[1];\n $.ajax({\n url: '/authorize',\n method: 'DELETE',\n data: {'node':node},\n beforeSend: spinner(),\n }).done(function(data){\n $('#view-results').html(data);\n });\n \n}", "function deleteCartItem() {\n $.ajax({\n type: \"GET\",\n url: '../include/deleteCartItem.php?cartID='+cartID+'&productID='+productID,\n success: function (data) {\n //Deleted successfully\n getCartItems(cartID);\n },\n failure: function (data) {\n //Delete failed.\n alert(\"Delete failed.\");\n }\n });\n}", "function fileDelete($href){\n $.post(\"/souche/\"+($(\"#ref\")[0].innerHTML)+\"/suppr/file\", // send HTTP POST request to a page and get the answer\n {\n _token: $('input[name=_token]').val(), // send data\n href:$href\n },\n function(data, status){ //retreive response\n console.log(\"Data: \" + data + \"\\nStatus: \" + status);\n if(status === \"success\"){\n //alerteInfo(data[0].alert, status, data);\n window.location.reload()\n //TODO : décommenter\n }\n else{\n window.location.reload()\n alerteInfo('info', status, data);\n }\n });\n}", "deleteDep(depid){\n if(window.confirm('Are you sure?'))\n {\n fetch('http://localhost:63308/api/department/'+depid,\n {\n method:'DELETE',\n header:{'Accept':'application/json',\n 'Content-Type':'application/json'}\n })\n }\n }", "function deleteGroup(gruppo_id){\n\n $.ajax({\n url: \"php/query.php\",\n data: {\n \"command\": 'deleteGroup',\n \"gruppo_id\": gruppo_id\n },\n cache: false,\n type: \"GET\"\n }).always(function() {\n $('li.gruppo[data-id=\"' + gruppo_id + '\"]').hide();\n alert('Gruppo eliminato con successo.');\n });\n\n}", "function deleteData() {\n\tif (!confirm(\"Уверен ?\")) {return};\n\n $.ajax({\n url: '/lists/' + todolist.getAttribute('data-id'), \n type: 'DELETE',\n success: function(data) {\n console.log(data);\n window.location.replace(\"/\");\n },\n error: function(xhr, str){\n alert('Возникла ошибка: ' + xhr.responseCode);\n }\n }); \n}", "function deleteRequest(id){\n //finds the li element in the HTML for quote\n let li1 = document.getElementById(`li-${id}`)\n //fetch request configs\n let config = {\n method: 'DELETE',\n headers: {\n \"Content-Type\": \"application/json\"\n }\n }\n //fetch request to update database\n fetch(quoteUrl + `/${id}`, config)\n .then(response => response.json());\n //removes the li element from the HTML\n li1.remove()\n}", "function deleteLinkUp(id) {\n const target = id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/linkup/\" + id\n }).then(function() {\n $(`#${target}`).remove();\n console.log(\"success\");\n });\n }", "function deleteItem(str) {\n\n var c = confirm(\"Are you sure?\");\n\n if (c) {\n if (window.XMLHttpRequest) {\n xmlhttp = new XMLHttpRequest();\n } else {\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"crud_pop_up\").innerHTML = this.responseText;\n $('#delete_item_modal').modal('show');\n location.reload();\n $('#tabs').tabs('#admin_items');\n }\n };\n xmlhttp.open(\"GET\", \"http://localhost/storelocator/str_lctr_admin/item/delete-item.php?q=\" + str, true);\n xmlhttp.send();\n }\n}", "function deleteFile()\n{\n var filePath = $(this).closest(\"tr\").attr(\"path\");\n var url = \"https://api.dropbox.com/1/fileops/delete\";\n var headers = {\n Authorization: 'Bearer ' + getAccessToken(),\n };\n var args = {\n url: url,\n headers: headers,\n crossDomain: true,\n crossOrigin: true,\n type: 'POST',\n data : {\n root: 'auto',\n path: filePath\n },\n dataType: 'json',\n success: function(data)\n {\n var oReq = new XMLHttpRequest();\n var request_data ={\n \"filePath\":filePath,\n \"owner\":user_id,\n };\n oReq.open(\"POST\",CLOUD_SERVER+'delete_file_meta', true);\n oReq.responseType = \"json\";\n oReq.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n oReq.onload = function(oEvent)\n {\n getMetadata(filePath.substring(0,filePath.lastIndexOf('/')),createFolderViews);\n };\n oReq.send(JSON.stringify(request_data));\n },\n error: function(jqXHR)\n {\n console.log(jqXHR);\n }\n };\n $.ajax(args); \n}", "function deleteItem(productId) {\n return $.ajax({\n url: deleteUri,\n type: \"POST\",\n data: { ProductId: productId }\n });\n }", "async function deleteProduct() {\r\n if (confirm(\"are you sure you want to delete \" + this.name + \" from products?\")) { \r\n let data = new FormData()\r\n data.append(\"action\", \"removeProduct\")\r\n data.append(\"product\", JSON.stringify(this))\r\n \r\n const response = await makeReq(\"./api/recievers/productReciever.php\", \"POST\", data)\r\n adminUpdateProductPanel()\r\n } \r\n \r\n}", "function delete_dropfile(){\n var url = \"controllers/script/delete_dropFile-script.php\";\n var fileName = $(event.target).parent().parent().children(\"div[class=dz-filename]\").children(\"span\").text();\n var div_to_remove = $(event.target).parent().parent().parent();\n $.ajax(url, {\n method : \"POST\",\n data : {\n \"fileName\" : fileName\n },\n dataType : \"text\",\n success: function(){\n div_to_remove.remove();\n },\n error: function(xhr) {\n alert(\"ERROR: \" + xhr.responseText + xhr.status);\n }\n });\n}", "function delListNotas(){\n new Ajax.Request(Utils.getKumbiaURL(\"desktop/delListNotas\"), {\n parameters: {\n numero: nota_selec\n },\n onSuccess: function(transport){\n showNotas();\n },\n onFailure: function(transport){\n alert(transport.responseText);\n }\n });\n}", "function delListNotas(){\n new Ajax.Request(Utils.getKumbiaURL(\"desktop/delListNotas\"), {\n parameters: {\n numero: nota_selec\n },\n onSuccess: function(transport){\n showNotas();\n },\n onFailure: function(transport){\n alert(transport.responseText);\n }\n });\n}", "function deleteSong(artistId, albumId, songId) {\n $.ajax({\n type: \"DELETE\",\n url: \"artists\" + artistId + \"albums\" + albumId + \"songs\" + \".json\",\n contentType: \"application/json\",\n datatype: \"json\"})\n\n .done(function(data) {\n $('#song_\"'+songId+'\"').remove();\n });\n}", "function deleteStudentCourseById(Id){\n return $.ajax({\n url:serverUrl+\"/_api/web/lists/getbytitle('StudentRegisterCourse')/items(\"+Id+\")\",\n method: \"POST\", //Specifies the operation to create the list item \n contentType:\"application/json;odata=verbose\",\n headers: {\n \"Accept\": \"application/json;odata=verbose\", \n \"X-RequestDigest\": $(\"#__REQUESTDIGEST\").val(),\n \"IF-MATCH\": \"*\",\n \"X-HTTP-Method\": \"DELETE\"\n }\n });\n}", "function deleteAsset(libAsset){\n let xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = function() {\n if(xhr.readyState === 4){\n deleteRowByAssetId(libAsset.assetId);\n \n alert('Asset with ID ' + libAsset.assetId + ' was deleted.');\n }\n }\n\n xhr.open('DELETE', '/library-api/api/library-asset');\n\n xhr.send(JSON.stringify(libAsset));\n}", "function delSong(e) {\n var song_id = e.target.id\n var artist_id = song_id.substr(0, song_id.indexOf(\"d\"));\n var song_id = song_id.substr(song_id.indexOf(\"l\") + 1, song_id.length);\n $.ajax({\n type: 'DELETE',\n url: 'http://localhost:3001/songs/' + artist_id,\n dataType: 'text',\n data: song_id,\n processData: false,\n encode: true,\n success: function(data, textStatus, jQxhr) {\n console.log(data);\n get_artists();\n },\n error: function(jqXhr, textStatus, errorThrown) {\n alert(errorThrown);\n }\n });\n}", "static delete(request, response) {\r\n\r\n itemsModel.getById(request.params.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n itemsModel.delete(request.params.id) \r\n response.sendStatus(200);\r\n console.log('Item has been deleted. ID: ', request.params.id); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Item not found. ID: ', request.params.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error deleting item by ID: ', request.params.id, err);\r\n }); \r\n\r\n }", "function ajaxClearSchedule( url )\n{\n if(confirm('Are you sure you want to clear all vendors schedule.')) {\n $('.ajaxLoading').show();\n $.post( url+'/delete',function( data ) {\n\n if(data.status =='success')\n {\n console.log(\"called succes\");\n notyMessage(data.message);\n } else {\n console.log(\"called error\");\n notyMessageError(data.message);\n }\n $('.ajaxLoading').hide();\n });\n\n }\n \n}", "function deleteInventoryItem(itemId)\n\t{\n\t\titemId = 6; //TEST CODE REMOVE\n\n\t\t$.ajax({\n \tmethod: \"DELETE\",\n \turl: \"/api/inventory/\" + itemId\n \t\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\t\n\t });\n\n\t}", "function confirmDeleteVersion(versionId) {\n $('#version-delete-' + versionId).remove();\n $('#version-info-' + versionId).remove();\n\n // perform ajax request\n $.ajax({\n type: 'POST',\n url: '/planta/' + plantaID + '/deleteVersion',\n crossDomain: true,\n data: {'versao': versionId},\n dataType: 'json',\n async: true,\n error: function (response, status, error) {\n logErrors(response, status, error, 'Ocorreu um erro ao apagar a versão do projeto.');\n },\n success: function (response) {\n for (var i = 0, n = versions.length; i < n; i++) {\n if (response.version == versions[i]['id']) {\n versions.splice(i, 1);\n break;\n }\n }\n }\n });\n}", "function Eliminar(){\n const inputIdClavemateria = document.getElementById(\"idsalon\").value;\n let url = uri + \"/\" + inputIdClavemateria\n fetch(url,{method:'DELETE'})\n .then(response => response.text())\n .then(data => Mensaje(data))\n .catch(error => console.error('Unable to Eliminar Item',error));\n}", "function del(delUrl) {\n $.ajax( {\n url: delUrl,\n type: 'DELETE',\n success: function(results) {\n location.reload();\n }\n });\n}", "function remove(module, endpoint, auth) {\n return $.ajax(makeRequest('DELETE', module, endpoint, auth));\n }", "function utilDelete(ctl) {\n crud =\"suppr\";\n $(ctl).parents(\"tr\").remove();\n $.ajax({\n url : backendurl + 'suppMeal.php',\n type : 'POST',\n data : 'label='+ document.getElementById('label').value,\n dataType : 'application/json'\n });\n}", "function deletePlaylist(playlistId) {\n var prompt = confirm(\"Are you sure you want to delte this playlist?\");\n\n if(prompt == true) {\n\n console.log(\"playlist deleted\")\n $.post(\"include_files/form_handlers/ajax/deletePlaylist.php\", { playlistId: playlistId })\n .done(function(error) {\n\n if(error != \"\") {\n alert(error);\n return;\n }\n\n //do something when ajax returns\n openPage(\"yourMusic.php\");\n });\n\n\n }\n}", "function deleteEntity(token, id) {\n apiUri = global_enterpriseEndpointUri;\n drawer = global_drawer;\n // https://hack.softheon.io/api/enterprise/content/v1/folder/{drawer}/{id}\n var url = apiUri + \"/content/v1/folder/\" + drawer + \"/\" + id;\n\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": url,\n \"method\": \"DELETE\",\n \"headers\": {\n \"authorization\": \"Bearer \" + token\n }\n }\n\n $.ajax(settings).done(function (response) {\n console.log(response);\n });\n}", "function deleteTemplateElement(req){\n deleteElement(dataTable_templates,'#template_'+req.request.data);\n updateTemplateSelect();\n}", "function deleteContentsHandler(req) {\n if (req.readyState == 4) {\n sendAjaxReq('GET', '/category/all?parent=' + sanitizePath(currentParentPath), updateContents);\n }\n }", "function onDelete(work_item_id) {\n // Use Ajax to start deleting task from the database\n $.ajax({\n url: `https://localhost:5001/api/v1/WorkItem?workItemId=${work_item_id}`,\n type: 'DELETE',\n cache: false,\n data: JSON.stringify({\n \"Title\": \"delete\",\n \"Content\": \"delete\",\n \"DateCreated\": \"delete\"\n }),\n contentType: \"application/json\",\n success: function (responseData) {\n // At this point, task is deleted in the database, we will now need to remove it from\n // current list of tasks (work item)\n $(\"div\").remove(`#${work_item_id}`);\n }\n })\n}", "delete() {\n\t\treturn this.fetch(baseApiURL + this.URIPath, { method: 'DELETE' });\n\t}", "function deletegroup(id){\n jQuery.ajax({\n url:'php/group/deletegroup.php',\n type:'post',\n data:{id:id},\n success:function(data){\n if(data==\"done\")\n location.reload();\n else\n console.log(data);\n },\n error:function(){\n alert('Error in netowrk connection');\n }\n })\n }", "function deleteItems(queryString) {\n var data = new FormData();\n data.append('type', 'all');\n data.append('action', 'delete');\n var xml = new XMLHttpRequest();\n xml.open(\"POST\", \"Core/action.php?\" + queryString, true)\n xml.send(data);\n }", "function removeFromPlaylist(button, playlistId) {\n var songId = $(button).prevAll(\".songId\").val();\n\n $.post(\"include_files/form_handlers/ajax/removeFromPlaylist.php\", { playlistId: playlistId, songId: songId })\n .done(function(error) {\n\n if(error != \"\") {\n alert(error);\n return;\n }\n\n //do something when ajax returns\n openPage(\"playlist.php?id=\" + playlistId);\n });\n}", "function deleteElement(e) {\n var caption = getItemCaptionFromURL();\n var index = -1;\n for (var i = 0; i < ingredient_arr.length; i++) {\n if (ingredient_arr[i] == e.parent().text().replace('\\u00D7', '')) {\n index = i;\n }\n }\n if(index != -1)\n ingredient_arr.splice(index, 1);\n\n var postRequest = new XMLHttpRequest();\n var requestURL = '/updateIng';\n postRequest.open('POST', requestURL);\n\n var requestBody = JSON.stringify({\n INGREDIENTS: ingredient_arr,\n CAPTION: caption\n });\n\n console.log(\"== Request Body:\", requestBody);\n postRequest.setRequestHeader('Content-Type', 'application/json');\n\n postRequest.addEventListener('load', function (event) {\n console.log(\"== status:\", event.target.status);\n if (event.target.status !== 200) {\n var responseBody = event.target.response;\n alert(\"Error saving item on server side: \", +responseBody);\n } else {\n $(e).parent().remove();\n }\n });\n\n postRequest.send(requestBody);\n\n}", "function deletefunction(methodname,object)\n { \n\n let id = $(object).attr(\"rel\");\n alertify.confirm(\"Delete ?\", function (e) {\n\n if (e) {\n $.ajax({\n type: \"delete\",\n url: methodname,\n data: {id:id},\n complete:function()\n {\n alertify.alert(\"Object Deleted\",function(e)\n {\n if(e)\n {\n location.reload();\n }\n });\n }\n });\n\n } else {\n return false;\n }\n });\n }", "function deleteElement(animu) {\n var id = getId(animu);\n // Put in the csrf token\n var payload = \"csrf_token=\" + csrf;\n console.log(payload);\n var request = new window.wrappedJSObject.XMLHttpRequest();\n request.withCredentials = true;\n const type = isManga ? \"manga\" : \"anime\";\n reqUrl = `https://myanimelist.net/ownlist/${type}/${id}/delete?hideLayout=1`;\n request.open(\"POST\", reqUrl, true);\n\n request.onload = function(e) {\n // This doesn't trigger on firefox for some reason, so we can't do anything here.\n if (request.status >= 200 && request.status < 400) {\n // Success!\n } else {\n // We reached our target server, but it returned an error\n console.error(\"Server returned an error\");\n console.error(request);\n }\n };\n\n request.onerror = function() {\n // There was a connection error of some sort\n console.error(\"Connection error\");\n console.error(request);\n };\n\n // Necessary for the server to respond\n request.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n request.send(payload);\n}", "function deleteTask(element) {\n var id = element.id;\n var classname = element.className;\n var parentid = document.getElementById(classname);\n\n if (window.XMLHttpRequest) {\n xmlhttp = new XMLHttpRequest();\n }\n else {\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n alert('Task berhasil di delete');\n parentid.parentNode.removeChild(parentid);\n }\n };\n\n xmlhttp.open(\"GET\", id, true);\n xmlhttp.send();\n}", "function delete_support() {\n $.get(admin_url + 'supports/delete_support/' + supportid, function (response) {\n if (response.success === true) {\n $('.table-supports').DataTable().ajax.reload();\n $('#support').html('');\n $('.tool-container').remove();\n alert_float('success', response.message);\n }\n }, 'json');\n}", "function list_delete(list) {\t\t\t\n\tif (window.XMLHttpRequest) {\n\t\treq = new XMLHttpRequest();\n\t} else {\n\t\t req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\treq.open(\"POST\", \"/lists\", true);\n\treq.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\")\n\treq.send(\"type=list_delete&list=\" + encodeURIComponent(list));\n\n\treq.onreadystatechange = function() {\n\t\tif (req.readyState==4 && req.status==200) {\n\t\t\tdocument.getElementById('prompt').innerHTML = req.responseText;\t\t\t\t\t\n\t\t} else {\n\t\t}\n\t}\n}", "function deleteFromCart(itemCode) {\n\n var req = newXMLHttpRequest();\n\n req.onreadystatechange = getReadyStateHandler(req, updateCart);\n \n req.open(\"POST\", \"cart.do\", true);\n req.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n req.send(\"action=delete&item=\"+itemCode);\n}", "function deleteLesson() {\n //notify the server of what lesson we want to delete\n $.post('lessons', {\n code: previousDeleteCode,\n request: 'delete'\n }).done(function (data) {\n var data = $.parseJSON(data);\n if (data['status'] == 'Success') {\n //the lesson got deleted, so refresh the lesson list and hide the deletion modal\n getLessons();\n $('#deleteModal').modal('hide');\n }\n });\n}", "function removeEcar(id){\r\r\n $.post('/officium/web/ecar/remove_item',{\r\r\n 'id_producto':id\r\r\n },\r\r\n function(result){\r\r\n if(result>0){\r\r\n location.reload();\r\r\n }else{\r\r\n alert(\"Error al actualizar el Carrito. Contacte a un asesor\");\r\r\n }\r\r\n });\r\r\n}///end of function result", "function deleteArtist(btn) {\n var uid = btn.parentNode.id;\n fetch(server + '/delete/' + uid).\n then((res) => res.json() ). // obtain data as json\n then( (data) => { \n if(data.result) {\n btn.parentNode.remove();\n } else {\n alert(\"Something wrong: Failed to save artist to database\");\n }\n }).\n catch((err) => console.log(err));\n}", "deleteSite(siteId) {\n return $.ajax({\n url: root + '/sites/' +siteId,\n type: DELETE\n });\n }", "function callDelete(id,filename){\r\n\tvar msg = \"Are you sure you want to delete this record !!!\";\r\n\tif(typeof($.ui)!==\"undefined\" && typeof(DialogBox)!==\"undefined\") {\r\n\t\t//needs jquery UI and tools.js\r\n\t\tDialogBox.showConfirm(msg, \"Delete\", function(ok) {\r\n\t\t\tif(ok == true) {\r\n\t\t\t\tdeleteNow();\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tvar confirmation=confirm(msg);\r\n\t\tif(confirmation)\r\n\t\t{\r\n\t\t\tdeleteNow();\r\n\t\t}\r\n\t}\t\r\n\t//delete now\r\n\tfunction deleteNow() {\t\t\r\n\t\t$.post(CMSSITEPATH + '/' + filename + '/get.php', {'id':id, 'action':'d'}, function(data) {\r\n\t\t\tif(data == '%$#@%') {\r\n\t\t\t\tshowAccessMsg();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t//add for history\r\n\t\t\t//adding to undo history only if success\r\n\t\t\tvar jObj=eval(\"(\"+data+\")\"); \r\n\t\t\tif (jObj.status==1) {\r\n\t\t\t\tvar divID = \"singleCont\"+jObj.id;\r\n\t\t\t\tvar html = $(\"#\" + divID).html();\r\n\t\t\t\tvar obj = {ajaxPath:CMSSITEPATH + '/' + filename + '/get.php', id:id, module:filename, html:html};\r\n\t\t\t\tUndoAction.addToHistory(obj);\r\n\t\t\t\tUndoAction.showUndoPanel();\r\n\t\t\t}\r\n\t\t\tremoveDiv(data);\r\n\t\t});\r\n\t}\r\n}", "function deleteAch(value){\n\t$('#deleteBox').modal('hide')\t\n\t$(\"#delButtonIcon\").hide();\n\t$(\"#delButtonText\").text(\"Deleting\");\n\t$(\"#achDeleteLoad\").show();\n\t$(\"#delAchButton\").css(\"background-color\",'#e3342f');\n\t$(\"#delAchButton\").css(\"border-color\",'#e3342f');\n\t$(\"#delAchButton\").css(\"color\",'white');\n\tevent.preventDefault();\n\t$.ajax({\n\t\tmethod: \"DELETE\",\n\t\turl:achDelete,\n\t\tdata:{id:value, _token:token}\n\t}).done(function(response){\n\t\t$(\"#achDeleteMesssage\").show();\n\t\t$(\"#delAchButton\").hide();\n\t\t$(\"#achFormDiv\").slideUp();\n\t});\n\t// achDelete\n}", "function deleteLink( base_url, sls_link_id, div_to_update, list_element_id ){\n var confirm_delete = confirm(\"Are you sure you want to delete this link?\");\n\n if(confirm_delete){\n \tpars = 'type=38&action=ajax_delete_link&sls_link_id='+sls_link_id;\n\n\t\tvar myAjax = new Ajax.Updater(\n\t\t\t\t\t\t div_to_update,\n\t\t\t\t\t\t base_url, {\n\t\t\t\t\t\t\tmethod: 'get',\n\t\t\t\t\t\t\tparameters: pars,\n\t\t\t\t\t\t\tonComplete:function(){\n\t\t\t\t\t\t\t\tfadeOut($(list_element_id), .5);\n\t\t\t\t\t\t\t}\n\t\t\t\t });\n\n }\n}", "function dropbox_delete() {\r\n // condition check\r\n if(dropboxDeleteFilename.length < 1) {\r\n $('#deleteFromDropboxBtn').text(\"Select a file for deleting.\");\r\n return;\r\n } else if ($('#deletedDropboxFileName').val() != dropboxDeleteFilename) {\r\n notifyDropboxDeleteOperation(\"on\");\r\n return;\r\n } else if (dropboxAllowDeleteFlag == 0) {\r\n $('#deleteFromDropboxBtn').text(\"The delete process is undergoing.\");\r\n return;\r\n }\r\n \r\n // allow to delete a file\r\n notifyDropboxDeleteOperation(\"off\");\r\n \r\n var sendData = {\r\n \"service\" : \"dropbox\", \r\n \"Authorization\" : dropboxCode, \r\n \"operation\" : \"delete\",\r\n \"filename\" : dropboxDeleteFilename\r\n };\r\n \r\n $.ajax({\r\n type: \"POST\",\r\n url: DropboxConnector,\r\n data: sendData,\r\n contentType: \"application/x-www-form-urlencoded\",\r\n datatype: 'json',\r\n beforeSend: function () {\r\n // temp deny new delete request to the dropbox\r\n dropboxAllowDeleteFlag = 0;\r\n $('#deleteFromDropboxBtn').html(\r\n '<i class=\"fa fa-refresh fa-spin fa-fw\" aria-hidden=\"true\"></i>'\r\n );\r\n },\r\n success: function (msg) {\r\n formatDropboxDeleteResponse(msg);\r\n },\r\n error: function (xhr, ajaxOptions, thrownError) {\r\n $('#deleteFromDropboxBtn').html('error(' + xhr.status + ': ' + thrownError + ')');\r\n dropboxDeleteFilename = \"\";\r\n }\r\n }); \r\n}", "function deletebestellung(li, id) {\n const really = confirm(\"Are you sure you want to delete this bestellung?\");\n if (really == true) {\n li.remove();\n \n fetch('http://localhost:8080/carmen/bestellungen/public/api/bestellung/delete/' + id, {\n method: 'DELETE',\n })\n .then(res => res.text()) // or res.json()\n .then(res => console.log(res))\n } \n}", "function deleteTask(clickedId) {\n $.ajax({\n method: 'DELETE',\n url: `/tasks/${clickedId}`,\n }).then(function(response) {\n getTasks();\n }).catch(function(error) {\n console.log('error in DELETE:', error);\n });\n}" ]
[ "0.7104768", "0.6778447", "0.67659724", "0.66179925", "0.66160184", "0.65829587", "0.65274787", "0.6504329", "0.6479114", "0.6477967", "0.6452176", "0.64471936", "0.64339083", "0.6427579", "0.64122874", "0.6392828", "0.637997", "0.63762397", "0.6365855", "0.6365851", "0.6348525", "0.631618", "0.63093835", "0.63072085", "0.63055825", "0.6299801", "0.6286259", "0.62838", "0.6264179", "0.6251402", "0.62500614", "0.62490016", "0.62249017", "0.6219051", "0.62182224", "0.62165403", "0.6213936", "0.6212359", "0.6195582", "0.6177857", "0.61714023", "0.6165886", "0.61621463", "0.61587995", "0.6137292", "0.6136096", "0.61332446", "0.61325794", "0.61298114", "0.6127464", "0.6121251", "0.6116966", "0.61163473", "0.610595", "0.61041635", "0.610318", "0.60942847", "0.6093624", "0.60845065", "0.6082046", "0.60783416", "0.60783416", "0.60746133", "0.6071536", "0.6066592", "0.60620445", "0.60617644", "0.606019", "0.60525185", "0.60509133", "0.60490483", "0.6046506", "0.60375655", "0.6034627", "0.6028925", "0.60271144", "0.6020395", "0.60194105", "0.60035485", "0.6001671", "0.5994838", "0.5993423", "0.59901744", "0.5983498", "0.59826297", "0.5980204", "0.5976632", "0.59710175", "0.59673566", "0.5956481", "0.59540755", "0.595368", "0.5948351", "0.5948121", "0.5944705", "0.59421146", "0.5937778", "0.5937371", "0.59368294", "0.5935892" ]
0.77091926
0
Listing function for packages
function getPackageItems(packageID) { document.getElementById("packageItemsList" + packageID).innerHTML = ""; $.ajax({ type: "GET", url: '../include/getPackageItems.php?action=getOnePackageItems&packageID='+packageID, success: function (data) { if (data.length > 0) { for (var i = 0; i < data.length; i++) { deleteString = "<a class='deletePackageItem' data-packageID=" + data[i]['packageID'] + " data-categoryID=" + data[i]['pCategory'] + " title='Delete from package'><i class='zmdi zmdi-delete'></i><a>"; document.getElementById("packageItemsList" + packageID).innerHTML += '<li class="list-group-item">' + data[i]['pName']+ ", " + data[i]["pDescription"] + " " + deleteString + '</li>'; } } }, failure: function(data) { console.log("failure"); }, dataType: "json" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listAll() {\n setPackageList(completeList);\n _setCurPackage(null);\n }", "async getPackages() {\n return [];\n }", "function getAllPackageNames() {\n return new Promise(function(resolve, reject) {\n exec('npm ls', {cwd: '.'},(error, stdout, stderr) => {\n var packages = stdout.split('\\n')\n .map(item => {\n var m = item.match(/^[└|├|─|┬|│|\\s]*(.+?)\\@/);\n if (m) {\n return m[1];\n }\n })\n .filter(item => !!item);\n\n resolve(packages);\n });\n });\n}", "static get usage () {\n return ['[<pkgname> [<pkgname> ...]]']\n }", "function Packages()\n {\n\tRenderHeader(\"Packages\");\n \tRenderPresentPackageBox();\n \tRenderUpgradeOptionsBox();\n \tRenderSeeDowngradeOptionsBox();\n \treturn;\t\t\t\n }", "function getAllPackages(packages, testPath) {\n let result = [];\n\n packages.forEach(package => {\n\n if (package) {\n let files = glob.sync(package);\n result.push(...files);\n }\n\n });\n\n return result;\n}", "function getPackages() {\n\tvar packages = {};\n\tvar Package = {\n\t\tdescribe: function () {\n\t\t},\n\t\t_transitional_registerBuildPlugin: function () {\n\t\t},\n\t\tregister_extension: function () {\n\t\t},\n\t\tregisterExtension: function () {\n\t\t},\n\t\ton_use: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tonUse: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\ton_test: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tonTest: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tregisterBuildPlugin: function () {\n\t\t}\n\t};\n\tNpm.depends = function () {\n\t};\n\tNpm.strip = function () {\n\t};\n\tvar Cordova = {\n\t\tdepends: function () {\n\t\t}\n\t};\n\tvar api = {\n\t\tadd_files: function () {\n\t\t},\n\t\taddFiles: function () {\n\t\t},\n\t\taddAssets: function () {\n\t\t},\n\t\timply: function () {\n\t\t},\n\t\tuse: function () {\n\t\t},\n\t\texport: function () {\n\t\t},\n\t\tversionsFrom: function() {\n\t\t},\n\t\tmainModule: function() {\n\t\t}\n\t}\n\n\tfs.readdirSync(packagesPath).forEach(handlePackage);\n\tif (fs.existsSync('packages')) {\n\t\tfs.readdirSync('packages').forEach(handlePackage);\n\t}\n\treturn packages;\n\n\tfunction initPackage(name) {\n\t\tif (typeof(packages[name]) === 'undefined') {\n\t\t\tvar packagePath = path.join(packagesPath, name);\n\t\t\tif (fs.existsSync(path.join('packages', name))) {\n\t\t\t\tpackagePath = path.join('packages', name);\n\t\t\t}\n\t\t\tpackages[name] = {\n\t\t\t\tpath: packagePath,\n\t\t\t\tserver: {\n\t\t\t\t\tuses: {},\n\t\t\t\t\timply: {},\n\t\t\t\t\tfiles: []\n\t\t\t\t},\n\t\t\t\tclient: {\n\t\t\t\t\tuses: {},\n\t\t\t\t\timply: {},\n\t\t\t\t\tfiles: []\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction handlePackage(package) {\n\t\tif (package.charAt(0) === '.') {\n\t\t\treturn;\n\t\t}\n\t\tinitPackage(package);\n\t\tvar packageJsPath = path.join(packagesPath, package, 'package.js');\n\t\tif (fs.existsSync(path.join('packages', package))) {\n\t\t\tpackageJsPath = path.join('packages', package, 'package.js');\n\t\t}\n\t\tif (package.charAt(0) === '.' || !fs.existsSync(packageJsPath)) {\n\t\t\treturn;\n\t\t}\n\t\tvar packageJs = fs.readFileSync(packageJsPath).toString();\n\t\tif (packageJs) {\n\t\t\tapi.use = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tname.forEach(function (item) {\n\t\t\t\t\tinitPackage(item);\n\t\t\t\t\tif (inServer) {\n\t\t\t\t\t\tpackages[package].server.uses[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t\tif (inClient) {\n\t\t\t\t\t\tpackages[package].client.uses[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\t\t\tapi.imply = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tname.forEach(function (item) {\n\t\t\t\t\tinitPackage(item);\n\t\t\t\t\tif (inServer) {\n\t\t\t\t\t\tpackages[package].server.imply[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t\tif (inClient) {\n\t\t\t\t\t\tpackages[package].client.imply[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\t\t\tapi.add_files = api.addFiles = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tvar items = name.filter(function (item) {\n\t\t\t\t\tif (item) {\n\t\t\t\t\t\treturn item.substr(item.length - 3) === '.ts';\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (inServer) {\n\t\t\t\t\tpackages[package].server.files = packages[package].server.files.concat(items);\n\t\t\t\t}\n\t\t\t\tif (inClient) {\n\t\t\t\t\tpackages[package].client.files = packages[package].client.files.concat(items);\n\t\t\t\t}\n\t\t\t};\n\t\t\tPackage.on_use = Package.onUse = function (callback) {\n\t\t\t\tcallback(api);\n\t\t\t};\n\t\t\tPackage.on_test = Package.onTest = function (callback) {\n\t\t\t\tcallback(api);\n\t\t\t};\n\t\t\tPackage.includeTool = function () {\n\t\t\t};\n\t\t\teval(packageJs);\n\t\t}\n\t}\n\n}", "function parseListFromPkgOutput({\n\texports: {\n\t\tname,\n\t\tversion,\n\t\tdependencies,\n\t\tdevDependencies\n\t}\n}) {\n\tif (!name && !version) return; // Not a npm package if having neither name nor version\n\n\tlet list = [];\n\n\t(function printTitle() {\n\t\tif (version) {\n\t\t\tconsole.log(chalk.blueBright(name + '@' + version));\n\t\t} else {\n\t\t\tconsole.log(name);\n\t\t}\n\t})();\n\n\tif (dependencies) {\n\t\tlist.push((chalk.underline('Dependencies')));\n\t\tlist = list.concat(objectToList(dependencies));\n\t}\n\n\tif (devDependencies) {\n\t\tlist.push((chalk.underline('DevDependencies')));\n\t\tlist = list.concat(objectToList(devDependencies));\n\t}\n\n\treturn list;\n\n\n\t/*\n\t * Converts the deps object to list\n\t * @params\n\t * deps: {}\n\t *\n\t * returns []\n\t */\n\tfunction objectToList(deps = {}) {\n\t\treturn Object.keys(deps).map(key => {\n\t\t\tlet value = deps[key] ? deps[key].replace(/[^0-9.,]/g, \"\") : '';\n\t\t\treturn key + '@' + chalk.grey(value);\n\t\t});\n\t}\n}", "function packages () {\n opts.packages = makeArray(argv.dep)\n opts.install = true\n }", "function listModules(options, cli, next) {\n\n // Command line\n if (cli) {\n var currentType = \"\";\n for (var moduleName in calipso.modules) {\n var module = calipso.modules[moduleName];\n if (module.type != currentType) {\n console.log(\"\\r\\n\" + module.type.green.bold);\n currentType = module.type;\n }\n console.log(\" - \" + module.name.white.bold + \" @ \" + module.about.version + \" [\".grey + (module.enabled ? \"Enabled\".green : \"Disabled\".grey) + \"]\".grey);\n }\n }\n\n // Else return it\n next(null, calipso.modules);\n\n}", "async function findPackages() {\n _log('Finding all packages')\n const pkgPromises = [\n time(getLocalPackages),\n time(getGlobalPackages),\n time(getOtherPackages),\n time(getHomePackages)\n ]\n const [local, global, other, home] = await Promise.all(pkgPromises)\n _log('Done finding all packages')\n const packages = local.packages\n packages.push.apply(packages, global.packages)\n packages.push.apply(packages, other.packages)\n\n const dependencies = local.dependencies\n dependencies.push.apply(dependencies, global.dependencies)\n dependencies.push.apply(dependencies, other.dependencies)\n\n if (home) {\n if (home.home) {\n packages.unshift.apply(packages, home.home.packages)\n dependencies.unshift.apply(dependencies, home.home.dependencies)\n }\n if (home.homeOld) {\n packages.unshift.apply(packages, home.homeOld.packages)\n dependencies.unshift.apply(dependencies, home.homeOld.dependencies)\n }\n }\n\n addSetting('Packages', flattenVersions(packages))\n addSetting('Dependencies', flattenVersions(dependencies))\n}", "function listPackageImports(answers) {\r\n if (!answers || typeof answers !== 'object') return null;\r\n\r\n let result = ['path'];\r\n\r\n return result;\r\n}", "function bowerList(kind, bowerOptions) {\n\t\treturn function(callback) {\n\t\t\tvar params = _.extend({}, bowerOptions);\n\t\t\tparams[kind] = true;\n\n\t\t\tbower.commands.list(params)\n\t\t\t\t.on('error', grunt.fatal.bind(grunt.fail))\n\t\t\t\t.on('end', function(data) {\n\t\t\t\t\tcallback(null, data); // null means \"no error\" for async.parallel\n\t\t\t\t});\n\t\t};\n\t}", "function functions() {\n return Object.keys(exports)\n}", "getAllInfoForPackageName(name) {\n const infos = [];\n const seen = new (_set || _load_set()).default();\n\n for (const pattern of this.patternsByPackage[name]) {\n const info = this.patterns[pattern];\n if (seen.has(info)) {\n continue;\n }\n\n seen.add(info);\n infos.push(info);\n }\n\n return infos;\n }", "function generateIndexFromPackageList(packageList) {\n let output = '';\n packageList.forEach((package) => {\n output = `${output}export * from '${package.name}';\\n`;\n });\n return output;\n}", "function listCommands() {\n console.log(\n 'List of commands available:\\n' +\n '[-help] - Lists all the available commands.\\n' +\n '[Github URL] - Lists the commits for the provided GitHub URL.\\n' +\n '[Github URL] [nocache] - Lists the commits for the provided GitHub URL, ignoring cached values.\\n' +\n '[exit] - Ends Application\\n'\n )\n}", "function FilesList() {\n\n}", "xdnAllPackages() {\n return [...this.xdnRuntimeDependencies(), ...this.xdnDevDependencies()];\n }", "function getPackageNames(options) {\n if (fs.existsSync(options.config)) {\n return Promise.resolve(fs.readFileSync(options.config, utf8).trim().split(\"\\n\"));\n } else {\n return getAllPackageNames();\n }\n}", "list() {\n }", "function showPackages(request, url, packages, options, div, cb) {\n // Create a result set\n var res2 = generateView(url, packages, options);\n // Insert into container on page\n div.html(res2 ? res2 : options.noresult);\n // Continue with callback\n cb(null, {client: CKANclient, request: request, packages: packages});\n}", "function npmList(path) {\n var global = false;\n if (!path) global = true;\n var cmdString = \"npm ls --depth=0 \" + (global ? \"-g \" : \" \");\n return new Promise(function (resolve, reject) {\n exec(cmdString, { cwd: path ? path : \"/\" }, (error, stdout) => {\n if (error) {\n return reject(error);\n }\n\n var packages = [];\n packages = stdout.split('\\n');\n\n packages = packages.filter(function (item) {\n if (item.match(/^\\+--.+/g) != null) {\n return true;\n }\n if (item.match(/^`--.+/g) != null) {\n return true;\n }\n return undefined;\n });\n\n packages = packages.map(function (item) {\n if (item.match(/^\\+--.+/g) != null) {\n return item.replace(/^\\+--\\s/g, \"\");\n }\n if (item.match(/^`--.+/g) != null) {\n return item.replace(/^`--\\s/g, \"\");\n }\n })\n resolve(packages);\n\n });\n });\n}", "async function getPackageNames(owner, repo, package_type, token) {\n var packages = []\n let continuePagination = false\n let afterId = \"\"\n do {\n const query = `query {\n repository(owner: \"${owner}\", name: \"${repo}\") {\n name\n packages(first: 20, after: \"${afterId}\", packageType: ${package_type.toUpperCase()}) {\n totalCount\n nodes {\n name\n id\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }`;\n try {\n const myRequest = request.defaults({\n headers: {\n authorization: `token ${token}`,\n },\n request: {\n hook(request, options) {\n return request(options);\n },\n },\n });\n const myGraphql = withCustomRequest(myRequest);\n const result = await myGraphql(query);\n if (result.repository.packages.nodes == null) {\n console.log(`No packages found in the org`);\n return\n }\n packages.push(...result.repository.packages.nodes);\n continuePagination = result.repository.packages.pageInfo.hasNextPage;\n afterId = result.repository.packages.pageInfo.endCursor;\n } catch (error) {\n core.setFailed(error);\n return;\n }\n } while(continuePagination)\n\n var packageNames = [];\n for(i = 0; i < packages.length; i++) {\n packageNames.push(packages[i].name)\n }\n return packageNames;\n}", "function checkPackageInfo(){\n let url = flutter_source_url_arg_page + '1';\n let options= {\n url: url,\n gzip: true,\n headers: {\n 'User-Agent' : 'pub.flutter-io.cn'\n }\n };\n request.get(options, (err, response, body) => {\n //response from remote http server\n if (err) {\n console.error(currentTimestamp() + '[debug] encountered error while requesting package information from remote server, message:' + err.toString());\n } else {\n try{\n let data = JSON.parse(body);\n if(typeof(data.packages) !== 'undefined' && data.packages.length > 0){\n for(let i=0; i<data.packages.length; i++){\n let index = i+1;\n let pkg = data.packages[i];\n console.log('[debug] ' + index + '. name-->' + pkg.name + ' version-->' + pkg.latest.version);\n }\n }\n }catch(e){\n console.error(currentTimestamp() + '[debug] encountered error while parsing json data -->' + e.message);\n }\n\n }\n });\n}", "listPluginNames(rootDir) {\n var packagePath = path.join(rootDir, 'package.json');\n\n // Make sure package.json exists\n if (!fs.existsSync(packagePath)) {\n return [];\n }\n\n // Read package.json and find dependencies\n const content = fs.readFileSync(packagePath);\n const json = JSON.parse(content);\n const deps = json.dependencies || {};\n return Object.keys(deps).filter((name) => {\n // Ignore plugins whose name is not started with \"crowi-\"\n return /^crowi-plugin-/.test(name);\n });\n }", "function listarTodosPregunta(){\r\n\r\n\tlistarTodosPreguntaGenerico(\"listarTodos\");\r\n\r\n}", "function package_view(dir) {\n\n $('#loadingview').show();\n $('#installed-packages').empty();\n $('#to-install').empty();\n\n api.get_info(dir, function (info) {\n var data = info.packages;\n\n var output = views.installed(data);\n $('#installed-packages').append(output);\n\n output = views.to_install(data);\n $('#to-install').append(output);\n if ($(output).children().length === 0) {\n $('#to-install-main').css(\"display\", \"none\");\n }\n\n var selectedPackages = [];\n views.select_installed(selectedPackages);\n\n var toInstall = [];\n views.select_to_install(toInstall);\n\n $('#packageview').show();\n $('#loadingview').hide();\n }, function () {\n common.display_msg(\"Server Error\", \"The project configuration could not be retrived. Please try again.\");\n $('#loadingtext').text(\"Server Error\");\n });\n}", "getModules(pkg: Package): Module[] {\n return this.modules.get(pkg) || []\n }", "function getCatalogs(){\n\n}", "function ListHelp() {\n}", "function showList() {\n\tconsole.log(modulesId.join(\"\\n\"));\n}", "function cmdCompl (opts, cb) {\n return cb(null, npm.fullList)\n}", "function listModpacks(){\n child = exec(nxreplicatorCommand+' list',\n function (error, stdout, stderr) {\n console.log('stdout: ' + stdout);\n console.log('stderr: ' + stderr);\n if (error !== null) {\n console.log('exec error: ' + error);\n }\n });\n}", "function rstAllPackages() {\n for (let package of AllPackages.concat(extraPackages)) {\n rstConfiguration(package, `/tmp/${package}.rst`);\n }\n}", "function getPackages() {\n\tvar lImage;\n\tinitializeDB();\n\t\n\tdb.transaction( function( tx ) {\n\t\ttx.executeSql( \"SELECT * FROM \" + tablePackages, [], function( tx, result ) {\n\t\t\tvar htmlContent = '';\n\t\t\tvar len = result.rows.length;\n\t\t\t$(\"#packages\").html( \"\" );\n\t\t\t\n\t\t\tfor( var i = 0; i < len; i++ ) {\n\t\t\t\tfor( var j = 0; j < imagesPack.length; j++ ) {\n\t\t\t\t\tif( imagesPack[j][0] == result.rows.item(i).id )\n\t\t\t\t\t\tlImage = imagesPack[j][1]; \n\t\t\t\t}\n\t\t\t\t//--console.log( \"title: \" + result.rows.item(i).title );\n\t\t\t\t//--htmlContent += '<li><a href=\"#\" onclick=\"getModules( \\'' + result.rows.item(i).fixed_modules + '\\', \\'' + result.rows.item(i).modules + '\\', \\'' + result.rows.item(i).optional_modules + '\\' )\">' + result.rows.item(i).title + '</a></li>';\n\t\t\t\thtmlContent += '<li>';\n\t\t\t\thtmlContent += '<a href=\"#\" onclick=\"';\n\t\t\t\thtmlContent += 'setLocalValue( \\'modules\\' , \\'' + result.rows.item(i).id_mod + '\\');';\n\t\t\t\thtmlContent += 'setLocalValue( \\'name\\' , \\'' + result.rows.item(i).name + '\\' );';\n\t\t\t\thtmlContent += 'setLocalValue( \\'title\\' , \\'' + result.rows.item(i).name + '\\' );';\n\t\t\t\thtmlContent += 'setLocalValue( \\'description\\', \\'' + result.rows.item(i).description + '\\' )';\n\t\t\t\thtmlContent += '\">';\n\t\t\t\thtmlContent += '<img src=\"images/' + result.rows.item(i).image + '\" width=\"80\" />';\n\t\t\t\thtmlContent += '<h2>' + result.rows.item(i).name + '</h2>';\n\t\t\t\thtmlContent += '<p>' + result.rows.item(i).description + '</p><br />';\n\t\t\t\thtmlContent += '</a>';\n\t\t\t\thtmlContent += '</li>';\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#packages\").html( $(\"#packages\").html() + htmlContent );\n\t\t\t$(\"#packages\").listview(\"refresh\");\n\t\t\t\n\t\t}, errorCB );\n\t}, errorCB, successCB );\n}", "_functionsInDirectory(directory)\n\t\t{\n\t\t\tlet _this = this;\n\t\t\tlet functionNames = [];\n\n\t\t\tlet globOptions =\n\t\t\t{\n\t\t\t\t\"cwd\": directory\n\t\t\t};\n\n\t\t\t// Find all s-function.json files\n\t\t\tlet files = glob.sync(\"**/s-function.json\", globOptions);\n\t\t\tfiles.forEach(function(file)\n\t\t\t{\n\t\t\t\tlet functionName = _this._functionNameResolve(path.join(directory, file));\n\t\t\t\tfunctionNames.push(functionName);\n\n\t\t\t\tS.utils.sDebug(\"Found function named \\\"\" + functionName + \"\\\".\");\n\t\t\t});\n\n\t\t\treturn functionNames;\n\t\t}", "ListAvailableServices() {\n let url = `/pack/xdsl`;\n return this.client.request('GET', url);\n }", "function Listify() {\r\n}", "function symbols() {\n return Object.keys(exports).sort();\n }", "function symbols() {\n\t\treturn Object.keys(exports).sort();\n\t}", "function symbols() {\n\t\treturn Object.keys(exports).sort();\n\t}", "function symbols() {\n\t\treturn Object.keys(exports).sort();\n\t}", "function symbols() {\n\t\treturn Object.keys(exports).sort();\n\t}", "function getSoftwareList() {\n \"use strict\";\n}", "function NCList() {\n}", "list() {\n // list all stored objects by reading the file system\n return mkderp(dir)\n .then(() => readDir(dir))\n .then(files =>\n Promise.all(files.filter(f => f.substr(-5) === '.json').map(loadFile))\n );\n }", "getModuleList() {\n return this.http.get(this.url + '/cesco/getmodule', this.httpOptions);\n }", "getAllFiles() {\n return this.cache.getOrAdd('getAllFiles', () => {\n let result = [];\n let dependencies = this.dependencyGraph.getAllDependencies(this.dependencyGraphKey);\n for (let dependency of dependencies) {\n //load components by their name\n if (dependency.startsWith('component:')) {\n let comp = this.program.getComponent(dependency.replace(/$component:/, ''));\n if (comp) {\n result.push(comp.file);\n }\n }\n else {\n let file = this.program.getFile(dependency);\n if (file) {\n result.push(file);\n }\n }\n }\n this.logDebug('getAllFiles', () => result.map(x => x.pkgPath));\n return result;\n });\n }", "function listAll() {\n var str = \"\";\n for (i in starterCheer) {\n str += `${i} ` + starterCheer[i] + \"\\n\";\n }\n return str;\n}", "function printRepositories(repos) {\n console.log(repos);\n}", "workspaceXpackages(params = {}, span = new opentracing_1.Span()) {\n return this.isDefinitelyTyped\n .mergeMap((isDefinitelyTyped) => {\n // In DefinitelyTyped, report all @types/ packages\n if (isDefinitelyTyped) {\n const typesUri = url.resolve(this.rootUri, 'types/');\n return util_1.observableFromIterable(this.inMemoryFileSystem.uris())\n .filter(uri => uri.startsWith(typesUri))\n .map((uri) => ({\n package: {\n name: '@types/' + decodeURIComponent(uri.substr(typesUri.length).split('/')[0]),\n },\n // TODO parse /// <reference types=\"node\" /> comments in .d.ts files for collecting dependencies between @types packages\n dependencies: [],\n }));\n }\n // For other workspaces, search all package.json files\n return this.projectManager.ensureModuleStructure(span)\n .concat(rxjs_1.Observable.defer(() => util_1.observableFromIterable(this.inMemoryFileSystem.uris())))\n .filter(uri => uri.includes('/package.json') && !uri.includes('/node_modules/'))\n .mergeMap(uri => this.packageManager.getPackageJson(uri))\n .mergeMap(packageJson => {\n if (!packageJson.name) {\n return [];\n }\n const packageDescriptor = {\n name: packageJson.name,\n version: packageJson.version,\n repoURL: typeof packageJson.repository === 'object' && packageJson.repository.url || undefined,\n };\n // Collect all dependencies for this package.json\n return rxjs_1.Observable.from(packages_1.DEPENDENCY_KEYS)\n .filter(key => !!packageJson[key])\n .mergeMap(key => lodash_2.toPairs(packageJson[key]))\n .map(([name, version]) => ({\n attributes: {\n name,\n version,\n },\n hints: {\n dependeePackageName: packageJson.name,\n },\n }))\n .toArray()\n .map((dependencies) => ({\n package: packageDescriptor,\n dependencies,\n }));\n });\n })\n .map((packageInfo) => ({ op: 'add', path: '/-', value: packageInfo }))\n .startWith({ op: 'add', path: '', value: [] });\n }", "function getListPackage(obj){\n console.log(obj);\n let headers = authHeader();\n return Vue.http.post(URL.API_ROOT+\"v1/api/package/search?size=\"+obj.limit+\"&page=\"+obj.page,obj.data,{headers});\n}", "function getPackageList(providerUrl) {\n\n const url = providerUrl + 'api/3/action/package_search?rows=1000';\n const response = UrlFetchApp.fetch(url).getContentText();\n\n const resultObj = JSON.parse(response);\n\n const packageList = resultObj.result.results.map( function(dataSet) {\n\n var downloadUrl = null;\n\n for(var ii = 0; ii < dataSet.resources.length; ii++) {\n var resource = dataSet.resources[ii];\n if (resource.datastore_active) {\n downloadUrl = providerUrl + 'datastore/dump/' + resource.id;\n break;\n }\n if (resource.mimetype === 'text/csv') {\n downloadUrl = resource.url;\n break;\n }\n if (resource.format === 'CSV') {\n downloadUrl = resource.url;\n }\n }\n\n var title;\n if (dataSet.title.en) {\n title = dataSet.title.en;\n } else {\n title = dataSet.title;\n }\n\n var description;\n if (dataSet.description && dataSet.description.en) {\n description = dataSet.description.en;\n } else if (dataSet.description) {\n description = dataSet.description;\n } else {\n description = dataSet.notes;\n }\n\n\n return {\n name: dataSet.name,\n title: title,\n downloadUrl: downloadUrl,\n notes: dataSet.notes,\n };\n\n }).filter( function(dataSet) {\n\n return dataSet.downloadUrl !== null;\n\n });\n\n return packageList;\n\n}", "function listModule(decoratorNameKey, filter) {\n const modules = manager.listModule(decoratorNameKey);\n if (filter) {\n return modules.filter(filter);\n }\n else {\n return modules;\n }\n}", "function list(callback) {\n var result = [];\n\n for(var key in registry) {\n if (registry.hasOwnProperty(key)) {\n result.push(registry[key]);\n }\n }\n\n callback(null, result);\n}", "function findLists() {}", "listScriptsTemplates(api) {\n // JavaScript / JS\n console.log(color(\"JavaScript:\", this.colors.divider));\n api.listCommands(api.tasks.scripts);\n }", "function bowerListTask() {\n return gulp\n .src(mainBowerFiles())\n .pipe(debug());\n }", "function showAll() {\n\n}", "function findPackageDeps () {\n var pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'))\n\n var deps = Object.keys(pkg.dependencies)\n var devDeps = Object.keys(pkg.devDependencies)\n var optionalDeps = Object.keys(pkg.optionalDependencies)\n\n return [].concat(deps, devDeps, optionalDeps)\n}", "function buildAll(list) {\n var modulesList = []\n ;\n\n forEachAsync(list, function (next, modulename) {\n makePackageReady(moduleRoot + '/' + 'node_modules' + '/' + modulename, builtIns, function (err, pkg, m, u, v, l, p, b) {\n if (err) {\n console.error('[local#1]', err);\n next();\n return;\n //throw err;\n }\n\n l.forEach(function (module) {\n modulesList.push(render(module, pkg));\n });\n\n next();\n\n /*\n l.forEachAsync(function (next, module) {\n render(function (err, str) {\n modulesList.push(str);\n }, pkg, module));\n }).then(next);\n */\n });\n }).then(function () {\n makePackageReady(moduleRoot, builtIns, function (err, pkg, m, u, v, l, p, b) {\n l.forEach(function (module) {\n modulesList.push(render(module));\n });\n\n fn(null, modulesList.join('\\n'));\n \n /*\n l.forEachAsync(function (next, module) {\n render(function (err, str) {\n modulesList.push(str);\n }, pkg, module);\n }).then(function () {\n fn(null, modulesList.join('\\n'));\n });\n */\n });\n });\n }", "function createPackages() {\n\t\t\tpacker.boxes.showDialog({\n\t\t\t\ttitle: _('boxes.header.waiting'), \n\t\t\t\tmessage: _('boxes.packer.waiting.packed'), \n\t\t\t\ttype: 'waiting', \n\t\t\t\tyestext: null,\n\t\t\t\textra: 'waiting'\n\t\t\t});\n\t\t\t\n\t\t\tvar list = cfg.packageList,\n\t\t\t jspackage,\n\t\t\t i = 0\n\t\t\t;\n\t\t\t\n\t\t\tfor (jspackage in list) {\n\t\t\t\tif (list.hasOwnProperty(jspackage)) {\n\t\t\t\t\tcompress(jspackage, i);\n\t\t\t\t\ti += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function getCoreRelevantPackages(packageList) {\n return packageList.filter((item) => {\n const isReleased = !item.private;\n const isNotBlocked = !BLOCKLIST.includes(item.name);\n return isReleased && isNotBlocked;\n });\n}", "list() {\n this._followRelService(\"list\", \"List\");\n }", "getListName() {}", "function jum_get_all_function_names(alltests) {\n var fnames = [];\n for(var i=0;i<alltests.groups_array_.length;++i) {\n var groupdef = alltests.groups_array_[i];\n var groupname = groupdef.groupname;\n jum_debug('concat of names for ' + groupname);\n //bu_alert(\"adding \" + groupdef.function_names_.length + \" functions to already \" + fnames.length);\n // ENVBUG: konqeror 3.05 has buggy Array.concat\n if (false) {\n var new_len = fnames.length + groupdef.function_names_.length;\n fnames = fnames.concat(groupdef.function_names_);\n if (new_len !== fnames.length) throw Error(\"(jsunit_wrap.js) buggy Array.concat; now fnames.length = \" + fnames.length);\n }\n else {\n for(var j=0;j<groupdef.function_names_.length;++j) {fnames.push(groupdef.function_names_[j])}\n } \n // bu_alert(\"(jsunit_wrap.js) now have \" + fnames.length + \" names after adding \" + groupdef.function_names_.length + \" for group \" + groupname);\n }\n bu_alert(\"(jsunit_wrap.js) returning \" + fnames.length + \" names from \" + alltests.groups_array_.length + \" groups\");\n return fnames;\n}", "function CakePhpListLayer() {\n\n}", "function listLambdas () {\n cmdListLambdas.run(function (err, lambdas) {\n if (err) return logError(err)\n\n for (let lambda of lambdas) {\n console.log(lambda)\n }\n })\n}", "function PackageList(props) {\n\n const {packages} = props\n\n return (\n <div className=\"package-list-container\">\n <div className=\"fade-away-top\"/>\n <div className=\"package-list\">\n <ul>\n {/* Making sure packages are found, cant do .map to undefined */}\n {packages ? ( \n packages.map(listPackage => \n <li>\n <Link to={`/${listPackage.name}`}>{listPackage.name}</Link>\n </li>\n ) \n ) : null\n }\n </ul>\n </div>\n <div className=\"fade-away-bot\"/>\n </div>\n );\n}", "function file_cache_list() {\n\t\tconsole.log(Object.keys(wkof.file_cache.dir).sort().join('\\n'));\n\t}", "getOwnCallables() {\n let result = [];\n this.logDebug('getOwnCallables() files: ', () => this.getOwnFiles().map(x => x.pkgPath));\n //get callables from own files\n this.enumerateOwnFiles((file) => {\n for (let callable of file.callables) {\n result.push({\n callable: callable,\n scope: this\n });\n }\n });\n return result;\n }", "function HelperFn() {\n console.log(\n chalk.bold.blue(`\n\n All the commands available:\n\n `)\n );\n console.log(\n chalk.yellowBright(`\n 1. tree 'dir path' \n this will return you tree veiw of the folder\n\n\n 2. organize 'dir path'\n this will help you to organize the folder according to their extension\n\n\n 3. Help Cmd\n `)\n );\n}", "function Go_Funciones()\n {\n if( g_listar == 1 )\n {\n Get_Marca_Producto();\n }\n \n }", "function sugarListView() {\n}", "name() {\n return ['extract', 'extractVendors'];\n }", "name() {\n return ['extract', 'extractVendors'];\n }", "function devpackages () {\n opts.devpackages = makeArray(argv.dev)\n opts.files.test = true\n opts.install = true\n }", "function getTaskLists() {\n\n}", "function _ls(){\n\tprepareSecureRequest( (userconfig, hash) => {\n\t\tvar url = [remote, '@', 'ls', userconfig.username, hash].join('/');\n\t\tif( debug ) console.log('@ls url', url); \n\t\trequest.get(url, (err, httpResponse, body) => {\n\t\t\tparse_net_response(err, httpResponse, body, (body) => {\n\t\t\t\t//TODO: format output\n\t\t\t\tconsole.log(\"Registered functions:\");\n\t\t\t\tconsole.dir(body.data, {colors:true});\n\t\t\t});\n\t\t});\n\t});\n}", "function _eachDependencies( packageName, bowerJson, packageFunc, options, packageList, firstLevel, dotBowerJson ){\n\t\tvar dependenciesPackageName,\n\t\t\t\tdependencies = bowerJson.dependencies || dotBowerJson.dependencies || {};\n\n\t\tpackageFunc(packageName, bowerJson, options, firstLevel, dotBowerJson);\n\n\t\t//Find dependencies\n\t\tfor (dependenciesPackageName in dependencies)\n\t\t\tif ( dependencies.hasOwnProperty(dependenciesPackageName) ){\n\t\t\t\t//If the package already has been check => continue\n\t\t\t\tif (packageList[ dependenciesPackageName ])\n\t\t\t\t continue;\n\t\t\t\tpackageList[ dependenciesPackageName ] = true;\n\n\t\t\t\t//Read the dependences of the package\n\t\t\t\t_eachDependencies(\n\t\t\t\t\tdependenciesPackageName,\n\t\t\t\t\treadJSONFile('bower_components/' + dependenciesPackageName + '/bower.json'),\n\t\t\t\t\tpackageFunc,\n\t\t\t\t\toptions,\n\t\t\t\t\tpackageList,\n\t\t\t\t\tfalse,\n\t\t\t\t\treadJSONFile('bower_components/' + dependenciesPackageName + '/.bower.json')\n\t\t\t\t);\n\t\t}\n\t}", "function listOptions(){\n let msg = \n`'q' or 'quit' exit the app\n'help' '?' or 'list' display available scripts`\n\n console.log(BLUE, msg)\n}", "function listCommands() {\n console.log(`${mainDivider}\\n${\"WELCOME TO LIRI-BOT! HERE'S WHAT I CAN DO!\"}\\n${mainDivider}`)\n console.log(`${\"Use the following commands to run Liri-Bot:\"}\\n${minorDivider}\\n${\"'my-tweets' : To list the last 20 tweets\"}\\n${minorDivider}\\n${\"'spotify-this-song' + 'song name': To lists the Artist, Song Name, Preview Link, and Album\"}\\n${minorDivider}\\n${\"'movie-this' + 'movie title': To lists the Movie Title, Release Year, IMDB Rating, Rotten Tomatoes Rating, Country, Language, Plot, Cast\"}\\n${mainDivider}`);\n}", "function packageSort(packages) {\r\n // packages = ['polyfills', 'vendor', 'app']\r\n const len = packages.length - 1;\r\n const first = packages[0];\r\n const last = packages[len];\r\n return function sort(a, b) {\r\n // polyfills always first\r\n if (a.names[0] === first) {\r\n return -1;\r\n }\r\n // app always last\r\n if (a.names[0] === last) {\r\n return 1;\r\n }\r\n // vendor before app\r\n if (a.names[0] !== first && b.names[0] === last) {\r\n return -1;\r\n } else {\r\n return 1;\r\n }\r\n };\r\n}", "getPackageImportPath(input) {\n const matchingPackages = [];\n this.pkgsList.forEach((info, pkgPath) => {\n if (input === info.name) {\n matchingPackages.push(pkgPath);\n }\n });\n return matchingPackages;\n }", "printList() { }", "function showAllTags(taggd) {\r\n if (taggd) {\r\n ls__showAll(taggd);\r\n }\r\n }", "async function tab0_browser_setup() {\n const pkgBrowserElement = document.getElementById('tab0-package-browser')\n pkgBrowserElement.innerHTML = ''\n await loadPackageList()\n for (let pkgRAW in packages) {\n let pkg = (packages[pkgRAW])\n pkgBrowserElement.innerHTML += `<li data-pkgid=\"${pkg.id}\" onclick=\"tab0_set_active_package(this)\">${pkg.title}<span class=\"tab0-filename\">${pkg.filename}</span></li>`\n }\n}", "function lmfc(klass){\n list_Methods(klass,1)\n}", "function getPackages() {\n\n $.ajaxSetup({\n beforeSend: function (xhr, settings) {\n if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) {\n // Send the token to same-origin, relative URLs only.\n // Send the token only if the method warrants CSRF protection\n // Using the CSRFToken value acquired earlier\n xhr.setRequestHeader(\"X-CSRFToken\", csrftoken);\n }\n }\n });\n\n $.ajax({\n url: 'getPackages',\n type: 'GET',\n dataType: \"json\",\n success: function (data) {\n $('#dropdownMenuLinkselect').empty(); // empty the div before fetching and adding new data\n\n data.user_packages.forEach((item, index) => {\n $(\"#dropdownMenuLinkselect\").append(\n `\n <a class=\"dropdown-item\" href=\"#\">${item}</a>\n\n `\n );\n }\n\n );\n packageOnClickListener();\n\n }\n\n });\n }", "ListTheEmailProServices(packName) {\n let url = `/pack/xdsl/${packName}/emailPro/services`;\n return this.client.request('GET', url);\n }", "function listarTodosEvaluacion(){\r\n\t\r\n\tlistarTodosEvaluacionGenerico(\"listarTodos\");\r\n}", "function listarTodosAprendiz(){\r\n\t\r\n\tlistarTodosAprendizGenerico(\"listarTodos\");\r\n\r\n}", "function getPackagesFromArg(pkg) {\n if ( !(pkg instanceof Array) ) {\n pkg = String(pkg).replace(/\\s+/g, ' ').split(' ');\n }\n return pkg;\n}", "list() {\n const listings = this._listings.all();\n return Object.keys(listings).map(key => listings[key]);\n }", "function getNPMPackageIds() {\n var packageManifest = {};\n try {\n packageManifest = require('./package.json');\n } catch (e) {\n // does not have a package.json manifest\n }\n return _.keys(packageManifest.dependencies) || []\n}", "function loadPackages(packageList){\n $(packageList).empty();\n $(packageList).append(\"<option disabled selected value>- SELECT -</option>\");\n $.get('/packages',\n function (response) {\n $.each(response, function(key){\n $(packageList).append(\n '<option class=\"remove\" value=\"'+key+'\">'+key+'</option>'\n );\n })\n });\n }", "function listFonts () {\n\n\tasciify.getFonts(function (err, fonts) {\n\t\tif (err) { return console.error(err); }\n\n\t\tvar padSize = ('' + fonts.length).length;\n\n\t\tfonts.forEach(function (font, index) {\n\t\t\tconsole.log(pad(padSize, index+1, '0') + ': ' + font);\n\t\t});\n\t});\n}", "get usage () {\n return usageUtil('prune',\n 'npm prune [[<@scope>/]<pkg>...] [--production]'\n )\n }", "function showAllBooks() {\n var bookList = \"\";\n for(var i = 0; i < books.length; i++) {\n bookList += \"Book # \" + (i+1) + \"\\n\" + showBookInfo(books[i]);\n } return bookList;\n }", "async list() { }" ]
[ "0.68251574", "0.6792283", "0.64070106", "0.61430895", "0.5931086", "0.57915926", "0.57597333", "0.5693645", "0.5690494", "0.56225806", "0.5613035", "0.5594061", "0.5540519", "0.55251276", "0.5511008", "0.5500252", "0.5499476", "0.54880375", "0.5484183", "0.54774046", "0.5475668", "0.54732853", "0.54660183", "0.54658645", "0.5435202", "0.54324424", "0.5424646", "0.5411356", "0.5399373", "0.5381955", "0.5377943", "0.53634626", "0.53601515", "0.5345645", "0.5326028", "0.5295959", "0.52937424", "0.5287972", "0.52810675", "0.5263621", "0.5255065", "0.5255065", "0.5255065", "0.5255065", "0.52438885", "0.5241974", "0.52252", "0.52196723", "0.52123445", "0.52099127", "0.5184862", "0.51719236", "0.5170436", "0.51703966", "0.51661444", "0.5163382", "0.51632786", "0.5153953", "0.51516795", "0.5136822", "0.5127907", "0.5121395", "0.51158386", "0.510706", "0.5093114", "0.5091743", "0.5091673", "0.50885916", "0.5087786", "0.5087051", "0.5078043", "0.50778735", "0.50750303", "0.5065435", "0.5064756", "0.50567865", "0.50567865", "0.505019", "0.5048454", "0.5048247", "0.5044175", "0.50344396", "0.5033692", "0.5003938", "0.49951544", "0.4992433", "0.49921095", "0.4983987", "0.49637267", "0.49567187", "0.49496862", "0.49487358", "0.49463916", "0.49429843", "0.49385265", "0.49286425", "0.4922422", "0.49205127", "0.49131817", "0.49117273", "0.49090183" ]
0.0
-1
Allow biometric usage on iOS if it isn't already accepted
allowIosBiometricUsage() { // See the wdio.shared.conf.js file in the `before` hook for what this property does if (!driver.isBioMetricAllowed) { // Wait for the alert try { this.iosAllowBiometry.waitForDisplayed({timeout: 3000}); this.allowBiometry.click(); } catch (e) { // This means that allow using touch/facID has already been accepted } // See the wdio.shared.conf.js file in the `before` hook for what this property does // Set it to accept driver.isBioMetricAllowed = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkiOS() {\n\t\treturn /iPad|iPhone|iPod/.test(navigator.userAgent) && ! window.MSStream;\n\t}", "function checkiOS() {\n return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n }", "iOS():boolean {\n\n\t\treturn this.agent.match(/iPhone|iPad|iPod/i) ? true : false;\n\t}", "acceptIOSPermission() {\n\t\tthis.iosAllowOnce.waitForDisplayed({ timeout: 3000 });\n\t\tthis.iosAllowOnce.click();\n\t}", "onSetAntiPhishingCode() {\n const { errors, isValid } = validateAntiPhishingCode(this.state);\n this.setState({ errors: errors });\n if (isValid) {\n this.props.getAntiPhishingCode();\n }\n }", "function DetectIPad()\n{\n if (uagent.search(deviceIPad) > -1) {\n\treturn true; \n }\n else {\n return false;\n }\n}", "shouldFarmHackingSkill() {\n return true;\n }", "function isWeirdUnusableDevice(device) {\n return device.id === '????????????'\n }", "function DetectIphone()\n{\n if (uagent.search(deviceIphone) > -1)\n return true;\n else\n return false;\n}", "function adBlockNotDetected() {\n}", "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return (\n request.type === \"IntentRequest\" &&\n request.intent.name === \"AMAZON.FallbackIntent\"\n );\n }", "function isMobileUser(){\n\tif(pmgConfig.agent_ios || pmgConfig.agent_android){\n\t\treturn true;\t\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "usesRidsForSimulcast() {\n return false;\n }", "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest'\n && request.intent.name === 'AMAZON.FallbackIntent';\n }", "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest'\n && request.intent.name === 'AMAZON.FallbackIntent';\n }", "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest'\n && request.intent.name === 'AMAZON.FallbackIntent';\n }", "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest'\n && request.intent.name === 'AMAZON.FallbackIntent';\n }", "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest'\n && request.intent.name === 'AMAZON.FallbackIntent';\n }", "function DetectTierOtherPhones()\n{\n if (DetectMobileLong())\n {\n //Exclude devices in the other 2 categories\n if (DetectTierIphone())\n return false;\n if (DetectTierRichCss())\n return false;\n\n //Otherwise, it's a YES\n else\n return true;\n }\n else\nreturn false;\n}", "async function confirmOnDevice() {\n dispatch({ type: \"SET_ACTIVE\" });\n const { multisig } = slice;\n\n try {\n const confirmed = await interaction.run();\n if (\n confirmed.address === multisig.address &&\n confirmed.serializedPath === interaction.bip32Path\n ) {\n dispatch({ type: \"SET_MESSAGE\", value: \"Success\" });\n } else {\n dispatch({ type: \"SET_ERROR\", value: \"An unknown error occured\" });\n }\n } catch (error) {\n dispatch({ type: \"SET_ERROR\", value: error.message });\n }\n }", "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n\n return request.type === 'IntentRequest' && request.intent.name === 'AMAZON.FallbackIntent';\n }", "function is_ios() {\n return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n}", "function updateUIFailure() {\n console.log(\"Request failed.\");\n }", "function verify(){\n if(done){\n var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n if(iOS){\n \tdrawCanvas();\n //alert('It looks like you are using an iOS device. Downloading is not available at this moment. You will be able to download on a desktop or using an Android device.');\n } else {\n drawCanvas();\n } \n }\n}", "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest'\n && request.intent.name === 'AMAZON.FallbackIntent';\n }", "function registerDevice() {\n var authnData = {\n \"authId\": AUTH_ID,\n \"hint\": \"GET_QR\" //dont change this value.\n };\n authenticate(authnData);\n}", "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return (\n request.type === 'IntentRequest' &&\n request.intent.name === 'AMAZON.FallbackIntent'\n );\n }", "function testClaimMerakiDevice(){\n var data = {\n \"serial\": TEST_SN\n };\n claimMerakiDevice(API_KEY,TEST_NET_ID,SHARD,data);\n}", "function safariEventRateLimitBlock() {\n\tif (isWebKit && isSafariVersion13OrOlder()) {\n\t\tif (safariRateLimited != 0)\n\t\t\treturn true;\n\t\telse {\n\t\t\tsafariRateLimited = setTimeout('safariRateLimited = 0;', 10);\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function ensureHNI() {\n var iccInfo = mobileConnection.iccInfo;\n if (!iccInfo) {\n return;\n }\n\n if (gNetwork &&\n gNetwork.mcc == iccInfo.mcc &&\n gNetwork.mnc == iccInfo.mnc) {\n return;\n }\n\n gNetwork = {};\n gNetwork.mcc = iccInfo.mcc;\n gNetwork.mnc = iccInfo.mnc;\n applyOperatorVariantSettings();\n }", "function scan() {\n FingerprintAuth.isAvailable(isAvailableSuccess, isAvailableError);\n }", "function DetectBlackBerry()\n{\n if (uagent.search(deviceBB) > -1)\n return true;\n else\n return false;\n}", "function isIOS() {\n return /iPad|iPhone|iPod/.test(ua());\n}", "function bypassAnticheat() { // SO THAT YOUR ACCOUNT DOESNT GET BANNED\n \n}", "function DetectIphoneOrIpodOrIPad()\n{\n //We repeat the searches here because some iPods \n // may report themselves as an iPhone, which is ok.\n if (uagent.search(deviceIphone) > -1 ||\n uagent.search(deviceIpod) > -1 ||\n uagent.search(deviceIPad) > -1)\n\n return true;\n else\n return false;\n}", "_requireGetUserMedia() {\n if (this.recorder) {\n return true;\n }\n console.log('Requesting getUserMedia permission first.');\n this.requestUserMedia();\n return false;\n }", "async function _checkInstanceConnection(instance) {\n try {\n await axios.put(`http://${instance.host}:${instance.port}/characteristics`,\n {\n characteristics: [{ aid: -1, iid: -1 }],\n },\n {\n headers: {\n Authorization: _findPinByKey(instance ? instance.deviceID : instance.host + ':' + instance.port),\n },\n }\n );\n return true;\n } catch (e) {\n throw 'Incorrect PIN \\'' + _findPinByKey(instance ? instance.deviceID : instance.host + ':' + instance.port) + '\\'';\n return false;\n }\n}", "function DetectDangerHiptop()\n {\n if (uagent.search(deviceDanger) > -1 ||\n uagent.search(deviceHiptop) > -1)\n return true;\n else\n return false;\n }", "function run_preflight_checks() {\n\n\t//\n\t// If we're not on a mobile, bring in the GitHub ribbon.\n\t//\n\tif (!util.is_mobile()) {\n\t\tjQuery(\"#github_ribbon\").fadeIn(1000);\n\t}\n\n\tif (!lib.iCanHasGoodCrypto()) {\n\t\tjQuery(\".source .bad_crypto\").clone().hide().fadeIn(800).appendTo(\".message\");\n\t}\n\n}", "function enrollNewTextIndependentVerificationProfile(){\n\tnavigator.getUserMedia({audio: true}, function(stream){\n\t\tconsole.log('I\\'m listening... just start talking for a few seconds...');\n\t\tconsole.log('Maybe read this: \\n' + thingsToRead[Math.floor(Math.random() * thingsToRead.length)]);\n\t\tonMediaSuccess(stream, createTextIndependentVerificationProfile, 6);\n\t}, onMediaError);\n}", "function DetectIphone()\n{\n if (uagent.search(deviceIphone) > -1)\n {\n //The iPod touch says it's an iPhone! So let's disambiguate.\n if (uagent.search(deviceIpod) > -1)\n return false;\n else \n return true;\n }\n else\n return false;\n}", "function DetectBlackBerry()\n{\n if (uagent.search(deviceBB) > -1)\n return true;\n if (uagent.search(vndRIM) > -1)\n return true;\n else\n return false;\n}", "function checkLic() {\n if (!params.enableObjectDetect) return;\n if (!params.lic) {\n _lic = false;\n return wss.broadcast('msgLicNotDetected', {\n binary: false\n });\n };\n _lic = true;\n}", "static isUserAgentNotFiringResize(userAgent) {\n return /(?:Lenovo.A850.*\\WVersion\\/|Lenovo.A889.*\\WBrowser\\/|\\WGT-P5100.*\\WVersion\\/)/i.test(userAgent)\n }", "canHandle(handlerInput) {\n console.log('canhandle fallback');\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest' && request.intent.name === 'AMAZON.FallbackIntent';\n }", "function pageRequiresDelayedSend() {\n // The Apple mobile password recovery page does not interact well with\n // iframes, so on pages with the 'iforgot.apple.com' domain, delay sending\n // the queue.\n return window.location.origin === \"https://iforgot.apple.com\";\n }", "function thridPartyDisallowance() {\n var frm = document.frmDisallow;\n if (frm.disallowTPAddress.value.length < 41) {\n $(\"#statusFormDisallow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormDisallow\").html(\"You must inform appropriate information\");\n return\n }\n $(\"#statusFormDisallow\").css(\"background-color\", \"lightblue\");\n $(\"#statusFormDisallow\").html(\"Waiting for you to confirm the transaction in MetaMask or another Ethereum wallet software\");\n console.log(\"Sending... \" + frm.disallowTPAddress.value);\n contract.removeIssuers(frm.disallowTPAddress.value, {from: web3.eth.accounts[0], gas: 3000000, value: 0}, function (err, result) {\n if (!err) {\n $(\"#statusFormDisallow\").css(\"background-color\", \"yellow\");\n $(\"#statusFormDisallow\").text(\"Transaction sent. Wait until it is mined. Transaction hash: \" + result);\n waitForTxToBeMined(result, \"#statusFormDisallow\");\n } else {\n console.error(err);\n $(\"#statusFormDisallow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormDisallow\").html(\"Error \" + JSON.stringify(err));\n }\n });\n $(\"#btnStartOverDisallowance\").show();\n $(\"#btn3TPDisallowance\").hide();\n}", "canHandle(handlerInput) {\n // handle fallback intent, yes and no when playing a game\n // for yes and no, will only get here if and not caught by the normal intent handler\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest' &&\n (request.intent.name === 'AMAZON.FallbackIntent' ||\n request.intent.name === 'AMAZON.YesIntent' ||\n request.intent.name === 'AMAZON.NoIntent');\n }", "function rfc3261_8_2_2_1(message, ua, transport) {\n if (!message.ruri || message.ruri.scheme !== 'sip') {\n reply(416, message, transport);\n return false;\n }\n }", "Nokia ():boolean {\n\n\t\treturn this.agent.match(/Nokia/i) ? true : false;\n\t}", "function isIphone() {\n \t\treturn !!navigator.userAgent.match(/iPhone/i);\n\t}", "function rfc3261_8_2_2_1(message, ua, transport) {\n if(!message.ruri || message.ruri.scheme !== 'sip') {\n reply(416, message, transport);\n return false;\n }\n}", "function didNotGetMicrophone(error)\n{\n if ( error.name == \"PermissionDeniedError\" ) {\n notice(\"No permission to use the microphone.\");\n }\n else {\n notice(\"Didn't get the microphone, error \" + error.name + \": \" + error.message);\n }\n}", "function _checkFeatures() {\n device.canvas = !!window.CanvasRenderingContext2D || device.cocoonJS;\n\n try {\n device.localStorage = !!localStorage.getItem;\n } catch (error) {\n device.localStorage = false;\n }\n\n device.file = !!window.File && !!window.FileReader && !!window.FileList && !!window.Blob;\n device.fileSystem = !!window.requestFileSystem;\n\n device.webGL = !!window.WebGLRenderingContext;\n\n device.worker = !!window.Worker;\n\n device.pointerLockElement = 'pointerLockElement' in document && 'pointerLockElement' || 'mozPointerLockElement' in document && 'mozPointerLockElement' || 'webkitPointerLockElement' in document && 'webkitPointerLockElement';\n\n device.pointerlockchange = 'onpointerlockchange' in document && 'pointerlockchange' || 'onmozpointerlockchange' in document && 'mozpointerlockchange' || 'onwebkitpointerlockchange' in document && 'webkitpointerlockchange';\n\n device.pointerlockerror = 'onpointerlockerror' in document && 'pointerlockerror' || 'onmozpointerlockerror' in document && 'mozpointerlockerror' || 'onwebkitpointerlockerror' in document && 'webkitpointerlockerror';\n\n device.pointerLock = !!device.pointerLockElement;\n\n device.quirksMode = document.compatMode === 'CSS1Compat' ? false : true;\n\n navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;\n\n window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n\n device.getUserMedia = device.getUserMedia && !!navigator.getUserMedia && !!window.URL;\n\n // Older versions of firefox (< 21) apparently claim support but user media does not actually work\n if (device.firefox && device.firefoxVersion < 21) {\n device.getUserMedia = false;\n }\n\n // TODO: replace canvasBitBltShift detection with actual feature check\n\n /*\n * Excludes iOS versions as they generally wrap UIWebView (eg. Safari WebKit) and it\n * is safer to not try and use the fast copy-over method.\n */\n if (!device.iOS && (device.ie || device.firefox || device.chrome)) {\n device.canvasBitBltShift = true;\n }\n\n // Known not to work\n if (device.safari || device.mobileSafari) {\n device.canvasBitBltShift = false;\n }\n }", "onTransportReceiveMsg(messageString) {\n const message = Parser.parseMessage(messageString, this.getLogger(\"sip.parser\"));\n if (!message) {\n this.logger.warn(\"Failed to parse incoming message. Dropping.\");\n return;\n }\n if (this.status === _UAStatus.STATUS_USER_CLOSED && message instanceof IncomingRequestMessage) {\n this.logger.warn(`Received ${message.method} request in state USER_CLOSED. Dropping.`);\n return;\n }\n // A valid SIP request formulated by a UAC MUST, at a minimum, contain\n // the following header fields: To, From, CSeq, Call-ID, Max-Forwards,\n // and Via; all of these header fields are mandatory in all SIP\n // requests.\n // https://tools.ietf.org/html/rfc3261#section-8.1.1\n const hasMinimumHeaders = () => {\n const mandatoryHeaders = [\"from\", \"to\", \"call_id\", \"cseq\", \"via\"];\n for (const header of mandatoryHeaders) {\n if (!message.hasHeader(header)) {\n this.logger.warn(`Missing mandatory header field : ${header}.`);\n return false;\n }\n }\n return true;\n };\n // Request Checks\n if (message instanceof IncomingRequestMessage) {\n // This is port of SanityCheck.minimumHeaders().\n if (!hasMinimumHeaders()) {\n this.logger.warn(`Request missing mandatory header field. Dropping.`);\n return;\n }\n // FIXME: This is non-standard and should be a configruable behavior (desirable regardless).\n // Custom SIP.js check to reject request from ourself (this instance of SIP.js).\n // This is port of SanityCheck.rfc3261_16_3_4().\n if (!message.toTag && message.callId.substr(0, 5) === this.options.sipjsId) {\n this.userAgentCore.replyStateless(message, { statusCode: 482 });\n return;\n }\n // FIXME: This should be Transport check before we get here (Section 18).\n // Custom SIP.js check to reject requests if body length wrong.\n // This is port of SanityCheck.rfc3261_18_3_request().\n const len = str_utf8_length(message.body);\n const contentLength = message.getHeader(\"content-length\");\n if (contentLength && len < Number(contentLength)) {\n this.userAgentCore.replyStateless(message, { statusCode: 400 });\n return;\n }\n }\n // Reponse Checks\n if (message instanceof IncomingResponseMessage) {\n // This is port of SanityCheck.minimumHeaders().\n if (!hasMinimumHeaders()) {\n this.logger.warn(`Response missing mandatory header field. Dropping.`);\n return;\n }\n // Custom SIP.js check to drop responses if multiple Via headers.\n // This is port of SanityCheck.rfc3261_8_1_3_3().\n if (message.getHeaders(\"via\").length > 1) {\n this.logger.warn(\"More than one Via header field present in the response. Dropping.\");\n return;\n }\n // FIXME: This should be Transport check before we get here (Section 18).\n // Custom SIP.js check to drop responses if bad Via header.\n // This is port of SanityCheck.rfc3261_18_1_2().\n if (message.via.host !== this.options.viaHost || message.via.port !== undefined) {\n this.logger.warn(\"Via sent-by in the response does not match UA Via host value. Dropping.\");\n return;\n }\n // FIXME: This should be Transport check before we get here (Section 18).\n // Custom SIP.js check to reject requests if body length wrong.\n // This is port of SanityCheck.rfc3261_18_3_response().\n const len = str_utf8_length(message.body);\n const contentLength = message.getHeader(\"content-length\");\n if (contentLength && len < Number(contentLength)) {\n this.logger.warn(\"Message body length is lower than the value in Content-Length header field. Dropping.\");\n return;\n }\n }\n // Handle Request\n if (message instanceof IncomingRequestMessage) {\n this.userAgentCore.receiveIncomingRequestFromTransport(message);\n return;\n }\n // Handle Response\n if (message instanceof IncomingResponseMessage) {\n this.userAgentCore.receiveIncomingResponseFromTransport(message);\n return;\n }\n throw new Error(\"Invalid message type.\");\n }", "get iosAllowOnce() {\n\t\treturn $('~Allow Once');\n\t}", "function DetectIpod()\n{\n if (uagent.search(deviceIpod) > -1)\n return true;\n else\n return false;\n}", "async handle(handlerInput) {\n\n // Set the userId as the session ID from the Alexa Skill\n // This will get a new user ID on each session - alternatively use deviceId\n let userId = handlerInput.requestEnvelope.session.sessionId;\n\n let speechText = 'Well, this is awkward I don\\'t have anything to say';\n let status = handlerInput.requestEnvelope.request.intent.confirmationStatus;\n\n // Check to see the status of the intent\n if( status === \"NONE\"){\n\n // Check to see if Optimizely Client exists...\n // If it doesn't we'll make a request to the REST api (most up to date), and init the client\n if(!optimizelyClientInstance){\n await initOptimizely(process.env.PROJECT_ID);\n }\n \n /*** \n OPTIMIZELY FEATURE FLAGS GO HERE\n ***/\n\n let enabled = optimizelyClientInstance.isFeatureEnabled('personal_stylist', userId);\n let response = optimizelyClientInstance.getFeatureVariableString('personal_stylist', 'response', userId);\n\n // Send back response with feature variable if applicable\n return handlerInput.responseBuilder\n .speak(enabled ? response : speechText)\n .addConfirmIntentDirective(handlerInput.requestEnvelope.request.intent)\n .getResponse();\n\n // How to respond if a user accepts my confirmation question\n } else if ( status === \"CONFIRMED\" ){\n \n // Send tracking event to Optimizely\n optimizelyClientInstance.track('respondedYes', userId);\n\n return handlerInput.responseBuilder\n .speak(confirmationResponse)\n .withShouldEndSession(true)\n .getResponse();\n\n // Check to see if the user rejected the prompt\n } else if ( status === \"DENIED\" ) {\n\n // Track event that the user rejected the recommendation\n optimizelyClientInstance.track('respondedNo', userId);\n \n return handlerInput.responseBuilder\n .speak(deniedResponse)\n .withShouldEndSession(true)\n .getResponse();\n\n }\n }", "function isAiCC() {\n if (parseInt(app.version) <= 16) { return false; }\n return true;\n}", "function handleBugIntent (intent, session, response){\n var speechOutput = \"Am I misbehaving? Please visit \"+options.homepage+ \" to contact my creator.\" ;\n var cardOutput = \"Please email [email protected]\";\n response.tellWithCard({speech: \"<speak>\" + speechOutput + \"</speak>\", type: AlexaSkill.speechOutput.SSML},\n \"D.U.M.M.Y.\", cardOutput);\n}", "function iOSAppTrue() {\n iosApp = true;\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function isSupported(kind) {\n console.log('supported', kind);\n const divNotSupported = document.getElementById('notSupported');\n divNotSupported.classList.toggle('hidden', true);\n butSet.removeAttribute('disabled');\n butClear.removeAttribute('disabled');\n inputBadgeVal.removeAttribute('disabled'); \n \n butMakeXHR.removeAttribute('disabled');\n}", "canEnroll() {\r\n return super._canEnroll(core.Credential.Fingerprints);\r\n }", "function DetectIpod()\n{\n if (uagent.search(deviceIpod) > -1)\n return true;\n else\n return false;\n}", "function DetectIpod()\n{\n if (uagent.search(deviceIpod) > -1)\n return true;\n else\n return false;\n}", "function allowNPS(){\n\t \tvar allowed_on_atlas = ( ( getSite() == 'BLUEMIX_ATLAS' ) && (getPageID() === 'BLUEMIX OVERVIEW') && ( _clientType() == 'Chrome') );\n\t \tvar allowed_on_classic = (( getSite() == 'BLUEMIX_CLASSIC' ) && getPageID() === 'BLUEMIX DASHBOARD') && ( _clientType() == 'Chrome');\n\t \tvar allowed = ( allowed_on_classic || allowed_on_atlas );\n\t \treturn allowed;\n\t }", "function identifyUser( user, currentSubscription, additionalTraits ) {\nif ( !$window.analytics || !config || !user || !currentSubscription ) {\nreturn;\n}\nvar nameSplit = splitName( user.name );\nvar agent = navigator.userAgent||navigator.vendor||window.opera;\nvar ismobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(agent.substr(0,4));\ntry {\nadditionalTraits = Object.assign({}, additionalTraits);\n} catch (error) {\nadditionalTraits = {}\n}\nvar traits = {\nbucket: user.bucketID,\ncreatedAt: moment(user.userCreatedAt).unix(),\ncreatedAtDateFormatIso8601: moment(user.userCreatedAt).toISOString(),\nname: user.name,\nfirstname: nameSplit.firstname,\nlastname: nameSplit.lastname,\nemail: user.email,\nreferring_source: user.source,\nplan_name: currentSubscription.name,\nlifecyclestage: translateSubscriptionToLifecycleStage( currentSubscription ),\nsubscriptionexpiresat: currentSubscription.expiresAt,\nlastKnownIPAddress: user.lastKnownIpAddress,\n\"feature_inspect-v-1\": config.featureFlags[\"inspect-v-1\"],\n\"feature_inspect-v-3\": config.featureFlags[\"inspect-v3\"],\n\"feature_inspect-v-3-enterprise\": config.featureFlags[\"inspect-v3-enterprise\"],\n\"feature_inspect-asset-manager\": config.featureFlags[\"inspect-assetManager\"],\nisSingleTenant: config.singleTenantConfig.useSingleTenantAnalytics,\ncustomer_status: config.isCustomer ? \"Existing Customer\" : \"Potential Customer\",\nscreenUploadedCount: user.screenUploadedCount,\ninvisionVersion: \"6.0\",\nlast_device_used: ismobile ? 'mobile' : 'desktop'\n};\ntraits = Object.assign(traits, additionalTraits);\nvar momentDate = moment( currentSubscription.projectGracePeriodEndsAt );\nif ( momentDate.isValid() ) {\ntraits.gracePeriodEndsAt = momentDate.toJSON();\n}\nif ( user.companyInfo && user.companyInfo.subdomain !== \"\" ) {\ntraits.usagedataid = user.companyInfo.subdomain;\n}\nif ( user.companyInfo && typeof user.companyInfo.sfdcAccountID !== \"undefined\" &&\nuser.companyInfo.sfdcAccountID !== \"\" &&\nuser.companyInfo.sfdcAccountID !== \"#N/A\"\n){\ntraits.sfdcaccountid = user.companyInfo.sfdcAccountID;\n}\nif ( typeof user.companyMembership !== \"undefined\" &&\ntypeof user.companyMembership.roleName !== \"undefined\" &&\nuser.companyMembership.roleName !== \"\"\n){\ntraits.enterprise_role = user.companyMembership.roleName;\n}\nif ( typeof user.companyMembership !== \"undefined\" &&\ntypeof user.companyMembership.companyID !== \"undefined\" &&\nuser.companyInfo.companyID > 0\n){\nif (\ntypeof user.companyInfo !== \"undefined\" &&\ntypeof user.companyInfo.providers !== \"undefined\" &&\nArray.isArray( user.companyInfo.providers ) &&\nuser.companyInfo.providers.length > 0\n){\ntraits.sso = true;\n} else {\ntraits.sso = false;\n}\n}\ntraits.derived_plan = getPlanAffiliation(user, currentSubscription);\nvar context = {};\nvar userID = formatUserId(user.id,vendorPrefixByDefault);\nsegmentUserId = userID;\nvar callback = function () {\nif ( typeof $window.mixpanel !== \"undefined\" && $window.mixpanel != null ) {\n$window.mixpanel.name_tag(null);\n}\n};\n$window.analytics.ready(function() {\nif (typeof $window.mixpanel !== 'undefined' && $window.mixpanel != null) {\n$window.mixpanel.reset();\n$window.mixpanel.identify(userID);\n}\nif (\ntypeof ga !== 'undefined'\n&& typeof ga === 'function'\n&& ['LIVE', 'PREVIEW'].indexOf(config.serverType) !== -1\n) {\nga('create', 'UA-24306919-3', 'projects.invisionapp.com', {'name': 'appTracker'} );\nvar gaDimensions = {};\ngaDimensions.dimension1 = config.isCustomer ? \"Existing Customer\" : \"Potential Customer\";\nga( 'appTracker.send', 'pageview', gaDimensions);\n}\n});\n$window.analytics.identify( userID, traits, context, callback );\nvar growthTraits = {\n\"Full Name\": user.name,\nEmail: user.email,\n\"Plan Name\": traits.plan_name,\n\"Current Plan Name\": getCurrentPlan(user, currentSubscription),\n\"Signup Date\": moment(user.userCreatedAt).format(\"YYYY-MM-DD HH:mm:ss\"),\n\"Most Recent IP Address\": user.lastKnownIpAddress,\n\"Screens Upload Count\": user.screenUploadedCount,\n\"Last Activity\": moment(user.lastRequestAt).format(\"YYYY-MM-DD HH:mm:ss\"),\n\"Plan Affiliation\": getPlanAffiliation(user, currentSubscription),\n\"Prototype Count\": user.prototypeCountForQuota,\n\"Over Prototype Limit\": (user.prototypeCountForQuota > currentSubscription.maxProjectCount ? \"True\" : \"False\")\n};\nif (user.paymentInfo){\nvar normalizedPaymentInfo = normalizePaymentTrackingInfo(user.paymentInfo);\ngrowthTraits[\"Credit Card Expiration\"] = normalizedPaymentInfo.cardExpiryDate || null;\ngrowthTraits[\"Credit Card Expiration Remaining Days\"] = normalizedPaymentInfo.cardExpiryRemainingDays || null;\n}\nidentifyGrowth( user.id, growthTraits );\nvar MILLIS_PER_DAY = 60 * 60 * 24 * 1000;\n$window.InvAnalytics = $window.InvAnalytics || {};\n$window.InvAnalytics.accountAgeDays = (Date.now() - config.accountCreatedAt) / MILLIS_PER_DAY;\n}", "function accept_friend_request() {\n handle_friend_request_accept_or_decline(true);\n}", "function realDeal() {\n var real = true;\n if (navigator.platform.substring(0, 3) == 'Mac') real = false;\n if (navigator.platform.substring(0, 3) == 'Win') real = false;\n //log('real deal?', real);\n return real;\n}", "isScreenSharing() {}", "function _checkDevice() {\n device.pixelRatio = window.devicePixelRatio || 1;\n device.iPhone = navigator.userAgent.toLowerCase().indexOf('iphone') !== -1;\n device.iPhone4 = device.pixelRatio === 2 && device.iPhone;\n device.iPad = navigator.userAgent.toLowerCase().indexOf('ipad') !== -1;\n\n if (typeof Int8Array !== 'undefined') {\n device.typedArray = true;\n } else {\n device.typedArray = false;\n }\n\n if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined') {\n device.littleEndian = _checkIsLittleEndian();\n device.LITTLE_ENDIAN = device.littleEndian;\n }\n\n device.support32bit = typeof ArrayBuffer !== 'undefined' && typeof Uint8ClampedArray !== 'undefined' && typeof Int32Array !== 'undefined' && device.littleEndian !== null && _checkIsUint8ClampedImageData();\n\n navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;\n\n if (navigator.vibrate) {\n device.vibration = true;\n }\n }", "function trustNone() {\n return false;\n}", "function trustNone() {\n return false;\n}", "function trustNone() {\n return false;\n}", "function trustNone() {\n return false;\n}", "function trustNone() {\n return false;\n}", "function trustNone() {\n return false;\n}", "unlocked(){return hasChallenge(\"燃料\",11)}", "unlocked(){return hasChallenge(\"燃料\",11)}", "function _phone_in(request){\n var trinity = 'https://apex.go.sonobi.com/trinity.js?key_maker=';\n var adSlots = request.bids || [];\n var bidderRequestId = request.bidderRequestId;\n var ref = (window.frameElement) ? '&ref=' + encodeURI(top.location.host || document.referrer) : '';\n adloader.loadScript(trinity + JSON.stringify(_keymaker(adSlots)) + '&cv=' + _operator(bidderRequestId) + ref );\n }", "function isAcceptable() {\n\n // Local variables\n var acceptableConnection = false;\n var devConnection = $cordovaNetwork.getNetwork();\n\n // Check to determine the type of connection available\n if (window.Connection) {\n if (navigator.connection.type == Connection.WIFI) {\n acceptableConnection = true;\n $log.info('This device has a WiFi connection');\n } else if (navigator.connection.type == Connection.CELL_3G) {\n acceptableConnection = true;\n $log.info('This device has a 3G connection');\n } else if (navigator.connection.type == Connection.CELL_4G) {\n acceptableConnection = true;\n $log.info('This device has a 4G connection');\n } else if (navigator.connection.type == Connection.CELL_2G) {\n $log.info('This device has a 2G connection');\n } else if (navigator.connection.type == Connection.ETHERNET) {\n acceptableConnection = true;\n $log.info('This device has an Ethernet connection');\n } else if (navigator.connection.type == Connection.NONE) {\n $log.info('This device has no connection');\n }\n }\n return acceptableConnection;\n }", "isRealDevice () {\n return false;\n }", "function getIsApple() {\n if( settings.hasWURFL ) {\n var deviceName = WURFL.complete_device_name.toLowerCase();\n if( deviceName.indexOf( \"apple\" ) > -1 ) {\n return true;\n }\n }\n return false;\n }", "enable (request, reply) {\n const user = request.params.currentUser;\n const that = this;\n if (user.totp === true) {\n // TOTP is already enabled, user needs to disable it first\n this.log.warn('2FA already enabled. No need to reenable.', { security: true, fail: true, request: request});\n return reply(Boom.badRequest('2FA is already enabled. You need to disable it first'));\n }\n const method = request.payload ? request.payload.method : '';\n if (method !== 'app' && method !== 'sms') {\n return reply(Boom.badRequest('Valid 2FA method is required'));\n }\n user.totpMethod = request.payload.method;\n user.totp = true;\n user\n .save()\n .then(() => {\n return reply(user);\n })\n .catch(err => {\n that.app.services.ErrorService.handleError(err, request, reply);\n });\n }", "function fixNegotiationNeeded(window) {\n const browserDetails = detectBrowser(window);\n wrapPeerConnectionEvent(window, 'negotiationneeded', e => {\n const pc = e.target;\n if (browserDetails.version < 72 || (pc.getConfiguration &&\n pc.getConfiguration().sdpSemantics === 'plan-b')) {\n if (pc.signalingState !== 'stable') {\n return;\n }\n }\n return e;\n });\n}", "function test_candu_verify_global_utilization_metrics() {}", "function setDeviceEnabledBand() {\n\tconsole.log('info: setDeviceEnabledBand() is called.');\n\n\t// Get csrf_token\n\tvar api = '/';\n\tvar url = 'http://' + document.apiform.address.value + api;\n\tupdateMessage(url, '', 'Connecting...', '');\n\n\tvar xhr = new XMLHttpRequest();\n\txhr.open('GET', url, false);\n\txhr.withCredentials = true;\n\txhr.onerror = function(e) {\n\t\tupdateMessage(url, xhr.statusText, 'Error: Cannot access.', '');\n\t};\n\txhr.send(null);\n\n\tif (xhr.status === 200) {\n\t\tvar str = xhr.responseText;\n\t\tvar csrf_token = str.match(/<meta name=\"csrf_token\" content=\"([A-Za-z0-9]+)\">/i);\n\t\tcsrf_token = csrf_token[1];\n\t\tif (csrf_token != null) {\n\t\t\tupdateMessage(url, xhr.statusText, 'Success to get a token: ' + csrf_token, '');\n\t\t} else {\n\t\t\tupdateMessage(url, xhr.statusText, 'Error: Fail to get the token.', '');\n\t\t\treturn -1;\n\t\t}\n\n\t\t// Login\n\t\tapi = '/api/user/login';\n\t\turl = 'http://' + document.apiform.address.value + api;\n\t\tupdateMessage(url, '', 'Connecting...', '');\n\n\t\txhr.open('POST', url, false);\n\t\txhr.onerror = function(e) {\n\t\t\tupdateMessage(url, xhr.statusText, 'Error: Cannot access.', '');\n\t\t};\n\n\t\t// Generate credential\n\t\tvar username = 'admin';\n\t\tvar password = document.apiform.password.value;\n\t\tvar password_hash = encryptSHA256(username + encryptSHA256(password) + csrf_token);\n\n\t\tvar login_params = '';\n\t\tlogin_params += '<!--?xml version=\"1.0\" encoding=\"UTF-8\"?-->\\r';\n\t\tlogin_params += '<request>\\r';\n\t\tlogin_params += '<Username>' + username + '</Username>\\r';\n\t\tlogin_params += '<Password>' + password_hash + '</Password>\\r';\n\t\tlogin_params += '<password_type>4</password_type>\\r';\n\t\tlogin_params += '</request>\\r';\n\t\tconsole.log(login_params);\n\n\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\t\txhr.setRequestHeader('__RequestVerificationToken', csrf_token);\n\t\txhr.send(login_params);\n\n\t\t// Login Result\n\t\tif (xhr.status === 200) {\n\t\t\t\n\t\t\tvar error_code = xhr.responseText.match(/<code>([0-9]+)<\\/code>/i);\n\t\t\tif (error_code == null) {\n\t\t\t\tupdateMessage(url, xhr.statusText, 'Login Successful!', xhr.responseText);\n\n\t\t\t\t// Set LTE Bands\n\t\t\t\tapi = '/api/net/net-mode';\n\t\t\t\turl = 'http://' + document.apiform.address.value + api;\n\t\t\t\tupdateMessage(url, '', 'Connecting...', '')\n\t\t\t\ttoken = xhr.getResponseHeader('__RequestVerificationTokenOne');\n\t\t\t\txhr.open('POST', url, true);\n\t\t\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\t\t\t\txhr.setRequestHeader('__RequestVerificationToken', token);\n\t\t\t\txhr.onload = function(e) {\n\t\t\t\t\terror_code = xhr.responseText.match(/<code>([0-9]+)<\\/code>/i);\n\t\t\t\t\tconsole.log(error_code);\n\t\t\t\t\tif (error_code == null) {\n\t\t\t\t\t\tupdateMessage(url, xhr.statusText, 'Change Successful!', xhr.responseText);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tupdateMessage(url, xhr.statusText, 'Error: ' + ERRORS[error_code[1]], xhr.responseText);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\txhr.onerror = function(e) {\n\t\t\t\t\tupdateMessage(url, xhr.statusText, 'Error: Check Parameters.', '')\n\t\t\t\t};\n\t\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=\"UTF-8\"');\n\t\t\t\tconsole.log(document.apiform.reqparams.value);\n\t\t\t\txhr.send(document.apiform.reqparams.value);\n\n\t\t\t} else {\n\t\t\t\tupdateMessage(url, xhr.statusText, 'Error: ' + ERRORS[error_code[1]], xhr.responseText);\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tupdateMessage(url, xhr.statusText, 'Error: Cannot access.', xhr.responseText);\n\t\t}\n\n\t} else {\n\t\tupdateMessage(url, xhr.statusText, 'Error: Check the address or your browser status (Cross-Origin Resource Sharing).', '')\n\t}\n}", "function checkPermissions(){\n navigator.permissions.query(\n { name: 'microphone' } \n).then( (permissionStatus) => {\n if(permissionStatus.state === 'granted'){\n permissionGiven = true;\n }\n permissionStatus.onchange = function(){\n console.log(\"Permission changed to \" + this.state);\n if(this.state === 'granted'){\n permissionGiven = true;\n }\n }\n})\n}", "function mustAutoplayMediaInLessonViewer() {\n return (!$.browser.ipad && !$.browser.iphone);\n}", "function check() {\n \n var production = \"75f2d410-0a3a-44d0-8240-08637eb5d2f8\";\n //getSnapshot(snapshot);\n postDeviceDetails(\"\", production);\n //getChannels();\n}" ]
[ "0.5587254", "0.5523544", "0.54189044", "0.5293914", "0.52858055", "0.51660085", "0.51615787", "0.5161381", "0.5151987", "0.51505095", "0.5066032", "0.50423324", "0.5026151", "0.501396", "0.501396", "0.501396", "0.501396", "0.501396", "0.50037426", "0.5000443", "0.4967216", "0.49561957", "0.49526265", "0.4916958", "0.4914813", "0.4844385", "0.4837649", "0.48179778", "0.4809706", "0.48029697", "0.4798695", "0.4790659", "0.47845754", "0.4775516", "0.4773111", "0.47666767", "0.47656518", "0.47583467", "0.47490704", "0.47358775", "0.4735629", "0.47355536", "0.47353384", "0.47338387", "0.4728973", "0.47280526", "0.4716719", "0.4711024", "0.47054943", "0.4703459", "0.46959034", "0.46832833", "0.46795407", "0.4678257", "0.46734506", "0.4663123", "0.46608204", "0.46595544", "0.46570975", "0.46560135", "0.4647309", "0.464726", "0.464726", "0.464726", "0.464726", "0.464726", "0.464726", "0.464726", "0.464726", "0.464726", "0.464726", "0.46468815", "0.46444118", "0.4642116", "0.4642116", "0.46230686", "0.46228194", "0.46153563", "0.4613481", "0.46124235", "0.46050742", "0.46028307", "0.46028307", "0.46028307", "0.46028307", "0.46028307", "0.46028307", "0.46024728", "0.46024728", "0.45984665", "0.4592708", "0.4590978", "0.45877498", "0.45855704", "0.45811772", "0.45747092", "0.45687106", "0.45597145", "0.45531288", "0.4550861" ]
0.73278826
0
fetch the users orders and items
function fetchMyOrders() { /* $.get('controller/app.php', { req : "fetch-my-orders", }, function(data) { console.log(data); $("#data-table").jsonTable({ head:["Order Number",'Item ID','Due Date','Quantity'], json:['order_number','item_id','due_date','quantity'], source:data }); }, "json");*/ $.ajax({ url : 'controller/app.php?req=fetch-my-orders', dataType : 'json', success : function(json) { dataTable = $('#data-table').columns({ data : json, schema : [{ "header" : "Order Number", "key" : "order_number" }, { "header" : "Item ID", "key" : "item_id" }, { "header" : "Due Date", "key" : "due_date" }, { "header" : "Quantity", "key" : "quantity" }] }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchOrdersList(user_id) {\r\n return axios.get(USER_API_BASE_URL + '/orders/' + user_id);\r\n }", "function get_users_items_normal(users) {\n var items = [];\n for (user of users) {\n for (order of user.orders) {\n for (item of order.items) {\n items.push(item);\n }\n }\n }\n\n return items;\n}", "function getOrders(orders) {\n //* Order have not loaded yet\n if (!orders) {\n return <></>\n }\n //* If the user has no orders\n if (orders.length === 0) return <></>\n //* Get all of the items\n const ordered = orders.reverse()\n return ordered.map(order => {\n return <OrderItem key={order.id} order={order} />\n })\n}", "findAllxUser(req, res) {\n OrderModel.find({ usuarios: req.user._id })\n .populate({\n path: \"productos\",\n populate: { path: \"productos\" },\n })\n .then((orders) => res.status(200).send(orders))\n .catch((err) => res.status(500).send(err));\n }", "list(req, res) {\n return Order.findAll({\n include: [\n {\n model: Item,\n as: \"Items\"\n }\n ]\n })\n .then(orders => res.status(200).send(orders))\n .catch(error => res.status(400).send(error));\n }", "async findAllOrdersByUserId(userId){\n return Order.find({user_id : userId});\n }", "list(req, res) {\n return OrderDetails.findAll({\n include: [\n {\n model: Item,\n as: \"Items\"\n }\n ]\n })\n .then(orders => res.status(200).send(orders))\n .catch(error => res.status(400).send(error));\n }", "function getOrders() {\n return getItem('orders');\n}", "allOrders() {\n return Order.find({member_id: Meteor.userId()});\n }", "static getItems(orderId) {\n return db.execute(\n `SELECT * FROM orderitems WHERE orderId = ?`, [orderId]\n )\n .then(([orderItems, metaData]) => {\n for(let i = 0; i < orderItems.length; i++) {\n orderItems[i] = Object.assign(new OrderItem(), orderItems[i]);\n }\n return orderItems;\n })\n .catch(err => console.log(err));\n }", "getOrderList() {\n return fetch('/api/orders/getMyOrders', {headers: {'authorization': localStorage.getItem('authorization')}}).then(function (response) {\n return response.json();\n }).then(function (result) {\n return result;\n }).catch(() => {\n NotificationManager.error(\"Ошибка\", 'Попробуйте позже');\n });\n }", "static getAllItems(user_id) {\n return db\n .manyOrNone(`\n SELECT * FROM outfits\n JOIN shopping_carts \n ON outfits.id = shopping_carts.shopping_cart_item\n WHERE shopping_carts.user_id = ${user_id};`)\n .then((items) => {\n return items.map((item) => {\n return new Outfit(item);\n });\n });\n }", "async function getCustomerOrders(userID){\n let order = await Order.find({userID: userID}).sort({'dateOfOrder': -1});\n return returnOrderObjects(order);\n}", "async getOrders(){\n try{\n const market = await this.veil.getMarket(this.market);\n const orders = await this.veil.getUserOrders(market);\n const fills = await this.veil.getOrderFills(market, \"short\");\n return orders;\n } catch(e) {\n console.log(\"error \" + e);\n return e;\n }\n }", "function _getAllOrdersByUser(userEmail, callback)\n{\n\n Order.getAllOrdersByUser(userEmail, function (data2)\n {\n callback(data2)\n })\n\n\n}", "async function getListOrder(req, res) {\r\n let userId = req.user._id;\r\n console.log(userId, req.user);\r\n Order.methods\r\n .getList(undefined, undefined, userId, undefined)\r\n .then(list => {\r\n console.log(\"get list order\", list);\r\n return res.json(list);\r\n })\r\n .catch(err => {\r\n console.log(err);\r\n return res.status(500).send({ ok: 0, message: \"fail\" });\r\n });\r\n}", "async function allOrders(req,res){\n if (req.user.user=='admin'){\n const orders = await OrderModel.find({order_made_by:'dealer'});\n return res.status(200).json({ orders, message: \"All Orders..\" })\n }\n else {\n return res.status(401).json({ message: \"Only Admin can access. Sorry!\" });\n }\n}", "async orderSendByManager(user_id) {\n try {\n const myUser = await UserDAO.readOneEntity(user_id);\n const store_id = myUser.storeId;\n\n var OurStoreOrdersList = []\n var allOrdersList = await OrderDAO.getAllUnReceviedOrders(); //get all orders list with not recvied status\n allOrdersList.forEach(order => {\n var storeId = await RouteDAO.getStoreIdByRouteId(order.routeId);\n if (storeId === store_id) {\n let id = order.orderId;\n let date = order.date;\n let total_amount = order.totalAmount;\n\n var product_list = await QueryDAO.getProductByOrderId(id);\n \n var OneOrder = { id, date, total_amount, product_list }\n OurStoreOrdersList.push(OneOrder);\n }\n });\n\n return OurStoreOrdersList;\n // [\n // {\n // id:1,\n // date:2020-12-12,\n // total_amount: 5,\n // product_list:[\n // {\n // productName:Shampoo,\n // orderedQuantity: 10\n // },\n // ..........\n // ]\n // },\n // ..........\n // ]\n\n } catch (error) {\n\n }\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 }", "async index(req, res) {\n let orders;\n if (req.userPerfil === 'client') {\n return res.status(400).json({ error: 'Perfil não autorizado' });\n }\n if (req.userPerfil === 'admin') {\n orders = await _Order2.default.findAll({\n where: {\n status: {\n [_sequelize.Op.or]: ['create', 'programada'],\n },\n },\n attributes: ['id', 'description_defect'],\n include: [\n {\n model: _Service2.default,\n as: 'service',\n attributes: ['id', 'type', 'defect', 'status'],\n include: [\n {\n model: _Client2.default,\n as: 'client',\n attributes: ['id', 'name'],\n },\n ],\n },\n {\n model: _User2.default,\n as: 'technical',\n attributes: ['id', 'name'],\n },\n ],\n });\n }\n if (req.userPerfil === 'tech') {\n orders = await _Order2.default.findAll({\n where: {\n [_sequelize.Op.and]: [\n {\n status: {\n [_sequelize.Op.or]: ['create', 'programada'],\n },\n },\n {\n technical_id: req.userId,\n },\n ],\n },\n attributes: ['id', 'description_defect'],\n include: [\n {\n model: _Service2.default,\n as: 'service',\n attributes: ['id', 'type', 'defect', 'status'],\n include: [\n {\n model: _Client2.default,\n as: 'client',\n attributes: ['id', 'name'],\n },\n ],\n },\n {\n model: _User2.default,\n as: 'technical',\n attributes: ['id', 'name'],\n },\n ],\n });\n }\n\n return res.json(orders);\n }", "async function getAllOrder(req, res){\n const populateQuery = [{path:'user', select: 'name'}, {path:'cart', select: 'product'}];\n let order = await Order.find({}).populate(populateQuery)\n\n res.status(200).json(success(order, \"order list\"))\n}", "function findAll(req, res, next) {\n orderItemDao.findAll(req.params.orderItemId)\n .then((orders) => {\n res.json(orders);\n });\n}", "async function getItems(page, orderBy, order) {\n\n // Determine the sorting order\n // In this example, orderBy == 1 => order by 'createdOn'\n orderBy = orderBy || 1; // Default to 1\n order = (order == 1 || order == -1) ? order : 1;\n\n let pData = new PaginationData( {\n pageSize: 10,\n params: {\n orderBy: orderBy,\n order: order\n }\n });\n\n let condition = {}; // Retrieve all items\n\n let itemCount = await Item.count(condition);\n\n pData.pageCount = Math.ceil(itemCount / pData.pageSize);\n\n // Ensure the current page number is between 1 and pData.pageCount\n page = (!page || page <= 0) ? 1 : page;\n page = (page >= pData.pageCount) ? pData.pageCount : page;\n pData.currentPage = page;\n\n // Construct parameter for sorting\n let sortParam = {};\n if (orderBy == 1)\n sortParam = { createdOn: order };\n // TODO: added sort by redeem cost\n if (orderBy == 2)\n sortParam = { token_value: order};\n\n // ----- Construct query and retrieve items from DB -----\n // Construct query\n\n pData.items = await Item.\n find(condition).\n skip(pData.pageSize * (pData.currentPage-1)).\n limit(pData.pageSize).\n sort(sortParam).\n exec();\n\n pData.validate(); // Make sure all required properties exist.\n\n return pData;\n}", "async getOrders() {\n const orders = await this.client().order.list().then((order) => (order))\n .catch((err) => console.log(err));\n\n return orders;\n }", "static getOrderItemsProducts(orderId) {\n return db.execute(\n `SELECT orderitems.*, products.* FROM orderitems\n JOIN products ON products.id = orderitems.productId\n WHERE orderitems.orderId = ?`, [orderId]\n )\n .then(([result, metaData]) => {\n return result;\n })\n .catch(err => console.log(err));\n }", "findAll(req, res) {\n OrderModel.find()\n .populate(\"usuarios\")\n .populate({\n path: \"productos\",\n populate: { path: \"productos\" },\n })\n .then((orders) => res.status(200).send(orders))\n .catch((err) => res.status(500).send(err));\n }", "fetchOpenOrders() {\n if ( !this._apikey || !this._ajax ) return;\n\n this._ajax.get( this.getSignedUrl( '/v3/openOrders' ), {\n type: 'json',\n headers: { 'X-MBX-APIKEY': this._apikey },\n\n success: ( xhr, status, response ) => {\n response.forEach( o => this.emit( 'user_order', this.parseOrderData( o ) ) );\n this.emit( 'user_data', true );\n },\n error: ( xhr, status, error ) => {\n this.emit( 'user_fail', error );\n }\n });\n }", "function adminOrdersFetchCall() {\n return request('get', urls.ADMIN_ORDER_URL);\n}", "async list(req, res) {\n try {\n const orders = await Orderservice.findAll({\n attributes: [\n 'id',\n 'client_id',\n 'is_package',\n 'services',\n 'situation',\n 'amount',\n 'date_order',\n ],\n include: [{ model: Client, as: 'client', attributes: ['name'] }],\n });\n return res.json(orders);\n } catch (error) {\n return res.status(401).json({ error: 'Does not exist order' });\n }\n }", "function getAllOrder() {\n return dispatch => {\n let user = JSON.parse(sessionStorage.user);\n\n let apiEndpoint = 'order/user/' + user._id;\n // console.log(\"Cek API : \", apiEndpoint);\n\n orderService.getAllOrders(apiEndpoint).then(\n (res) => {\n // console.log(\"Cek Material Data : \", res.data.material);\n let orders = res.data.order;\n // ordersData.data = res.data.order;\n console.log(\"Check Order Data : \", orders)\n\n if (res.data.status === 200) {\n sessionStorage.setItem('ordersData', JSON.stringify(orders));\n dispatch(getOrderList(orders));\n }\n }\n ).catch(\n err => {\n console.log(err);\n }\n );\n };\n}", "function getOrders(res, mysql, context, complete) {\n mysql.pool.query(\"SELECT Employees.id as eid, fname, lname, FoodSupply.id as fid, bname, pname, Orders.quantity, DATE_FORMAT(dateOrdered, '%Y-%m-%d %H:%i:%s') AS newDate FROM Employees INNER JOIN Orders ON Employees.id = Orders.EmployeeID INNER JOIN FoodSupply ON FoodSupply.id = Orders.FoodSupplyID ORDER BY Orders.dateOrdered\", function (error, results, fields) {\n if (error) {\n res.write(JSON.stringify(error));\n res.end();\n }\n context.order = results; //define results as \"order\"\n complete(); //call the complete function to increase callbackcount\n });\n }", "async getOrders(){\n return await fetch(ORDER_API_BASE_URI+\"/\",{\n method:'GET',\n }).then(response =>{\n return response.json();\n }).catch(reason => {\n return reason;\n })\n\n }", "function loadOrders(){\n orderService.orders().then(function(data){\n all_orders = data;\n povoateTable();\n setupDeleteListener();\n })\n}", "async get_orders(req, res) {\n try {\n const orders = await Order.find();\n res.status(200).json({\n type: \"success\",\n orders\n })\n } catch (err) {\n res.status(500).json({\n type: \"error\",\n message: \"Something went wrong please try again\",\n err\n })\n }\n }", "function getAllMyOrders(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // const orderid = req.params.id\n const cusid = req.body; // in a hidden field pass this.Customer.getId\n database_1.con.query('SELECT * from orders WHERE cus_id = ?', [cusid], (err, result) => {\n if (err) {\n res.status(400).send(err);\n return;\n }\n if (true)\n return res.json(result);\n else\n res.json({});\n });\n }\n catch (e) {\n console.log(e);\n }\n });\n}", "async function getOrder(id)\n{\n return pool.query('SELECT * FROM orders,order_items,items WHERE orders.order_id=order_items.order_id AND order_items.item_id=items.item_id AND orders.order_id=$1', [id])\n .then(res => {\n //HAY QUE PROCESAR EL RETURN: order_id,rest_id,deliv_id,cust_id,status,timestamp,[item_id,cantidad,title,desc,price,visible,url,cat_id]\n //check at least one row\n if(!res.rows[0]) return null\n\n var order = {\n order_id : res.rows[0].order_id,\n rest_id : res.rows[0].rest_id,\n deliv_id : res.rows[0].deliv_id,\n cust_id : res.rows[0].cust_id,\n status : res.rows[0].status,\n timestamp : res.rows[0].timestamp,\n importe : 0.0,\n items : []\n }\n res.rows.forEach(row => {\n order.importe = order.importe + row.price*row.cantidad\n order.items.push(\n {\n item_id : row.item_id,\n cantidad : row.cantidad,\n title : row.title,\n desc : row.desc,\n price : row.price\n })\n })\n\n return order\n })\n .catch(err => {\n return {error: err, errCode: 500}\n })\n}", "async bringOrders(req, res) {\n try {\n const orders = await Order.find();\n res\n .status(200)\n .json(orders);\n } catch (error) {\n res\n .status(400)\n .json({\n message: err\n });\n }\n\n }", "static async getAllOrders() {\n const { rows } = await pool.query(\n 'SELECT * FROM orders', \n )\n\n return rows.map(row => {\n return new Order(row);\n\n })\n }", "async fetchAll () {\n const orders = await Order.find()\n return orders\n }", "renderOrder() {\n return this.props.user.order.map((value, index) => {\n return <OrderList loggedUser={this.props.loggedUser} orderItem={value} key={index} />\n });\n }", "getOpenOrders (){\n let params = {\n // 'account-id': accountId,\n size: 500\n }\n\n params = this.auth.addSignature(cons.AccountAPI + cons.OpenOrders,\n cons.GET,\n params)\n\n return from(rest.get(cons.AccountAPI + cons.OpenOrders, params)).pipe(\n map(data => data.data),\n flatMap(datas => from(datas)),\n map(data => {\n data['order-id'] = data.id\n Reflect.deleteProperty(data, 'id')\n data['order-amount'] = data.amount\n Reflect.deleteProperty(data, 'amount')\n data['order-state'] = data.state\n Reflect.deleteProperty(data, 'state')\n data['order-type'] = data.type\n Reflect.deleteProperty(data, 'type')\n data['order-source'] = data.source\n Reflect.deleteProperty(data, 'source')\n\n return data\n }),\n toArray(),\n ).toPromise()\n }", "function getOrdersForUser (userid) {\n return new Promise((resolve, reject)=> {\n db = getDb()\n db.collection(\"orders\").find({userId: userid}).toArray(function(err, docs) {\n if (err) { \n reject (err)\n }\n console.log(\"Found the record:\");\n console.log(docs)\n resolve(docs)\n })\n })\n}", "function getItems(req, res, next) {\n var userId = req.userId;\n db.query(\"SELECT s.id, s.name, s.description__c as description, s.level__c as level, s.session_date__c as date, h.name as venue , h.location__latitude__s as latitude, h.location__longitude__s as longitude FROM salesforce.session__c as s, salesforce.hotel__c as h, schedule as sch WHERE sch.userid = $1 AND s.id = sch.sessionId AND h.sfid = s.venue__c ORDER BY date DESC LIMIT $2\", \n [userId, 20])\n .then(function (sessions) {\n return res.send(JSON.stringify(sessions));\n })\n .catch(next);\n}", "function getOrders() {\n return ClientOrder.query({\n id: null,\n page : page,\n orderBy: 'created_at',\n sortedBy: 'desc'\n }).$promise;\n }", "async getOrder(request) {\n return new Promise(async (resolve, reject) => {\n try {\n if (request.id) {\n let result = await Order.findOne({\n _id: request.id,\n isDeleted: false,\n user: request.owner\n }).populate(\"payment\").populate([{\n path: 'cart',\n model: 'cart',\n populate: {\n path: 'item',\n model: 'items'\n }\n }]);\n resolve(this.prepareOrderData(result));\n } else {\n let query = {\n isDeleted: false,\n user: request.owner\n };\n if (request.status) {\n query[\"status\"] = request.status;\n }\n const count = await Order.find(query).countDocuments();\n let result = await Order.find(query).sort({_id: -1}).skip(parseInt(request.offset)).limit(parseInt(request.limit)).populate(\"payment\");\n resolve({total: count, records: this.prepareOrdersData(result)})\n }\n } catch (error) {\n log.error(\"OrderService-->getOrder-->\", error);\n reject(errorFactory.dataBaseError(error));\n }\n\n\n });\n }", "getOrders(query) {\n query = this.getSequelizeQuery(query);\n return this.orders.findAll({ where: query });\n }", "myOrders (options) {\n return api('GET', helpers.appendQuery(`/order/self`, options.queryParams), options)\n }", "async searchOrdersByCity(body){\n let arrayOrders = [];\n let city = body.city;\n let allUsers = await User.findAll({where: {city}});\n for (let j in allUsers){\n let allOrders = await Order.findAll({where: {userId: allUsers[j].id}});\n for (let i in allOrders) {\n arrayOrders.push(allOrders[i]);\n }\n }\n return arrayOrders;\n }", "function loadOrder() {\n const postData = {orderId: sessionStorage.getItem(\"orderId\")};\n post(\"/api/authTable/getOrderItems\", JSON.stringify(postData),\n function (data) {\n const orderMenuItems = JSON.parse(data);\n for (let i = 0; i < orderMenuItems.length; i++) {\n const item = orderMenuItems[i];\n addItemToBasket(item);\n }\n calculateTotal();\n });\n}", "addorders(totalPrice, userId) {\r\n return axios.get(USER_API_BASE_URL+'/orders/'+userId+'/'+totalPrice);\r\n }", "async function getOrderCartByUserId(req, res, next) {\n try {\n const { userId } = req.params;\n console.log(\"getOrderCartByUserId\", userId);\n const order = await Order.findOne({\n where: {\n userId,\n orderState: \"CART\"\n },\n include: [User, Product]\n });\n if (!order) return res.status(404).send({\n message: \"No se encontró la orden\"\n });\n return res.json(order);\n } catch (error) {\n console.log(error);\n }\n}", "async getAllUser(req, res, next) {\n try {\n let limits = 12;\n if (req.query.order_status === \"all\") {\n let data = await transaction.findAll({\n where: {\n id_user: req.user.id,\n },\n // pagination\n limit: limits,\n offset: (parseInt(req.query.page) - 1) * limits,\n order: [[\"updatedAt\", \"DESC\"]],\n attributes: [\n \"id\",\n \"createdAt\",\n \"appointment_date\",\n \"appointment_address\",\n \"total_item\",\n \"total_fee\",\n \"order_status\",\n \"payment_status\",\n \"payment_type\",\n \"redirect_url\",\n \"expired_payment\",\n \"token\",\n ],\n include: [\n {\n model: user,\n attributes: [\n [\"id\", \"id_user\"],\n \"name\",\n \"phone_number\",\n \"city_or_regional\",\n \"postal_code\",\n ],\n },\n {\n model: partner,\n attributes: [\n [\"id\", \"id_partner\"],\n \"brand_service_name\",\n \"business_phone\",\n \"business_address\",\n \"partner_logo\",\n ],\n include: [\n {\n model: category,\n attributes: [\"category_name\"],\n },\n ],\n },\n ],\n });\n\n if (data.length === 0) {\n return next({ message: \"Data not found\", statusCode: 404 });\n }\n // if successful\n return res.status(200).json({\n message: \"Success\",\n data,\n });\n } else if (\n req.query.order_status === \"waiting\" ||\n \"accepted\" ||\n \"cancelled\" ||\n \"on process\" ||\n \"done\"\n ) {\n let data = await transaction.findAll({\n where: {\n id_user: req.user.id,\n order_status: req.query.order_status,\n },\n // pagination\n limit: limits,\n offset: (parseInt(req.query.page) - 1) * limits,\n order: [[\"updatedAt\", \"DESC\"]],\n attributes: [\n \"id\",\n \"createdAt\",\n \"appointment_date\",\n \"appointment_address\",\n \"total_item\",\n \"total_fee\",\n \"order_status\",\n \"payment_status\",\n \"payment_type\",\n \"redirect_url\",\n \"expired_payment\",\n \"token\",\n ],\n include: [\n {\n model: user,\n attributes: [\n [\"id\", \"id_user\"],\n \"name\",\n \"phone_number\",\n \"city_or_regional\",\n \"postal_code\",\n ],\n },\n {\n model: partner,\n attributes: [\n [\"id\", \"id_partner\"],\n \"brand_service_name\",\n \"business_phone\",\n \"business_address\",\n \"partner_logo\",\n ],\n include: [\n {\n model: category,\n attributes: [\"category_name\"],\n },\n ],\n },\n ],\n });\n if (data.length === 0) {\n return next({ message: \"Data not found\", statusCode: 404 });\n }\n // if successful\n return res.status(200).json({\n message: \"Success\",\n data,\n });\n }\n } catch (e) {\n return next(e);\n }\n }", "static async listCurrentOrders() {\n const query = `\n SELECT order.id AS \"orId\",\n order.customer_id AS \"cusId\",\n order.delivery_address AS \"addy\"\n FROM orders\n WHERE orders.completed = True\n `\n const result = await db.query(query)\n return result.rows\n }", "getAllOrders() {\n let dataURL = `${_environments_environment__WEBPACK_IMPORTED_MODULE_1__[\"environment\"].apiURL}/order/all`;\n return this.httpClient.get(dataURL).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"retry\"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"catchError\"])(this.handleError));\n }", "function getOrders(req, res) {\n var answer = [];\n if(req.query.email === undefined) {\n return res.send(\"Error: no email specified\");\n }\n Order.find({userEmail: req.query.email}, function(err, orders) {\n if (err) throw err;\n orders.sort(compare);\n if(orders.length <= 5) {\n answer.push({orders: orders});\n }\n else {\n answer.push({orders: orders.slice(0,6)}); \n }\n return res.json(answer);\n });\n}", "function all_orders_query() {\n\tvar query = new Parse.Query(Order);\n\tquery.equalTo(\"user\", user);\n\tquery.descending(\"createdAt\");\n\treturn query;\n}", "async findAllOrders(){\n return Order.find();\n }", "static async getMyOrder(userId) {\r\n let myOrder = await OrderDAO.findMyOrder(userId);\r\n return myOrder;\r\n // console.log(myOrder);\r\n }", "function myOrders(req, res, next){\n\tlet reqURL = url.parse(req.url, true);\n\t\n\t//query the database for the particular order based on the users username, password, and order number\n\tdb.any('SELECT order_number, shipping_company_name, tracking_number, shipping_status FROM sale JOIN customer USING (user_id) WHERE username = $1 AND \"password\" = $2 AND order_number = $3;', [req.query.username, req.query.password, req.query.ordernumber])\n\t\t.then(data => {\n\t\t\tlet orders = data;\n\n\t\t\t//if there are null attributes in the results, it means the data is not available yet\n\t\t\tfor(let i = 0; i < orders.length; i++){\n\t\t\t\tfor(key in orders[i]){\n\t\t\t\t\tif(orders[i][key] == null){\n\t\t\t\t\t\torders[i][key] = \"Not available\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet ordersObj = {\"orders\": orders}\n\n\t\t\t//send the information to the client\n\t\t\tres.format({\n\n\t\t\t\t//render the partial HTML page to list the order information\n\t\t\t\t'text/html': function(){\n\t\t\t\t\tres.render(\"listOrders\", ordersObj, function(err, html){\n\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\tres.status(500).send(\"Database error rendering HTML page\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tres.writeHead(200, { 'Content-Type': 'text/html' });\n\t\t\t\t\t\tres.end(html);\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\t//or send questions as a JSON string\n\t\t\t\t'application/json': function(){\n\t\t\t\t\tres.json(data);\n\t\t\t\t},\n\t\t\t})\n\t\t})\n\t\t.catch(error => {\n\t\t res.status(500).send(\"Database error: Error retrieving order information\");\n\t\t\treturn;\n\t});\n\t\n}", "function CustomerOrders(){\n let url = 'https://localhost:5001/MainMenu/get/orders/' + localStorage.getItem('customerId');\n fetch(url)\n .then(response => response.json())\n .then(result => {\n document.querySelectorAll('#customerorderlist tbody tr').forEach(element => element.remove());\n let table = document.querySelector('#customerorderlist tbody');\n for(let i = 0; i < result.length; ++i)\n {\n let row = table.insertRow(table.rows.length);\n\n let locCell = row.insertCell(0);\n let location;\n if(result[i].locationId == 1) {location = \"Albany\";}\n if(result[i].locationId == 2) {location = \"Syracuse\";}\n if(result[i].locationId == 3) {location = \"Buffalo\";}\n locCell.innerHTML = location;\n\n let pCell = row.insertCell(1);\n pCell.innerHTML = result[i].totalPrice;\n\n let productCell = row.insertCell(2);\n for (let j = 0; j < result[i].orderItems.length; ++j){\n fetch('https://localhost:5001/Location/get/product/' + result[i].orderItems[j].productId)\n .then(result => result.json())\n .then(result => productCell.innerHTML += result.name + \" - \" + result.price + \", \");\n }\n }\n \n });\n}", "function list(req, res, next){\n res.json({data: orders})\n}", "function getUsers() {\n return getItem('users');\n}", "async index(req,res){\n const { user_id } = req.query;\n const allOrders = await Order.find({foods: {$elemMatch: {user: mongooese.Types.ObjectId(user_id)}}});\n return res.json(allOrders);\n }", "static async getOpenOrders() {\n try {\n return await shopdb.po.findAll({ where: {status: { [Op.ne]: \"CLOSED\"} } });\n } catch (error) {\n throw error;\n }\n }", "function getUserItems(userId, cb){\n db.sequelize\n .query(\n \" Select MI.id as MIid, MI.name, MI.description, MI.picture, \"\n +\" MI.value, MI.categoryId, C.categoryName, MI.ownerId, \"\n +\" BI.borrowedStatus, BI.borrowedDate, BI.dueDate, \"\n +\" M.firstName as borrowerFirstName, M.id as borrowerId, \"\n +\" BI.id as borrowedItemsId, MI.canBorrow \"\n +\" FROM MemberItems as MI \"\n +\" LEFT OUTER JOIN BorrowedItems as BI ON MI.id = BI.itemId \"\n +\" LEFT OUTER JOIN Members as M on BI.borrowerId = M.id \"\n +\" LEFT OUTER JOIN Categories as C on MI.categoryId = C.id \"\n +\" WHERE MI.ownerId = ? ORDER BY MI.id;\"\n , { replacements: [userId], type: db.sequelize.QueryTypes.SELECT}\n ).then (function(results){\n var userItems = [];\n for(i=0; i<results.length; i++){\n userItems.push({\n id: results[i].MIid,\n name: results[i].name,\n description: results[i].description,\n picture:setBlankIfNull(results[i].picture),\n value: results[i].value,\n categoryId: results[i].categoryId,\n categoryname: results[i].categoryName,\n canBorrow:results[i].canBorrow,\n borrowedStatus: results[i].borrowedStatus,\n borrowedStatusText : getBorrowedStatusText(results[i].borrowedStatus),\n borrowedDate: setBlankIfNull(results[i].borrowedDate),\n dueDate: setBlankIfNull(results[i].dueDate),\n borrowerFirstName: setBlankIfNull(results[i].borrowerFirstName),\n borrowerId: setBlankIfNull(results[i].borrowerId),\n borrowedItemsId:setBlankIfNull(results[i].borrowedItemsId)\n });\n } // close for loop\n cb(userItems);\n }); //close then\n }//close function", "function list(req, res) {\n res.json({ data: orders });\n}", "fetchItems(){\n\t\tfetch(Constants.restApiPath+'items')\n\t\t.then(function(res){\n\t\t\tif(res.ok){\n\t\t\t\tres.json().then(function(res){\n\t\t\t\t\tdispatcher.dispatch({\n\t\t\t\t\t\ttype: \t\"FETCH_ITEMS_FROM_API\",\n\t\t\t\t\t\tres,\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t}\n\t\t\telse{\n\t\t\t\tconsole.log(Strings.error.restApi);\n\t\t\t\tconsole.log(res);\n\t\t\t}\n\t\t});\n\t}", "async getAdminOrder(request) {\n return new Promise(async (resolve, reject) => {\n try {\n if (request.id) {\n let result = await Order.findOne({\n isDeleted: false,\n _id: request.id\n }).populate(\"payment\").populate([{\n path: 'cart',\n model: 'cart',\n populate: {\n path: 'item',\n model: 'items'\n }\n }]);\n resolve(this.prepareOrderData(result));\n } else {\n let query = {isDeleted: false};\n if (request.status) {\n query[\"status\"] = request.status;\n }\n const count = await Order.find(query).countDocuments();\n let result = await Order.find(query).sort({modifiedAt: -1}).skip(parseInt(request.offset)).limit(parseInt(request.limit)).populate(\"payment\");\n resolve({total: count, records: this.prepareOrdersData(result)})\n }\n } catch (error) {\n log.error(\"OrderService-->getCart-->\", error);\n reject(errorFactory.dataBaseError(error));\n }\n\n\n });\n }", "function userOrderList(user, ulid){\n let orders = user.orders;\n\n for (order in orders){\n\n let orderOBJ = user.orders[order];\n\n $(`#${ulid}`).append(`\n <li class=\"list-group-item\">\n <div class=\"row\">\n <div class=\"col-8\">${orderOBJ.date}</div>\n <div class=\"col-4\">$${orderOBJ.value}</div>\n </div> \n </li>\n `)\n }\n}", "function setOrdersFromFirebase() {\n let orders = [];\n firebaseDB.ref().child('orders')\n .orderByChild('business')\n .equalTo(uid)\n .get().then((snapshot) => {\n if (snapshot.exists()) {\n orders = iterateOrders(snapshot.val());\n if (typeof orders !== 'undefined') {\n setOrderList(orders);\n }\n } else {\n console.log('No data available');\n setOrderList(orders);\n }\n }).catch((error) => {\n console.error(error);\n });\n }", "getAllItems(id) {\n return new Promise((fulfill, reject) => {\n return items().then((itemCollection) => {\n return itemCollection.find({\n userId: id\n }).toArray().then((itemArray) => {\n if (!itemArray) reject(`No items found for user with id of ${id}`);\n fulfill(itemArray);\n });\n });\n });\n }", "sortOrdersBasedOnUser(orderData, userName) {\n const ordersPerPerson = [];\n orderData.forEach(order => {\n if (order.user === userName) {\n ordersPerPerson.push(order);\n }\n });\n return ordersPerPerson;\n }", "function retrieveOrders(numPages)\n {\n const apiCalls = [];\n for(let pg = 1; pg <= numPages; pg++)\n {\n let url = `${baseUrl}/admin/orders.json?page=${pg}&limit=${ordersPerPage}&access_token=${token}`;\n apiCalls.push(fetchJson(url));\n }\n \n return Promise.all(apiCalls)\n .then(results => results.map(data => data.orders)) // pluck orders\n .then(orders => orders.reduce((prev, curr) => prev.concat(curr)));\n }", "getOrders() {\r\n return this.builder.orders;\r\n }", "function list(req, res, next) {\n res.status(200).json({ data: orders });\n}", "listCustomersWithOrders(req, res){\n return Customer\n .findAll({\n // include:[{\n // model: Order,\n // as: 'orders',\n // }],\n include:[{all:true}]\n })\n .then(customersWithOrders => res.status(200).send(customersWithOrders))\n .catch(error => res.status(400).send(error));\n }", "orders(page = 1) {\n if(typeof page !== 'number') throw new TypeError(\"Parameter 'page' must be of type Number\")\n return this.#request(`Orders?page=${page}`, 'GET');\n }", "async function getUsers() {\n const response = await api.get(`/users/?_sort=id&_order=desc`);\n\n if (response.data) {\n setCompletedListUsers(response.data);\n setListUsers(response.data);\n refreshCountPages(response.data);\n }\n }", "function fetchItemsAction () {\n fetchTodoItems().then((response) => {\n return response.json()\n }).then((serverItemModel) => {\n if (serverItemModel.data) {\n viewState.items.length = 0\n serverItemModel.data.forEach((item) => {\n viewState.items.push(\n serverItemModelToClientItemModel(item)\n )\n })\n fillItems()\n }\n })\n}", "function getOrderList() {\n OrderFactory.GetOrderList($scope.pgOptions.pageNumber, $scope.pgOptions.itemsPerPage, $scope.listOptions)\n .then(function(data) {\n $scope.orderList = data.list;\n $scope.totalItems = data.total;\n $scope.pgOptions.pageNumber = data.page;\n processPagination();\n });\n }", "function fetchUsers(ids) {\n return {\n url: helpers.fmt('/api/v2/users/show_many.json?ids=%@&include=organizations,groups', ids.join(',')),\n type: 'GET',\n dataType: 'json'\n };\n }", "function getOrders (next) {\n\tLog.log('');\n\tLog.log('TASK TWO: Inventory updates');\n\n\tasync.waterfall([\n\n\t\t// Get last order date\n\t\tfunction (callback) {\n\t\t\tFiles.getTimestamp({\n\t\t\t\t'path': config.directories.timestamps+'orders.txt',\n\t\t\t}, function (err, timestamp) {\n\t\t\t\tcallback(err, timestamp);\n\t\t\t})\n\t\t},\n\n\t\t// Get detailed orders since timestamp\n\t\tfunction (timestamp, callback) {\n\t\t\tLog.log('Getting orders since '+timestamp);\n\t\t\tShopify.getOrders({\n\t\t\t\t'params': {\n\t\t\t\t\t'created_at_min': timestamp,\n\t\t\t\t\t'fields': \"id,name,email,phone,shipping_address,discount_codes,shipping_lines,total_tax,line_items\",\n\t\t\t\t},\n\t\t\t}, function (err, orders) {\n\t\t\t\tcallback(err, orders);\n\t\t\t});\n\t\t},\n\n\t\t// Make orders file if orders are returned\n\t\tfunction (orders, callback) {\n\t\t\tif (orders.length) {\n\t\t\t\tFiles.makeOrdersFile({\n\t\t\t\t\t'orders': orders,\n\t\t\t\t\t'path': config.directories.orders+'ShopifyOrders'+moment().format('YYYYMMDDHHmmss')+'.csv',\n\t\t\t\t}, function (err) {\n\t\t\t\t\tcallback(err);\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tLog.log('No orders since last update.');\n\t\t\t\tcallback(null);\n\t\t\t}\n\t\t},\n\n\t\t// Make timestamp file\n\t\tfunction (callback) {\n\t\t\tFiles.makeTimestamp({\n\t\t\t\t'path': config.directories.timestamps+'orders.txt',\n\t\t\t}, function (err) {\n\t\t\t\tcallback(err);\n\t\t\t});\n\t\t}\n\n\t], function (err) {\n\t\tif (!err) Log.log('TASK TWO COMPLETE');\n\t\telse Log.log('TASK TWO FAILED');\n\t\tnext(err);\n\t})\n}", "fetchAllUsers() {\n let account = JSON.parse(localStorage.getItem(\"cachedAccount\")).id;\n let url = (\"./admin/admin_getusers.php?allusers=\" + account);\n\n\t\t\tfetch(url)\n\t\t\t.then(res => res.json())\n\t\t\t.then(data => {\n\t\t\t\tthis.userList = data;\n\t\t\t})\n\t\t\t.catch((err) => console.error(err));\n }", "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 prepareUserItems(uid){\n Item.retrieveItems(uid).then(function(result) {\n if(result.status == 'success'){\n itemsList = result.data;\n renderItems(itemsList);\n }\n else {\n var errMsg = document.querySelector('#errMsg');\n errMsg.innerHTML += \"<center><p><h1><strong>\"+result.data+\"</strong></h1></p></center>\";\n }\n }, function(err) {\n Error(err.data)\n var errMsg = document.querySelector('#errMsg');\n errMsg.innerHTML += \"<center><p>\"+result.data+\"</p></center>\";\n });\n}", "static showOrderForm(req, res) {\n const promises = [User.findOne({\n where: {\n email: req.session.email\n }\n }), Product.findAll()]\n Promise.all(promises)\n .then((result) => {\n // res.send(result)\n res.render('createOrder', { UserId: result[0].id, products: result[1] })\n }).catch((err) => {\n res.send(err)\n })\n }", "async processOpenOrders(wallet) {\n let orders = await grapheneAPI.fetchOpenOrders(this.name, wallet.address);\n }", "function getItems() {\n \n //Selects all from the table named products\n connection.query(\"SELECT * FROM products\", \n function (err, results) {\n if (err) throw err;\n \n //logs formatted table\n console.table(results); \n \n // fires promptUser function\n promptId(results); \n\n });\n}", "queryLists() {\n fetch(\"https://deco3801-oblong.uqcloud.net/wanderlist/get_bucketlist_belonging_to_user/\" + this.state.userData.id)\n .then(response => response.json())\n .then(obj => this.loadLists(obj));\n }", "async queryAllOrders(stub, args) {\n\n //check args length should be 4\n if (args.length != 4) {\n console.info(`Argument length should be 3 with the order example: \n {\n orderer_id: \"user12\",\n organization: \"Seller\",\n start_order_id: \"order000\",\n end_order_id: \"order999\"\n }`);\n\n throw new Error(`Argument length should be 4 with the order example: \n {\n orderer_id: \"user12\",\n organization: \"Seller\",\n start_order_id: \"order000\",\n end_order_id: \"order999\"\n }`);\n }\n\n // check the user existence\n // let userBytes = await stub.getPrivateData((args[1].charAt(0).toLowerCase() + args[1].slice(1))+'_users', args[0]);\n let userBytes = await stub.getState(args[0]);\n if (!userBytes || userBytes.length == 0) {\n throw new Error(`Seller with this id ${args[0]} not exist`);\n }\n\n let startKey = args[2];\n let endKey = args[3];\n\n\n const { iterator } = await stub.getStateByRange(startKey, endKey);\n\n const allResults = [];\n while (true) {\n const res = await iterator.next();\n\n if (res.value && res.value.value.toString()) {\n console.log(res.value.value.toString('utf8'));\n\n const Key = res.value.key;\n let Record;\n try {\n Record = JSON.parse(res.value.value.toString('utf8'));\n } catch (err) {\n console.log(err);\n Record = res.value.value.toString('utf8');\n }\n allResults.push({ Key, Record });\n }\n if (res.done) {\n console.log('end of data');\n await iterator.close();\n console.info(allResults);\n return JSON.stringify(allResults);\n }\n }\n }", "async function getAllOrders(storeaccount) {\n const { chain_id, store_id } = storeaccount;\n try {\n const data = await pool.query(\n `\n \t\t\tselect\n \t\t \t*\n \t\t \tfrom\n \t\t \torders\n \t\t \twhere\n \t\t \tchain_id = $1\n \t\t \tAND\n \t\t \tstore_id = $2\n \t\t \torder by\n \t\t \t\torders.created_in_app_at desc;\n \t\t`,\n [chain_id, store_id]\n );\n\n if (data.length === '') {\n return `No such store name in table stores, database`;\n } else {\n return data.rows;\n }\n } catch (error) {\n console.log(`getAllOrders-error: ${error.message}`);\n return false;\n }\n}", "function fetchAll(userId) {\n const condition = typeof userId !== 'undefined' ? { author_id: userId } : {};\n\n return knex(TABLE_NAME)\n .select()\n .where(condition)\n .orderBy('updated_at', 'desc');\n}", "getOrderList(pageid = 1) {\n return fetch('/api/orders?page=' + pageid, {\n method: \"get\",\n headers: {'authorization': localStorage.getItem(\"authorization\")}\n }).then(function (response) {\n return response.json();\n }).then(function (result) {\n return result;\n }).catch(() => {\n NotificationManager.error('Ошибка');\n });\n }", "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "listOrders(context, params) {\n return this.$axios\n .get(`/orders?${querystring.stringify(params)}`)\n .then(({ data }) => data)\n .catch(this.$catch);\n }", "function getOrders() {\n var sql = 'SELECT category, SUM(DISTINCT orderId) as totalOrders, SUM(qty) as totalItems, SUM(price*qty) as totalRevenue FROM orders GROUP BY category WITH ROLLUP';\n return new Promise(function(resolve, reject) {\n pool.query(sql, function(err, rows) {\n if (err) throw err;\n resolve(rows);\n });\n });\n}", "function readItems() {\n console.log(\"Getting Items for sale... \\n\");\n query = connection.query(\"Select * FROM products\", function (err, res) {\n if (err) {\n console.log(err);\n }\n console.log(\"<<<<<<<<< STORE >>>>>>>>>>>\");\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"\\nID: \" +\n res[i].item_id +\n \" || ITEM: \" +\n res[i].product_name +\n \" || PRICE: \" +\n res[i].price\n )\n };\n shoppingCart();\n })\n}", "function loadOrders(){\n\t\t$.get(\"get_orders.php\", {scope:\"ALL\"}, function(orders_arr){\n\t\t\tfor(var i in orders_arr){\n\n\t\t\t\tvar OrdersTile = toOrdersHtml(orders_arr[i]);\n\t\t\t\t$('.inbox-page').append(OrdersTile);\n\t\t\t}\n\t\t});\n\t}", "function getOrdersByCustomers(cust) {\n $.ajax({\n url: \"/Customer/Orders/\" + cust.CustomerId,\n type:\"GET\"\n }).done(function (resp) {\n self.Orders(resp);\n }).error(function (err) {\n self.ErrorMessage(\"Error! \" + err.status);\n });\n }", "getAllOrders(token) {\n return AxiosRequests.get(\"/orders\", {\n headers: {\n Authorization: `Token ${token}`,\n },\n });\n }", "static getUsers() {\n const req = new Request('/api/users/', {\n method : 'GET',\n headers : this.requestHeaders()\n });\n return fetch(req).then(res => this.parseResponse(res))\n .catch(err => {\n throw err;\n });\n }" ]
[ "0.7409201", "0.69241416", "0.6918097", "0.6792871", "0.6756308", "0.6727229", "0.6671801", "0.667033", "0.66540277", "0.66072905", "0.64724755", "0.6466617", "0.6462575", "0.64583296", "0.6456917", "0.6400723", "0.6395485", "0.6376045", "0.6358382", "0.63574594", "0.63159496", "0.6304263", "0.6300218", "0.6288064", "0.626085", "0.6250567", "0.62256354", "0.6211105", "0.61788136", "0.6173374", "0.61626", "0.6151361", "0.6140299", "0.61244375", "0.6109661", "0.60980296", "0.6092017", "0.6047817", "0.604401", "0.60377216", "0.6028494", "0.6005648", "0.6002504", "0.5989888", "0.59585404", "0.59512407", "0.59480876", "0.59388506", "0.5924211", "0.5907266", "0.59065825", "0.5905103", "0.59034574", "0.5903214", "0.588995", "0.5881852", "0.58766043", "0.5868435", "0.58591056", "0.5854174", "0.5832723", "0.5824918", "0.58210236", "0.5820775", "0.5819271", "0.5794103", "0.5783533", "0.5782539", "0.57726943", "0.5765503", "0.57629395", "0.5760866", "0.57585055", "0.5756945", "0.57546926", "0.5733439", "0.57333064", "0.57316273", "0.57127106", "0.5711956", "0.57043344", "0.5701008", "0.56934553", "0.56931657", "0.5691202", "0.56880033", "0.5681543", "0.5681136", "0.5680827", "0.56807965", "0.56736284", "0.56668097", "0.5661675", "0.56566197", "0.56555897", "0.5639468", "0.5635771", "0.5634148", "0.5632358", "0.5629756", "0.5627481" ]
0.0
-1
Start a transition that interpolates the data based on year. svg.transition() .duration(30000) .ease("linear") .tween("year", tweenYear) .each("end", enableInteraction); Positions the dots based on data.
function position(dot) { dot .attr("cx", function(d) { return xScale(x(d)); }) .attr("cy", function(d) { return yScale(y(d)); }) .attr("r", function(d) { if (typeof(imageURL(d))=="undefined" || radius(d) == 0) {return radiusScale(radius(d)); } else if (key(d) == "Saturn+Rings") { return size(d)*1.1; } else { return size(d); } }) .attr("opacity", function(d) { if (typeof(imageURL(d))=="undefined") { return 0.7; } else { return 1.0; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animate(){\n svg.transition()\n .duration(30000)\n .ease(d3.easeLinear)\n .tween(\"year\", tweenYear);\n }", "function tweenYear() {\n var curYear = $(\"#ci-years-selector\").val();\n if(curYear == endYear) curYear = startYear;\n var year = d3.interpolateNumber(curYear, endYear);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n\t\t \tvar year = d3.interpolateNumber(1976,2014);\n\t\t return function(t) { updateChart(year(t)); };\n\t }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2005, 2016);\n return function(t) {\n yearLabel.text(Math.round(year(t)));\n transitionYear((year(t)));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(min_year, max_year);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(bubbleChart.state.year, 2009);\n return function(t) { console.log(t); displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(1600, 1900);\n return function(t) { displayYear(year(t)); };\n }", "function makeChart(data){\n\n\tvar giniYear = \"gini\" + YEAR_CHOICE;\n\tvar gdpYear = \"gdp\" + YEAR_CHOICE;\n\n\tvar update = svg.selectAll(\".dot\")\n\t\t\t\t .data(data, function(d){ return d.key })\n\n\tvar enter = update.enter()\n .append(\"circle\")\n .attr(\"class\", \"dot\")\n\n update.transition().duration(500)\n .attr(\"cx\", function(d){ return x(d.values[0][gdpYear]); })\n .attr(\"cy\", function(d){ return y(d.values[0][giniYear]); })\n\t .attr(\"r\", 5)\n\n \tvar exit = update.exit();\n\n\texit.remove();\n\n}", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function StartAnimation()\n{\n //Do the animation\n var start_year = 1990;\n var end_year = 2011;\n var current_year = 1990;\n\n var year_slider = d3.selectAll(\"#year_slider\");\n\n d3.csv(\"data/country_data.csv\", function(data)\n {\n country_emissions_data = data;\n var year_interval_mapping = setInterval(function()\n {\n draw_map_by_year(country_emissions_data,\n current_year);\n year_slider.property(\"value\", current_year);\n current_year++;\n\n if(current_year > end_year)\n {\n clearInterval(year_interval_mapping);\n hidden_divs = d3.selectAll(\".hidden_at_start\")//.style(\"visibility\", \"visible\");\n hidden_divs.style(\"visibility\", \"visible\");\n var divs_opacity=0;\n //based over http://stackoverflow.com/questions/10266432/how-to-make-a-div-appear-in-slow-motion\n if(first_animation_flag == false)\n {\n function gradualDisplay()\n {\n if(divs_opacity == 1)\n {\n clearInterval(t);\n }\n\n divs_opacity+=0.05;\n hidden_divs.style('opacity', divs_opacity)\n }\n\n var t=setInterval(gradualDisplay,50);\n // d3.selectAll(\"#animation_button\").style(\"visibility\", \"hidden\");\n //var button_div = document.getElementById('button_div').text(animation_button);\n d3.selectAll(\"#animation_button\").text(\"Restart Animation\")\n //button_div.innerHTML = '<b>Slide to Change Map Year</b>';\n first_animation_flag = true;\n }\n }\n },\n 1000);\n });\n}", "function transition_data() {\n\tsvg.selectAll(\".physical_dot\")\n\t .data(vtlib)\n\t .transition()\n\t .duration(500)\n\t .attr(\"cx\", function(d) { return phy_x(d.duration); });\n}", "function cars(slide,carYear) {\n if (slide == 3) {\n var cars = svg.selectAll(\".cars\").data(data.filter(function(d) { if (d[\"ModelYear\"] == carYear) { return d; }}).filter(function(d) { if (d[\"FuelUnit\"] == \"MPG\") { return d; }}));\n } else {\n var cars = svg.selectAll(\".cars\").data([]);\n }\n\n var carCircles = cars.enter().append(\"circle\").attr(\"class\",\"cars\").merge(cars);\n carCircles.transition().duration(3000).style(\"opacity\",100) \n .attr(\"cx\",function(d) { return xlog(d.CombFE); })\n .attr(\"cy\",function(d) { return ylog(d.AnnualFuelCost); })\n .attr(\"r\",5)\n .style(\"fill\", function(d) { if (d.Type == \"Gas\") { return \"red\"; } else if (d.Type == \"Electric\") { return \"blue\"; } else if (d.Type == \"Plug-In\") { return \"purple\"; } else if (d.Type == \"Fuel Cell\") { return \"green\"; } });\n carCircles\n .on(\"mouseover\",mouseOver)\n .on(\"mousemove\", mouseMove)\n .on(\"mouseleave\",mouseLeave);\n \n cars.exit().transition().duration(1000).style(\"opacity\",0).remove();\n}", "function moveCircles() {\r\n newYear = yearSlider.value;\r\n\r\n d3.select(\"svg\").selectAll(\".datapoint\")\r\n .transition()\r\n .duration(duration)\r\n .attr(\"transform\",function(d){\r\n if(d.data.cpw && d.data.ipp){\r\n \r\n if (d.data.cpw[newYear] != undefined){var cpw = d.data.cpw[newYear]}\r\n if (d.data.ipp[newYear] != undefined){var ipp = d.data.ipp[newYear]}\r\n \r\n if (cpw&&ipp){return \"translate(\" + x(cpw) + \",\" + y(ipp) + \")\"} \r\n }\r\n })\r\n\r\n d3.select(\"svg\").selectAll(\"circle\")\r\n .transition()\r\n .duration(duration)\r\n .attr(\"r\", function(d) {\r\n if(d && d.data.ley){\r\n return z(d.data.ley[newYear])\r\n }\r\n }) \r\n}", "function chartAnimator(x, y) { \n d3.csv(\"assets/data/data.csv\").then((Data) => {\n Data.forEach((data) => {\n data[x] = +data[x];\n data[y] = +data[y];\n });\n \n // Define x axis and y axis range\n var xExtent = d3.extent(Data, d => d[x]);\n var xRange = xExtent[1] - xExtent[0];\n var yExtent = d3.extent(Data, d => d[y]);\n var yRange = yExtent[1] - yExtent[0];\n\n var xScale = d3.scaleLinear()\n .domain([xExtent[0] - (xRange * 0.05), xExtent[1] + (xRange * 0.05)])\n .range([0, width]);\n var yScale = d3.scaleLinear()\n .domain([yExtent[0] - (yRange * 0.05), yExtent[1] + (yRange * 0.05)])\n .range([height, 0]);\n\n var bottomAxis = d3.axisBottom(xScale);\n var leftAxis = d3.axisLeft(yScale);\n\n var duration = 1000\n var radius = 10\n\n chartGroup.select(\".x\")\n .transition()\n .duration(duration)\n .call(bottomAxis);\n chartGroup.select(\".y\")\n .transition()\n .duration(duration)\n .call(leftAxis); \n \n chartGroup.selectAll(\"circle\")\n .transition()\n .duration(duration)\n .attr(\"cx\", d => xScale(d[x]))\n .attr(\"cy\", d => yScale(d[y]));\n\n chartGroup.selectAll(\".chartText\")\n .transition()\n .duration(duration)\n .attr(\"x\", d => xScale(d[x]))\n .attr(\"y\", d => yScale(d[y]) + radius/2);\n\n tip = d3.tip()\n .attr('class', 'd3-tip')\n .html((d) => { return(d.state + '<br>' + x + \": \" + d[x] + \"<br>\" + y + \": \" + d[y]) });\n // vis.call(tip)\n chartGroup.append(\"g\")\n .attr(\"class\", \"tip\")\n .call(tip);\n });\n}", "function update() {\nif (!(year in data)) return;\ntitle.text(year);\n\ntempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\ntempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n\n.transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n\n .attr(\"year\",function(d){return glob=year;})\n\n .attr(\"sum\", function(value) {value2.push(value);})//new temps stored here\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); })\n\n\n//manipulating array for temps\nvar tem= 2014-glob; //distance away from ends of arrays\nvar tempor=value2.length;\nvar newtem= 2014-glob;\n\nif(tem >12){newtem=tem*2-tem;}\n\nif(tem<=12){\nwhile(value2.length!=12)\n {\n while(value2.length>tempor-newtem)\n {\n value2.pop();\n }\n value2.shift();\n\n }\n}\nif(tem==113){\n while (value2.length!=12)\n {\n value2.pop();\n } \n}\nif(tem>12){\n while(value2.length!=12)\n {\n while(value2.length>tempor-newtem+(12-tem))\n {\n value2.pop();\n }\n value2.shift();\n }\n}\n\n}//end of update()", "function updateMapPointsAutoPlay(data, year) {\n var circles = g_bubbles.selectAll(\"circle.seizure-bubble\").data(data, function(d) { return d.id });\n\n if (year == \"2000\") { //reset\n svg.selectAll(\"circle.seizure-bubble\").remove()\n }\n\n circles.enter().append(\"circle\") // new entering points\n .attr('class', 'seizure-bubble')\n .attr(\"fill\", \"rgba(240, 135, 24, 0.3)\")\n .attr(\"cx\", function(d) { return projection([+d.Longitude, +d.Latitude])[0]; })\n .attr(\"cy\", function(d) { return projection([+d.Longitude, +d.Latitude])[1]; })\n .attr(\"r\", 0)\n .transition()\n .duration(500)\n .attr(\"r\", function(d) { return radiusScale(+d.ESTNUM); });\n\n circles.exit() // exiting points\n .transition()\n .duration(500)\n .attr(\"fill\", \"rgba(201, 62, 62, 0.3)\")\n}", "function update() {\n if (!(year in data)) return;\n title.text(year);\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob=year;})\n\n .attr(\"sum\", function(value) {value2.push(value);})//new\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob; //find distance from ends of arrays\n var tempor=value2.length;\n var newtem= 2014-glob;\n\n //manipulate arrays to end up with temps\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12)\n {\n while(value2.length!=12)\n {\n while(value2.length>tempor-newtem)\n {\n value2.pop();\n }\n value2.shift();\n\n }\n }\n if(tem==113)\n {\n while (value2.length!=12)\n {\n value2.pop();\n }\n\n }\n if(tem>12)\n {\n while(value2.length!=12)\n {\n while(value2.length>tempor-newtem+(12-tem))\n {\n value2.pop();\n }\n value2.shift();\n }\n }\n \n }//end of update()", "update(data) {\r\n\r\n\r\n let ctx = this;\r\n let width = this.svgWidth;\r\n let height = this.svgHeight;\r\n let setsperyear = new Array();\r\n\r\n for (var i = 0; i < 45; i++) {\r\n setsperyear[i] = 0;\r\n }\r\n for (var i = 0; i < data.length; i++) {\r\n for (var j = 0; j < this.years.length; j++) {\r\n if (data[i].Year == this.years[j]) {\r\n setsperyear[j]++;\r\n }\r\n }\r\n }\r\n\r\n var onclickdata;\r\n\r\n let brushed = function () {\r\n let selectedYears = [];\r\n if (d3.event.selection != null && !(d3.event.selection[0] == 0 && d3.event.selection[1] == 0)) {\r\n let lowBound = d3.event.selection[0];\r\n let highBound = d3.event.selection[1];\r\n let circles = d3.select(\"#year-chart\").select(\"svg\").selectAll(\"circle\");\r\n let xVals = circles.nodes().map((d) => d.getAttribute(\"cx\"));\r\n let indices = [];\r\n for (let i = 0; i < xVals.length; i++) {\r\n if (xVals[i] > lowBound && xVals[i] < highBound) {\r\n indices.push(i);\r\n }\r\n }\r\n indices.forEach(function (index) {\r\n selectedYears.push(1971 + index);\r\n });\r\n ctx.updateYearSelStr(selectedYears);\r\n ctx.updateCharts(selectedYears);\r\n }\r\n }\r\n let brush = d3.brushX().extent([[0, 0], [ctx.svgWidth, ctx.svgHeight]])\r\n .on(\"end\", brushed);\r\n\r\n let yearPopup = new YearPopup(this.legos);\r\n\r\n let mouseMove = function (d) {\r\n yearPopup.mousemove(d)\r\n };\r\n\r\n this.svg.attr(\"class\", \"brush\").call(brush);\r\n\r\n let colorScale = d3.scaleLinear()\r\n .domain([350, 0])\r\n .range([\"#b3cde0\", \"#03396c\"]);\r\n\r\n // Create the chart by adding circle elements representing each election year\r\n this.svg.append('line')\r\n .attr(\"x1\", 0)\r\n .attr(\"y1\", (this.svgHeight / 2) - 10)\r\n .attr(\"x2\", width)\r\n .attr(\"y2\", (this.svgHeight / 2) - 10)\r\n .style(\"stroke\", \"#A0A0A0\")\r\n .style(\"stroke-dasharray\", \"2,2\");\r\n\r\n this.svg.selectAll('circle')\r\n .data(data)\r\n .enter()\r\n .append('circle')\r\n .data(setsperyear)\r\n .style(\"fill\", d => colorScale(d))\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\")\r\n .data(data)\r\n .attr(\"cx\", function (d, i) {\r\n return (width / 45) * i + 10;\r\n })\r\n .attr(\"cy\", (this.svgHeight / 2) - 10)\r\n .data(setsperyear)\r\n .attr(\"r\", d => Math.log(d) * 3)\r\n .data(this.years)\r\n .on(\"mousemove\", mouseMove)\r\n .on('mouseover', function (d, i) {\r\n d3.select(this)\r\n .transition()\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"3\");\r\n yearPopup.mouseover(d);\r\n })\r\n .on('mouseout', function (d, i) {\r\n d3.select(this)\r\n .transition()\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\");\r\n yearPopup.mouseout(d)\r\n })\r\n .on('click', function (d, i) {\r\n\r\n ctx.updateYearSelStr([d]);\r\n ctx.updateCharts([d]);\r\n\r\n d3.select(this)\r\n .transition()\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"3\");\r\n d3.select(\"rect.selection\")\r\n .attr(\"width\", 0);\r\n\r\n })\r\n .attr(\"pointer-events\", \"all\")\r\n ;\r\n\r\n this.svg.selectAll('text')\r\n .data(this.years)\r\n .enter()\r\n .append('text')\r\n .attr(\"text-anchor\", \"middle\")\r\n .attr(\"transform\", function (d, i) {\r\n let xval = (width / 45) * i + 6;\r\n let yval = ((height / 2) + 23);\r\n return \"translate(\" + xval + \",\" + yval + \")rotate(90)\"\r\n })\r\n .style(\"font-size\", \"12px\")\r\n .style(\"stroke\", \"black\")\r\n .html(d => d);\r\n d3.select(\".brush\").call(brush.move, [[0], [0]], [[0], [0]]);\r\n\r\n //This builds the legend on the bottom of the yearchart\r\n let legend = d3.select('#year-chart').append('svg')\r\n .attr(\"id\", \"legolegend\")\r\n .attr(\"width\", width)\r\n .attr(\"height\", \"50\")\r\n .append('rect')\r\n .attr(\"x\", 0)\r\n .attr(\"y\", 0)\r\n .attr(\"width\", 190)\r\n .attr(\"height\", 50)\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"2\")\r\n .style(\"fill\", \"white\");\r\n\r\n let smallcircle = d3.select('#legolegend').append('circle')\r\n .attr(\"cx\", \"12\")\r\n .attr(\"cy\", \"25\")\r\n .attr(\"r\", \"7\")\r\n .style(\"fill\", \"#03396c\")\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\");\r\n\r\n let smalltext = d3.select('#legolegend').append('text')\r\n .attr(\"x\", \"49\")\r\n .attr(\"y\", \"29\")\r\n .attr(\"text-anchor\", \"middle\")\r\n .style(\"font-size\", \"12px\")\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\")\r\n .html(\"Fewer Sets\");\r\n\r\n let largecircle = d3.select('#legolegend').append('circle')\r\n .attr(\"cx\", \"100\")\r\n .attr(\"cy\", \"25\")\r\n .attr(\"r\", \"15\")\r\n .style(\"fill\", \"#b3cde0\")\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\");\r\n\r\n let moretext = d3.select('#legolegend').append('text')\r\n .attr(\"x\", \"145\")\r\n .attr(\"y\", \"29\")\r\n .attr(\"text-anchor\", \"middle\")\r\n .style(\"font-size\", \"12px\")\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\")\r\n .html(\"More Sets\");\r\n\r\n\r\n }", "function updateChart() {\n\n\n /* -------------- */\n /* Circles\n /* -------------- */\n\n // First, we define our data element as the value of theData[currYear].\n // Remember, this is simply an array of objects taht all have the same value for the property \"Year\".\n var data = theData[currYear];\n\n // Select all elements classed \".dot\"\n // Assign the data as the value of \"data\" and match each element to d.Tm.\n var teams = svg.selectAll(\".line\")\n .data(data, function(d) {\n return d.Tm;\n });\n \n // If d.Tm does match any elements classed \".dot\",\n // We create a new one. In other words, it \"enters\" the chart.\n // The first time our page loads, no circles with the class name \"dot\" exist\n // So we append a new one and give it an cx, cy position based on wins and attendance.\n // If the circle already exists for that team, we do nothing here.\n var city = svg.selectAll(\".city\")\n .data(cities)\n .enter().append(\"g\")\n .attr(\"class\", \"city\");\n\n city.append(\"path\")\n .attr(\"class\", \"line\")\n .attr(\"d\", function(d) { return line(d.values); })\n .style(\"stroke\", function(d) { return color(d.name); });\n\n city.append(\"text\")\n .datum(function(d) { return {name: d.name, value: d.values[d.values.length - 1]}; })\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.value.date) + \",\" + y(d.value.temperature) + \")\"; })\n .attr(\"x\", 3)\n .attr(\"dy\", \".35em\")\n .text(function(d) { return d.name; });\n\n\n/*teams.enter()\n .append(\"circle\")\n .attr(\"class\", \"dot\")\n .attr(\"r\", 10)\n .attr(\"cx\", function(d) { return x(d.wins); })\n .attr(\"cy\", function(d) { return y(d.attendance); })\n .style(\"fill\", function(d) { return color(d.Tm); });*/\n\n // By the same token, if an \"circle\" element with the class name \"dot\" is already on the page\n // But the d.Tm property doesn't match anything in the new data,\n // It \"exits\".\n // Exit doesn't actually remove it though.\n // Exit is just what we use to select the elements that aren't represented in our data.\n // If we'd like to remove it, we use .remove().\n // I've left the transition to black in place so you can see it in action.\n city.exit()\n .transition()\n .duration(200)\n .style(\"fill\", \"#000\");\n //.remove();\n\n\n // Finally, we want to reassign the position of all elements that alredy exist on the chart\n // AND are represented in the current batch of data.\n // Here we transition (animate) them to new x,y positions on the page.\n city.transition()\n .duration(200)\n .attr(\"cx\", function(d) { return x(d.wins); })\n .attr(\"cy\", function(d) { return y(d.attendance); })\n .style(\"fill\", function(d) { return color(d.Tm); });\n\n\n // TO READ MORE ABOUT EXIT ENTER, READ MIKE BOSTOCK'S THREE LITTLE CIRCLES TUTORIAL:\n // http://bost.ocks.org/mike/circles/\n\n\n\n /* -------------- */\n /* Labels\n /* -------------- */\n\n //Everything we did above we'll also do with labels.\n //It is literally the exact same pattern.\n\n var labels = svg.selectAll(\".lbl\")\n .data(data, function(d) {\n return d.Tm;\n });\n \n labels.enter()\n .append(\"text\")\n .attr(\"class\", \"lbl\")\n .attr(\"x\", function(d) { return x(d.year); })\n .attr(\"y\", function(d) { return y(d.commute); })\n .text(function(d) {\n return d.Tm;\n });\n\n labels.exit()\n .remove();\n\n labels.transition()\n .duration(200)\n .attr(\"x\", function(d) { return x(d.year); })\n .attr(\"y\", function(d) { return y(d.commute); })\n\n\n\n\n\n}", "function updateChart(year) {\n\t\t \tlabel_bubbleChart.text(Math.round(year)); /*update year label, since year could be a fraction of years, round it to the whole year number*/\n\t\t \tcircleGroup\n\t\t /*bind new data interpolated from the dataset based on the tweenYear, and use key to match up with existing bound data*/\n\t\t \t\t.data(interpolateData(year),key) \n\t\t \t\t .attr(\"r\", data=>radiusScale_bubbleChart(data.population))\n\t\t \t\t .attr(\"cx\", data=>xScale_bubbleChart(data.crimeRate))\n\t\t \t\t .attr(\"cy\", data=>yScale_bubbleChart(data.unemploymentRate))\n\t\t \t\t .attr(\"opacity\",.8)\n\t\t \t\t .style(\"fill\", data=>colorScale_bubbleChart(data.category))\n\t\t \t\t .sort(order)\n\t }", "function update2() {\n if (!(year in data)) return;\n title.text(year);\n// var value3=[];\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob2=year;})\n\n .attr(\"sum\", function(value) {value3.push(value);})//new where temps are stored\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob2;\n var tempor=value3.length;\n var newtem= 2014-glob2;\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem)\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n if(tem>12)\n {\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem+(12-tem))\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n }", "function update2() {\n if (!(year in data)) return;\n title.text(year);\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob2=year;})\n\n .attr(\"sum\", function(value) {value3.push(value);})//new\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob2;\n var tempor=value3.length;\n var newtem= 2014-glob2;\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem)\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n if(tem>12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem+(12-tem))\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n }", "function drawYear(off, angle, arr, i, points){\n\t\tsvg.append(\"path\")\n\t\t\t.datum(d3.range(points))\n\t\t .attr(\"class\", \"year_scale\")\n\t\t .attr(\"d\", d3.svg.line.radial()\n\t\t \t\t\t\t.radius(radiScale(arr[i]))\n\t\t \t\t\t\t.angle(function(d, j) { return angle(j); }))\n\t\t .attr(\"transform\", \"translate(\" + center.x + \", \" + (center.y + off) + \")\")\n\t\t .attr(\"opacity\", 0)\n\t\t\t.transition()\n\t\t\t.duration(inTransLength)\n\t\t\t.attr(\"opacity\", 1);\n\t}", "function to_first_slide(current_slide) {\n var t0 = svg\n .transition()\n .duration(1000)\n\n yLabel.transition(t0)\n .text(\"Number of Women MPs\")\n\n // Different actions depending on which slide we're coming from\n switch (current_slide) {\n case 1:\n // If we're coming from the second slide\n t0.select(\"#slide2-group\")\n .style(\"opacity\", 0)\n .remove()\n t0.select(\"#info-bubbles\")\n .style(\"opacity\", 0)\n .remove()\n break\n case 2:\n // Fade all objects belonging to second and third slides\n t0.select(\"#slide2-group\")\n .style(\"opacity\", 0)\n .remove()\n t0.select(\"#slide3-group\")\n .style(\"opacity\", 0)\n .remove()\n d3.select(\"#tooltip\")\n .classed(\"slide3-tooltip\", false)\n .classed(\"slide5-tooltip\", false)\n\n break\n }\n svg.select(\".slide6-annotation-group\").style(\"opacity\", 0)\n d3.selectAll(\".election-rect\")\n .on(\"mouseover\", null)\n .on(\"mouseout\", null)\n\n // Hide tooltip\n d3.select(\"#tooltip\")\n .style(\"opacity\", 0)\n // Get rid of annotation line too\n mouseover_svg.selectAll(\".annotation-group\").remove()\n\n // Show canvas\n d3.select(\"#visible-canvas\")\n .style(\"opacity\", 1)\n .style(\"display\", null)\n // Scale axes to fit all data\n y.domain([0, 220])\n gY.transition()\n .duration(1000)\n .call(yAxis.tickFormat(d => d))\n xAxis.scale(x.domain([new Date(1915, 1, 1), new Date(2020, 1, 1)]))\n gX.transition()\n .duration(1000)\n .call(xAxis)\n\n d3.selectAll(\".x-axis path\").style(\"opacity\", 1)\n\n pointsGroup.style(\"opacity\", 0)\n t0.select(\"#slide1-group\")\n .style(\"opacity\", 1)\n // Enable all pointer events for canvas\n canvas.style(\"pointer-events\", \"all\")\n\n // Increment lastTransitioned counter if it is less than 0\n if (lastTransitioned < 0) {\n lastTransitioned = 0\n first_slide(false)\n } else {\n first_slide(true)\n }\n}", "function animate() {\n\n\t\t\tbubbleChartGroup.transition()\n\t\t\t\t.duration(30000)\n\t\t\t\t.ease(d3.easeLinear) /*use linear transition*/\n\t\t\t\t.tween(\"year\",tweenYear); /*use customized tween method to create transitions frame by frame*/\n\n\t\t\t/*show observations text only after the animation is completed*/\n\t\t\tsetTimeout(showObservation, 30500);\n\n\t\t\tfunction showObservation() {\n\t\t\t\t/*change the color of text so that they become visible*/\n\t\t\t\td3.selectAll(\"#observationSection\")\n\t\t\t\t\t.style(\"color\",\"black\");\n\t\t\t\td3.selectAll(\"#observations\")\n\t\t\t\t\t.style(\"color\",\"red\");\n\t\t\t}\n\t }", "circleChart() {\n\n var circleData = this.yearData;\n\n // If trace checkbox is ticked, add country traces to dataset.\n if (traceChecked && Object.keys(this.trace).length) {\n for (var country in this.trace) {\n // remove final element so country can do an animated \"update\" into it instead\n var trace_circles = this.trace[country].slice(0, -1)\n circleData = circleData.concat(trace_circles);\n }\n }\n\n /******** PERFORM DATA JOIN ************/\n var circles = svgBubble.selectAll(\"circle\")\n .data(circleData, function key(d) { return d.Country; });\n\n /******** HANDLE UPDATE SELECTION ************/\n // Update the display of existing elements to match new data\n circles\n .transition()\n .duration(1000)\n .ease(d3.easeLinear)\n .attr(\"cx\", function(d) { return xScaleBubble(d.GDP); })\n .attr(\"cy\", function(d) { return yScaleBubble(d.Global_Competitiveness_Index); })\n .attr(\"r\", function(d) { return Math.sqrt(rScaleBubble(+d.Population)/Math.PI); })\n .style(\"fill\", function(d) { return colour[d['Forum classification']]; });\n\n /******** HANDLE ENTER SELECTION ************/\n // Create new elements in the dataset\n circles.enter()\n .append(\"circle\")\n .attr(\"cx\", function(d) { return xScaleBubble(d.GDP); })\n .attr(\"cy\", function(d) { return yScaleBubble(d.Global_Competitiveness_Index); })\n .attr(\"r\", function(d) { return Math.sqrt(rScaleBubble(+d.Population)/Math.PI); })\n .style(\"fill\", function(d) { return colour[d['Forum classification']]; })\n .on(\"mouseover\", function(d) { return countryLabel.style(\"visibility\", \"visible\").html(\"<b>Country: </b>\" + d.Country + \"<br><b>Population: </b>\" + (+d.Population).toLocaleString());})\n .on(\"mousemove\", function() {\n return countryLabel.style(\"top\", (d3.event.pageY - 10) + \"px\").style(\"left\", (d3.event.pageX + 10) + \"px\");\n })\n .on(\"mouseout\", function() { return countryLabel.style(\"visibility\", \"hidden\"); });\n\n /******** HANDLE EXIT SELECTION ************/\n // Remove dom elements that no longer have a matching data element\n circles.exit().remove();\n }", "function update(data) {\n // Set transition\n var t = d3.transition().duration(100);\n\n // JOIN new data with old elements\n var points = g.selectAll(\"circle\").data(data, function(d) {\n return d.country;\n });\n\n // Remove points that no longer correspond to data\n points.exit().remove();\n\n // Draw points for new data\n points\n .enter()\n .append(\"circle\")\n .attr(\"fill\", function(d) {\n return colorScale(d.continent);\n })\n .attr(\"opacity\", 0.5)\n .merge(points)\n .transition(t)\n .attr(\"cx\", function(d) {\n return xScale(d.income);\n })\n .attr(\"cy\", function(d) {\n return yScale(d.life_exp);\n })\n .attr(\"r\", function(d) {\n return aScale(d.population);\n });\n\n // Update existing points\n // points\n // // .transition(t)\n // .attr(\"cx\", function(d) {\n // return xScale(d.income);\n // })\n // .attr(\"cy\", function(d) {\n // return yScale(d.life_exp);\n // })\n // .attr(\"r\", function(d) {\n // return aScale(d.population);\n // })\n // .attr(\"fill\", function(d) {\n // return colorScale(d.continent);\n // })\n // .attr(\"opacity\", 0.5);\n\n var year = 1800 + time;\n yearLabel.text(year);\n}", "function map(mapData) {\n //Map slider update function\n d3.select(\"#timeslide\").on(\"input\", function () {\n update(+this.value);\n // console.log(+this.value);\n });\n\n // update the fill of each circle of class \"projects\" with value\n function update(value) {\n document.getElementById(\"range\").innerHTML = month[value];\n inputValue = month[value];\n d3.selectAll(\".projects\").attr(\"fill\", dateMatch);\n }\n\n // Date Match function used to determine the color of the circles based on whether or not selector selection\n // matches month in actual start date\n function dateMatch(mapData1, value) {\n let m = mapData1.month;\n\n if (inputValue == m) {\n this.parentElement.appendChild(this);\n return \"#eb2828\";\n } else {\n return \"#636769\";\n }\n }\n\n // Establish initial date view on map. Set for January.\n function initialDate(mapData1, i) {\n let m = mapData1.month;\n\n if (m == \"January\") {\n this.parentElement.appendChild(this);\n return \"#eb2828\";\n } else {\n return \"#636769\";\n }\n }\n\n //Appending option to html id-mapYear and adding selectYears to the dropdown\n const mapOptions = d3\n .select(\"#mapYear\")\n .selectAll(\"option\")\n .data(selectYears)\n .enter()\n .append(\"option\")\n .text((d) => d);\n\n mapUpdate(d3.select(\"#mapYear\").property(\"value\"), 0);\n\n function mapUpdate(year, speed) {\n var dataf1 = mapData1.filter((f) => f.year == year);\n // console.log(dataf1)\n\n projectG.selectAll(\".projects\").transition().duration(speed);\n // .call(project_circles)\n\n var projects = projectG.selectAll(\".projects\");\n // .data(dataf1, d => d.lng, d.lat)\n\n //Function to plot points\n projectG.selectAll(\".projects\").remove();\n projectG\n .selectAll(\"circle\")\n .raise()\n .data(dataf1)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"projects\")\n .attr(\"fill\", initialDate)\n // .attr('fill', '#eb2828')\n .attr(\"r\", (d) => {\n return Math.sqrt((d.fin_act_revenue / widthMap) * 0.1);\n })\n .attr(\"cx\", (d) => {\n return projection([d.lng, d.lat])[0];\n })\n .attr(\"cy\", (d) => {\n return projection([d.lng, d.lat])[1];\n })\n\n // Adding Tooltip Behavior\n .on(\"mouseover\", function (d) {\n // d3.select(this).style(\"fill\", \"#a834eb\");\n d3.select(\"#name\").text(\" \" + d.project_name);\n d3.select(\"#address\").text(\" \" + d.project_address);\n d3.select(\"#revenue\").text(\" $\" + valueFormat(d.fin_act_revenue)); \n d3.select(\"#startDate\").text(\n \" \" + d.month + \" \" + d.day + \", \" + d.year\n );\n\n //Position the tooltip <div> and set its content\n let x = d3.event.pageX;\n let y = d3.event.pageY - 40;\n\n //Position tooltip and make it visible\n d3.select(\"#tooltip\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\")\n .style(\"opacity\", 1);\n })\n .on(\"mouseout\", function () {\n // d3.select(this).style(\"fill\", initialDate);\n\n //Hide the tooltip\n d3.select(\"#tooltip\").style(\"opacity\", \"0\");\n });\n //Creating pan and zoom feature\n zoomG.call(\n d3.zoom().on(\"zoom\", () => {\n zoomG.attr(\"transform\", d3.event.transform);\n })\n );\n }\n map.update = mapUpdate;\n}", "function draw_map_by_year(data, year)\n{\n //Get this year's data\n current_year = get_year_data(data, year);\n\n //Update map's year text\n d3.selectAll(\"#year_text\").text(year)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"60px\")\n .attr(\"fill\", \"black\");\n\n d3.selectAll(\"path\")\n .datum(function(d)\n {\n return {\"name\" : d3.select(this).attr(\"id\")};\n })\n .data(current_year, //Ensure we map correctly\n function(d, i)\n {\n return d.name;\n })\n .transition()\n //The reason that it is 500 and not 750 as the update interval is that I want to color\n //transition be noticeably stable before the start of next year's transition\n .duration(500)\n .style('fill',\n function(d)\n {\n return emissions_scale(d.total_emissions);\n });\n}", "function drawViz(){\n\n let currentYearData = incomingData.filter(filterYear);\n console.log(\"---\\nthe currentYearData array now carries the data for year\", currentYear);\n\n\n // Below here is where your coding should take place! learn from lab 6:\n // https://github.com/leoneckert/critical-data-and-visualization-spring-2020/tree/master/labs/lab-6\n // the three steps in the comments below help you to know what to aim for here\n\n // bind currentYearData to elements\n function getGroupLocation(d,i){\n let x = xScale(d.fert);\n let y = yScale(d.life);\n return \"translate(\" + x + \",\" + y + \")\";\n }\n\n let datagroups = vizGroup.selectAll(\".datagroup\").data(currentYearData,function(d,i){\n console.log(d.Country);\n return d.Country;\n });\n\n // take care of entering elements\n let enteringElements = datagroups.enter()\n .append(\"g\")\n .attr(\"class\",\"datagroup\")\n ;\n\n enteringElements.append(\"circle\")\n .attr(\"r\",10)\n .attr(\"fill\",color)\n ;\n\n enteringElements.append(\"text\")\n .text(function(d,i){\n return d.Country;\n })\n .attr(\"x\",12)\n .attr(\"y\",7)\n .attr(\"font-family\",\"sans-serif\")\n .attr(\"font-size\",\"15px\")\n .attr(\"fill\",\"purple\")\n ;\n\n // take care of updating elements\n enteringElements.transition().attr(\"transform\",getGroupLocation);\n datagroups.transition().ease(d3.easeLinear).attr(\"transform\",getGroupLocation);\n\n function color(d,i){\n country = d.Country;\n if (country == \"Afghanistan\" || country == \"Albania\" || country == \"Algeria\" || country == \"Angola\" || country == \"Argentina\" || country == \"Australia\" || country == \"Austria\"){\n color = \"#9FE7F7\";\n }else if (country == \"Bahrain\" || country == \"Bangladesh\" || country == \"Belgium\" || country == \"Benin\" || country == \"Bolivia\" || country == \"Bosnia and Herzegovina\" || country == \"Botswana\" || country == \"Brazil\" || country == \"Bulgaria\" || country == \"Burkina Faso\" || country == \"Burundi\"){\n color = \"#F7D59F\";\n }else if (country == \"Cambodia\" || country == \"Cameroon\" || country == \"Canada\" || country == \"Central African Republic\" || country == \"Chad\" || country == \"Chile\" || country == \"China\" || country == \"Colombia\" || country == \"Comoros\" || country == \"Congo, Dem. Rep.\" || country == \"Congo, Rep.\" || country == \"Costa Rica\" || country == \"Cote d'Ivoire\" || country == \"Croatia\" || country == \"Cuba\" || country == \"Czech Republic\"){\n color = \"#F7F39F\"\n }else if (country == \"Denmark\" || country == \"Djibouti\" || country == \"Dominican Republic\" ){\n color = \"#D9F99C\"\n }else if (country == \"Ecuador\" || country == \"Egypt\" || country == \"El Salvador\" || country == \"Equatorial Guinea\" || country == \"Eritrea\" || country == \"Ethiopia\" ){\n color = \"#C1C1FB\"\n }else if (country == \"Finland\" || country == \"France\" ){\n color = \"#EFC1FB\"\n }else if (country == \"Gabon\" || country == \"Gambia\" || country == \"Germany\" || country == \"Ghana\" || country == \"Greece\" || country == \"Guatemala\" || country == \"Guinea\" || country == \"Guinea-Bissau\" ){\n color = \"#C1DFFB\"\n }else if (country == \"Haiti\" || country == \"Honduras\" || country == \"Hong Kong, China\" || country == \"Hungary\"){\n color = \"#3297F6\"\n }else if (country == \"Iceland\" || country == \"India\" || country == \"Indonesia\" || country == \"Iran\" || country == \"Iraq\" || country == \"Ireland\" || country == \"Israel\" || country == \"Italy\"){\n color = \"#6FFBAC\"\n }else if (country == \"Jamaica\" || country == \"Japan\" || country == \"Jordan\" ){\n color = \"#FBD86F\"\n }else if (country == \"Kenya\" || country == \"Kuwait\" ){\n color = \"#FEA4B2\"\n }else if (country == \"Lebanon\" || country == \"Lesotho\" || country == \"Liberia\" || country == \"Libya\"){\n color = \"#FC6179\"\n }else if (country == \"Madagascar\" || country == \"Malawi\" || country == \"Malaysia\" || country == \"Mali\" || country == \"Mauritania\" || country == \"Mauritius\" || country == \"Mexico\" || country == \"Mongolia\" || country == \"Montenegro\" || country == \"Morocco\" || country == \"Mozambique\" || country == \"Myanmar\" ){\n color = \"#F7A5E4\"\n }else if (country == \"Namibia\" || country == \"Nepal\" || country == \"Netherlands\" || country == \"New Zealand\" || country == \"Nicaragua\" || country == \"Niger\" || country == \"Nigeria\" || country == \"Norway\"){\n color = \"#4E62F7\"\n }else if (country == \"Oman\"){\n color = \"#4EF7E5\"\n }else if (country == \"Pakistan\" || country == \"Panama\" || country == \"Paraguay\" || country == \"Peru\" || country == \"Philippines\" || country == \"Poland\" || country == \"Portugal\" || country == \"Puerto Rico\" ){\n color = \"#D2AF6D\"\n }else if (country == \"Reunion\" || country == \"Romania\" || country == \"Rwanda\"){\n color = \"#6DD295\"\n }else if (country == \"Sao Tome and Principe\" || country == \"Saudi Arabia\" || country == \"Senegal\" || country == \"Serbia\" || country == \"Sierra Leone\" || country == \"Singapore\" || country == \"Slovak Republic\" || country == \"Slovenia\" || country == \"Somalia\" || country == \"South Africa\" || country == \"Spain\" || country == \"Sri Lanka\" || country == \"Sudan\" || country == \"Swaziland\" || country == \"Sweden\" || country == \"Switzerland\" || country == \"Syria\"){\n color = \"#D2976D\"\n }else if (country == \"Taiwan\" || country == \"Tanzania\" || country == \"Thailand\" || country == \"Togo\" || country == \"Trinidad and Tobago\" || country == \"Tunisia\" || country == \"Turkey\"){\n color = \"#6D6FD2\"\n }else if (country == \"Uganda\" || country == \"United Kingdom\" || country == \"United States\" || country == \"Uruguay\"){\n color = \"#74C443\"\n }else if (country == \"Venezuela\" || country == \"Vietnam\"){\n color = \"#E88022\"\n }else if (country == \"West Bank and Gaza\"){\n color = \"#139236\"\n }else if (country == \"Zambia\" || country == \"Zimbabwe\"){\n color = \"white\"\n }\n return color;\n }\n\n }", "function draw() {\n // + FILTER DATA BASED ON STATE\n let filteredData = [];\n if (state.selectedCountry !== null) {\n filteredData = state.data.filter(d => d.country === state.selectedCountry)\n }\n console.log(filteredData);\n //\n // + UPDATE SCALE(S), if needed\n yScale.domain([0, d3.max(filteredData, d => d.number)]);\n // + UPDATE AXIS/AXES, if needed\n d3.select(\"g.y-axis\")\n .transition()\n .duration(1000)\n .call(yAxis.scale(yScale));\n\n // we define our line function generator telling it how to access the x,y values for each point\n\n const lineFunc = d3\n .line()\n .x(d => xScale(d.year))\n .y(d => yScale(d.number));\n const areaFunc = d3\n .area()\n .x(d => xScale(d.year))\n .y1(d => yScale(d.number))\n .y0(yScale(0));\n\n // + DRAW CIRCLES, if you decide to\n const dot = svg\n .selectAll(\".dot\")\n .data(filteredData, d => d.country) // use `d.year` as the `key` to match between HTML and data elements\n .join(\n enter => // + HANDLE ENTER SELECTION\n enter // enter selections -- all data elements that don't have a `.dot` element attached to them yet\n .append(\"circle\")\n .attr(\"fill\", \"green\")\n .attr(\"class\", \"dot\")\n .attr(\"r\", radius)\n .attr(\"cx\", d => xScale(d.year))\n .attr(\"cy\", d => yScale(d.number)),\n\n\n\n update => update, // + HANDLE UPDATE SELECTION\n exit => // + HANDLE EXIT SELECTION\n exit.call(exit =>\n // exit selections -- all the `.dot` element that no longer match to HTML elements \n exit\n .remove()\n\n )\n )\n\n .call(\n selection =>\n selection\n .transition()\n .duration(1000)\n .attr(\"cy\", d => yScale(d.number))\n );\n //\n // + DRAW LINE AND AREA\n const line = svg\n .selectAll(\"path.trend\")\n .data([filteredData])\n .join(\n enter =>\n enter\n .append(\"path\")\n .attr(\"class\", \"trend\")\n .attr(\"opacity\", 0),\n // .attr(0, \"opacity\"), // start them off as opacity 0 and fade them in\n update => update, // pass through the update selection\n exit => exit\n .transition()\n .remove(),\n )\n .call(selection =>\n selection\n .transition()\n .duration(1000)\n .attr(\"opacity\", 0.8)\n .attr(\"d\", d => lineFunc(d))\n )\n const area = svg\n .selectAll(\".area\")\n .data([filteredData])\n .join(\"path\")\n .attr(\"class\", \"area\")\n .attr(\"cx\", (width - margin.left))\n .attr(\"d\", d => areaFunc(d));\n\n\n\n\n}", "function start() {\n \n var width = 1300;\n var height = 550;\n\n var div = d3.select(\"body\").append(\"div\")\t\n .attr(\"class\", \"tooltip\")\t\t\t\t\n .style(\"opacity\", 0);\n\n // Initial graph -> default year = 2010\n d3.csv(\"movies.csv\", function(d) {\n d.budget = +d.budget; \n d.gross = +d.gross;\n return d;\n \n }, function (csv) {\n for (var i = 0; i < csv.length; ++i) {\n csv[i].gross = Number(csv[i].gross);\n csv[i].budget = Number(csv[i].budget);\n csv[i].imdb_score = Number(csv[i].imdb_score);\n csv[i].movie_title = String(csv[i].movie_title);\n csv[i].title_year = String(csv[i].title_year);\n csv[i].movie_imdb_link = String(csv[i].movie_imdb_link);\n }\n var grossExtent = d3.extent(csv, function (row) {\n return row.gross;\n });\n var budgetExtent = d3.extent(csv, function (row) {\n return row.budget;\n });\n \n var xScale = d3.scale.linear().domain([0, 10]).range([80, 600]);\n var yScale = d3.scale.linear().domain([0,263700000]).range([500, 30]); //[0,263700000]\n var rScale = d3.scale.linear().domain(grossExtent).range([3, 60]);\n\n\n var xAxis = d3.svg.axis().scale(xScale);\n var yAxis = d3.svg.axis().scale(yScale);\n yAxis.orient(\"left\");\n\n // Dot plot\n var chart1 = d3.select(\"#chart1\")\n .append(\"svg:svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n\n // Dots\n var temp1 = chart1.selectAll(\"circle\")\n .data(csv)\n .enter()\n .append(\"circle\")\n .attr('class', 'dot')\n .attr(\"id\", function (d, i) {\n return i;\n })\n .attr(\"stroke\", \"black\")\n .attr(\"fill\", \"pink\")\n .filter(function (d) {return d.title_year == 2010 }) //170051787\n //.attr(\"class\", \"moreGross\")\n .attr(\"cx\", function (d) {\n return xScale(d.imdb_score);\n })\n .attr(\"cy\", function (d) {\n return yScale(d.budget);\n })\n .attr(\"r\", function(d) {\n return rScale(d.gross);\n })\n \n .on(\"mouseover\", function(d) {\t\t\n div.transition()\t\t\n .duration(200)\t\t\n .style(\"opacity\", .9);\t\t\n div.html(\"Title:\" + d.movie_title+ \"<br/>\" \n + \"Director: \" + d.director_name+ \"<br/>\" \n + \"IMDb Score: \" + d.imdb_score+ \"<br/>\" \n + \"Budget: $\" + d.budget+ \"<br/>\" \n + \"Gross: $\" + d.gross+ \"<br/>\" \n + \"Genres: \" + d.genres+ \"<br/>\" \n )\t\n .style(\"left\", (d3.event.pageX) + \"px\")\t\t\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\t\n })\t\t\t\t\t\n .on(\"mouseout\", function(d) {\t\t\n div.transition()\t\t\n .duration(500)\t\t\n .style(\"opacity\", 0)\t})\n .on(\"click\", function (d, i) {\n document.getElementById(\"title\").textContent = d.movie_title;\n document.getElementById(\"director\").textContent = d.director_name;\n document.getElementById(\"IMDd\").textContent = d.imdb_score;\n document.getElementById(\"budget\").textContent = \"$ \"+d.budget;\n document.getElementById(\"gross\").textContent = \"$ \"+d.gross;\n document.getElementById(\"genre\").textContent = d.genres;\n \n });\n\n chart1.selectAll('.dot')\n .filter(function (d) {\n return d.gross >= d.budget; })\n .attr(\"class\", \"moreGross\");\n \n // x-axis\n chart1 // or something else that selects the SVG element in your visualizations\n .append(\"g\") // create a group node\n .attr(\"transform\", \"translate(0,500)\")\n .call(xAxis) // call the axis generator\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"x\", 600)\n .attr(\"y\", -6)\n .style(\"text-anchor\", \"end\")\n .text(\"IMDb score\");\n \n // y-axis\n chart1 // or something else that selects the SVG element in your visualizations\n .append(\"g\") // create a group node\n .attr(\"transform\", \"translate(80, 0)\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"x\", -30)\n .attr(\"y\", 6)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .text(\"Budget\");\n\n\n csvFilter = csv.sort(function(x, y) {return d3.descending(x.gross, y.gross);});\n csvF1 = csvFilter.filter(function (d) {return d.title_year == 2010});\n csvF = csvF1.filter(function (d) {return d.gross > csvF1[10].gross});\n var svg = chart1\n .append('svg')\n .attr('width', width)\n .attr('height', height);\n \n var bars = svg.append('g');\n xScale1 = d3.scale.linear().range([0, width/2.7]);\n yScale1 = d3.scale.ordinal().rangeRoundBands([0, height/1.25], 0.3);\n d3BarChart(csvF, bars, 1700000, xScale1, yScale1);\n \n });\n\n\n\n // Dropdown for years\n d3.select(\"select\")\n .on(\"change\", function (d) {\n var selected = d3.select(\"#dropdown\").node().value;\n console.log(selected);\n\n d3.selectAll(\".dot\").remove();\n d3.select(\"svg\").remove();\n\n d3.csv(\"movies.csv\", function(d) {\n d.budget = +d.budget; \n d.gross = +d.gross;\n return d;\n \n }, function (csv) {\n for (var i = 0; i < csv.length; ++i) {\n csv[i].gross = Number(csv[i].gross);\n csv[i].budget = Number(csv[i].budget);\n csv[i].imdb_score = Number(csv[i].imdb_score);\n csv[i].movie_title = String(csv[i].movie_title);\n csv[i].title_year = String(csv[i].title_year);\n csv[i].movie_imdb_link = String(csv[i].movie_imdb_link);\n }\n var grossExtent = d3.extent(csv, function (row) { return row.gross; });\n var budgetExtent = d3.extent(csv, function (row) { return row.budget; });\n\n \n var xScale = d3.scale.linear().domain([0, 10]).range([80, 600]);\n var yScale = d3.scale.linear().domain([0,263700000]).range([500, 30]); //[0,263700000]\n var rScale = d3.scale.linear().domain(grossExtent).range([3, 60]);\n\n\n var xAxis = d3.svg.axis().scale(xScale);\n var yAxis = d3.svg.axis().scale(yScale);\n yAxis.orient(\"left\");\n\n // Dot plot\n var chart1 = d3.select(\"#chart1\")\n .append(\"svg:svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n // Dots\n var temp1 = chart1.selectAll(\"circle\")\n .data(csv)\n .enter()\n .append(\"circle\")\n .attr(\"class\",'dot')\n .attr(\"id\", function (d, i) {\n return i;\n })\n .attr(\"stroke\", \"black\")\n .attr(\"fill\", \"pink\")\n .filter(function (d) {return d.title_year == selected }) //170051787\n //.attr(\"class\", \"moreGross\")\n .attr(\"cx\", function (d) {\n return xScale(d.imdb_score);\n })\n .attr(\"cy\", function (d) {\n return yScale(d.budget);\n })\n .attr(\"r\", function(d) {\n return rScale(d.gross);\n })\n .on(\"mouseover\", function(d) {\t\t\n div.transition()\t\t\n .duration(200)\t\t\n .style(\"opacity\", .9);\t\t\n div.html(\"Title:\" + d.movie_title+ \"<br/>\" \n + \"Director: \" + d.director_name+ \"<br/>\" \n + \"IMDb Score: \" + d.imdb_score+ \"<br/>\" \n + \"Budget: $\" + d.budget+ \"<br/>\" \n + \"Gross: $\" + d.gross+ \"<br/>\" \n + \"Genres: \" + d.genres+ \"<br/>\" \n )\t\n .style(\"left\", (d3.event.pageX) + \"px\")\t\t\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\t\n })\t\t\t\t\t\n .on(\"mouseout\", function(d) {\t\t\n div.transition()\t\t\n .duration(500)\t\t\n .style(\"opacity\", 0)\t})\n .on(\"click\", function (d, i) {\n document.getElementById(\"title\").textContent = d.movie_title;\n document.getElementById(\"director\").textContent = d.director_name;\n document.getElementById(\"IMDd\").textContent = d.imdb_score;\n document.getElementById(\"budget\").textContent = \"$ \"+d.budget;\n document.getElementById(\"gross\").textContent = \"$ \"+d.gross;\n document.getElementById(\"genre\").textContent = d.genres;\n });\n\n \n chart1.selectAll('.dot')\n .filter(function (d) {\n return d.gross >= d.budget; })\n .attr(\"class\", \"moreGross\");\n \n // x-axis\n chart1 // or something else that selects the SVG element in your visualizations\n .append(\"g\") // create a group node\n .attr(\"transform\", \"translate(0,500)\")\n .call(xAxis) // call the axis generator\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"x\", 600)\n .attr(\"y\", -6)\n .style(\"text-anchor\", \"end\")\n .text(\"IMDb score\");\n \n // y-axis\n chart1 // or something else that selects the SVG element in your visualizations\n .append(\"g\") // create a group node\n .attr(\"transform\", \"translate(80, 0)\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .text(\"Budget\");\n\n\n csvFilter = csv.sort(function(x, y) {return d3.descending(x.gross, y.gross);});\n csvF1 = csvFilter.filter(function (d) {return d.title_year == selected});\n csvF = csvF1.filter(function (d) {return d.gross > csvF1[10].gross});\n var svg = chart1\n .append('svg')\n .attr('width', width)\n .attr('height', height);\n \n var bars = svg.append('g');\n xScale1 = d3.scale.linear().range([0, width/2.7]);\n yScale1 = d3.scale.ordinal().rangeRoundBands([0, height/1.25], 0.3);\n d3BarChart(csvF, bars, 1700000, xScale1, yScale1);\n \n \n });\n })\n\n\n\n}", "function update() {\n\t\tvar dot = data_canvas.selectAll(\".dot\") // magic!\n\t\t\t.data(filtered_nations, function(d) {return d.name});\n\n\t\tdot.enter().append(\"circle\").attr(\"class\",\"dot\")\n\t\t\t.attr(\"cx\", function(d) { return xScale(d.income[year_idx]); }) // this is why attr knows to work with the data\n\t\t\t.attr(\"cy\", function(d) { return yScale(d.lifeExpectancy[year_idx]); })\n\t\t\t.attr(\"r\", function(d) { return rScale(d.population[year_idx]); })\n\t\t\t.attr(\"opacity\", 0.5)\n\t\t\t.style(\"fill\", function(d) { return colorScale(d.region); })\n\t\t\t.on(\"mouseover\", function(d){ return tooltip.style(\"visibility\", \"visible\").text(d.name); })\n\t\t\t.on(\"mousemove\", function(){ return tooltip.style(\"top\", (d3.event.pageY-10)+\"px\").style(\"left\",(d3.event.pageX+10)+\"px\"); })\n\t\t\t.on(\"mouseout\", function(){ return tooltip.style(\"visibility\", \"hidden\"); });\n\n\t\tdot.exit().remove();\n\n\t\tdot.transition().ease(d3.easeLinear).duration(200)\n\t\t\t.attr(\"cx\", function(d) { return xScale(d.income[year_idx]); }) // this is why attr knows to work with the data\n\t\t\t.attr(\"cy\", function(d) { return yScale(d.lifeExpectancy[year_idx]); })\n\t\t\t.attr(\"r\", function(d) { return rScale(d.population[year_idx]); });\n\n\t\tdata_canvas.selectAll(\".dot\")\n\t\t\t.sort(function (a, b) { return b.population[year_idx] - a.population[year_idx]; });\n\n\t\tvar cross = data_canvas.selectAll(\".cross\")\n\t\t\t.data(filtered_reg_nations, function(d){return d.region});\n\n\t\tcross.enter().append(\"path\").attr(\"class\",\"cross\")\n\t\t\t.style(\"stroke\", function(d) { return colorScale(d.region); })\n\t\t\t.style(\"stroke-width\", 2)\n\t\t\t.attr(\"d\", function(d){\n\t\t\t\tvar posx = xScale(d.mean_income[year_idx]);\n\t\t\t\tvar posy = yScale(d.mean_lifeExpectancy[year_idx]);\n\t\t\t\tvar posx10u = posx+10;\n\t\t\t\tvar posy10u = posy+10;\n\t\t\t\tvar posx10d = posx-10;\n\t\t\t\tvar posy10d = posy-10;\n\t\t\t\tvar pathstring = \"M \" + posx + \" \" + posy + \" L \" + posx + \" \" + posy10u +\n\t\t\t\t\"M \" + posx + \" \" + posy + \" L \" + posx + \" \" + posy10d +\n\t\t\t\t\"M \" + posx + \" \" + posy + \" L \" + posx10d + \" \" + posy +\n\t\t\t\t\"M \" + posx + \" \" + posy + \" L \" + posx10u + \" \" + posy;\n\t\t\t\treturn pathstring;\n\t\t\t});\n\n\t\tcross.exit().remove();\n\n\t\tcross.transition().ease(d3.easeLinear).duration(200)\n\t\t\t.attr(\"d\", function(d){\n\t\t\t\tvar posx = xScale(d.mean_income[year_idx]);\n\t\t\t\tvar posy = yScale(d.mean_lifeExpectancy[year_idx]);\n\t\t\t\tvar posx10u = posx+10;\n\t\t\t\tvar posy10u = posy+10;\n\t\t\t\tvar posx10d = posx-10;\n\t\t\t\tvar posy10d = posy-10;\n\t\t\t\tvar pathstring = \"M \" + posx + \" \" + posy + \" L \" + posx + \" \" + posy10u +\n\t\t\t\t\"M \" + posx + \" \" + posy + \" L \" + posx + \" \" + posy10d +\n\t\t\t\t\"M \" + posx + \" \" + posy + \" L \" + posx10d + \" \" + posy +\n\t\t\t\t\"M \" + posx + \" \" + posy + \" L \" + posx10u + \" \" + posy;\n\t\t\t\treturn pathstring;\n\t\t\t});\n\n\t}", "function transition2014() {\n \n svgc.selectAll(\"rect\")\n .data(dataset_2014)\n .transition()\n .duration(700)\n .delay(function (d, i){return i*100;})\n .attr(\"y\", function(d) { return yScale(d.Frequency);})\n .attr(\"height\", function(d) { return height - yScale(d.Frequency); });\n \n}", "function displayYear(year) {\n d3.selectAll(\".dot\").data(interpolateData(year), key)\n .call(position)\n .sort(order);\n $(\"#ci-years-selector\").val(Math.round(year));\n }", "function renderLineVis(data, current_year) {\n // bind data to html elements - circles \n /*var line_selection = bodyP.selectAll(\"path\")\n .data(data);\n */ \n var lineFunction = d3.svg.line()\n .x(function(d) {return xlinear(d[\"Revenue\"])})\n .y(function(d) {return ylinear(d[\"Attendance\"])})\n .interpolate(\"linear\");\n\n var lineGraph = svg.append(\"path\")\n .attr(\"d\", lineFunction(data))\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", 1)\n .attr(\"fill\", \"none\")\n .attr(\"opacity\",0.25) \n .attr(\"transform\", translator(margin,margin));\n\n \n}", "function lollipopChart(data) {\r\n\r\n var nest = d3.nest()\r\n .key(d=>d.Year)\r\n .entries(data)\r\n\r\n zScale.domain([d3.min(data, d=>d.Magnitude),d3.max(data,d=>d.Magnitude)])\r\n\r\n var quakes = svgMap.selectAll('quake')\r\n .data(data)\r\n .enter()\r\n .append(\"circle\")\r\n .attr(\"class\", \"quake\")\r\n .attr(\"cx\", d=> projection([d.Longitude, d.Latitude])[0])\r\n .attr(\"cy\", d => projection([d.Longitude, d.Latitude])[1])\r\n .attr(\"r\", d=>zScale(d.Magnitude))\r\n\r\n xScale.domain([d3.min(nest,d=>d3.min(d.values,d=>d.Date)),d3.max(nest,d=>d3.max(d.values,d=>d.Date))])\r\n yScale.domain([d3.min(nest,d=>d3.min(d.values,d=>d.Magnitude)),d3.max(nest,d=>d3.max(d.values,d=>d.Magnitude))])\r\n rScale.domain([d3.min(nest,d=>d3.min(d.values,d=>d.Magnitude)), d3.max(nest, d=>d3.max(d.values,d=>d.Magnitude))])\r\n \r\n \r\n xAxis.scale(xScale)\r\n yAxis.scale(yScale)\r\n\r\n axisX.attr(\"class\", \"x-axis\")\r\n .call(xAxis)\r\n \r\n axisY.attr(\"class\", \"y-axis\")\r\n .call(yAxis)\r\n \r\n\r\n var selectLineG = svgGraph.selectAll(\"lineG\")\r\n .data(nest)\r\n .enter()\r\n .append(\"g\")\r\n .attr(\"class\",\"lineG\")\r\n\r\n var line = selectLineG.selectAll(\"line\")\r\n .data(d=>d.values)\r\n .enter()\r\n .append(\"line\")\r\n\r\n line.attr(\"x1\", d=>xScale(d.Date))\r\n .attr(\"y1\", d=>yScale(d.Magnitude))\r\n .attr(\"x2\", d=>xScale(d.Date))\r\n .attr(\"y2\",graphHeight)\r\n .attr(\"class\", \"line\")\r\n\r\n var bubble = svgGraph.selectAll(\"bubble\")\r\n .data(data)\r\n .enter()\r\n .append(\"circle\")\r\n .attr(\"cx\", d=>xScale(d.Date))\r\n .attr(\"cy\", d=>yScale(d.Magnitude))\r\n .attr(\"r\",d=>rScale(d.Magnitude))\r\n .attr(\"class\", \"bubble\")\r\n\r\n //create the brush\r\n var brush = svgGraph.append(\"g\")\r\n .attr(\"class\", \"brush\")\r\n .call(d3.brush()\r\n .extent([[0,0], [graphWidth, graphHeight+5]])\r\n .on(\"brush\", highlightedBubble)\r\n .on(\"end\",displayQuake))\r\n \r\n //function for the brush function\r\n function highlightedBubble() {\r\n if (d3.event.selection != null) {\r\n bubble.attr(\"class\", \"nonBrush\")\r\n var brushCoordinate = d3.brushSelection(this)\r\n bubble.filter(function() {\r\n var cx = d3.select(this).attr(\"cx\"),\r\n cy = d3.select(this).attr(\"cy\")\r\n return isBrushed(brushCoordinate, cx, cy)\r\n })\r\n .attr(\"class\", \"brushed\")\r\n }}\r\n \r\n //function for displaying the earthquakes on the world map based on the brushed data on the graph.\r\n function displayQuake() {\r\n if (!d3.event.selection) return\r\n d3.select(this).on(brush.move, null)\r\n var d_brushed = d3.selectAll(\".brushed\").data()\r\n if (d_brushed.length>0) {\r\n clearQuake()\r\n populateQuake(d_brushed)} \r\n \r\n else {clearQuake()}}\r\n\r\n }", "function updateYear(year) {\n\t\t// First set the beggining and end dates\n\t\t/* Variables */\n\n\t\tvar yearStartDate = year + \"-01-01\";\n\t\tvar yearEndDate = year + \"-12-31\";\n\t\t//URL\n\t\tvar yearTotalEnergyURL = POWER_DATA_URL + \"?mode=watts&startDate=\" + yearStartDate + \"%2000:00:00&endDate=\" + yearEndDate + \"%2000:00:00&device=\" + devices[0];\n\t\tconsole.log(yearTotalEnergyURL);\n\n\t\tvar yearTotalEnergyOptions = {\n\t\t\t\txaxis : {\n\t\t\t\t\tmode : 'time',\n\t\t\t\t\tmin : (new Date(yearStartDate)).getTime(),\n\t\t\t\t\tmax : (new Date(yearEndDate)).getTime()\n\t\t\t\t},\n\t\t\t\tyaxis : {\n\t\t\t\t\ttickFormatter : wattFormatter\n\t\t\t\t},\n\t\t\t\tlegend : {\n\t\t\t\t\tshow : true,\n\t\t\t\t\tmargin : 10,\n\t\t\t\t\tbackgroundOpacity : 0.5\n\t\t\t\t},\n\t\t\t\tseries : {\n\t\t\t\t\tlines: { show: true, fill: true }\n\t\t\t\t},\n\t\t\t\tgrid : {\n\t\t\t\t\thoverable : true\n\t\t\t\t}\n\t\t};\n\n\t\tvar yearTotalEnergyData = [];\n\n\t\tvar yearTotalEnergyPlaceholder = $(\"#year_view\");\n\n\t\t// fetch one series, adding to what we got\n\t\tvar yearAlreadyFetched = {};\n\n\t\t// then fetch the data with jQuery\n\t\tfunction onDataReceived_yearTotalEnergyOptions(series) {\n\n\t\t\t// extract the first coordinate pair so you can see that\n\t\t\t// data is now an ordinary Javascript object\n\t\t\tvar firstcoordinate = '(' + series.data[0][0] + ', ' + series.data[0][1] + ')';\n\n\t\t\t// let's add it to our current data\n\t\t\tif(!yearAlreadyFetched[series.label]) {\n\t\t\t\tyearAlreadyFetched[series.label] = true;\n\t\t\t\tyearTotalEnergyData.push(series);\n\t\t\t}\n\t\t\t//debugger;\n\n\t\t\t// and plot all we got\n\t\t\t$.plot(yearTotalEnergyPlaceholder, yearTotalEnergyData, yearTotalEnergyOptions);\n\n\t\t\t//Now, for shits and giggles, lets do some maths!\n\n\t\t};\n\n\t\tvar previousPoint = null;\n\t\t$(\"#year_view\").bind(\"plothover\", function(event, pos, item) {\n\t\t\t$(\"#x\").text(pos.x.toFixed(2));\n\t\t\t$(\"#y\").text(pos.y.toFixed(2));\n\n\t\t\tif(item) {\n\t\t\t\tif(previousPoint != item.dataIndex) {\n\t\t\t\t\tpreviousPoint = item.dataIndex;\n\n\t\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\t\tvar x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);\n\n\t\t\t\t\tshowTooltip(item.pageX, item.pageY, y + \" watts\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\tpreviousPoint = null;\n\t\t\t}\n\n\t\t});\n\n\t\t$.plot(yearTotalEnergyPlaceholder, yearTotalEnergyData, yearTotalEnergyOptions);\n\n\t\t//Now lets do some temp stuff, much simpler *ahhhh*\n\t\t$.ajax({url : yearTotalEnergyURL,method : 'GET',dataType : 'json',success : onDataReceived_yearTotalEnergyOptions});\n\n\t}", "update_roll(){\n this.circles.transition()\n .duration(this.parent.speed)\n .ease(d3.easeLinear)\n .attr('transform', `translate(${this.year_to_x_for_g(this.parent.year0)}, ${this.label_height})`)\n }", "function layer1(trans) {\n\tvar dataPath = \"./dataset/songs.json\";\n\n\tvar margin = 40,\n\t\toffset = 28,\n\t\twidth = 1024,\n\t\theight = 720;\n\t\tradius = 240,\n\t\tr = 600;\n\t\tcenter = {x:radius + margin, y:radius + margin},\n\t\tinTransLength = 1000,\n\t\toutTransLength = 1000,\n\t\tyear_apart = 15,\n\t\tminBubble = 7,\n\t\tmaxBubble = 30;\n\n\tvar svg,\n\t\tminYear, \n\t\tmin, \n\t\tmaxYear, \n\t\tmax, \n\t\tradiScale,\n\t\tcolor, \n\t\ttip, \n\t\tcir;\n\n\t// initialize variables\n\tfunction initVar(data) {\n\t\tmin = d3.min(data, function(d) { return d.year; });\n\t\tmax = d3.max(data, function(d) { return d.year; });\n\n\t\tminYear = new Date(min, 1, 1);\n\t\tmaxYear = new Date(max, 1, 1);\n\n\t\tcolor = d3.scale.sqrt()\n\t\t\t\t\t.domain([min, max])\n\t\t\t\t\t.range([circleFillRangeMin, circleFillRangeMax]);\n\n\t\tcir = d3.scale.linear()\n\t\t\t.domain(d3.extent(data, function(d) { return d.hotArr.length; }))\n\t\t\t.range([minBubble, maxBubble]);\n\n\t\tradiScale = d3.scale.linear()\n\t\t\t\t\t.domain([min, max])\n\t\t\t\t\t.range([0, radius]);\n\t}\n\n\t// Load the data\n\td3.json(dataPath,\n\t\t\tfunction(d) {\n\t\t\t\tvar data = d.map(function(d) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tpopularity: d.popularity,\n\t\t\t\t\t\thotArr:d.hotArr,\n\t\t\t\t\t\tpopArr:d.popArr,\n\t\t\t\t\t\thotness: d.hotness,\n\t\t\t\t\t\tyear: d.year\n\t\t\t\t \t\t};\n\t\t\t\t \t});\n\t\t\t\t// start drawing the visualization\n\t \t\t\tstart(data);\n\t\t\t});\n\n\t// the tool tip\n\ttip = d3.tip().attr('class', 'd3-tip')\n\t\t\t\t.offset([-10, 0]);\n\n\n\n\tsvg = d3.select(\"body\").append(\"svg\")\n\t\t \t.attr(\"width\", width)\n\t \t.attr(\"height\", height)\n\t \t\t.append(\"g\")\n\t \t\t.attr(\"transform\", \"translate(\" + (width - r) / 2 + \",\" + (height - r) / 2 + \")\")\n\t \t\t.call(tip);\n\t\n\tsvg.append(\"text\")\n\t\t.attr(\"id\", \"layer1_title\")\n\t\t.text(\"Artists grouped by hotness and familiarity per year\")\n\t\t.attr(\"transform\", \"translate(\" + (5 - (width - r) / 2) + \",\" + (-30) + \")\");\n\n\tsvg.attr(\"transform\", \"translate(\" + (width - r) / 2 + \",\" + (height - r) / 2 + \")\");\n\n\tfunction start(data){\n\t\t\td3.select(\"img\").remove();\n\t\t\tinitVar(data);\n\t\t\tdrawAxis();\n\t\t\tdrawLine();\n\t\t\tdrawYearScale();\n\t\t\tdrawLegend();\n\t\t\tbindData(data);\n\t\t}\n\n\t// 3 axises in total, left, right and bottom\n\tfunction drawAxis(){\n\t\tvar xLeft, xRight, xLeftAxis, xRightAxis, bottom;\n\n\t\txLeft = d3.time.scale()\n\t\t\t.domain([maxYear, minYear])\n\t\t\t.range([margin, radius + margin]);\n\n\t\txRight = d3.time.scale()\n\t\t\t.domain([minYear, maxYear])\n\t\t\t.range([radius + margin, 2*radius + margin]);\n\n\t\txLeftAxis = getAxis(xLeft);\n\t\txRightAxis = getAxis(xRight);\n\n\t\tsvg.append(\"line\")\n\t\t\t.attr(\"class\", \"bottom_xAxis\")\n\t\t\t.attr(\"x1\", margin)\n\t\t\t.attr(\"y1\", center.y + offset)\n\t\t\t.attr(\"x2\", margin + 2 * radius)\n\t\t\t.attr(\"y2\", center.y + offset)\n\t\t\t.attr(\"opacity\", 0)\n\t\t\t.transition()\n\t\t\t.duration(inTransLength)\n\t\t\t.attr(\"opacity\", 1);\n\t\t\n\t\tappendAxis(xLeftAxis, \"xLeft axis\");\n\t\tappendAxis(xRightAxis, \"xRight axis\");\n\t}\n\n\t// helper function to init axis\n\tfunction getAxis(axis){\n\t\treturn d3.svg.axis()\n\t\t \t\t.scale(axis)\n\t\t \t\t.tickPadding(3)\n\t\t \t\t.ticks(d3.time.years, year_apart);\n\t}\n\n\t// helper function to draw axis\n\tfunction appendAxis(axis, className){\n\t\tsvg.append(\"g\")\n\t \t.attr(\"class\", className)\n\t \t.attr(\"transform\", \"translate(0,\" + center.y + \")\")\n\t \t.call(axis)\n\t \t.attr(\"opacity\", 0)\n\t\t\t.transition()\n\t\t\t.duration(inTransLength)\n\t\t\t.attr(\"opacity\", 1);\n\t}\n\n\tfunction drawLine(data){\n\t\tvar line_offset = 25,\n\t\t\ttext_offset = 30,\n\t\t\ttext_x,\n\t\t\ttext_y,\n\t\t\trotate;\n\t\t// hotness line scale\n\t\tfor (var i = 1; i <= 9; i++) {\n\t\t\tsvg.append(\"line\")\n\t\t\t\t.attr(\"class\", \"line_scale\")\n\t\t\t\t.attr(\"id\", \"hot_line\" + i)\n\t\t\t\t.attr(\"x1\", center.x - (Math.cos(i*Math.PI/10) * (radius + line_offset)))\n\t\t\t\t.attr(\"y1\", center.y - (Math.sin(i*Math.PI/10) * (radius + line_offset)))\n\t\t\t\t.attr(\"x2\", center.x)\n\t\t\t\t.attr(\"y2\", center.y)\n\t\t\t\t.attr(\"opacity\", 0)\n\t\t\t\t.transition()\n\t\t\t\t.duration(inTransLength)\n\t\t\t\t.attr(\"opacity\", 1);\n\n\t\t\ttext_x = center.x - (Math.cos(i*Math.PI/10 - 0.02) * (radius + text_offset)),\n\t\t\ttext_y = center.y - (Math.sin(i*Math.PI/10 - 0.02) * (radius + text_offset)),\n\t\t\trotate = 180 - Math.atan2(text_x-center.x, text_y-center.y)/(Math.PI/180);\n\t\t\t\n\t\t\t// add the number\n\t\t\tputText(\"scale_number\", \"hot_number\" + i, text_x, text_y, rotate, i);\t\t\t\n\t\t}\n\t\t// draw the popularity line scale\n\t\tfor (var i = 11; i <= 19; i++){\n\t\t\tsvg.append(\"line\")\n\t\t\t\t.attr(\"class\", \"line_scale\")\n\t\t\t\t.attr(\"id\", \"pop_line\" + (i-10))\n\t\t\t\t.attr(\"x1\", center.x - (Math.cos(i*Math.PI/10) * (radius + line_offset)))\n\t\t\t\t.attr(\"y1\", center.y + offset - (Math.sin(i*Math.PI/10) * (radius + line_offset)))\n\t\t\t\t.attr(\"x2\", center.x)\n\t\t\t\t.attr(\"y2\", center.y + offset)\n\t\t\t\t.attr(\"opacity\", 0)\n\t\t\t\t.transition()\n\t\t\t\t\t.duration(inTransLength)\n\t\t\t\t\t.attr(\"opacity\", 1);\n\n\t\t\ttext_x = center.x - (Math.cos(i*Math.PI/10 - 0.02) * (radius + text_offset)),\n\t\t\ttext_y = center.y + offset - (Math.sin(i*Math.PI/10 - 0.02) * (radius + text_offset)),\n\t\t\trotate = 180 - Math.atan2(text_x-center.x, text_y-center.y)/(Math.PI/180);\n\t\t\t\n\t\t\t// add text\n\t\t\tputText(\"scale_number\", \"pop_number\" + (i-10), text_x, text_y, rotate, (i-10));\n\t\t}\n\n\t\ttext_x = center.x - radius - 30,\n\t\ttext_y = center.y + 10;\n\t\tputText(\"scale_number\", \"hot_number0\", text_x, text_y, 270, 0);\n\n\t\ttext_x = center.x + radius + 30,\n\t\ttext_y = center.y;\n\t\tputText(\"scale_number\", \"hot_number10\", text_x, text_y, 90, 1);\n\n\t\ttext_x = center.x - radius - 30,\n\t\ttext_y = center.y + offset;\n\t\tputText(\"scale_number\", \"pop_number10\", text_x, text_y, 270, 1);\n\n\t\ttext_x = center.x + radius + 30,\n\t\ttext_y = center.y + 20;\n\t\tputText(\"scale_number\", \"pop_number0\", text_x, text_y, 90, 0);\n\t}\n\n\t// helper function to put text\n\tfunction putText(className, idName, text_x, text_y, rotation, num){\n\t\t\tsvg.append(\"text\")\n\t\t\t\t.attr(\"id\", idName)\n\t\t\t\t.attr(\"class\", className)\n\t\t\t\t.attr(\"x\", text_x)\n\t\t\t\t.attr(\"y\", text_y)\n\t\t\t\t.text(num)\n\t\t\t\t.attr(\"transform\", \"rotate(\" + rotation + \" \" + text_x + \",\" + text_y + \")\")\n\t\t\t\t.attr(\"opacity\", 0)\n\t\t\t\t.transition()\n\t\t\t\t.duration(inTransLength)\n\t\t\t\t.attr(\"opacity\", 1);\n\t}\n\n\tfunction drawYearScale(data){\n\t\t// need to hard code the year\n\t\tvar arr = [1935, 1950, 1965, 1980, 1995, 2010];\n\t\tvar points = 50;\n\n\t\tvar up_angle = d3.scale.linear()\n\t\t .domain([0, points-1])\n\t\t .range([-Math.PI/2, Math.PI/2]);\n\n\t\tvar down_angle = d3.scale.linear()\n\t\t .domain([0, points-1])\n\t\t .range([Math.PI/2, 3*Math.PI/2]);\n\n\t\tfor (var i = 0; i < 6; i++){\n\t\t\tdrawYear(0, up_angle, arr, i, points);\n\t\t\tdrawYear(offset, down_angle, arr, i, points);\n\t\t}\n\t}\n\n\t// helper function to draw the year\n\tfunction drawYear(off, angle, arr, i, points){\n\t\tsvg.append(\"path\")\n\t\t\t.datum(d3.range(points))\n\t\t .attr(\"class\", \"year_scale\")\n\t\t .attr(\"d\", d3.svg.line.radial()\n\t\t \t\t\t\t.radius(radiScale(arr[i]))\n\t\t \t\t\t\t.angle(function(d, j) { return angle(j); }))\n\t\t .attr(\"transform\", \"translate(\" + center.x + \", \" + (center.y + off) + \")\")\n\t\t .attr(\"opacity\", 0)\n\t\t\t.transition()\n\t\t\t.duration(inTransLength)\n\t\t\t.attr(\"opacity\", 1);\n\t}\n\n\tfunction drawLegend(){\n\t\tvar grad = svg.append(\"defs\")\n\t\t\t.append(\"svg:linearGradient\")\n\t\t\t\t.attr(\"id\", \"grad1\")\n\t\t\t\t.attr(\"x1\", \"0%\")\n\t\t\t\t.attr(\"y1\", \"0%\")\n\t\t\t\t.attr(\"x2\", \"100%\")\n\t\t\t\t.attr(\"y2\", \"0%\");\n\n\t\tgrad.append(\"svg:stop\")\n\t\t\t.attr(\"offset\", \"0%\")\n\t\t\t.style(\"stop-color\", circleFillRangeMin)\n\t\t\t.style(\"stop-opacity\", \"1\");\n\t\t\n\t\tgrad.append(\"svg:stop\")\n\t\t\t.attr(\"offset\", \"100%\")\n\t\t\t.style(\"stop-color\", circleFillRangeMax)\n\t\t\t.style(\"stop-opacity\", \"1\");\n\n\t\tvar legend = svg.append(\"g\")\n\t\t//background\n\t\tlegend.append(\"rect\")\n\t\t\t.attr(\"width\", 145)\n\t\t\t.attr(\"height\", 75)\n\t\t\t.attr(\"fill\", legendBackground)\n\t\t\t.attr(\"stroke\", \"black\");\n\t\t\n\t\tdrawLegendText(legend, 7, 30, 11.5, \"Year\");\n\t\tdrawLegendText(legend, 7, 15, 11.5, \"Size: Num. Artist\");\n\t\n\t\tlegend.append(\"rect\")\n\t\t\t.attr(\"width\", 105)\n\t\t\t.attr(\"height\", 20)\n\t\t\t.attr(\"x\", 20)\n\t\t\t.attr(\"y\", 35)\n\t\t\t.attr(\"fill\", \"url(#grad1)\");\n\t\t\n\t\tdrawLegendText(legend, 20, 65, 10, min).attr(\"text-anchor\", \"middle\");\n\t\tdrawLegendText(legend, 125, 65, 10, max).attr(\"text-anchor\", \"middle\");\n\t\t\n\t\tlegend.attr(\"transform\", \"translate(\" + (5 - (width - r) / 2) + \",\" + (height - 185) + \")\")\n\t\t\t.attr(\"opacity\", 0)\n\t\t\t.transition()\n\t\t\t\t.duration(inTransLength)\n\t\t\t\t.attr(\"opacity\", 1);\n\t}\n\n\t// helper function to draw the legend text\n\tfunction drawLegendText(legend, x, y, size, text){\n\t\treturn legend.append(\"text\")\n\t\t\t\t\t.attr(\"x\", x)\n\t\t\t\t\t.attr(\"y\", y)\n\t\t\t\t\t.attr(\"font-size\", size)\n\t\t\t\t\t.style(\"fill\", legendTextColor)\n\t\t\t\t\t.text(text);\n\t}\n\n\tfunction bindData(data){\n\n\t\tsvg.selectAll(\"hotness\")\n\t\t\t.data(data)\n\t\t\t.enter()\n\t\t\t.append(\"circle\")\n\t\t\t.attr(\"id\", function(d, i) { return \"hotness\" + i; })\n\t\t\t.attr(\"class\", \"hotness\")\n\t\t\t.attr(\"cx\", function(d) { return transit(d, \"x\", \"hotness\"); })\n\t\t\t.attr(\"cy\", function(d) { return transit(d, \"y\", \"hotness\"); })\n\t\t\t.attr(\"r\", function(d) {\n\t\t\t\tif (trans) {\n\t\t\t\t\tif (d.year == trans.year && d.hotness == trans.hotness && d.popularity == trans.popularity) {\n\t\t\t\t\t\treturn 300;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn cir(d.hotArr.length);\n\t\t\t\t\t}\t\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.style(\"fill\", function(d) { return color(d.year); })\n\t\t\t.style(\"fill-opacity\", getOpacity)\n\t\t\t.on(\"mouseover\", mouseover)\n\t\t\t.on(\"mouseleave\", mouseleave)\n\t\t\t.on(\"click\", toSecLayer)\n\t\t\t.transition()\n\t\t\t.duration(outTransLength)\n\t\t\t.delay(delayTran)\n\t\t\t.attr(\"cx\", function(d) { return coord(d, \"x\", \"hotness\", radiScale(d.year)); })\n\t\t\t.attr(\"cy\", function(d) { return coord(d, \"y\", \"hotness\", radiScale(d.year)); })\n\t\t\t.style(\"fill-opacity\", 0.3)\n\t\t\t.attr(\"r\", function(d) { return cir(d.hotArr.length); });\n\n\t\tsvg.selectAll(\"popularity\")\n\t\t\t.data(data)\n\t\t\t.enter()\n\t\t\t.append(\"circle\")\n\t\t\t.attr(\"id\", function(d, i) { return \"pop\" + i; })\n\t\t\t.attr(\"class\", \"popularity\")\n\t\t\t.attr(\"cx\", function(d) { return transit(d, \"x\", \"pop\"); })\n\t\t\t.attr(\"cy\", function(d) { return transit(d, \"y\", \"pop\"); })\n\t\t\t.attr(\"r\", function(d) {\n\t\t\t\tif (trans) {\n\t\t\t\t\tif (d.year == trans.year && d.hotness == trans.hotness && d.popularity == trans.popularity) {\n\t\t\t\t\t\treturn 300;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn cir(d.popArr.length);\n\t\t\t\t\t}\t\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.style(\"fill\", function(d) { return color(d.year); })\n\t\t\t.style(\"fill-opacity\", getOpacity)\n\t\t\t.on(\"mouseover\", mouseover)\n\t\t\t.on(\"mouseleave\", mouseleave)\n\t\t\t.on(\"click\", toSecLayer)\n\t\t\t.transition()\n\t\t\t.duration(outTransLength)\n\t\t\t.delay(delayTran)\n\t\t\t.attr(\"cx\", function(d) { return coord(d, \"x\", \"pop\", radiScale(d.year)); })\n\t\t\t.attr(\"cy\", function(d) { return coord(d, \"y\", \"pop\", radiScale(d.year)); })\n\t\t\t.style(\"fill-opacity\", 0.3)\n\t\t\t.attr(\"r\", function(d) { return cir(d.popArr.length); });\n\t}\n\n\t// helper function to get the coordinate of x and y\n\tfunction transit(d, coor, className){\n\t\tif (trans) {\n\t\t\tif (d.year == trans.year && d.hotness == trans.hotness && d.popularity == trans.popularity) {\n\t\t\t\treturn 300;\n\t\t\t} else {\n\t\t\t\treturn coord(d, coor, className, radius*2);\n\t\t\t}\n\t\t} else {\n\t\t\treturn coord(d, coor, className, radiScale(d.year));\n\t\t}\n\t}\n\n\t// helper function to get fill opacity level\n\tfunction getOpacity(d){\n\t\tif (trans) {\n\t\t\tif (d.year == trans.year && d.hotness == trans.hotness && d.popularity == trans.popularity) {\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t} else {\n\t\t\treturn 0.3;\n\t\t}\n\t}\n\n\t// helper function to get the delay time\n\tfunction delayTran(d){\n\t\tif (!trans || (trans && d.year == trans.year && d.hotness == trans.hotness && d.popularity == trans.popularity)) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn outTransLength/2;\n\t\t}\n\t}\n\n\t// helper function to get the coordinate\n\tfunction coord(d, coordinate, type, year){\n\t\tvar len, val, array, sign, low;\n\t\tif (coordinate === \"x\") {\n\t\t\tarray = (type === \"hotness\") ? d.hotArr : d.popArr;\n\t\t\tsign = (type === \"hotness\") ? -1 : 1;\n\t\t\tlen = array.length == 0 ? 0 : array.length - 1;\n\t\t\tval = center.x + sign * (Math.cos(Math.PI * array[Math.round(Math.random()*(len - 0))]) * year);\n\t\t} else {\n\t\t\tif (type === \"hotness\"){\n\t\t\t\tarray = d.hotArr;\n\t\t\t\tsign = -1;\n\t\t\t\tlow = 0;\n\t\t\t} else {\n\t\t\t\tarray = d.popArr;\n\t\t\t\tsign = 1;\n\t\t\t\tlow = offset;\n\t\t\t}\n\t\t\tlen = array.length == 0 ? 0 : array.length - 1;\n\t\t\tval = center.y + low + sign * (Math.sin(Math.PI * array[Math.round(Math.random()*(len - 0))]) * year); \n\t\t}\n\t\treturn Math.round(val);\n\t}\n\n\tfunction mouseover(d, i){\n\t\tsvg.select(\"#pop\" + i)\n\t\t\t.style(\"fill\", \"black\")\n\t\t\t.style(\"fill-opacity\", 1);\t\t\t\n\t\t\n\t\tsvg.select(\"#hotness\" + i)\n\t\t\t.style(\"fill\", \"black\")\n\t\t\t.style(\"fill-opacity\", 1);\n\t\t\t\n\t\tvar coord = d3.mouse(this);\n\t\t\n\t\tif (coord[1] > center.y + 20) {\n\t\t\ttip.html(function(d) {\n\t\t\t\t\treturn \"<strong>Year:</strong> <span style='color:red'>\" + d.year + \"</span><br />\" + \n\t\t\t\t\t\"<strong>Familiarity:</strong> <span style='color:red'>\" + d.popularity + \"</span><br />\" +\n\t\t\t\t\t\"<strong>Hotness:</strong> <span style='color:red'>\" + d.hotness + \"</span><br />\" + \n\t\t\t\t\t\"<strong>Num. Artist:</strong> <span style='color:red'>\" + d.popArr.length + \"</span>\";\n\t\t\t\t});\t\t\n\t\t} else {\n\t\t\ttip.html(function(d) {\n\t\t\t\t\treturn \"<strong>Year:</strong> <span style='color:red'>\" + d.year + \"</span><br />\" + \n\t\t\t\t\t\"<strong>Hotness:</strong> <span style='color:red'>\" + d.hotness + \"</span><br />\" + \n\t\t\t\t\t\"<strong>Familiarity:</strong> <span style='color:red'>\" + d.popularity + \"</span><br />\" +\n\t\t\t\t\t\"<strong>Num. Artist:</strong> <span style='color:red'>\" + d.hotArr.length + \"</span>\"; \n\t\t\t\t});\n\t\t}\n\t\tchangeFontSize(d.popularity, d.hotness, \"40px\");\n\t\ttip.show(d);\n\t\t\n\t}\n\n\tfunction mouseleave(d, i){\n\t\tsvg.select(\"#pop\" + i)\n\t\t\t.style(\"fill-opacity\", 0.3)\n\t\t\t.style(\"fill\", function(d) { return color(d.year); });\n\n\t\tsvg.select(\"#hotness\" + i)\n\t\t\t.style(\"fill-opacity\", 0.3)\n\t\t\t.style(\"fill\", function(d) { return color(d.year); });\n\n\t\tchangeFontSize(d.popularity, d.hotness, \"20px\");\n\t\ttip.hide(d);\n\t}\n\n\tfunction changeFontSize(pop, hot, fontSize){\n\t\tsvg.select(\"#pop_number\" + pop)\n\t\t\t\t.style(\"font-size\", fontSize);\n\t\tsvg.select(\"#hot_number\" + hot)\n\t\t\t\t.style(\"font-size\", fontSize);\n\n\t\tif (pop == 10) {\n\t\t\tsvg.select(\"#hot_number\" + 0)\n\t\t\t\t.style(\"font-size\", fontSize);\n\t\t}\n\n\t\tif (hot == 10) {\n\t\t\tsvg.select(\"#pop_number\" + 0)\n\t\t\t\t.style(\"font-size\", fontSize);\n\t\t}\n\t}\n\n\tfunction toSecLayer(d, i){\n\t //remove events immediately\n\t svg.selectAll(\"circle\")\n\t \t.on(\"mouseover\", null)\n\t\t\t.on(\"mouseleave\", null)\n\t\t\t.on(\"click\", null)\n\t\t\n\t\t//shrink all other circles\n\t\tsvg.selectAll(\"circle\").filter(function(d, i) {\n\t\t\treturn d != this;\n\t\t}).transition()\n\t\t\t.duration(inTransLength)\n\t\t\t.attr(\"r\", 0);\n\t\t\n\t\t//fade all labels and axis\n\t\tsvg.selectAll(\"text\")\n\t\t\t.transition()\n\t\t\t\t.duration(inTransLength)\n\t\t\t\t.style(\"opacity\", 0);\n\t\tsvg.selectAll(\"line\")\n\t\t\t.transition()\n\t\t\t\t.duration(inTransLength)\n\t\t\t\t.style(\"opacity\", 0);\n\t\tsvg.selectAll(\"path\")\n\t\t\t.transition()\n\t\t\t\t.duration(inTransLength)\n\t\t\t\t.style(\"opacity\", 0);\n\t\tsvg.selectAll(\"g\")\n\t\t\t.transition()\n\t\t\t\t.duration(inTransLength)\n\t\t\t\t.style(\"opacity\", 0);\n\t\t\n\t\t//make clicked circle fill screen and transition to layer root bubble fill color\n\t d3.select(this).transition()\n\t \t.duration(inTransLength)\n\t \t.attr(\"r\", 300)\n\t \t.attr(\"cx\", 300)\n\t \t.attr(\"cy\", 300)\n\t \t.style(\"fill\", rootCircleFill)\n\t \t.each(\"end\", function() {\n\t \t\ttip.hide(d);\n\t\t\t\td3.select(\"div\").remove();\n\t\t\t\td3.select(\"svg\").remove();\n\t\t\t\tlayer2(d.year, d.hotness, d.popularity);\n\t \t});\t\n\t} \n}", "function updateLineChart() {\n\n // Scales\n var x = d3.scaleLinear()\n .range([0, width]);\n\n var y = d3.scaleLinear()\n .range([height, 0]);\n\n // transition\n var t = d3.transition().duration(750);\n\n // get option for data type\n var option = d3.select(\"#data-type\").property('value');\n\n var startyr = tooltipSlider.noUiSlider.get()[0];\n var endyr = tooltipSlider.noUiSlider.get()[1];\n\n // filter according to start and end years to update data\n filtered_alldata = data.filter(function(d){return d.YEAR >= startyr && d.YEAR <= endyr;});\n\n // add two more lines for males and females\n filtered_male = male.filter(function(d){return d.YEAR >= startyr && d.YEAR <= endyr;});\n filtered_female = female.filter(function(d){return d.YEAR >= startyr && d.YEAR <= endyr;});\n\n // var line\n var line = d3.line()\n .x(function (d) { return x(d.YEAR);})\n .y(function (d) { return y(d[option]);});\n\n // var axes\n x.domain([d3.min(filtered_alldata, function(d) { return d.YEAR; }), d3.max(filtered_alldata, function(d) { return d.YEAR; })]);\n y.domain([d3.min(filtered_alldata, function(d) { return d[option]; })-0.5, d3.max(filtered_alldata, function(d) { return d[option]; })+0.5]);\n\n var xAxis = d3.axisBottom(x).tickValues(d3.range(startyr, endyr)).tickFormat(d3.format(\".0f\"));\n var yAxis = d3.axisLeft(y);\n\n //axes\n var xxx = svg.selectAll(\".axis--x\")\n .data(filtered_alldata);\n\n var yyy = svg.selectAll(\".axis--y\")\n .data(filtered_alldata);\n\n xxx.enter().append(\"g\")\n .merge(xxx)\n .attr(\"class\", \"axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n yyy.enter().append(\"g\")\n .merge(yyy)\n .transition(t)\n .attr(\"class\", \"axis--y\")\n .call(yAxis);\n\n xxx.exit().remove();\n yyy.exit().remove();\n \n // two more paths for male and female\n var male_path = svg.selectAll(\".mline\")\n .data(filtered_male);\n male_path.enter().append(\"path\")\n .merge(male_path)\n .transition(t)\n .attr(\"class\", \"mline\")\n .attr(\"data-legend\",\"Male\")\n .attr(\"d\", line(filtered_male));\n male_path.exit().remove();\n\n var female_path = svg.selectAll(\".fline\")\n .data(filtered_female);\n female_path.enter().append(\"path\")\n .merge(female_path)\n .transition(t)\n .attr(\"class\", \"fline\")\n .attr(\"data-legend\",\"Female\")\n .attr(\"d\", line(filtered_female));\n female_path.exit().remove();\n\n\n // path\n var path = svg.selectAll(\".line\")\n .data(filtered_alldata);\n path.enter().append(\"path\")\n .merge(path)\n .transition(t)\n .attr(\"class\", \"line\")\n .attr(\"data-legend\",\"Total\")\n .attr(\"d\", line(filtered_alldata));\n path.exit().remove();\n\n\n // axes titles\n svg.append(\"text\")\n .attr(\"text-anchor\", \"middle\") // this makes it easy to centre the text as the transform is applied to the anchor\n .attr(\"transform\", \"translate(\"+ (-margin.left/1.8) +\",\"+(height/2)+\")rotate(-90)\") // text is drawn off the screen top left, move down and out and rotate\n .text(\"Percetage\")\n .style(\"font-weight\", 400);\n\n svg.append(\"text\")\n .attr(\"text-anchor\", \"middle\") // this makes it easy to centre the text as the transform is applied to the anchor\n .attr(\"transform\", \"translate(\"+ (width/2) +\",\"+(height+(margin.bottom-10))+\")\") // centre below axis\n .text(\"Year\")\n .style(\"font-weight\", 400);\n\n // chart title\n svg.append(\"text\")\n .attr(\"text-anchor\", \"middle\") // this makes it easy to centre the text as the transform is applied to the anchor\n .attr(\"transform\", \"translate(\"+ (width/2) +\",\" + (-10)+\")\") // centre below axis\n .text(\"Survey Results over Selected Years\")\n .attr(\"class\", \"chart-title\")\n .style(\"font-weight\", 400);\n\n d3.selectAll(\".chart-title\").html(\"Suicidal \" + option.toLowerCase() + \" data from \" + startyr + \" to \" + endyr);\n\n // create option-specific tip\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-20, 0])\n .html(function(d) {\n selected_year = d.YEAR;\n male_data = male.filter(function(d){return d.YEAR == selected_year})[0][option];\n female_data = female.filter(function(d){return d.YEAR == selected_year})[0][option];\n\n return \"<strong>\" + d.YEAR + \" survey results on suicidal \" + option.toLowerCase()+ \"</strong>\" +\n \"<br>\" + \"Total: \" + \"<span style='color:yellow'>\"+ d[option] + \"%\" + \"</span>\" +\n \"<br>\" + \"Female: \" + \"<span style='color:yellow'>\"+ female_data + \"%\" + \"</span>\" +\n \"<br>\" + \"Male: \" + \"<span style='color:yellow'>\"+ male_data + \"%\" + \"</span>\";\n });\n\n svg.call(tip);\n\n // dots\n var dots = svg.selectAll(\".dot\")\n .data(filtered_alldata);\n\n dots.enter().append(\"circle\")\n .merge(dots)\n .attr(\"class\", \"dot\")\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .on(\"click\", function(d){return updateBarChart(d);})\n .transition(t)\n .attr(\"cx\", line.x())\n .attr(\"cy\", line.y())\n .attr(\"r\", 8);\n dots.exit().remove();\n\n}", "function update(selectedGroup) {\n\n // Create new data with the selection?\n var dataFilter = data.map(function(d){return {x: d.x, y: d[selectedGroup]} })\n\n console.log(dataFilter);\n\n line2\n .transition()\n .duration(0)\n .attr(\"y1\", 0)\n .attr(\"y2\", 0)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n line3\n .transition()\n .duration(0)\n .attr(\"y1\", 0)\n .attr(\"y2\", 0)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n line4\n .transition()\n .duration(0)\n .attr(\"y1\", 0)\n .attr(\"y2\", 0)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n line2_2\n .transition()\n .duration(0)\n .attr(\"y1\", 310)\n .attr(\"y2\", 310)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n line3_2\n .transition()\n .duration(0)\n .attr(\"y1\", 310)\n .attr(\"y2\", 310)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n line4_2\n .transition()\n .duration(0)\n .attr(\"y1\", 310)\n .attr(\"y2\", 310)\n .attr(\"x1\", 70)\n .attr(\"x2\", 70)\n .attr(\"stroke\", \"white\")\n\n rtlabt90\n .transition()\n .duration(0)\n .attr(\"y\", 100)\n .attr(\"x\", -150)\n .attr(\"dy\", \"0em\")\n .text(\"\");\n\n rtlabt50\n .transition()\n .duration(0)\n .attr(\"y\", 100)\n .attr(\"x\", -150)\n .attr(\"dy\", \"0em\")\n .text(\"\");\n\n rtlabt10\n .transition()\n .duration(0)\n .attr(\"y\", 100)\n .attr(\"x\", -150)\n .attr(\"dy\", \"0em\")\n .text(\"\");\n\n\n // Give these new data to update line\n line\n .datum(dataFilter)\n .transition()\n .duration(500)\n .attr(\"d\", d3.line().curve(d3.curveStepAfter)\n .x(function(d) { return x(d.x) + 70 })\n .y(function(d) { return y(d.y) + 10 })\n )\n .attr(\"stroke\", \"steelblue\")\n }", "function myVis([data,geodata]) {\n // Plot configurations\n const height = 500;\n const width = 600;\n const margin = {top: 80, left: 50, right: 75, bottom: 20};\n\n const plotWidth = width - margin.left - margin.right;\n const plotHeight = height - margin.bottom - margin.top;\n const state_abb=[\"AGS\",\"BC\",\"BCS\",\"CAMP\",\"CHIS\",\"CHIH\",\"COAH\",\"COL\",\"CDMX\",\"DUR\",\"GTO\",\"GUE\",\"HGO\",\"JAL\",\"MICH\",\n \"MOR\",\"MEX\",\"NAY\",\"NL\",\"OAX\",\"PUE\",\"QUER\",\"QROO\",\"SLP\",\"SIN\",\"SON\",\"TAB\",\"TAM\",\"TLAX\",\"VER\",\"YUC\",\"ZAC\"]\n\n var dict_names={}\n for (i = 0; i < 32; i++) {\n dict_names[`${i+1}`] = state_abb[i];\n }\n var dict_longnames={}\n for (i = 0; i < 32; i++) {\n dict_longnames[`${i+1}`] = states[i];\n }\n\n // Geographic Data\n const projection = d3.geoAlbers()\n const geoGenerator = d3.geoPath(projection);\n projection.fitExtent([[0, 0], [650, 500]], geodata);\n projection.fitSize([650,500],geodata);\n\n // Line chart\n // X SCALE , years\n const x_scale = d3.scaleBand()\n .domain(data.map((row)=>row.year_death))\n .range([margin.right, plotWidth + 50]);\n // Y SCALE, rate\n var max_y_domain = d3.max(data, function(d) { return Math.max(d.rate)} );\n const y_scale = d3.scaleLinear()\n .domain([0,max_y_domain]) //\n \t.range([plotHeight,0]);\n\n const xAxis = d3.axisBottom()\n .scale(x_scale);\n xAxis.tickValues([1998, 2003, 2008, 2013, 2017])\n xAxis.tickSize(8);\n xAxis.ticks(5);\n\n const yAxis = d3.axisRight(y_scale);\n yAxis.tickSize(8);\n yAxis.ticks(5);\n\n function state_name (data) {return data.state_name};\n\n // SVG for chart\n const svg_chart = d3.select(\".main\")\n \t.append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right +50)\n .attr(\"height\", height + margin.top + margin.bottom )\n .append(\"g\")\n .attr(\"id\", \"main_g\")\n .attr(\"transform\", `translate(${margin.left}, ${margin.top}) `)\n\n svg_chart.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,400)\")\n .call(xAxis);\n\n // todo` once the chart is back, look at the css style for the ticks, write a css style display none for the\n svg_chart.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", \"translate(555,0)\")\n .call(yAxis);\n\n svg_chart\n .append('text')\n .attr('class', 'label')\n .attr('x', 300)\n .attr('y', 430)\n .attr('text-anchor', 'right')\n .attr('font-size', 15)\n .attr('font-family', 'Karla')\n .attr('font-weight', 'bold')\n .text(\"Year\");\n svg_chart\n .append('text')\n .attr(\"class\", \"label\")\n .attr(\"y\", 600)\n .attr(\"x\", -plotHeight/2 - 100)\n .attr('text-anchor', 'right')\n .attr('font-size', 14)\n .attr(\"transform\", \"rotate(-90)\")\n .attr('font-weight', 'bold')\n .text(\"Rate per 100K inhabitants\")\n\n // Function to draw lines (FROM here https://bl.ocks.org/gordlea/27370d1eea8464b04538e6d8ced39e89#index.html)\n var line = d3.line()\n .x(function(d) {\n return x_scale(d.year_death);\n })\n .y(function(d) { return y_scale(d.rate); }) // set the y values for the line generator\n .curve(d3.curveMonotoneX); // apply smoothing to the line\n\n\n let lines = svg_chart.append(\"g\")\n .attr(\"class\", \"lines\");\n\n // Transform data to have an array\n const lines_data = data.reduce((acc, row) => {\n if (!acc[row.state_name]){\n acc[row.state_name]=[] ;\n }\n\n acc[row.state_name].push(row);\n return acc;\n },{});\n\n var dataByStateByYear = d3.nest()\n \t\t.key(function(d) { return d.fips; })\n \t\t.key(function(d) { return d.year; })\n \t\t.map(data);\n// Some Brute force here :(\nlines_data['Aguascalientes'].abbrev=\"AGS\";lines_data['Baja California'].abbrev=\"BC\";lines_data['Baja California Sur'].abbrev=\"BCS\";\nlines_data['Campeche'].abbrev=\"CAMP\";lines_data['Coahuila'].abbrev=\"COAH\";lines_data['Colima'].abbrev=\"COL\";lines_data['Chiapas'].abbrev=\"CHIS\";\nlines_data['Chihuahua'].abbrev=\"CHIH\";lines_data['Distrito Federal'].abbrev=\"CDMX\";lines_data['Durango'].abbrev=\"DUR\";lines_data['Guanajuato'].abbrev=\"GTO\";\nlines_data['Guerrero'].abbrev=\"GUER\";lines_data['Hidalgo'].abbrev=\"HGO\";lines_data['Jalisco'].abbrev=\"JAL\";lines_data['México'].abbrev=\"MEX\";\nlines_data['Michoacán'].abbrev=\"MICH\";lines_data['Morelos'].abbrev=\"MOR\";lines_data['Nayarit'].abbrev=\"NAY\";lines_data['Nuevo León'].abbrev=\"NL\";\nlines_data['Oaxaca'].abbrev=\"OAX\";lines_data['Puebla'].abbrev=\"PUE\";lines_data['Querétaro'].abbrev=\"QUER\";lines_data['Quintana Roo'].abbrev=\"QROO\";\nlines_data['San Luis Potosí'].abbrev=\"SLP\";lines_data['Sinaloa'].abbrev=\"SIN\";lines_data['Sonora'].abbrev=\"SON\";lines_data['Tabasco'].abbrev=\"TAB\";\nlines_data['Tamaulipas'].abbrev=\"TAMP\";lines_data['Tlaxcala'].abbrev=\"TLAX\";lines_data['Veracruz'].abbrev=\"VER\";lines_data['Yucatán'].abbrev=\"YUC\"\nlines_data['Zacatecas'].abbrev=\"ZAC\";lines_data['National'].abbrev=\"NAT\";\n\n\n// Draw lines\nlines.selectAll(\".state-line\")\n .data(Object.values(lines_data)).enter()\n .append(\"path\")\n .attr(\"class\", \"state-line\")\n .attr(\"d\", d => line((d)))\n .attr(\"stroke\", '#D3D3D3')\n .attr(\"id\", function(d){return `state-path-${Number(d[0][\"cve_edo\"])}`;}\n )\n .attr(\"name\", function(d){return (d[0][\"state_name\"]);}\n )\n .attr( \"abbreviation\", function(d){return (d['abbrev']);})\n .attr(\"class\", \"inactive\")\n .attr(\"stroke-opacity\", 0)\n .attr(\"fill\", \"none\")\n .attr(\"stroke-width\", 1)\n ;\n// Create labels that will be placed at the end of the line\nlines.selectAll(\".myLabels\")\n .data(Object.values(lines_data)) // Source: https://www.d3-graph-gallery.com/graph/connectedscatter_multi.html\n .enter()\n .append('g')\n .append(\"text\")\n .datum(function(d) {return {name: d[\"abbrev\"], value: d[19]['rate'], year: d[19]['year_death'], id:d[19]['cve_edo'] }; }) // keep only the last value of each time serie\n .attr(\"transform\", function(d) { return \"translate(\" + x_scale(d.year) + \",\" + y_scale(d.value) + \")\"; }) // Put the text at the position of the last point\n .attr(\"x\", 3)\n .attr(\"y\", 5)\n .attr(\"id\", function(d){return `state-label-${(d.id)}`;})\n .text(function(d) { return d.name; })\n .attr (\"fill\", \"none\")\n .style(\"font-size\", 15);\n\n // SVG for map\n const svg_map = d3.select(\".main\")\n .append(\"svg\")\n .attr(\"width\", 860)\n .attr(\"height\", 800)\n .attr(\"id\", \"mapcontainer\")\n .append(\"g\")\n .attr(\"transform\", `translate(${margin.left}, ${margin.top}) `);\n\n// This is the line for the national rate\n d3.select(\"#main_g\")\n .selectAll(\"#state-path-33\")\n .attr(\"stroke\", \"red\")\n .attr(\"stroke-width\", 4)\n .style(\"stroke-dasharray\", (\"3, 3\"))\n .attr(\"stroke-opacity\", .8);\n// And its label\n d3.select(\"#main_g\")\n .selectAll(\"#state-label-33\")\n .attr(\"fill\", \"red\")\n\n// Add a tooltip for mouseover\nvar tooltip = d3.select(\"body\").append(\"main\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n\n// I was playing with these colors for the choropleth\nvar green = [\"#f0f9e8\", \"#bae4bc\", \"#7bccc4\", \"#2b8cbe\"]\nvar blue = [ '#d2e2f0','#90b8da','#4d8dc3', '#2171b5']\nvar orange = ['#ffffd4','#fed98e','#fe9929','#cc4c02']\n var color = d3.scaleThreshold()\n \t\t.domain([4.3, 6.9, 7.5, 12]) // These are the thresolds for quantiles. Should be in a function\n \t\t.range(blue);\n\nvar stateshapes = svg_map.selectAll(\".state\")\n .data(geodata.features)\n .enter()\n .append('path')\n .attr(\"d\", geoGenerator)\n .attr(\"id\", function(d) { return Number(d['properties'][\"CVE_ENT\"])} )\n .attr(\"state-name\", function(d) { return (d['properties'][\"NOM_ENT\"])} )\n .attr('stroke', 'black')\n .attr('fill', function(d) {\n\t\t\t return color(d['properties'][\"Rate_2017\"])})\n .attr(\"opacity\", \".7\")\n .on(\"click\", function(d){\n var id = d3.select(this).attr('id')\n var activeClass = \"active\"; // Source for this part https://jaketrent.com/post/d3-class-operations/\n var alreadyIsActive = d3.select(this).classed(activeClass);\n d3.select(this)\n .classed(activeClass, !alreadyIsActive);\n d3.select(this)\n .attr(\"stroke-width\", d=> alreadyIsActive? .7: 2.5)\n .attr(\"stroke\", \"black\")\n .attr(\"fill-opacity\", \".8\")\n\n //console.log(id)\n d3.select(\"#main_g\").selectAll(`#state-path-${id}`)\n .attr(\"stroke\", alreadyIsActive? \"#D3D3D3\" : color(d['properties'][\"Rate_2017\"]))\n .attr(\"stroke-width\", alreadyIsActive? 1 : 3.5)\n\n .attr(\"stroke-opacity\", alreadyIsActive? 0: .8);\n d3.select(\"#main_g\")\n .selectAll(`#state-label-${id}`)\n .attr(\"fill\", alreadyIsActive ? \"#FF000000\" : \"black\" )\n });\n// Show the historic ranking with mouseover\n//Source for this part of the code: http://bl.ocks.org/dougdowson/9832019\nstateshapes.on(\"mouseover\", function(d) {\n\t\t\ttooltip.transition()\n\t\t\t.duration(250)\n\t\t\t.style(\"opacity\", .7);\n\t\t\ttooltip.html(\n\t\t\t\"<p><strong>\" + dict_longnames[d['properties']['NOM_ENT']] + \"</strong></p>\" +\n\t\t\t\"<table><tbody><tr><td class='wide'>Ranking 1998:</td><td>\" + d['properties']['Ranking_19'] + \"</td></tr>\" +\n\t\t\t\"<tr><td>Ranking 2017:</td><td>\" + d['properties']['Ranking_20'] + \"</td></tr>\" +\n\t\t\t\"<tr><td>Rate 2017:</td><td>\" + (d['properties']['Rate_2017']).toFixed(1) + \"</td></tr></tbody></table>\"\n\t\t\t)\n\t\t\t.style(\"left\", (d3.event.pageX + 15) + \"px\")\n\t\t\t.style(\"top\", (d3.event.pageY - 28) + \"px\");\n\n d3.select(this)\n .attr(\"stroke\", \"black\")\n .attr(\"fill-opacity\", \".4\")}\n )\n\t\t.on(\"mouseout\", function(d) {\n\t\t\ttooltip.transition()\n\t\t\t.duration(250)\n\t\t\t.style(\"opacity\", 0);\n d3.select(this)\n .attr(\"stroke\", \"black\")\n .attr(\"fill-opacity\", \".8\")});\n\n//Create legend for choropleth\nsvg_map.append('rect')\n .attr('class', 'First_quartile')\n .attr('height', 18)\n .attr('width', 18)\n .attr('x', 55)\n .attr('y', 340)\n .attr(\"stroke\", \"black\");\n\nsvg_map.append('rect')\n .attr('class', 'rect Second_quartile')\n .attr('height', 18)\n .attr('width', 18)\n .attr('x', 55)\n .attr('y', 370)\n .attr(\"stroke\", \"black\");\n\nsvg_map.append('rect')\n .attr('class', 'rect Third_quartile')\n .attr('height', 18)\n .attr('width', 18)\n .attr('x', 55)\n .attr('y', 400)\n .attr(\"stroke\", \"black\");\n\nsvg_map.append('rect')\n .attr('class', 'rect Fourth_quartile')\n .attr('height', 18)\n .attr('width', 18)\n .attr('x', 55)\n .attr('y', 430)\n .attr(\"stroke\", \"black\");\n\nsvg_map.append('text')\n .attr('class', 'label')\n .attr('x', 55)\n .attr('y', 300)\n .attr('text-anchor', 'right')\n .attr('font-size', 18)\n .attr('font-family', 'Karla')\n .attr('font-weight', 'bold')\n .text(\"Rates of Suicide\");\n\nsvg_map.append('text')\n .attr('class', 'label')\n .attr('x', 55)\n .attr('y', 300)\n .attr('text-anchor', 'right')\n .attr('font-size', 18)\n .attr('font-family', 'Karla')\n .attr('font-weight', 'bold')\n .attr(\"dy\", \"1em\")\n .text(\"(State Quartiles)\")\n\nsvg_map.append('text')\n .attr('class', 'label')\n .attr('x', 80)\n .attr('y', 355)\n .attr('text-anchor', 'right')\n .attr('font-size', 16)\n .attr('font-family', 'Karla')\n .text(\"< 4.3\");\n\nsvg_map.append('text')\n .attr('class', 'label')\n .attr('x', 80)\n .attr('y', 385)\n .attr('text-anchor', 'right')\n .attr('font-size', 16)\n .attr('font-family', 'Karla')\n .text(\"4.3 < X < 6.9\");\n\nsvg_map.append('text')\n .attr('class', 'label')\n .attr('x', 80)\n .attr('y', 415)\n .attr('text-anchor', 'right')\n .attr('font-size', 16)\n .attr('font-family', 'Karla')\n .text(\"6.9 < X < 7.5\");\n\nsvg_map.append('text')\n .attr('class', 'label')\n .attr('x', 80)\n .attr('y', 445)\n .attr('text-anchor', 'right')\n .attr('font-size', 16)\n .attr('font-family', 'Karla')\n .text(\"> 7.5\");\n\nsvg_map.append('text')\n .attr('class', 'title')\n .attr('x', 0)\n .attr('y', 0 )\n .attr('text-anchor', 'center')\n .attr('font-size', 28)\n .attr('font-family', 'Karla')\n .text(\"Geographic Distribution of Suicide Occurrences 2017\") ;\n\nsvg_chart.append('text')\n .attr('class', 'title')\n .attr('x', 0)\n .attr('y', height -20 )\n .attr('text-anchor', 'center')\n .attr('font-size', 28)\n .attr('font-family', 'Karla')\n .text(\"Evolution of Suicide Occurrences 1998-2017\") ;\n\nsvg_map.append('text')\n .attr('class', 'x_axis_label')\n .attr('x', (166))\n .attr('y', height )\n .attr('text-anchor', 'right')\n .attr('font-size', 14)\n .attr('font-family', 'Karla')\n .attr('text-anchor', 'middle')\n .text(\"Source: INEGI for death certificates, and CONAPO for population\") ;\n// svg_map.append('text')\n// .attr('class', 'x_axis_label')\n// .attr('x', (126))\n// .attr('y', height )\n// .attr('text-anchor', 'right')\n// .attr('font-size', 14)\n// .attr('font-family', 'Karla')\n// .attr('text-anchor', 'middle')\n// .attr(\"dy\", \"1em\")\n// .text(\"and CONAPO for population\") ;\n\n\n}", "function changeYear() {\n let year = d3.select('#selected').property('value')\n buildMap(stateUrl,year)\n}", "function animate(i, idx) { \n idx = idx + 1;\n if (idx === numCountries) return; //iterate until condition is met\n \n const eachGenderData = generateDataForTime(dataSet[i], idx); //generate each set each country data for the specific gender\n\n d3.select(chartPosition[i]) //chart position\n .datum(eachGenderData) //add data by gender\n .transition() //animate the dataSet\n .duration(ANIMATION_TIME_MS) //country data are added each duration\n .call(chartInfo[i]) //call the chart including info for specific gender\n .on('end',function() { //at the end of the transidition \n animate(i, idx); //call the animate function\n });\n }", "function ready(datapoints) {\n var nested = d3\n .nest()\n .key(function(d) {\n return d.location\n })\n .entries(datapoints)\n\n // xPositionScale domain\n\n var minAge = d3.min(datapoints, function(d) {\n return d.year\n })\n\n var maxAge = d3.max(datapoints, function(d) {\n return d.year\n })\n\n xPositionScale.domain([minAge, maxAge])\n\n container\n .selectAll('.searise-graph')\n .data(nested)\n .enter()\n .append('svg')\n .attr('class', 'searise-graph')\n .attr('height', height + margin.top + margin.bottom)\n .attr('width', width + margin.left + margin.right)\n .append('g')\n .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')')\n .each(function(d) {\n // going through each SVG one by one\n var svg = d3.select(this)\n\n // mid-level scenario\n\n svg\n .append('path')\n .datum(d.values)\n .attr('d', mid)\n .attr('stroke', '#3182bd')\n .attr('stroke-width', 2)\n .attr('class', 'mid-scenario-slr')\n .attr('fill', 'none')\n\n // high-level scenario\n\n svg\n .append('path')\n .datum(d.values)\n .attr('d', high)\n .attr('stroke', '#9ecae1')\n .attr('stroke-width', 2)\n .attr('class', 'high-scenario-slr')\n .attr('fill', 'none')\n\n // Title\n\n svg\n // .attr('transform', `rotate(-5 0 ${height})`)\n .append('text')\n .attr('font-size', 12)\n .attr('y', -5)\n .attr('x', width / 2)\n .attr('text-anchor', 'middle')\n .attr('fill', 'black')\n .attr('font-weight', 'bold')\n .attr('font-family', 'Arial')\n .text(function(d) {\n return d.key\n })\n\n svg\n .append('text')\n .attr('font-size', 11)\n .attr('y', 75)\n .attr('x', 75)\n .attr('fill', '#9ecae1')\n .attr('font-family', 'Arial')\n .text('highest')\n\n\n // Axis\n var xAxis = d3\n .axisBottom(xPositionScale)\n .tickFormat(d3.format(''))\n .tickSize(-height)\n .tickValues([2025,2050,2075,2100])\n\n svg\n .append('g')\n .attr('class', 'axis x-axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(xAxis)\n\n\n var yAxis = d3\n .axisLeft(yPositionScale)\n .tickFormat(d => d3.format(',')(d) + 'ft')\n .tickSize(-width)\n .tickValues([2,4,6,8])\n\n\n svg\n .append('g')\n .attr('class', 'axis y-axis')\n .call(yAxis)\n\n\n \n d3.selectAll('.x-axis line')\n .attr('stroke-dasharray', '2 3')\n .attr('stroke-linecap', 'round')\n\n d3.selectAll('.y-axis line')\n .attr('stroke-dasharray', '2 3')\n .attr('stroke-linecap', 'round')\n \n\n // REMOVE THOSE THINGS\n\n d3.selectAll('.x-axis .domain').remove()\n d3.selectAll('.y-axis .domain').remove()\n\n\n })\n}", "function transition2016() {\n \n svgc.selectAll(\"rect\") //Select the rect\n .data(dataset_2016) \n .transition() // Adding a transition\n .duration(700) //with duration and delay\n .delay(function (d, i){return i*100;})\n .attr(\"y\", function(d) { return yScale(d.Frequency);}) //Sending the Frequency to y\n .attr(\"height\", function(d) { return height - yScale(d.Frequency); }); //in order to get pixels\n \n}", "drawPlot() {\n let parent = this;\n let svgSelect = d3.select(\"#vis-8-svg\");\n let groupSelect = svgSelect.selectAll(\".yearGroup\").data(this.data)\n .join(\"g\")\n .attr(\"class\", \"yearCircles\");\n groupSelect.each(function(d, i) {\n d3.select(this).selectAll(\".yearHiddenLine\").data(d => [d])\n .join(\"line\")\n .attr(\"class\", \"yearHiddenLine\")\n .attr(\"x1\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"x2\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"y1\", d => parent.scaleNumFires(parent.scaleNumFires.domain()[0]))\n .attr(\"y2\", d => parent.scaleNumFires(parent.scaleNumFires.domain()[1]));\n d3.select(this).selectAll(\".yearLine\").data(d => [d])\n .join(\"line\")\n .attr(\"class\", \"yearLine\")\n .attr(\"x1\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"x2\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"y1\", d => parent.scaleNumFires(parent.scaleNumFires.domain()[0]))\n .attr(\"y2\", d => parent.scaleNumFires(parent.scaleNumFires.domain()[1]));\n d3.select(this).selectAll(\".numFires\").data(d => [d])\n .join(\"circle\")\n .attr(\"class\", \"numFires\")\n .attr(\"r\", 6)\n .attr(\"cx\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"cy\", d => parent.scaleNumFires(d.numFires));\n d3.select(this).selectAll(\".totalAcres\").data(d => [d])\n .join(\"circle\")\n .attr(\"class\", \"totalAcres\")\n .attr(\"r\", 6)\n .attr(\"cx\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"cy\", d => parent.scaleTotalAcres(d.totalAcres));\n\n d3.select(this).selectAll(\".yearNumber\").data(d => [d])\n .join(\"text\")\n .attr(\"class\", \"yearNumber\")\n .attr(\"x\", d => parent.scaleYears(new Date(d.year, 0, 1)) - 10)\n .attr(\"y\", d => parent.scaleNumFires(parent.scaleNumFires.domain()[0] + 1000))\n .text(d => d.year);\n\n\n\n });\n groupSelect.on(\"mouseover\", function(event, d) {\n d3.select(this).selectAll(\".numFires\")\n .classed(\"numFires-hover\", true)\n .attr(\"r\", 8);\n d3.select(this).selectAll(\".totalAcres\")\n .classed(\"totalAcres-hover\", true)\n .attr(\"r\", 8);\n d3.select(this).selectAll(\".yearLine\")\n .classed(\"yearLine-hover\", true);\n d3.select(this).selectAll(\".yearNumber\")\n .classed(\"yearNumber-hover\", true);\n\n //Display Tooltip:\n let tooltip = d3.select(\"#national-tooltip\");\n tooltip.style(\"opacity\", 0);\n\n let year = d.year;\n let numFires = parent.numberWithCommas(d.numFires);\n let totalAcres = parent.numberWithCommas(d.totalAcres);\n\n //Populate header:\n tooltip.select(\".card-title\").select(\"span\").text(year);\n //populate body:\n tooltip.select(\".card-body\").selectAll(\"span\").data([numFires, totalAcres])\n .text(d => d);\n\n //Tooltip transition and position:\n tooltip\n .style(\"left\", (event.pageX + 20) + 'px')\n .style(\"top\", (event.pageY + 20) + 'px')\n .classed(\"d-none\", false)\n .style(\"opacity\", 1.0)\n .style(\"transform\", \"scale(1)\");\n tooltip.select(\".card\").raise();\n\n\n })\n .on(\"mouseout\", function(event, d) {\n d3.select(this).selectAll(\".numFires\")\n .classed(\"numFires-hover\", false)\n .attr(\"r\", () => parent.isHighlightNumFires ? 10 : 6);\n d3.select(this).selectAll(\".totalAcres\")\n .classed(\"totalAcres-hover\", false)\n .attr(\"r\", () => parent.isHighlightTotalAcres ? 10 : 6);\n d3.select(this).selectAll(\".yearLine\")\n .classed(\"yearLine-hover\", false);\n d3.select(this).selectAll(\".yearNumber\")\n .classed(\"yearNumber-hover\", false);\n\n //Remove tooltip:\n let tooltip = d3.select(\"#national-tooltip\")\n .style(\"opacity\", 0)\n .classed(\"d-none\", true)\n .style(\"transform\", \"\");\n })\n }", "function change_franchise(newData) {\n\n\t//\n var makeSomeDots = movie_dots.selectAll(\".movie_dot\")\n .data(newData)\n\n// section workingwith dots representing movies in a franchise\n\n\t// add new individual movie dots\n\tmakeSomeDots\n\t\t.enter().append(\"circle\")\n\t\t.attr(\"class\", \"movie_dot\")\n\t\t.attr(\"cx\", function (d) {return x(d.releaseDate); } )\n\t\t.attr(\"cy\", function (d) {return y(d.tomatoScore); } )\n\t\t.attr(\"r\", function (d) {\n\t\t\tif (d.tomatoScore > 2) { \n\t\t\t\treturn Math.sqrt(d.tomatoScore) + 1\n\t\t\t\t} else {\n\t\t\t\t\treturn 3\n\t\t\t}}) \n\t\t.style(\"fill\", function (d) {\n\t\t\tif(d.tomatoScore < 10) { return \"purple\"} \n\t\t\t\telse \n\t\t\t{if(d.tomatoScore > 69) { return \"green\" } \n\t\t\t\telse { return \"red\"}\n\t\t\t}\n\t\t});\n\n\t// update existing movie dots\n\tmakeSomeDots\n .attr(\"cx\", function (d) { return x(d.releaseDate); })\n .attr(\"cy\", function (d) { return x(d.tomatoScore); })\n .attr(\"r\", function (d) {\n\t\t\tif (d.tomatoScore > 2) { \n\t\t\t\treturn Math.sqrt(d.tomatoScore) + 1\n\t\t\t\t} else {\n\t\t\t\t\treturn 3\n\t\t\t}}) \t\n .style(\"fill\", colorTheDots)\n .style(\"stroke-width\", ringAttr)\n ;\n\n\t// remove old and unused movie dots\n\tmakeSomeDots\n\t\t.exit()\n\t\t.remove();\n\n// section for working with text associated with individual move dots\n\n\t// create the \"g\" element for all movie titles\n\tvar movie_titles = main.append(\"g\")\n\t\t.attr(\"class\", \"movie_titles\");\n\n\t// create the individual title text for each movie\n\tmovie_titles.selectAll(\".movie_title\")\n\t\t.data(data)\n\t\t.enter().append(\"text\")\n\t\t.attr(\"class\", \"movie_title\")\n\t\t.attr(\"x\", function (d) {return x(d.releaseDate); })\n\t\t.attr(\"y\", function (d) {return y(d.tomatoScore); })\n\t\t.attr(\"text-anchor\", function (d) {\n\t\t\tif(x(d.releaseDate) < (width / 2)) {return \"left\"}\n\t\t\t\telse {return \"end\"}\n\t\t})\n\t\t.attr(\"dy\", function (d) {\n\t\t\treturn -Math.sqrt(d.tomatoScore)\n\t\t})\n\t\t.text(function (d) {return d.movieTitle; });\n\n}", "function transitionData()\n\t{\n\t\tvar index = 0;\n\t\td3.select(\"#viewCounter\").text(titles[viewCounter]);\n\t\t\n\t\tif ( viewCounter == 0 ) {\n\t\t\t \n\t\t\t// opening page ... \n\t\t}\n\t\telse if ( viewCounter == 1 ) {\n\t\t\t \n\t\t\td3.selectAll(\".dots1\")\n\t\t\t\t.transition()\n\t\t\t\t.duration(2500)\n\t\t\t\t.attr(\"r\", function (d,i) { return circleScale(+d.markersize_2); })\n\t\t\t \t.style(\"fill\" , function(d,i){ return colors[d.color_2]; })\n\t\t\t\t.style(\"stroke\" , function(d,i){\n\t\t\t\t\t if ( d.color_2 == 0 ) { return \"none\"; }\n\t\t\t\t\telse if ( d.color_2 == 1 ) { return colors[d.color_2]; }\n\t\t\t\t\telse if ( d.color_2 == 2 ) { return \"white\"; }\n\t\t\t\t})\n\t\t\t\t.style(\"stroke-width\" , function(d,i){ \n\t\t\t\t\tif ( d.color_2 == 0 ){ return \"0px\"; }\n\t\t\t\t\telse { return \"2px\"; }\n\t\t\t\t})\n\t\t\t\t.style(\"fill-opacity\" , function(d,i){ \n\t\t\t\t\tif ( d.color_2 == 0 ){ return 0.25; }\n\t\t\t\t\telse { return 0.75; }\n\t\t\t\t});\n\t\t\t\t\n\t\t\t var sel = d3.selectAll(\".dots1.view1\");\n\t\t\t sel.moveToFront();\n\t\t\t var sel = d3.selectAll(\".mainTweet\");\n\t\t\t sel.moveToFront();\n\t\t\t\t\t\n\t\t}// end else if ... \n\t\t\n\t\telse if ( viewCounter == 2 ) {\n\t\t\t \n\t\t\td3.selectAll(\".dots1\")\n\t\t\t\t.transition()\n\t\t\t\t.duration(2500)\n\t\t\t\t.attr(\"r\", function (d,i) { return circleScale(+d.markersize_3); })\n\t\t\t \t.style(\"fill\" , function(d,i){ return colors[d.color_3]; })\n\t\t\t\t.style(\"stroke\" , function(d,i){\n\t\t\t\t\tif ( d.index == 33 ) { return \"#FFFFFF\"; }\n\t\t\t\t\telse if ( calloutIndexes[2].indexOf(+d.index) != -1 ) { return \"#FFFFFF\"; }\n\t\t\t\t\telse { return colors[d.color_3]; }\n\t\t\t\t})\n\t\t\t\t.style(\"stroke-width\" , function(d,i){ \n\t\t\t\t\tif ( d.color_3 == 0 ){ return \"0px\"; }\n\t\t\t\t\telse { return \"2px\"; }\n\t\t\t\t})\n\t\t\t\t.style(\"fill-opacity\" , function(d,i){ \n\t\t\t\t\tif ( d.color_3 == 0 ){ return 0.25; }\n\t\t\t\t\telse { return 0.75; }\n\t\t\t\t}); \n\t\t\t\t\n\t\t\t var sel = d3.selectAll(\".dots1.view2\");\n\t\t\t sel.moveToFront();\t\n\t\t\t var sel = d3.selectAll(\".mainTweet\");\n\t\t\t sel.moveToFront();\t\t\n\t\n\t\t}// end else if ... \t\n\t\t\n\t\telse if ( viewCounter == 3 ) {\n\t\t\t \n\t\t\td3.selectAll(\".dots1\")\n\t\t\t\t.transition()\n\t\t\t\t.duration(2500)\n\t\t\t\t.attr(\"r\", function (d,i) { return circleScale(+d.markersize_4); })\n\t\t\t \t.style(\"fill\" , function(d,i){ return colors[d.color_4]; })\n\t\t\t\t.style(\"stroke\" , function(d,i){\n\t\t\t\t\tif ( d.index == 33 ) { return \"#FFFFFF\"; }\n\t\t\t\t\telse if ( calloutIndexes[3].indexOf(+d.index) != -1 ) { return \"#FFFFFF\"; }\n\t\t\t\t\telse { return colors[d.color_4]; }\n\t\t\t\t})\n\t\t\t\t.style(\"stroke-width\" , function(d,i){ \n\t\t\t\t\tif ( d.color_4 == 0 ){ return \"0px\"; }\n\t\t\t\t\telse { return \"2px\"; }\n\t\t\t\t})\n\t\t\t\t.style(\"fill-opacity\" , function(d,i){ \n\t\t\t\t\tif ( d.color_4 == 0 ){ return 0.25; }\n\t\t\t\t\telse { return 0.75; }\n\t\t\t\t});\n\t\t\t\t\n\t\t\t var sel = d3.selectAll(\".dots1.view3\");\n\t\t\t sel.moveToFront();\t\n\t\t\t var sel = d3.selectAll(\".mainTweet\");\n\t\t\t sel.moveToFront();\n\t\t\t\t\n\t\t} // end else if ... \t\n\t\t\n\t\tdrawLegend();\n\t\t\n\t\treturn;\n\t \n\t}// end transitionData()", "function page2() {\n d3.select(\".page2\").selectAll(\"*\")\n .remove();\n heatmapHeight = .7*windowHeight\n var page2 = d3.select(\".page2\");\n var page2_svg = page2.append(\"svg\")\n .attr(\"id\", \"page2_svg\")\n .attr(\"height\", heatmapHeight*1.05)\n .attr(\"width\", heatmapWidth)\n var page2_plot = page2_svg.append(\"g\")\n .attr(\"id\", \"page2_plot\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n var page2_slider = page2.append(\"div\")\n .attr(\"id\", \"yearslider\")\n .style(\"display\", \"inline\")\n .style(\"margin-left\", \"5.5%\");\n lineGraphTitle = page2_svg.append(\"text\")\n .attr(\"id\", \"lineGraphTitle\")\n .attr(\"x\", heatmapWidth / 2 + 50)\n .attr(\"y\", 0.075 * heatmapHeight)\n .style(\"font-family\", \"Cubano-Reg, sans-serif\")\n .style(\"font-size\", 15)\n .style(\"letter-spacing\", 2)\n .style(\"font-weight\", \"bold\")\n .style(\"text-anchor\", \"middle\");\n var data_option = d3.select(\"#dropdown\").node().value;\n updateLineGraphTitle(data_option, sliderBounds[data_option][0])\n drawLineGraph(data_option, sliderBounds[data_option][0]);\n generateSlider(\".page2\", sliderBounds[data_option][0],\n sliderBounds[data_option][1], function (val) {\n updateLineGraphTitle(d3.select(\"#dropdown\").node().value,\n val.getFullYear());\n plotYearData(lineGraphData, val.getFullYear());\n });\n}", "function interpolateData(year) {\n return testData.map(function(d) {\n return {\n xPos: d.xPos,\n yPos: d.yPos,\n name: d.name,\n size: d.size,\n region: d.region,\n number: interpolateValues(d.number, year),\n textLabel: setLabel(d.name, d.number, year),\n magnitude: d.magnitude,\n image: d.image,\n caption: d.caption\n };\n });\n }", "function drawYears(){\n var years = [\"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\", \"2010\", \"2011\", \"2012\", \"2013\"];\n\n\t\td3.selectAll(\".time_frame_lable\").remove();\n\t\tvar time_frame_label = top_svg.append(\"g\")\n\t\t\t\t\t\t\t\t .attr(\"class\", \"time_frame_lable\")\n\t\t\t\t\t\t\t\t .attr(\"x\",0)\n\t\t\t\t\t\t\t\t .attr(\"y\", 360)\n\t\t\t\t\t\t\t\t .selectAll(\"text\")\n\t\t\t\t\t\t\t\t .data(function(){return years;})\n\t\t\t\t\t\t\t\t.enter().append(\"text\")\n\t\t\t\t\t\t\t\t .text(function(d,i){return years[i];})\n\t\t\t\t\t\t\t\t .attr(\"x\", function(d,i) {return i*95 + 40;})\n\t\t\t\t\t\t\t\t .attr(\"y\", function(d,i){if ((i>=GLOBALS.time_frame.start-2003)&&(i<=GLOBALS.time_frame.end-2003)){return yheight-8}else{return yheight-3}})\n\t\t\t\t\t\t\t\t .attr(\"font-family\", \"sans-serif\")\n\t\t\t\t\t\t\t\t .attr(\"font-size\", 14)\n\t\t\t\t\t\t\t\t .attr(\"fill\", function(d,i){if ((i>=GLOBALS.time_frame.start-2003)&&(i<=GLOBALS.time_frame.end-2003)){return \"red\"}else{return \"black\"}})\n\t\t\t\t\t\t\t\t ;\n\t}", "function drawYears(){\n var years = [\"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\", \"2010\", \"2011\", \"2012\", \"2013\"];\n\n\t\td3.selectAll(\".time_frame_lable\").remove();\n\t\tvar time_frame_label = top_svg.append(\"g\")\n\t\t\t\t\t\t\t\t .attr(\"class\", \"time_frame_lable\")\n\t\t\t\t\t\t\t\t .attr(\"x\",0)\n\t\t\t\t\t\t\t\t .attr(\"y\", 360)\n\t\t\t\t\t\t\t\t .selectAll(\"text\")\n\t\t\t\t\t\t\t\t .data(function(){return years;})\n\t\t\t\t\t\t\t\t.enter().append(\"text\")\n\t\t\t\t\t\t\t\t .text(function(d,i){return years[i];})\n\t\t\t\t\t\t\t\t .attr(\"x\", function(d,i) {return i*95 + 40;})\n\t\t\t\t\t\t\t\t .attr(\"y\", function(d,i){if ((i>=GLOBALS.time_frame.start-2003)&&(i<=GLOBALS.time_frame.end-2003)){return yheight-8}else{return yheight-3}})\n\t\t\t\t\t\t\t\t .attr(\"font-family\", \"sans-serif\")\n\t\t\t\t\t\t\t\t .attr(\"font-size\", 14)\n\t\t\t\t\t\t\t\t .attr(\"fill\", function(d,i){if ((i>=GLOBALS.time_frame.start-2003)&&(i<=GLOBALS.time_frame.end-2003)){return \"red\"}else{return \"black\"}})\n\t\t\t\t\t\t\t\t ;\n\t}", "function drawXY(){\r\n//setting the x and y domains\r\n x.domain([d3.min(cars, function(d) { return d.year; }), d3.max(cars, function(d) { return d.year; })]);\r\n y.domain([d3.min(cars, function(d) { return d.power; }), d3.max(cars, function(d) { return d.power; })]);\r\n\r\n//setting the yPosition \r\n var yPos = height -20;\r\n//creating the x-Axis\r\n chart.append(\"g\")\r\n\t .attr(\"class\", \"xaxis\")\r\n\t .attr(\"transform\", \"translate(0,\" + yPos + \")\")\r\n\t .call(xAxis);\r\n//creating the Y-axis\r\n chart.append(\"g\")\r\n\t .attr(\"class\", \"yaxis\")\r\n\t .attr(\"transform\", \"translate(480,0)\")\r\n\t .call(yAxis);\r\n\r\n \r\n//selecting ths dot \r\n//adding attributes\t\r\n chart.selectAll(\".dot\")\r\n\t .data(cars)\r\n\t .enter().append(\"circle\")\r\n\t .attr(\"class\", \"dot\")\r\n\t .attr(\"cx\", function(d) { return x(d.year); })\r\n\t .attr(\"cy\", function(d) { return y(d.power); })\r\n\t .attr(\"r\", 3)\r\n\t \r\n//the mouseover function that fills the dots red when the mouse is over them\r\n\t .on(\"mouseover\", function(){\r\n\t\t\td3.select(this)\r\n\t\t\t.attr(\"fill\", \"red\")\r\n\t })\r\n//the mouseout function that changes the dots back to normal color\r\n\t.on(\"mouseout\", function(){\r\n\t\td3.select(this)\r\n\t\t.attr(\"fill\", \"black\")\r\n\t\t\r\n})\r\n\t\r\n \r\n}", "function ready(datapoints) {\n // Group your data together\n var nested = d3\n .nest()\n .key(d => d.Year)\n .entries(datapoints)\n // console.log(nested)\n\n // pull out ages on x axis\n var ages = datapoints.map(d => d.Age)\n xPositionScale.domain(d3.extent(ages))\n\n // Draw your lines\n container\n .selectAll('.fertility-svg')\n .data(nested)\n .enter()\n .append('svg')\n .attr('class', 'fertility-svg')\n .attr('height', height + margin.top + margin.bottom)\n .attr('width', width + margin.left + margin.right)\n .append('g')\n .attr('transform', `translate(${margin.left},${margin.top})`)\n .each(function(d) {\n var svg = d3.select(this)\n\n var datapoints = d.values\n // console.log(datapoints)\n\n let rateUS = d3.sum(datapoints, d => +d.ASFR_us).toFixed(2)\n let rateJP = d3.sum(datapoints, d => +d.ASFR_jp).toFixed(2)\n\n // Add your pathes\n svg\n .append('path')\n // why I cannot use .data(datapoints)\n .datum(datapoints)\n .attr('d', line_us)\n .attr('stroke', 'lightblue')\n .attr('fill', 'lightblue')\n .attr('opacity', 0.6)\n\n svg\n .append('path')\n .datum(datapoints)\n .attr('d', line_jp)\n .attr('stroke', 'red')\n .attr('fill', 'red')\n .attr('opacity', 0.4)\n .lower()\n\n // Add your notations\n svg\n .append('text')\n .attr('x', (width * 3) / 4)\n .attr('y', height / 2)\n .attr('text-anchor', 'middle')\n .style('font-size', 8)\n .attr('stroke', 'lightblue')\n .attr('fill', 'lightblue')\n .attr('opacity', 0.6)\n .text(rateUS)\n\n svg\n .append('text')\n .attr('x', (width * 3) / 4)\n .attr('y', height / 2 + 10)\n .attr('text-anchor', 'middle')\n .style('font-size', 8)\n .attr('stroke', 'red')\n .attr('fill', 'red')\n .attr('opacity', 0.4)\n .text(rateJP)\n\n // Add your title\n svg\n .append('text')\n .attr('x', width / 2)\n .attr('y', 0 - margin.top / 2)\n .attr('text-anchor', 'middle')\n .style('font-size', 10)\n .text(d.key)\n\n // Add your axes\n var xAxis = d3.axisBottom(xPositionScale).tickValues([15, 30, 45])\n\n svg\n .append('g')\n .attr('class', 'axis x-axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(xAxis)\n\n var yAxis = d3\n .axisLeft(yPositionScale)\n .tickValues([0.0, 0.1, 0.2, 0.3])\n .ticks(4)\n\n svg\n .append('g')\n .attr('class', 'axis y-axis')\n .call(yAxis)\n })\n}", "function init() {\n \n // + SCALES\n\n xScale = d3.scaleTime()\n .domain(d3.extent(state.data, d=> d.year)) // getFullYear() function to parse only the year\n .range([margin.left, width - margin.right])\n \n\n yScale = d3.scaleLinear()\n .domain(d3.extent(state.data, d => d.death_count))\n .range([height - margin.bottom, margin.bottom])\n\n// + AXES \nconst x = d3.axisBottom(xScale) \nconst y = d3.axisLeft(yScale)\n\n//Create the svg\n\nsvg = d3.select(\"#d3-container\")\n.append(\"svg\")\n.attr(\"width\", width)\n.attr(\"height\",height)\n\n// + UI ELEMENT SETUP\n// add labels - xAxis\n // + CALL AXES\nconst xAxisGroup = svg.append(\"g\")\n.attr(\"class\", 'xAxis')\n.attr(\"transform\", `translate(${0}, ${height - margin.bottom})`) // move to the bottom\n.call(x)\n\nconst yAxisGroup = svg.append(\"g\")\n.attr(\"class\", 'yAxis')\n.attr(\"transform\", `translate(${margin.left}, ${0})`) // align with left margin\n.call(y)\n\n// add labels - xAxis\nxAxisGroup.append(\"text\")\n.attr(\"class\", 'axis-title')\n.attr(\"x\", width / 2)\n.attr(\"y\", 40)\n.attr(\"text-anchor\", \"middle\")\n.style(\"fill\",\"#FFFF00\")\n.style(\"font\", \"15px courier,arial,helvetica\")\n.text(\"Year\")\n\n// add labels - yAxis\nyAxisGroup.append(\"text\")\n.attr(\"class\", 'axis-title')\n.attr(\"x\", -40)\n.attr(\"y\", height / 2)\n.attr(\"writing-mode\", \"vertical-rl\")\n.attr(\"text-anchor\", \"middle\")\n.style(\"fill\",\"#FFFF00\")\n.style(\"font\", \"15px courier,arial,helvetica\")\n.text(\"Deaths per Year\")\n\n// append a new group, g stands for group\nsvg.append(\"g\")\n.attr(\"class\", \"xAxis\")\n.attr(\"transform\", `translate(${0},${height-margin.bottom})`)\n.call(x)\n\nsvg.append(\"g\")\n.attr(\"class\", \"yAxis\")\n.attr(\"transform\", `translate(${margin.left},${0})`)\n.call(y)\n\n\n// Setting up the UI Elements\n\n /** const selectElement = d3.select(\"#dropdown\").on(\"change\", function() {\n\n state.selection = this.value; // + UPDATE STATE WITH YOUR SELECTED VALUE\n console.log(\"new value is\", this.value);\n\n selectElement\n .selectAll(\"option\")\n .data([\"All\", \"1\", \"2\", \"3\"]) // + ADD DATA VALUES FOR DROPDOWN\n .join(\"option\")\n .attr(\"value\", d => d)\n .text(d => d);\n\n\n\n draw(); // re-draw the graph based on this new selection\n }); */\n\n \n const selectElement = d3.select(\"#dropdown\")\n\n // add in dropdown options from the unique values in the data\n selectElement.selectAll(\"option\")\n .data([\n \n // add in all the unique values from the dataset\n ...new Set(state.data.map(d => d.death_cause))])\n .join(\"option\")\n .attr(\"attr\", d => d)\n .text(d => d)\n\n selectElement.on(\"change\", event =>{\n\n state.selection = event.target.value\n draw();\n\n})\n\n draw(); // calls the draw function\n}", "function update(data) {\n\n // DATA JOIN\n // Join new data with old elements, if any.\n gemCircles = svgGroup.selectAll(\".gemCircle\")\n .data(data);\n\n text = svgGroup.selectAll(\"text\")\n .data(data);\n\n\n // UPDATE\n // Update old elements as needed.\n gemCircles.transition()\n .duration(750);\n text.transition()\n .duration(750);\n\n //delete all old lines\n d3.selectAll(\".line\").remove();\n var line = d3.svg.line()\n .x(function(d) {\n return d.x;\n })\n .y(function(d) {\n return d.y;\n })\n .interpolate(\"bundle\")\n .tension(sliderVal);\n\n\n // draw all lines\n _.forEach(data, function(obj){\n _.forEach(obj[\"connections\"], function(elem, i){ //e.g. elem = 0-1\n var moveFromTo = i.split(\"-\"); // split \"0-2\" = i into {0, 2} 0= from 2 = to\n var from = moveFromTo[0];\n var to = moveFromTo[1];\n var reverseKey = to + \"-\" + from; //make \"2-3\" from i = \"3-2\"\n\n //draw line\n _.forEach(elem[\"pathEnds\"], function(item, j){ //all path elements -> array with 0-7 e.g.\n var numOfPeople = (Math.abs(elem[\"delta\"]) > alphaLimit) ? alphaLimit : Math.abs(elem[\"delta\"]);\n var alphaMap = d3.scale.linear() //map number of people to an alpha value\n .domain([1, 100])\n .range([0.15, 1]);\n var strokeColor = \"rgba(254, 255, 223,\" + alphaMap(numOfPeople) + \")\";\n\n //prohibit program to draw double lines\n if (from >= to){\n var x = data[to][\"connections\"][reverseKey][\"pathEnds\"][j][\"x\"];\n var y = data[to][\"connections\"][reverseKey][\"pathEnds\"][j][\"y\"];\n var path = [];\n //define path animation direction\n if (data[to][\"connections\"][reverseKey][\"delta\"] < 0){\n path[0] = {\"x\": item[\"x\"] , \"y\": item[\"y\"]};\n path[1] = { x: bgCircCenterX, y: bgCircCenterY }; //center of circle as control point\n path[2] = {\"x\": x , \"y\": y};\n } else {\n path[2] = {\"x\": item[\"x\"] , \"y\": item[\"y\"]};\n path[1] = { x: bgCircCenterX, y: bgCircCenterY }; //center of circle as control point\n path[0] = {\"x\": x , \"y\": y};\n }\n\n\n\n lines = svgGroup.append(\"path\")\n .data(path)\n .attr(\"class\", \"line\")\n .attr(\"d\", line(path))\n .style(\"fill\", \"none\")\n .style(\"stroke-width\", 1)\n .style(\"stroke\", strokeColor)\n .style(\"stroke-dasharray\", \"2\")\n\n\n // lines.data(path)\n // .enter()\n // .append(\"path\")\n // .transition()\n // .duration(750)\n // .style(\"fill-opacity\", 1);\n\n // lines.exit()\n // .transition()\n // .duration(750)\n // .style(\"fill-opacity\", 1e-6) //1e-6 extremly small number -> prohibit flickering ??\n // .remove();\n\n // var lineAttr = lines\n // .attr(\"class\", \"line\")\n // .attr(\"d\", line(path))\n // .style(\"fill\", \"none\")\n // .style(\"stroke-width\", 1)\n // .style(\"stroke\", strokeColor)\n // .style(\"stroke-dasharray\", \"2\")\n\n }\n\n });\n });\n });\n\n\n // ENTER\n // Create new elements as needed.\n gemCircles.enter()\n .append(\"circle\")\n .transition()\n .duration(750)\n .style(\"fill-opacity\", 1);\n\n text.enter()\n .append(\"text\")\n .transition()\n .duration(750)\n .style(\"fill-opacity\", 1);\n\n\n // EXIT\n // Remove old elements as needed.\n gemCircles.exit()\n .transition()\n .duration(750)\n .style(\"fill-opacity\", 0) //1e-6 extremly small number -> prohibit flickering ??\n .remove();\n\n text.exit()\n .transition()\n .duration(750)\n .style(\"fill-opacity\", 0) //1e-6 extremly small number -> prohibit flickering ??\n .remove();\n\n\n\n\n\n //add text to circles\n var offset;\n var textLabels = text\n .attr(\"x\", function(d) {\n offset = 11; // in pixel\n return (rad * Math.cos(d[\"angle\"]) + bgCircCenterX + offset);\n })\n .attr(\"y\", function(d) {\n return (rad * Math.sin(d[\"angle\"]) + bgCircCenterY + 2); //last number = y offset to align text with center of circle\n })\n .text(function(d) {\n return d[\"name\"];\n })\n .attr(\"transform\", function(d) {\n var degrees = d[\"angle\"] * (180/Math.PI);\n return \"rotate(\" + degrees + \" \" + (rad * Math.cos(d[\"angle\"]) + bgCircCenterX) +\",\" + (rad * Math.sin(d[\"angle\"]) + bgCircCenterY) +\")\";\n })\n .attr(\"class\", function(d) {\n return \"label \" + d[\"name\"] ;\n })\n\n\n\n\n //set circle Attributes\n var gemCircAttr = gemCircles\n .each(function(d, i){\n d3.select(this).attr({\n cx: function(){\n return d[\"centerPos\"][\"xM\"];\n },\n cy: function(){\n return d[\"centerPos\"][\"yM\"];\n },\n r: function(d){\n return d[\"circleRad\"];\n }, //todo: write mapping function and set a max size\n fill: function(d) {\n //use mapping function to map trafficCosts to RGB from 0 - 255\n var colorMap = map_range(d[\"trafficcostPerPerson\"], 0, maxTraffCost, 35, 0 ); //hsl 0 -350\n colorMap = Math.floor(colorMap); //and round it to whole numbers to use as rgb\n // console.log(colorMap + \" - \" + d[\"trafficCosts\"]);\n return \"hsla(\" + colorMap + \", 100%, 58%, 0.7)\";\n },\n class: \"gemCircle\"\n })\n .transition()\n .duration(750)\n .style(\"fill-opacity\", 1);\n\n\n\n })\n\n } //update function", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function ready(datapoints) {\n var nested = d3\n .nest()\n .key(function(d) {\n return d.Year\n })\n .entries(datapoints)\n\n container\n .selectAll('.year-graph')\n .data(nested)\n .enter()\n .append('svg')\n .attr('class', 'year-graph')\n .attr('height', height + margin.top + margin.bottom)\n .attr('width', width + margin.left + margin.right)\n .append('g')\n .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')')\n .each(function(d) {\n // which svg are we looking at?\n\n var svg = d3.select(this)\n\n svg\n .append('path')\n .datum(d.values)\n .attr('d', areaUS)\n .attr('stroke', 'none')\n .attr('fill', 'blue')\n .attr('fill-opacity', 0.25)\n\n svg\n .append('path')\n .datum(d.values)\n .attr('d', areaJapan)\n .attr('stroke', 'none')\n .attr('fill', 'red')\n .attr('fill-opacity', 0.25)\n\n svg\n .append('text')\n .text(d.key)\n .attr('x', width / 2)\n .attr('y', 0)\n .attr('font-size', 15)\n .attr('dy', -2)\n .attr('text-anchor', 'middle')\n .attr('font-weight', 'bold')\n\n var datapoints = d.values\n var usSum = d3.sum(datapoints, d => +d.ASFR_us).toFixed(2)\n var japanSum = d3.sum(datapoints, d => +d.ASFR_jp).toFixed(2)\n\n svg\n .append('text')\n .text(usSum)\n .attr('x', xPositionScale(45))\n .attr('y', yPositionScale(0.2))\n .attr('font-size', 13)\n .attr('text-anchor', 'middle')\n .attr('fill', 'blue')\n .attr('font-weight', 'bold')\n\n svg\n .append('text')\n .text(japanSum)\n .attr('x', xPositionScale(45))\n .attr('y', yPositionScale(0.15))\n .attr('font-size', 13)\n .attr('text-anchor', 'middle')\n .attr('fill', 'red')\n .attr('font-weight', 'bold')\n\n var xAxis = d3.axisBottom(xPositionScale).tickValues([15, 30, 45])\n svg\n .append('g')\n .attr('class', 'axis x-axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(xAxis)\n\n var yAxis = d3.axisLeft(yPositionScale).tickValues([0, 0.1, 0.2, 0.3])\n svg\n .append('g')\n .attr('class', 'axis y-axis')\n .call(yAxis)\n })\n}", "function ready(error, data) {\n if (error) throw error;\n\n var margin = 20\n\n xScale.domain([d3.min(data, xValue)-margin, d3.max(data, xValue)+margin]);\n yScale.domain([d3.min(data, yValue)-margin, d3.max(data, yValue)+margin]);\n\n\n // draw dots\n svg.selectAll(\".dot\")\n .data(data)\n .enter().append(\"circle\")\n .attr(\"class\", \"dot\")\n //.attr(\"r\", pointSize)\n .attr(\"r\", function(d) { return topCandidates.includes(d.label) ? pointSize*2.5 : pointSize; })\n .attr(\"cx\", xMap)\n .attr(\"cy\", yMap)\n .style(\"fill\", colorManager)\n .on(\"mouseover\", function(d) {\n tooltip.transition()\n .duration(200)\n .style(\"opacity\", .9);\n tooltip.html(d.name + \"<br/>\" + d.party)\n .style(\"left\", (d3.event.pageX + 5) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n })\n .on(\"mouseout\", function(d) {\n tooltip.transition()\n .duration(500)\n .style(\"opacity\", 0);\n })\n .on(\"click\", function(d) {\n showDetails(d);\n });\n\n}", "function dataViz() {\n let index = document.getElementById(\"whatyear\").value;\n var stats;\n d3.csv(\"js/ADP_Employment_History.csv\").then(function(data) {\n stats = data[index];\n $( \"#data-month\" ).text(stats.month);\n $( \"#data-year\" ).text(stats.year);\n\n $( \"#graph-1-num\" ).text(stats.privateThousands);\n $( \"#graph-2-num\" ).text(stats.goodsThousands);\n $( \"#graph-3-num\" ).text(stats.serviceThousands);\n\n $( \"#graph-1-perc\" ).text(stats.privatePercent);\n $( \"#graph-2-perc\" ).text(stats.goodsPercent);\n $( \"#graph-3-perc\" ).text(stats.servicePercent);\n let privatePerc = mapped(stats.privatePercent,-0.64,0.32,0,900);\n let goodsPerc = mapped(stats.goodsPercent,-0.97,0.42,0,900);\n let servicePer = mapped(stats.servicePercent,-0.47,0.33,0,900);\n\n if (privatePerc > 900) {\n privatePerc = 900;\n }\n\n if (goodsPerc > 900) {\n goodsPerc = 900;\n }\n if (servicePer > 900) {\n servicePer = 900;\n };\n\n if (privatePerc < 300) {\n privatePerc = 300;\n }\n if (goodsPerc < 300) {\n goodsPerc = 300;\n }\n if (servicePer < 300) {\n servicePer = 300;\n };\n\n let graph1 = document.getElementById(\"graph-1-num\");\n let graph2 = document.getElementById(\"graph-2-num\");\n let graph3 = document.getElementById(\"graph-3-num\");\n\n graph1.style.fontVariationSettings = \" 'wght' \" + privatePerc;\n graph2.style.fontVariationSettings = \" 'wght' \" + goodsPerc;\n graph3.style.fontVariationSettings = \" 'wght' \" + servicePer;\n });\n\n //requestAnimationFrame(dataViz);\n}", "function ready(datapoints) {\n let ages = datapoints.map(d => d.Age)\n xPositionScale.domain(d3.extent(ages))\n\n let nested = d3\n .nest()\n .key(d => d.Year)\n .entries(datapoints)\n\n container\n .selectAll('.fertility-graph')\n .data(nested)\n .enter()\n .append('svg')\n .attr('class', 'fertility-graph')\n .attr('height', height + margin.top + margin.bottom)\n .attr('width', width + margin.left + margin.right)\n .append('g')\n .attr('transform', `translate(${margin.left},${margin.top})`)\n .each(function(d) {\n let svg = d3.select(this)\n\n svg\n .append('path')\n .datum(d.values)\n .attr('d', line_jp)\n .attr('stroke', 'lightblue')\n .attr('fill', 'lightblue')\n .attr('stroke-width', 0.5)\n .attr('opacity', 0.6)\n\n svg\n .append('path')\n .datum(d.values)\n .attr('d', line_us)\n .attr('stroke', 'pink')\n .attr('fill', 'pink')\n .attr('stroke-width', 0.5)\n .attr('opacity', 0.9)\n .lower()\n\n svg\n .append('text')\n .text(d.key)\n .attr('font-size', 14)\n .attr('x', width / 2)\n .attr('y', 0)\n .attr('text-anchor', 'middle')\n .attr('dy', -10)\n\n let xAxis = d3.axisBottom(xPositionScale)\n svg\n .append('g')\n .attr('class', 'axis x-axis')\n .attr('transform', `translate(0,${height})`)\n .call(xAxis.ticks(5))\n\n let yAxis = d3.axisLeft(yPositionScale)\n svg\n .append('g')\n .attr('class', 'axis y-axis')\n .call(yAxis.ticks(4))\n })\n}", "function add(){\n addDatapoints(1);\n // we add new code below:\n\n//UPDATE BARS\n\n// we add new code below:\nconsole.log(\"new data\", data)\n\nelementsForPage = graphGroup.selectAll(\".datapoint\").data(data);\n update();\n elementsForPage.transition().duration(1000).attr(\"transform\", function(d, i){//horizontal\n return \"translate(\"+ xScale(d.key)+ \",\" + (h - padding) + \")\"\n });\n elementsForPage.select(\"rect\")\n .attr(\"fill\",\"black\")\n .transition()\n .delay(100)\n .duration(2000)//vertical\n .attr(\"width\", function(){\n return xScale.bandwidth();\n })\n .attr(\"y\", function(d,i){\n return -yScale(d.value);\n })\n .attr(\"height\", function(d, i){\n return yScale(d.value);\n })\n ;\n\n// note, we don't need \"let\" because the variable elementsForPage already exists\nconsole.log(elementsForPage);\n\nlet incomingDataGroups = enteringElements\n .append(\"g\")\n .classed(\"datapoint\", true)\n;\n// position the groups:\nincomingDataGroups.attr(\"transform\", function(d, i){\n return \"translate(\"+ xScale(d.key)+ \",\" + (h - padding) + \")\"\n});\n\n incomingDataGroups\n .append(\"rect\")\n .attr(\"y\", function(d,i){\n return 0;\n })\n .attr(\"height\", function(d, i){\n return 0;\n })\n .attr(\"width\", function(){\n return xScale.bandwidth();\n })\n .transition()\n .delay(120)\n .duration(2000)//pink\n .attr(\"y\", function(d,i){\n return -yScale(d.value);\n })\n .attr(\"height\", function(d, i){\n return yScale(d.value);\n })\n .attr(\"fill\", \"#F27294\")\n ;\n}", "function updateLine(selectedYear) {\n // Create new data with the selection?\n let tradesFilter = JSON.parse(JSON.stringify(trades));\n if (selectedYear == 'All') {\n x.domain(\n d3.extent(prices, function (d) {\n return d3.timeParse('%Y-%m-%d')(d[0]);\n })\n );\n } else {\n let year = Number(selectedYear);\n if (year == Date.today().getFullYear()) {\n x.domain([\n d3.timeParse('%Y-%m-%d')(''.concat(year, '-01-01')),\n d3.timeParse('%Y-%m-%d')(Date.today().toString('yyyy-MM-dd')),\n ]);\n } else {\n x.domain([\n d3.timeParse('%Y-%m-%d')(''.concat(year, '-01-01')),\n d3.timeParse('%Y-%m-%d')(''.concat(year, '-12-31')),\n ]);\n }\n tradesFilter = tradesFilter.filter(\n (d) => Date.parse(d[0]).getFullYear() == year\n );\n }\n xAxis\n .transition()\n .duration(1000)\n .call(d3.axisBottom(x).tickSize(0).tickPadding(10));\n\n // xAxis.select('.domain').remove()\n\n // filter out trades that don't match\n for (let date of tradesFilter) {\n date[1][1] = date[1][1].filter(passFilterTests);\n if (date[1][1].length > 0) {\n date[1][0] = date[1][1].reduce(function (acc, curr) {\n return acc + getVolume(curr.amount);\n }, 0);\n }\n }\n\n // remove dates with no matching trades\n tradesFilter = tradesFilter.filter((date) => date[1][1].length > 0);\n svg.select('#bubbles').remove();\n\n gradient.transition().duration(500).style('opacity', 0);\n\n var bub = svg\n .append('g')\n .attr('id', 'bubbles')\n .selectAll('dot')\n .data(tradesFilter);\n\n var bubbleColor = function (trades) {\n let [buy, sell] = [false, false];\n for (const trade of trades) {\n if (trade.transaction_type == 'Purchase') {\n buy = true;\n } else if (\n trade.transaction_type == 'Sale (Full)' ||\n trade.transaction_type == 'Sale (Partial)'\n ) {\n sell = true;\n } else {\n sell = true;\n buy = true;\n }\n }\n\n if (buy && sell) {\n return 'grey';\n } else {\n return buy ? 'red' : 'green';\n }\n };\n\n var bubEnter = bub.enter();\n\n // draw bubbles for each trade\n bubEnter\n .append('circle')\n .attr('class', 'tradeBubble')\n .attr('cx', function (d) {\n return x(d3.timeParse('%Y-%m-%d')(d[0]));\n })\n .attr('cy', function (d) {\n return y(prices_obj[d[0]]);\n })\n .attr('r', function (d) {\n return 0;\n })\n .style('fill', (d) => bubbleColor(d[1][1]))\n .style('opacity', '0.3')\n .attr('stroke', 'white')\n .style('stroke-width', '2px');\n\n // draw center dot in bubble\n bubEnter\n .append('circle')\n .attr('class', 'centerDot')\n .attr('cx', function (d) {\n return x(d3.timeParse('%Y-%m-%d')(d[0]));\n })\n .attr('cy', function (d) {\n return y(prices_obj[d[0]]);\n })\n .attr('r', 0)\n .style('fill', 'black')\n .style('opacity', '0.5')\n .attr('pointer-events', 'none');\n\n // add mouseover behavior for bubbles\n bubEnter\n .selectAll('circle')\n .on('mouseover', function (event, d) {\n selectBubble(event.target);\n\n tooltip.transition().duration(200).style('opacity', 1);\n tooltip.style('visibility', 'visible').style('display', '');\n })\n .on('mousemove', function (event, d) {\n let xy = d3.pointer(event, bub.node());\n tooltip\n .html(\n '<b>' +\n d[1][1].length +\n ' trades </b>on ' +\n Date.parse(d[0]).toString('MMM dd, yyyy') +\n '<br><b>Closing stock price:</b> $' +\n Number(prices_obj[d[0]]).toFixed(2)\n )\n .style('left', xy[0] + 10 + 'px')\n .style('top', xy[1] + 10 + 'px');\n })\n .on('mouseleave', function (event, d) {\n if (event.target != selectedBubble) {\n unselectBubble(event.target);\n }\n\n tooltip\n .transition()\n .duration(200)\n .style('opacity', 0)\n .on('end', () => {\n tooltip.style('visibility', 'hidden').style('display', 'none');\n });\n })\n .on('click', onClick);\n\n // Give these new data to update line\n line\n .transition()\n .duration(1000)\n .attr(\n 'd',\n d3\n .line()\n .curve(d3.curveCardinal)\n .x(function (d) {\n return x(d3.timeParse('%Y-%m-%d')(d[0]));\n })\n .y(function (d) {\n return y(d[1]);\n })\n )\n .attr('stroke', function (d) {\n return 'steelblue';\n })\n .on('end', function (d) {\n bubEnter\n .selectAll('.tradeBubble')\n .transition()\n .duration(1000)\n .attr('r', function (d) {\n return z(d[1][0]);\n });\n\n bubEnter\n .selectAll('.centerDot')\n .transition()\n .duration(1000)\n .attr('r', 3);\n\n gradient.attr('d', area).transition().duration(500).style('opacity', 1);\n });\n\n bub.exit().remove();\n updateSenatorSelect(tradesFilter);\n return tradesFilter;\n }", "function makeTimeline(svg, x, y, width, height, start, end, interval, years, index) {\n \n // draw the line\n var timelineY = y + 0.2 * height;\n var timeline = svg.append('path')\n .attr('d', line([\n [x, timelineY],\n [x + width, timelineY]\n ]))\n .attr('stroke', timelineColor)\n .attr('stroke-width', 4);\n \n // compute ranges where dates can exist\n var dateStartX = x + 0.1 * width;\n var dateEndX = x + width - 0.1 * width;\n var dateLength = dateEndX - dateStartX;\n\n function getXOfYear(year) {\n return dateStartX + ((year - start) / (end - start)) * dateLength;\n }\n\n // draw the labels\n for (var i = start; i <= end; i += interval) {\n var yearX = getXOfYear(i);\n \n // show the tick mark\n var tick = svg.append('path')\n .attr('d', line([\n [yearX, timelineY - (tickSize / 2)],\n [yearX, timelineY + (tickSize / 2)]\n ]))\n .attr('stroke', timelineColor)\n .attr('stroke-width', 2);\n \n // show the year \n var label = svg.append('text')\n .attr('x', yearX)\n .attr('y', timelineY - (tickSize / 2) - (padding / 2))\n .attr('width', interval)\n .attr('height', labelHeight)\n .style('font-family', mainFont)\n .style('font-size', timelineFontSize)\n .style('text-anchor', 'middle')\n .text(i);\n }\n \n // compute point sizes\n buttonSize = (dateLength / (years.length));\n buttonRadius = (buttonSize - padding) / 2;\n var currentButtonX = dateStartX;\n \n // create layer for points to prevent overlap\n var lineLayer = svg.append('g');\n\n // draw the points\n for (var i = 0; i < years.length; i++) {\n var yearX = getXOfYear(years[i]);\n \n // show the larger button\n var buttonStartY = timelineY + (tickSize / 2) + labelHeight + padding;\n var buttonCenterX = currentButtonX + (buttonSize / 2);\n var buttonCenterY = buttonStartY + buttonRadius;\n\n // show a point at the appropriate place\n var point = svg.append('circle')\n .attr('cx', yearX)\n .attr('cy', timelineY)\n .attr('r', 4)\n .attr('fill', timelineColor);\n \n // show the large button\n var button = svg.append('circle')\n .attr('cx', buttonCenterX)\n .attr('cy', buttonCenterY)\n .attr('r', buttonRadius)\n .attr('fill', buttonColor)\n .attr('index', index - 1) // for referencing purposes on click\n .on('mouseover', function() {\n showDetail(svg, d3.select(this).attr('index'));\n })\n .on('click', function() {\n showDetail(svg, d3.select(this).attr('index'));\n });\n animatePoint(button, buttonCenterX, buttonCenterY, buttonRadius,\n 1, 1000 * index / years.length);\n\n // fill the larger button with the number\n var label = svg.append('text')\n .attr('x', currentButtonX + (buttonSize / 2))\n .attr('y', buttonStartY + 1.4 * buttonRadius )\n .attr('width', buttonRadius * 2)\n .attr('height', buttonRadius * 2)\n .attr('index', index - 1) // for referencing purposes on click\n .style('font-family', mainFont)\n .style('font-size', buttonFontSize)\n .style('text-anchor', 'middle')\n .text(index)\n .on('mouseover', function() {\n showDetail(svg, d3.select(this).attr('index'));\n })\n .on('click', function() {\n showDetail(svg, d3.select(this).attr('index'));\n });\n disableSelection(label);\n\n // draw the connecting line\n var conLine = lineLayer.append('path')\n .attr('d', line([\n [yearX, timelineY],\n [buttonCenterX, buttonStartY]\n ]))\n .attr('stroke', timelineColor)\n .attr('stroke-dasharray', '5 5')\n .attr('stroke-width', 1);\n \n index++;\n currentButtonX += buttonSize;\n }\n\n}", "function annotation(slide) {\n if (slide == 0) {\n var annotations = \n [{\"x1\": 2010, \"y1\": 16, \"x2\": 2011, \"y2\": 15, \"text\": \"Congress estabilishes Corporate Average Fuel Economy standards in 1975.\"},\n {\"x1\": 2010, \"y1\": 20, \"x2\": 2010.5, \"y2\": 17, \"text\": \"Agreement reached to estabilsh national program to implement first fuel efficency improvements in 34 years in 2009.\"},\n {\"x1\": 2012, \"y1\": overall.filter(function(d) { return d.key === \"2012\"; })[0].value.averageFE, \"x2\": 2011, \"y2\": 19.5, \"text\": \"First phase of national program goes into effect calling for an annual ~5% increase in fuel economy from 2012 to 2016.\"},\n {\"x1\": 2017, \"y1\": overall.filter(function(d) { return d.key === \"2017\"; })[0].value.averageFE, \"x2\": 2012.5, \"y2\": 21.5, \"text\": \"Second phase of nation program goes into effect. Fuel efficiency expected to increase to 36-37 mpg by 2025.\"}];\n } else if (slide == 1) {\n var annotations = \n [{\"x1\": 2010, \"y1\": 16, \"x2\": 2011, \"y2\": 15, \"text\": \"Congress estabilishes Corporate Average Fuel Economy standards in 1975.\"},\n {\"x1\": 2010, \"y1\": 20, \"x2\": 2010.5, \"y2\": 17, \"text\": \"Agreement reached to estabilsh national program to implement first fuel efficency improvements in 34 years in 2009.\"},\n {\"x1\": 2012, \"y1\": overall.filter(function(d) { return d.key === \"2012\"; })[0].value.averageFE, \"x2\": 2011, \"y2\": 19.5, \"text\": \"First phase of national program goes into effect calling for an annual ~5% increase in fuel economy from 2012 to 2016.\"},\n {\"x1\": 2017, \"y1\": overall.filter(function(d) { return d.key === \"2017\"; })[0].value.averageFE, \"x2\": 2012.5, \"y2\": 21.5, \"text\": \"Second phase of nation program goes into effect. Fuel efficiency expected to increase to 36-37 mpg by 2025.\"}];\n } else if (slide == 2) {\n var annotations = \n [{\"x1\": 2017, \"y1\": electric.filter(function(d) { return d.key === \"2017\"; })[0].value.averageFE, \"x2\": 2016.5, \"y2\": 95, \"text\": \"The best selling electric vehicle, the Tesla Model 3, is released.\"},\n {\"x1\": 2013, \"y1\": electric.filter(function(d) { return d.key === \"2013\"; })[0].value.averageFE, \"x2\": 2013.5, \"y2\": 80, \"text\": \"Nissan begins assembling the Leaf, the first zero tailpipe emissions mass market vehicle.\"},\n {\"x1\": 2012, \"y1\": overall.filter(function(d) { return d.key === \"2012\"; })[0].value.averageFE, \"x2\": 2011, \"y2\": 10, \"text\": \"First phase of national program goes into effect calling for an annual ~5% increase in fuel economy from 2012 to 2016.\"},\n {\"x1\": 2017, \"y1\": overall.filter(function(d) { return d.key === \"2017\"; })[0].value.averageFE, \"x2\": 2012.5, \"y2\": 15, \"text\": \"Second phase of nation program goes into effect. Fuel efficiency expected to increase to 36-37 mpg by 2025.\"}];\n } else if (slide == 3) {\n var annotations = [];\n }\n \n var annotationLine = svg.selectAll(\".annotationline\").data(annotations);\n var annotationText = svg.selectAll(\".annotationtext\").data(annotations);\n\n if (slide == 0) {\n annotationLine = annotationLine.enter().append(\"line\").attr(\"class\",\"annotationline\").merge(annotationLine);\n annotationText = annotationText.enter().append(\"text\").attr(\"class\",\"annotationtext\").merge(annotationText);\n } else {\n annotationLine.exit().transition().duration(1000).style(\"opacity\",0).remove();\n annotationText.exit().transition().duration(1000).style(\"opactiy\",0).remove();\n annotationLine = annotationLine.enter().append(\"line\").attr(\"class\",\"annotationline\").merge(annotationLine).transition().duration(3000).style(\"opacity\",100);\n annotationText = annotationText.enter().append(\"text\").attr(\"class\",\"annotationtext\").merge(annotationText).transition().duration(3000).style(\"opacity\",100);\n }\n\n annotationLine\n .attr(\"x1\",function(d) { return x(d.x1) })\n .attr(\"y1\",function(d) { return y(d.y1) })\n .attr(\"x2\",function(d) { return x(d.x2) })\n .attr(\"y2\",function(d) { return y(d.y2) });\n\n annotationText\n .attr(\"x\",function(d) { return x(d.x2) })\n .attr(\"y\",function(d) { return y(d.y2) + 7 })\n .attr(\"text-anchor\",\"start\")\n .text(function(d) { return d.text });\n}", "function drawHovers(year) {\n // Bisector function to get closest data point: note, this returns an *index* in your array\n var bisector = d3.bisector(function (d, x) {\n return +d.year - x;\n }).left;\n\n // Get hover data by using the bisector function to find the y value\n var years = selectedData.map(function (d) {\n d.values.sort(function (a, b) {\n return +a.year - +b.year;\n });\n return (d.values[bisector(d.values, year)]);\n })\n\n // Do a data-join (enter, update, exit) to draw circles\n var circles = g.selectAll('circle').data(years, function (d) {\n return d.country_area;\n });\n\n circles.enter().append('circle').attr('fill', 'none').attr('stroke', function (d) {\n return colorScale(d.country_area);\n });\n\n circles.transition().duration(0).attr('cx', function (d) {\n return xScale(d.year);\n }).attr('cy', function (d) {\n return yScale(d.value);\n }).attr('r', 15);\n\n circles.exit().remove();\n\n // Do a data-join (enter, update, exit) draw text\n var labels = g.selectAll('.label').data(years, function (d) {\n return d.country_area;\n })\n\n labels.enter().append('text').attr('class', 'label');\n\n labels\n .attr(\"dy\", \".35em\")\n .style('font-size', '0.75em')\n .text(function(d){\n return d.State + \": \" + (Math.round(d.value));})\n .attr('transform', function(d){\n return 'translate(' + xScale(d.year) + \", \" + yScale(d.value) + \")\";\n });\n labels\n .exit().remove();\n\n // labels.transition().duration(0).attr('x', function (d) {\n // return xScale(d.year);\n // }).attr('y', function (d) {\n // return yScale(d.value);\n // }).text(function (d) {\n // return d.State + \": \" + d.value;\n // })\n\n // labels.exit().remove()\n\n }", "function update() {\n \t// update bubbles\n \tpoints.transition()\n \t\t .duration(200)\n \t .attr(\"transform\", function(d) {\n \t \t return \"translate(\"+xScale(d.years[dragit.time.current].year)+\", \"+yScale(d.years[dragit.time.current].val)+\")\";\n \t\t });\n \tcircle.transition()\n \t\t .duration(200)\n \t\t .attr(\"r\", function(d) {\n \t\t return Math.sqrt(d.years[dragit.time.current].audience);\n \t\t });\n \tlabel.text(function(d) {\n \t\t return d.years[dragit.time.current].audience;\n \t\t });\n \t}", "function draw() {\n let filteredData = state.data;\n if (state.selectedDir !== 'Both') {\n filteredData = state.data.filter(d => d.direction === state.selectedDir);\n console.log(filteredData);\n }\n const dot = svg\n .selectAll(\".dot\")\n .data(filteredData, d => d.name)\n .join(\n enter =>\n enter \n .append(\"circle\")\n .attr('class', 'dot')\n .attr('stroke', 'black')\n .attr('opacity', 0.2)\n .attr('fill', d => {\n if (d.direction === \"Towards Manhattan\") return \"pink\";\n else return \"purple\";\n })\n .attr(\"r\", radius)\n .attr(\"cy\", d => height)\n .attr(\"cx\", d => margin.top) \n .call(enter => enter\n .transition()\n .delay(500)\n .attr(\"cx\", d => xScale(d.count))\n .attr(\"cy\", d => yScale(d.temperature))\n .attr(\"opacity\", 0.6)\n ),\n update => \n update.call(update => \n update\n .transition()\n .duration(50)\n .attr(\"stroke\", \"black\")\n ),\n exit => \n exit.call(exit => \n exit\n .transition()\n .attr(\"opacity\", 1)\n .delay(700)\n .duration(500)\n .attr(\"opacity\", .2)\n .remove()\n )\n );\n}", "function transition() {\n if(animFlag){\n d3.selectAll(\".line\").transition().duration(1000).ease(\"linear\")\n .style(\"stroke-dashoffset\", \"12\")\n .each(\"end\", function() {\n d3.selectAll(\".line\").style(\"stroke-dashoffset\", \"0\");\n transition();\n });\n }\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function setupLifeBars(_data_life) {\n console.log(_data_life);\n console.log(_vis_height);\n // divide the height of our vis to the number of rows\n var y_pad = Math.floor(_vis_height / _data_life.length);\n var spacing = 0;\n\n console.log(_data_life);\n\n var xScale_L = d3.scaleLinear()\n .domain([0, 100-1]) //input\n .range([0, _vis_width/2.4]); //output\n\n /**Function is not being used at the moment\n var line = d3.line()\n .x(function(d,i){\n return xScale_L(i);\n })\n .curve(d3.curveMonotoneX());//apply smoothing of line\n **/\n\n var lifeBarGroup = _vis.selectAll(\"g.life-bar\")\n .data(_data_life)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"life-bar\")\n .attr(\"transform\", \"\");\n\n lifeBarGroup\n //.selectAll(\"rect\")\n .append(\"rect\")\n .attr(\"id\", function (d, i) {\n return \"row_L_\" + i;\n })\n .attr(\"rx\", 12)\n .attr(\"ry\", 12)\n .attr(\"x\", (_vis_width / 2) * 1.20)\n .attr(\"y\", (d, i) => i * y_pad)\n .attr(\"height\", 25)\n .attr(\"width\", y_pad/2)\n .attr(\"style\", \"fill:#66FCF1\");\n\n\n\n lifeBarGroup\n .append(\"text\")\n .text(function (d) {\n return d.Country;\n })\n\n .attr(\"y\", function (d, i) {\n if (i === 0) {\n return spacing += 30;\n } else {\n return spacing += 66;\n }\n\n })\n .attr(\"x\", _vis_width/1.98)\n .attr(\"style\", \"@import url('https://fonts.googleapis.com/css?family=Roboto|Roboto+Slab')\")\n .attr(\"style\", \"fill: white; text-anchor: middle; font-size: 20px; font-family: 'Roboto Slab', serif;\");\n\n //Call the x-axis\n lifeBarGroup\n .append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(\"+((_vis_width/2)*1.2)+\",\"+(_vis_height-15) + \")\")\n .attr(\"style\", \"font-size: 8px\")\n .call(d3.axisBottom(xScale_L)); //Create an axis component with d3\n\n // console.log(lifeBarGroup.select(\".x axis\"));\n //\n // lifeBarGroup\n // .append(\"g\")\n // .attr(\"class\", \"x-axis-label\")\n // .attr(\"transform\", \"translate(\"+((_vis_width/2)*1.5)+\",\"+(_vis_height + 10) + \")\")\n // .append(\"text\")\n // .text(\"Life Expectancy\")\n // .style(\"fill\", \"white\")\n // .style(\"font-size\", \"20px\");\n\n let body = d3.select(\"body\")\n .append(\"p\")\n .text(\"Life Expectancy\")\n .style(\"position\", \"absolute\")\n .style(\"top\", function(d){\n console.log((parseInt(d3.select(\"#vis\").attr(\"margin-left\"))));\n return ((_vis_height-25) + (parseInt(d3.select(\"#vis\").style(\"margin-left\"))) * 2) + \"px\";\n })\n .style(\"left\", function(d){\n return (((_vis_width/2)*1.5) + (parseInt(d3.select(\"#vis\").style(\"margin-top\"))) * 3) + \"px\";\n })\n .style(\"font-size\", \"20px\");\n //.style(\"margin\", \"5px\")\n //.style(\"padding\", \"5px\");\n\n d3.select(\"body\")\n .append(\"p\")\n .text(\"Fertility Rate\")\n .style(\"position\", \"absolute\")\n .style(\"top\", function(d){\n console.log((parseInt(d3.select(\"#vis\").attr(\"margin-left\"))));\n return ((_vis_height-25) + (parseInt(d3.select(\"#vis\").style(\"margin-left\"))) * 2) + \"px\";\n })\n .style(\"left\", function(d){\n return ((_vis_width/6) + (parseInt(d3.select(\"#vis\").style(\"margin-top\"))) * 3) + \"px\";\n })\n .style(\"font-size\", \"20px\");\n //.style(\"margin\", \"5px\")\n //.style(\"padding\", \"5px\");\n\n /**This function causes the yellow bars in set up mode to not appear**/\n /* lifeBarGroup\n .append(\"path\")\n .datum(_data_life) //Binds data to the line\n .attr(\"class\", \"line\") //Assign a class for the styling\n .attr(\"d\", line); //Calls the line generator\n */\n\n}", "function UpdateSlider(year) {\n d3.selectAll(\"#nodata\").remove();\n var value = brush.extent()[0];\n year = formatDate(value);\n UpdateMap(data, year);\n drawScatterPlot(data[year], year);\n drawpiechart(populationdata[year], countrycode, year);\n\n d3.select('.btn.btn-primary').on('click', function() {\n $('html,body').animate({\n scrollTop: $(\".third\").offset().top},\n 'slow');\n sunburstSelected(populationdata[year], countrycode, year);\n }); \n \n if (d3.event.sourceEvent) {\n d3.select(\"#sunburstsvg\").remove();\n value = timeScale.invert(d3.mouse(this)[0]);\n year = formatDate(value);\n UpdateMap(data, year);\n drawScatterPlot(data[year], year);\n drawpiechart(populationdata[year], countrycode, year);\n\n d3.select('.btn.btn-primary').on('click', function() {\n $('html,body').animate({\n scrollTop: $(\".third\").offset().top},\n 'slow');\n sunburstSelected(populationdata[year], countrycode, year)\n });\n\n brush.extent([value, value]);\n }\n\n handle.attr(\"transform\", \"translate(\" + timeScale(value) + \",0)\");\n handle.select('text').text(year);\n\n }", "function year(){\n step=1;\n timeSelector=\"year\";\n resetGraph();\n}", "function dropdownChange() {\n var newYear = d3.select(this).property('value');\n axes(slide,newYear);\n cars(slide,newYear);\n}", "function updateDisplay(year) {\n featureValues = []; \n\n d3.select(\"#yearInfo\").text(year); \n \n mapProp = geoJsonData.properties.mapProp; // Propery name to map to on each geoJSON feature object\n scaleValue = geoJsonData.properties.scaleValue; // Map scaling\n xOffset = geoJsonData.properties.xOffset; // Map xoffset\n yOffset = geoJsonData.properties.yOffset; // Map yoffset\n \n // DON'T NEED TO DO THESE EVERY TIME!! TODO: MOVE THEM\n totalProdExtent = d3.extent(chartData.map(function(d){return parseFloat(d.totalprod);}));\n console.log(\"totalProdExtent \" , totalProdExtent);\n\n totalProdColors = d3.scaleLinear()\n .domain(totalProdExtent)\n .range(['#FFF9CC', '#bc8600'])\n .interpolate(d3.interpolateHcl); \n\n \n // d3.nest() groups data\n var groupByYear = d3.nest()\n .key(function(d) {\n return d.year;\n })\n .entries(chartData);\n //console.log(groupByYear);\n \n groupByYear.forEach(function(d) {\n d.total = d3.sum(d.values, function(d2) {\n return d2.totalprod;\n });\n d.average = d3.mean(d.values, function(d3) {\n return d3.totalprod;\n });\n }); \n\n var currentData = groupByYear.filter(obj => {\n return obj.key == year.toString();\n }) \n console.log(\"currentData \", currentData);\n var ctFormat = d3.format(\".2s\");\n d3.select(\"#totalProdInfo\").text(ctFormat(currentData[0].total)); \n\n d3.select(\"#avgProdInfo\").text(ctFormat(currentData[0].average)); \n\n console.log(\"Current Year Data\", currentData[0].values);\n var currentYearData = currentData[0].values;\n \n // Assign state abbreviations to each shape\n $.each(geoJsonData.features, function(key, value) { \n var featureName = value.properties[mapProp];\n var stateAbbr = value.properties[\"HASC_1\"].split(\".\")[1]; \n \n var myDataRow = currentYearData.filter(obj => {\n return obj.state == stateAbbr;\n })\n\n var myVal = 0;\n if(myDataRow[0] != undefined) {\n myVal = myDataRow[0].totalprod; // Get total honey production\n }\n \n var dataObj = {\"name\": featureName, \"value\": myVal, \"state\": stateAbbr}; \n featureValues.push(dataObj); \n });\n\n renderMap(); // Render the map\n\n\n }", "function animateIntro (){\n\t\n\t\td3.selectAll(\".countrypath\")\n\t\t\t.attr(\"opacity\", 1)\t\n\t}", "update () {\n\n //Domain definition for global color scale\n let domain = [-60, -50, -40, -30, -20, -10, 0, 10, 20, 30, 40, 50, 60];\n\n //Color range for global color scale\n let range = [\"#063e78\", \"#08519c\", \"#3182bd\", \"#6baed6\", \"#9ecae1\", \"#c6dbef\", \"#fcbba1\", \"#fc9272\", \"#fb6a4a\", \"#de2d26\", \"#a50f15\", \"#860308\"];\n\n //ColorScale be used consistently by all the charts\n this.colorScale = d3.scaleQuantile()\n .domain(domain)\n .range(range);\n\n // ******* TODO: PART I *******\n\n // Create the chart by adding circle elements representing each election year\n //The circles should be colored based on the winning party for that year\n //HINT: Use the .yearChart class to style your circle elements\n //HINT: Use the chooseClass method to choose the color corresponding to the winning party.\n\n //Append text information of each year right below the corresponding circle\n //HINT: Use .yeartext class to style your text elements\n\n //Style the chart by adding a dashed line that connects all these years.\n //HINT: Use .lineChart to style this dashed line\n\n //Clicking on any specific year should highlight that circle and update the rest of the visualizations\n //HINT: Use .highlighted class to style the highlighted circle\n\n //Election information corresponding to that year should be loaded and passed to\n // the update methods of other visualizations\n\n\n //******* TODO: EXTRA CREDIT *******\n\n //Implement brush on the year chart created above.\n //Implement a call back method to handle the brush end event.\n //Call the update method of shiftChart and pass the data corresponding to brush selection.\n //HINT: Use the .brush class to style the brush.\n\n }", "function setupYears(){\n d3.select('#years')\n .selectAll('.Ybutton')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.Ybutton').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n d3.select(\"#yearClicked\").text(buttonId);\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function mousemoveCountry() {\r\n\r\n // set correct domain\r\n yG.domain([0, maxDataGraphCountryAmount]);\r\n\r\n // select correct year and data\r\n var timeMouse = xG.invert(d3.mouse(this)[0]),\r\n i = bisectDate(dataGraphCountry, timeMouse, 1),\r\n dataLeft = dataGraphCountry[i - 1],\r\n dataRight = dataGraphCountry[i],\r\n d = timeMouse - dataLeft.year > dataRight.year - timeMouse ? dataRight : dataLeft;\r\n\r\n // set amount of refugees\r\n var amount = +d.amount;\r\n\r\n // place circle on correct place\r\n svgTooltipTimelineCountry.select(\"circle.yTooltip\")\r\n .attr(\"transform\", \"translate(\" + xG(d.year) + \",\" + yG(d.amount) + \")\");\r\n\r\n // place correct text in tooltip\r\n if (absPerc == \"absolute values\") {\r\n setTextTooltipTimeline(\"Amount of refugees: \", amount);\r\n } \r\n else if (absPerc == \"percentage of inhabitants\") {\r\n setTextTooltipTimeline(\"Percentage of inhabitants: \", amount);\r\n };\r\n\r\n // place correct year in tooltip\r\n svgTooltipTimelineCountry.select(\"text.textYear\")\r\n .attr(\"transform\", \"translate(\" + xTooltipTimeline + \",\" + yTooltipTimeline + \")\")\r\n .text(\"Year: \" + d.yearx);\r\n\r\n // place vertical line on correct place \r\n svgTooltipTimelineCountry.select(\".xTooltip\")\r\n .attr(\"transform\", \"translate(\" + xG(d.year) + \",\" + yG(d.amount) + \")\")\r\n .attr(\"y2\", heightG - yG(d.amount));\r\n\r\n // place horizontal line on correct place\r\n svgTooltipTimelineCountry.select(\".yTooltip\")\r\n .attr(\"transform\", \"translate(\" + widthG * -1 + \",\" + yG(d.amount) + \")\")\r\n .attr(\"x2\", widthG + widthG);\r\n}", "function drawDefault() {\n \n var margin = {top: 10, right: 60, bottom: 20, left:150},\n width = 1100 - margin.left - margin.right,\n height = 600 - margin.top - margin.bottom;\n\n\n var margin2 = {top: 20, right: 20, bottom: 20, left: 150},\n width2 = 1100 - margin2.left - margin2.right,\n height2 = 500 - margin2.top - margin2.bottom;\n\n //used to parse time data on \"year\" only\n var parseTime = d3.timeParse(\"%Y\");\n var xValue = function(d) { return d.year;}\n var xScale = d3.scaleTime().range([0, width-80]);\n var xMap = function(d) { return xScale(xValue(d));};\n\n var yValue = function(d) { return d.category;};\n //var yScale = d3.scalePoint().range([height, 0]).padding(1);\n\n var yScale = d3.scaleLinear().range([height, 0]);\n\n //var yMap = function(d) { return yScale(yValue(d))+d3.randomUniform(15, 45)();};\n var yMap = function(d) { return yScale(yValue(d));};\n\n\n var color = d3.scaleOrdinal().domain([\"All\",\"North America\",\"South America\", \"Europe\",\"Africa\",\"Asia\",\"Australia\" ]).range([\"#9b989a\",\"#beaed4\",\"#fb9a99\",\"#a6d854\",\"#80b1d3\",\"#ffd92f\",\"#ff9933\"]);\n\n var circles;\n\n //#fbb4ae \n var xAxis = d3.axisBottom().scale(xScale).ticks(13).tickSize(0,9,0);\n var yAxis = d3.axisLeft().scale(yScale).ticks(11).tickSize(0,9,0).tickFormat( function(d) { return mapfunc(d);});\n\n //.tickFormat(function(d) { return mapping[d.category2]; });\n var svg = d3.select('body')\n .append('svg')\n .attr(\"id\", 'default')\n .attr('width', width + margin.left + margin.right)\n .attr('height', height + margin.top + margin.bottom)\n .append('g')\n .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n //For draw cell\n // var svg2 = d3.select('body')\n // .append('svg')\n // .attr(\"id\", 'cell')\n // .attr('width', width2 + margin2.left + margin2.right)\n // .attr('height', height2 + margin2.top + margin2.bottom);\n var svg2 = d3.select('body')\n .append('svg')\n .attr(\"id\", 'cell')\n .attr('width', width2 + margin2.left + margin2.right)\n .attr('height', height2 + margin2.bottom + margin2.top);\n\n\n var tooltip = d3.select(\"body\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n \n function rowConverter(d) {\n return {\n year2: +d.year,\n year: parseTime(d.yearMap),\n cat: d.cat,\n name: d.name,\n category: d.catMap,\n country: d.country,\n award: d.award,\n Rationale: d.Rationale,\n continent: d.continent\n }\n }\n\n d3.csv('full.csv',rowConverter).then(function(data){\n// data.forEach(function(d){\n// d.year2 = +d.year;\n// d.year = parseTime(d.yearMap); \n// d.cat = d.cat;\n// d.name=d.name;\n// d.category = d.catMap;\n// d.country=d.country;\n// d.award = d.award;\n// d.Rationale = d.Rationale;\n// d.continent = d.continent;\n// });\n console.log(\"data\", data);\n\n var asia = [];\n var namerica = [\"All\"];\n var samerica = [\"All\"];\n var africa = [\"All\"];\n var europe = [\"All\"];\n var australia = [\"All\"];\n\n // organizing countries by their continent\n for (var i = 0; i < data.length; i++) {\n if (data[i].continent == \"Asia\" && !asia.includes(data[i].country))\n {\n asia.push(data[i].country);\n }\n if (data[i].continent == \"Africa\" && !africa.includes(data[i].country))\n {\n africa.push(data[i].country);\n }\n if (data[i].continent == \"Australia\" && !australia.includes(data[i].country))\n {\n australia.push(data[i].country);\n }\n if (data[i].continent == \"Europe\" && !europe.includes(data[i].country))\n {\n europe.push(data[i].country);\n }\n if (data[i].continent == \"North America\" && !namerica.includes(data[i].country))\n {\n namerica.push(data[i].country);\n }\n if (data[i].continent == \"South America\" && !samerica.includes(data[i].country))\n {\n samerica.push(data[i].country);\n }\n }\n console.log(\"asia\", asia);\n console.log(\"africa\", africa);\n console.log(\"australia\", australia);\n console.log(\"europe\", europe);\n console.log(\"namerica\", namerica);\n console.log(\"samerica\", samerica);\n\n xScale.domain([d3.min(data, function(d){return d.year;}),\n d3.max(data,function(d){return d.year;})]).nice();\n\n yScale.domain([d3.min(data, function(d) { return d.category;})-1, d3.max(data, function(d) { return d.category;})]).nice();\n\n //\t\tyScale.domain(d3.extent(data, function(d){\n //\t\t\treturn d.category2;\n //\t\t})).nice();\n //yScale.domain(data.map(function(d) { return d.category; }));\n\n\n\n\n var x = svg.append('g')\n .attr('transform', 'translate(0,' +height + ')')\n .attr('class', 'x axis')\n .call(xAxis);\n\n var zoom = d3.zoom().on(\"zoom\",zoomed);\n\n // y-axis is translated to (0,0)\n var y = svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n .selectAll(\"text\")\n .attr(\"y\", 26)\n .attr(\"x\",-5)\n .attr(\"cx\", -1000)\n .attr(\"cy\", -1000)\n .attr(\"dy\", \".85em\")\n .attr(\"font-weight\",\"bold\");\n //.attr(\"transform\", \"rotate(60)\")\n\n\n // Draw the x gridlines\n var xgrid = svg.append(\"g\")\n .attr(\"class\", \"grid\")\n .attr(\"transform\", \"translate(0,\" + height+ \")\")\n .call(make_x_gridlines(xScale, 13).tickSize(-height).tickFormat(\"\"))\n\n\n\n // Draw the y gridlines\n var ygrid = svg.append(\"g\")\n .attr(\"class\", \"grid\")\n .call(make_y_gridlines(yScale, 11)\n .tickSize(-width+80)\n .tickFormat(\"\")\n ) \n\n\n circles=svg.selectAll(\".dot\")\n .data(data)\n .enter().append(\"circle\")\n .attr(\"class\", \"dot\")\n .attr(\"r\", 4)\n .attr(\"cx\", xMap)\n .attr(\"cy\", yMap)\n .style(\"fill\", function(d) { return color(d.continent);})\n .on(\"mouseover\", function(d) {\n d3.select(this)\n tooltip.transition()\n .duration(200)\n .attr('r',10)\n .style(\"opacity\", .9);\n tooltip.html(d.name+\"<br/>\"+\"Year: \"+ d.year2+\"<br/>\"+\"Country: \"+d.country+\"<br/>\"+\"Award: \"+d.award+\" - \"+d.cat+\"<br/>\"+\"________________\"+\"<br/>\"+d.Rationale) \n .style(\"left\", (d3.event.pageX -4) + \"px\")\n .style(\"top\", (d3.event.pageY+2 ) + \"px\");\n })\n .on(\"mouseout\", function(d) {\n tooltip.transition()\n .duration(500)\n .style(\"opacity\", 0);\n });\n //TODO: the zoom not looks good \n // svg.call(d3.zoom()\n // .scaleExtent([1/2, 32])\n // .on(\"zoom\", zoomed));\n // \n\n // drop down menu\n // referenced: https://www.d3-graph-gallery.com/graph/connectedscatter_select.html\n var dropdownArray = [\"namerica\", \"samerica\", \"europe\", \"africa\", \"asia\", \"australia\"];\n \n namerica = namerica.sort();\n namerica.splice(1, 0, \"None\");\n d3.select(\"#namerica\")\n .selectAll('myOptions')\n .data(namerica)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n samerica = samerica.sort();\n samerica.splice(1, 0, \"None\");\n d3.select(\"#samerica\")\n .selectAll('myOptions')\n .data(samerica)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n // drop down menu\n europe = europe.sort();\n europe.splice(1, 0, \"None\");\n d3.select(\"#europe\")\n .selectAll('myOptions')\n .data(europe)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n // drop down menu\n africa = africa.sort();\n africa.splice(1, 0, \"None\");\n d3.select(\"#africa\")\n .selectAll('myOptions')\n .data(africa)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n // drop down menu\n asia = asia.sort();\n asia.splice(0, 0, \"All\");\n asia.splice(1, 0, \"None\");\n d3.select(\"#asia\")\n .selectAll('myOptions')\n .data(asia)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n // drop down menu\n australia = australia.sort();\n australia.splice(1, 0, \"None\");\n d3.select(\"#australia\")\n .selectAll('myOptions')\n .data(australia)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n d3.selectAll(\".dropdown\").on(\"change\", function() {\n // color.domain()[ind] is the continent the country belongs to\n // connecting the dropdown with the legend\n var ind = dropdownArray.indexOf(d3.select(this).attr(\"id\")) + 1;\n update(d3.select(this), data, color.domain()[ind], color.domain());\n });\n \n // draw legend\n var legend = svg.selectAll(\".legend\")\n .data(color.domain())\n .enter().append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"id\", function(d, i){\n return color.domain()[i];}) // assign ID to each legend\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 27 + \")\"; });\n \n legend.append(\"select\");\n \n // draw legend colored rectangles\n legend.append(\"rect\")\n .attr(\"x\", width - 50)\n .attr(\"rx\",5)\n .attr(\"ry\",5)\n .attr(\"width\", 110)\n .attr(\"height\", 25)\n .style(\"fill\", color)\n .attr(\"id\", function(d){\n return \"rect\"+d.replace(\" \",\"\");});\n \n // Adding click event\n legend.on(\"click\", function(type) {\n\n\n //dim all of the legends\n //d3.selectAll(\".legend\")\n // .style(\"opacity\", 0.1);\n // make the one selected be un-dimmed\n //d3.select(this)\n // .style(\"opacity\", 1);\n\n //Show if 'All' selected\n if (d3.select(this).attr('id') == 'All') {\n // turns on all buttons and dots\n if (d3.select(this).select(\"rect\").style(\"opacity\") == 0.4) {\n d3.selectAll(\".dot\")\n .style(\"opacity\", 1);\n d3.selectAll(\"rect\")\n .style(\"opacity\", 1); \n // ________________________________________________________________________________________________________\n d3.selectAll(\".dropdown\").property(\"value\", \"All\");\n }\n // grays out all buttons and dots\n else {\n d3.selectAll(\".dot\")\n .style(\"opacity\", 0.1);\n d3.selectAll(\"rect\")\n .style(\"opacity\", 0.4);\n d3.selectAll(\".dropdown\").property(\"value\", \"None\");\n }\n } else {\n // ___________________________________________________________________________________________________________\n // if continent button clicked, change dropdown menu of that button to All\n var indx = color.domain().indexOf(d3.select(this).attr('id'));\n var dropdown = \"#\"+dropdownArray[indx-1];\n console.log(\"in legend, dropdown id: \", dropdown);\n \n // grays out the \"All\" button\n d3.select(\"#rectAll\").style(\"opacity\", 0.4);\n // highlights/colors button and dots belonging to continent\n if (d3.select(this).select(\"rect\").style(\"opacity\") == 0.4) {\n d3.selectAll(\".dot\")\n .filter(function(d){\n return d[\"continent\"] == type\n })\n //Make this line seen\n .style(\"opacity\", 1);\n d3.select(this).select(\"rect\").style(\"opacity\", 1);\n d3.select(dropdown).property(\"value\", \"All\");\n }\n // grays out buttons and dots belonging to the continent\n else {\n d3.selectAll(\".dot\")\n .filter(function(d){\n return d[\"continent\"] == type\n })\n //Make this line grayed\n .style(\"opacity\", 0.1);\n d3.select(this).select(\"rect\").style(\"opacity\", 0.4);\n d3.select(dropdown).property(\"value\", \"None\");\n }\n countingIters();\n console.log(d3.select(this).attr('id'));\n\n // PREVIOUS CODE\n // //Select all dot and hide\n // d3.selectAll(\".dot\")\n // .style(\"opacity\", 0.1)\n // .filter(function(d){\n // return d[\"continent\"] == type\n // })\n // //Make this line seen\n // .style(\"opacity\", 1);\n // \n // d3.selectAll(\"rect\")\n // .style(\"opacity\", 0.1);\n // d3.select(this).select(\"rect\").style(\"opacity\", 1);\n // console.log(\"clicked id\", d3.select(this).attr('id'));\n // console.log(\"id rect\", d3.select(this).select(\"rect\").attr('id'));\n // \n // if (d3.select(this).select(\"rect\").style(\"opacity\") == 1)\n // {\n // console.log(\"rectangle opacity is 1\");\n // }\n } \n })\n\n // draw legend text\n legend.append(\"text\")\n .attr(\"x\", width+3)\n .attr(\"y\", 7)\n .attr(\"dy\", \"0.65em\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\",\"14px\")\n .style(\"font-family\",\"sans-serif\")\n .text(function(d) { return d;})\n\n\n //Clickabl legend ref: http://bl.ocks.org/WilliamQLiu/76ae20060e19bf42d774 \n var categoryMap = [\"Art\", \"Literature\", \"Medicine\", \"Chemistry\", \"Physics\", \"Math\", \"Computer\", \"Peace & Leadership\", \"Pioneers\"];\n\n svg.on(\"click\", function() {\n //Get click coordinate\n var coords = d3.mouse(this);\n //Convert pixel to data\n var posX = xScale.invert(coords[0]),\n posY = Math.floor(yScale.invert(coords[1]));\n var category = categoryMap[posY],\n date = new Date(posX),\n year = date.getFullYear();\n\n //Find decade boundary given year\n var decadeLower = year - year%10,\n decadeUpper = decadeLower + 10;\n\n //Get relevant data\n var cellData = data.filter(function(d) {\n return d[\"cat\"] === category && d[\"year2\"] < decadeUpper && d[\"year2\"] >= decadeLower\n });\n clearCell();\n drawCell(margin2, color, decadeLower, decadeUpper, cellData);\n });\n\n function zoomed() {\n //Create new scale based on event\n var new_xScale = d3.event.transform.rescaleX(xScale)\n var new_yScale = d3.event.transform.rescaleX(yScale)\n\n\n //Update axes\n x.call(xAxis.scale(new_xScale));\n xgrid.call(make_x_gridlines(new_xScale, 13).tickFormat(\"\"));\n ygrid.call(make_y_gridlines(new_yScale, 11).tickFormat(\"\"));\n\n //Update scatter plot and associated text\n svg.selectAll(\".dot\")\n .attr(\"transform\", d3.event.transform);\n svg.selectAll(\".text\")\n .attr(\"transform\", d3.event.transform);\n svg.selectAll(\".grid\")\n .attr(\"transform\",\n d3.event.transform);\n } \n }); \n\n}", "function createPlot () {\n const xScale = d3.scale.linear()\n .domain([0, 365])\n .range([0, width])\n\n const yScale = d3.scale.linear()\n .domain([0, 2])\n .range([0, height])\n\n const x = d3.time.scale()\n .domain([new Date(2015, 4, 1), new Date(2016, 3, 1)])\n .range([0, width])\n\n const xAxis = d3.svg.axis()\n .scale(x)\n .orient('bottom')\n .ticks(d3.time.months)\n .tickSize(16, 0)\n .tickFormat(d3.time.format('%b'))\n\n const tip = d3tip()\n .attr('class', 'plot-tip')\n .html(d => '<span>' + d.name + '</span>')\n\n const svg = d3.select('[role=\"plot\"]')\n .append('svg')\n .attr('height', height + marginY * 2)\n .attr('width', width + marginX * 2)\n .append('g')\n .attr('transform', 'translate(' + marginX + ',' + marginY + ')')\n .attr('class', 'plot')\n\n svg.call(tip)\n\n // create x axis\n svg.append('g')\n .attr('transform', 'translate(0,' + (height + 20) + ')')\n .attr('class', 'plot-x-axis')\n .call(xAxis)\n\n // create dots\n svg.selectAll('circle')\n .data(data)\n .enter()\n .append('circle')\n .attr('cx', d => xScale(d.cx))\n .attr('cy', d => yScale(d.cy))\n .attr('r', circleR)\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .on('click', d => window.open(d.uri))\n\n // add labels to dots\n svg.selectAll('text')\n .data(data)\n .enter()\n .append('text')\n .text(d => d.name)\n .attr('x', d => xScale(d.cx))\n .attr('y', d => yScale(d.cy))\n}", "function plot_participation(data) {\n // Group data based on year\n var average_participation = d3.nest()\n .key(function (d) {return d.Year;})\n .rollup(function (g) {\n var participants = d3.set(g, function (g) {return g.ID;}).values().length;\n var countries = d3.set(g, function (g) {return g.Country;}).values().length;\n return participants/countries;\n })\n .sortKeys(d3.ascending);\n if (sport_selector.value == 'None'){\n average_participation = average_participation.entries(data);\n }\n else {\n average_participation = average_participation.entries(data.filter(function (d) {\n return d.Sport == sport_selector.value;\n }));\n }\n\n var svg = d3.select('#participation');\n const width = svg.attr('width') - margin.left - margin.right;\n const height = svg.attr('height') - margin.top - margin.bottom;\n var tooltip = d3.select('body').append('div')\n .attr('class', 'tooltip')\n .style('opacity', 0);\n \n var x = d3.scaleTime()\n .domain(d3.extent(average_participation, function (d) {return new Date(d.key);})).nice()\n .range([0, width]);\n var y = d3.scaleLinear()\n .domain([0, d3.max(average_participation, function (d) {return d.value;})]).nice()\n .range([height, 0]);\n var x_axis = svg.append('g')\n .attr('class', 'xaxis')\n .attr('transform', 'translate(' + margin.left + ', ' + (height + margin.top) + ')')\n .call(d3.axisBottom(x));\n var y_axis = svg.append('g')\n .attr('class', 'yaxis')\n .attr('transform', 'translate(' + margin.left + ', ' + margin.top + ')')\n .call(d3.axisLeft(y));\n // Average participation path generator\n var avg_line = d3.line()\n .x(function (d) {return x(new Date(d.key));})\n .y(function (d) {return y(d.value);});\n // Group element for the path elements\n var path_group = svg.append('g')\n .attr('class', 'time_series')\n .attr('transform', 'translate(' + margin.left + ', ' + margin.top + ')');\n path_group.append('path')\n .attr('id', 'avg-path')\n .data([average_participation])\n .attr('d', avg_line)\n .attr('stroke', 'white');\n path_group.append('path')\n .attr('id', 'country-path');\n var avg_circle = svg.append('g')\n .attr('class', 'time_scatter')\n .attr('id', 'average')\n .attr('transform', 'translate(' + margin.left + ', ' + margin.top + ')');\n avg_circle.selectAll('circle')\n .data(average_participation).enter()\n .append('circle')\n .attr('cx', function (d) {return x(new Date(d.key));})\n .attr('cy', function (d) {return y(d.value);})\n .attr('r', 3)\n .on('mouseover', function (d) {\n tooltip.style('opacity', 1)\n .style('left', (d3.event.pageX + 5) + 'px')\n .style('top', (d3.event.pageY + 10) + 'px');\n tooltip.html(\n 'Participants: ' + Math.round(d.value) +\n '</br>' +\n 'Year: ' + d.key\n );\n })\n .on('mouseout', () => {\n tooltip.style('opacity', 0);\n });\n var country_circle = svg.append('g')\n .attr('class', 'time_scatter')\n .attr('id', 'country')\n .attr('transform', 'translate(' + margin.left + ', ' + margin.top + ')');\n \n // Legend\n var legend = svg.append('g')\n .attr('id', 'legend')\n .attr('transform', 'translate(' + x(new Date('1940')) + ', ' + 0 + ')');\n legend.append('rect')\n .attr('x', 10)\n .attr('y', 10)\n .attr('width', 15)\n .attr('height', 15)\n .attr('fill', 'white');\n legend.append('rect')\n .attr('x', 10)\n .attr('y', 35)\n .attr('width', 15)\n .attr('height', 15)\n .attr('fill', 'green');\n legend.append('text')\n .attr('x', 35)\n .attr('y', 23)\n .attr('width', 15)\n .attr('height', 15)\n .text('Average Participation');\n legend.append('text')\n .attr('x', 35)\n .attr('y', 48)\n .attr('width', 15)\n .attr('height', 15)\n .text('Country\\'s Participation');\n \n // Axis labels\n svg.append('text')\n .attr('x', width/2)\n .attr('y', height + margin.top + margin.bottom - 5)\n .text('Year');\n \n svg.append('text')\n .attr('x', margin.left + 5)\n .attr('y', margin.top - 15)\n .text('Number of Participants');\n \n /** This is the function that actually updates the plot. */\n function update(event) {\n // Group data based on year, this time for specific country/sport\n var country_participation = d3.nest()\n .key(function (d) {return d.Year;})\n .rollup(function (g) {\n return d3.set(g, function (g) {return g.ID;}).values().length;\n })\n .sortKeys(d3.ascending);\n if (sport_selector.value == 'None') {\n country_participation = country_participation.entries(data.filter(function (d) {return d.Country == country_selector.value;}));\n }\n else {\n country_participation = country_participation.entries(data.filter(function (d) {return d.Country == country_selector.value && d.Sport == sport_selector.value;}));\n }\n // Recreate for average\n average_participation = d3.nest()\n .key(function (d) {return d.Year;})\n .rollup(function (g) {\n var participants = d3.set(g, function (g) {return g.ID;}).values().length;\n var countries = d3.set(g, function (g) {return g.Country;}).values().length;\n return participants/countries;\n })\n .sortKeys(d3.ascending);\n if (sport_selector.value == 'None'){\n average_participation = average_participation.entries(data);\n }\n else {\n average_participation = average_participation.entries(data.filter(function (d) {\n return d.Sport == sport_selector.value;\n }));\n }\n\n // Y-axis needs to be updated, but not the X-axis\n var country_max = d3.max(country_participation, function (d) {return d.value;});\n var average_max = d3.max(average_participation, function (d) {return d.value;});\n var y = d3.scaleLinear()\n .domain([0, d3.max([country_max, average_max])]).nice()\n .range([height, 0]);\n d3.select('#participation').select('.yaxis')\n .call(d3.axisLeft(y));\n // Country and average path generators\n var country_line = d3.line()\n .x(function (d) {return x(new Date(d.key));})\n .y(function (d) {return y(d.value);});\n var avg_line = d3.line()\n .x(function (d) {return x(new Date(d.key));})\n .y(function (d) {return y(d.value);});\n path_group.select('#country-path')\n .data([country_participation])\n .transition()\n .duration(1000)\n .attr('d', country_line)\n .attr('stroke', 'green');\n path_group.select('#avg-path')\n .data([average_participation])\n .transition()\n .duration(1000)\n .attr('d', avg_line);\n country_circle.selectAll('circle')\n .data(country_participation).exit()\n .remove();\n country_circle.selectAll('circle')\n .data(country_participation)\n .transition()\n .duration(1000)\n .attr('cx', function (d) {return x(new Date(d.key));})\n .attr('cy', function (d) {return y(d.value);});\n country_circle.selectAll('circle')\n .data(country_participation).enter()\n .append('circle')\n .attr('cx', function (d) {return x(new Date(d.key));})\n .attr('cy', function (d) {return y(d.value);})\n .attr('r', 3)\n .on('mouseover', function (d) {\n tooltip.style('opacity', 1)\n .style('left', (d3.event.pageX + 5) + 'px')\n .style('top', (d3.event.pageY + 10) + 'px');\n tooltip.html(\n 'Participants: ' + Math.round(d.value) +\n '</br>' +\n 'Year: ' + d.key\n );\n })\n .on('mouseout', () => {\n tooltip.style('opacity', 0);\n });\n avg_circle.selectAll('circle')\n .data(average_participation).exit()\n .remove();\n avg_circle.selectAll('circle')\n .data(average_participation)\n .transition()\n .duration(1000)\n .attr('cx', function (d) {return x(new Date(d.key));})\n .attr('cy', function (d) {return y(d.value);});\n avg_circle.selectAll('circle')\n .data(average_participation).enter()\n .append('circle')\n .attr('cx', function (d) {return x(new Date(d.key));})\n .attr('cy', function (d) {return y(d.value);})\n .attr('r', 3)\n .on('mouseover', function (d) {\n tooltip.style('opacity', 1)\n .style('left', (d3.event.pageX + 5) + 'px')\n .style('top', (d3.event.pageY + 10) + 'px');\n tooltip.html(\n 'Participants: ' + Math.round(d.value) +\n '</br>' +\n 'Year: ' + d.key\n );\n })\n .on('mouseout', () => {\n tooltip.style('opacity', 0);\n });\n }\n country_selector.addEventListener('change', update);\n sport_selector.addEventListener('change', update);\n}", "constructor(legos, tableChart, topThemesChart, biggestSetsChart, mostExpensiveSetsChart, priceVTimeChart, sizeVTimeChart) {\r\n\r\n this.legos = legos;\r\n this.years = new Array();\r\n for (var i = 1971; i < 2016; i++) {\r\n this.years.push(i);\r\n }\r\n this.firstTime = true;\r\n this.tableChart = tableChart;\r\n this.biggestSetsChart = biggestSetsChart;\r\n this.topThemesChart = topThemesChart;\r\n this.mostExpensiveSetsChart = mostExpensiveSetsChart;\r\n this.priceVTimeChart = priceVTimeChart;\r\n this.sizeVTimeChart = sizeVTimeChart;\r\n\r\n this.updateCharts(this.years);\r\n\r\n // Initializes the svg elements required for this chart\r\n this.margin = { top: 10, right: 20, bottom: 30, left: 50 };\r\n let divyearChart = d3.select(\"#year-chart\").classed(\"fullView\", true);\r\n\r\n //fetch the svg bounds\r\n this.svgBounds = divyearChart.node().getBoundingClientRect();\r\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\r\n this.svgHeight = 120;\r\n\r\n //add the svg to the div\r\n this.svg = divyearChart.append(\"svg\")\r\n .attr(\"width\", this.svgWidth)\r\n .attr(\"height\", this.svgHeight);\r\n\r\n this.selected = null;\r\n }", "function update(selectedVar) {\n\n // Parse the Data\n d3.csv(\"data.csv\").then(function(data) {\n\n // X axis\n x.domain(data.map(function(d) { return d.Month; }))\n xAxis.transition().duration(1000).call(d3.axisBottom(x))\n\n // Add Y axis\n y.domain([0, d3.max(data, function(d) { return +d[selectedVar] })]);\n yAxis.transition().duration(1000).call(d3.axisLeft(y));\n\n // variable u: map data to existing circle\n var j = svg.selectAll(\".myLine\")\n .data(data)\n // update lines\n j\n .enter()\n .append(\"line\")\n .attr(\"class\", \"myLine\")\n .merge(j)\n .transition()\n .duration(1000)\n .attr(\"x1\", function(d) { console.log(x(d.Month)); return x(d.Month); })\n .attr(\"x2\", function(d) { return x(d.Month); })\n .attr(\"y1\", y(0))\n .attr(\"y2\", function(d) { return y(d[selectedVar]); })\n .attr(\"stroke\", \"grey\")\n .delay(function(d, i) { return i * 500 });\n\n\n // variable u: map data to existing circle\n var u = svg.selectAll(\"circle\")\n .data(data)\n // update bars\n u\n .enter()\n .append(\"circle\")\n .merge(u)\n .transition()\n .duration(1000)\n .attr(\"cx\", function(d) { return x(d.Month); })\n .attr(\"cy\", function(d) { return y(d[selectedVar]); })\n .attr(\"r\", 20)\n .attr(\"fill\", \"red\")\n .delay(function(d, i) { return i * 500 });\n\n // Create axes labels\n svg.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 0 - margin.left + 10)\n .attr(\"x\", 0 - (height / 1.50))\n .attr(\"dy\", \"1em\")\n .attr(\"class\", \"axisText\")\n .attr(\"fill\", \"red\")\n .text(\"Number of Incidents\");\n\n svg.append(\"text\")\n .attr(\"transform\", `translate(${width / 2}, ${height + margin.top + 30})`)\n .attr(\"class\", \"axisText active\")\n .attr(\"id\", \"month\")\n .attr(\"fill\", \"red\")\n .text(\"Month\");\n\n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([80, -105])\n .html(function(d) {\n return (`<strong>${d.Month}<strong><hr><strong>${d[selectedVar]}</strong>`);\n });\n\n svg.selectAll(\"circle\").call(toolTip);\n\n\n // Step 3: Create \"mouseover\" event listener to display tooltip\n svg.selectAll(\"circle\").on(\"mouseover\", function(event, d) {\n toolTip.show(d, this);\n\n //make bubbles big\n d3.select(this)\n .transition()\n .duration(1000)\n .attr(\"r\", 40);\n })\n // Step 4: Create \"mouseout\" event listener to hide tooltip\n .on(\"mouseout\", function(event, d) {\n toolTip.hide(d);\n\n d3.select(this)\n .transition()\n .duration(1000)\n .attr(\"r\", 20);\n });\n\n\n });\n\n}", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function update_chart(){\n// d3.select(\"p\")\n// .on(\"click\", function() {\n\n// update_parameters(\"no2\",\"o3\",\"GDP_per_capita\")\n\n //Update scale domains\n xScale.domain([0, d3.max(dataset, function(d) { return d[0]; })]);\n yScale.domain([0, d3.max(dataset, function(d) { return d[1]; })]);\n // BubbleRadiusScale=d3.scale.linear()\n // .domain([0, d3.max(dataset, function(d) {\n // \t// return d['pm10'];\n // \treturn d[2]\n // })])\n // .range([3, 50]);\n \t//Update X axis\n svg3.select(\".x.axis\")\n \t.transition()\n \t.duration(1000)\n \t.call(xAxis);\n\n //Update Y axis\n svg3.select(\".y.axis\")\n \t.transition()\n \t.duration(1000)\n \t.call(yAxis);\n\n\n //Update all circles\n\t\tsvg3.selectAll(\"circle\")\n\t\t\t.data(dataset)\n\t\t\t.transition()\n\t\t\t.duration(1000)\n\t\t\t// .each(\"start\", function() { // <-- Executes at start of transition\n // \t\t\td3.select(this)\n\n \t// \t\t\t// .attr(\"fill\", \"magenta\")\n \t// \t\t\t// .attr(\"r\", 3);\n\t\t\t// })\n\t\t\t.attr(\"cx\", function(d) {\n\t\t\t\treturn xScale(d[0])\n\t\t\t})\n\t\t\t.attr(\"cy\", function(d) {\n\t\t\t\tif(d[1]){\n\t\t\t\treturn yScale(d[1]);}\n\t\t\t})\n\t\t\t.attr(\"r\", function(d) {\n\t\t\t\treturn BubbleRadiusScale(d[2])\n\t\t \t// return 5\n\t\t\t})\n\t\t\t.attr(\"opacity\", 0.2)\n\t\t\t.style(\"fill\", \"#00e4cf\")\n\t\t\t.attr(\"r\", function(d) {\n\t\t\t \t// return BubbleRadiusScale(d[2]);\n\t\t\t \treturn 5\n\t\t\t\t});\n\n\n\n\tlr = linearRegression(y_values,x_values);\n\tmax = d3.max(x_values);\n\tmyLine\n\t.transition()\n\t\t\t.duration(1000)\n\t .attr(\"x1\",xScale(0))\n\t .attr(\"y1\", yScale(lr.intercept))\n\t .attr(\"x2\",xScale(max))\n\t .attr(\"y2\", yScale((max * lr.slope) + lr.intercept ))\n\t .style(\"stroke\", \"#5ba4ff\");\n\n ///update axis labels\n label_x.transition().duration(1000).text(function(){\n \tif (unit[p1]['unit'] !=\"\"){\n \t\treturn unit[p1]['label']+' ('+unit[p1]['unit']+')'\n \t}else{\n \t\treturn unit[p1]['label']\n \t}\n \t});\n label_y.transition().duration(1000).text(function(){\n \tif (unit[p2]['unit'] !=\"\"){\n \t\treturn unit[p2]['label']+' ('+unit[p2]['unit']+')'\n \t}else{\n \t\treturn unit[p2]['label']\n \t}\n \t});\n}", "function draw() {\n\n \n\n const lineFunc = d3\n .line()\n .x(d => xScale(d.year))\n .y(d => yScale(d.amount));\n\n const dot = svg\n .selectAll(\".dot\")\n .data(state.data, d => d.year) // use `d.year` as the `key` to match between HTML and data elements\n .join(\n enter =>\n // enter selections -- all data elements that don't have a `.dot` element attached to them yet\n enter\n .append(\"circle\")\n .attr(\"class\", \"dot\")\n .attr(\"r\", radius)\n .attr(\"cy\", d => yScale(d.amount))\n .attr(\"cx\", d => xScale(d.year)),\n update => update,\n exit => exit.remove()\n );\n\n const line = svg\n .selectAll(\"path.trend\")\n .data(state.data)\n .join(\n enter =>\n enter\n .append(\"path\")\n .attr(\"class\", \"trend\")\n .attr(\"d\", d => lineFunc(d)),\n update => update, // pass through the update selection\n exit => exit.remove()\n );\n\n console.log(\"drawn!\");\n}", "function transitionAnxiety() {\n\n (async () => {\n\n const data = await d3.csv('./Indicators_of_Anxiety_or_Depression_Based_on_Reported_Frequency_of_Symptoms_During_Last_7_Days.csv')\n\n\n let filterData = data.filter(function (d) {\n return d.Indicator === \"Symptoms of Anxiety Disorder\" && d.Group === \"National Estimate\" && d.Value !== \"\"\n });\n\n filterData.forEach(\n function (d) { d.Value = +d.Value; }\n )\n\n const data2 = await d3.csv('./covid.csv')\n\n // Reshape data with keys set to Subgroups of each Group\n let sumstat = d3.nest()\n .key(function (d) { return d.Subgroup })\n .entries(filterData)\n\n /////////////// Scales /////////////\n const xScale = d3.scaleBand()\n .domain(data.map(function (d) { return d['Time Period Label']; }))\n .range([0, width])\n .paddingInner(1)\n\n // console.log(filterData.map(d => d.Value))\n // console.log(d3.extent(filterData, function (d) { return +d.Value; }))\n\n const yScale = d3.scaleLinear()\n .domain(d3.extent(filterData, function (d) { return d.Value; }))\n .range([height, 0])\n .nice();\n\n // Remove old lines before adding new ones\n d3.selectAll('.line')\n .remove();\n\n // Draw the lines\n svg.selectAll(\"myline\")\n .data(sumstat)\n .enter()\n .append(\"path\")\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"indianred\")\n .transition() // Transition method\n .duration(2000) // Set timing (ms)\n .ease(d3.easeLinear) // Set easing \n .attr(\"stroke-width\", 4)\n .attr(\"d\", function (d) {\n return d3.line()\n .curve(d3.curveNatural)\n .x(function (d) { return xScale(d['Time Period Label']); })\n .y(function (d) { return yScale(d.Value); })\n (d.values)\n })\n .attr('class', 'line')\n\n // Remove old labels before drawing new ones\n d3.selectAll('.labels')\n .remove();\n // Draw the labels\n svg.append('text')\n .attr('x', width / 2)\n .attr('y', -50)\n .style('text-anchor', 'middle')\n .style('font-size', '1.5em')\n .style('fill', 'indianred')\n .style('fill-opacity', 0)\n .transition() // Transition method\n .duration(2000) // Set timing (ms)\n .ease(d3.easeLinear) // Set easing\n .style('fill-opacity', 1)\n .text('Symptoms of Anxiety Disorder')\n .attr('class', 'labels')\n\n\n })()\n\n}" ]
[ "0.7556511", "0.69782275", "0.6917286", "0.68596864", "0.68596864", "0.68596864", "0.68346024", "0.6830071", "0.6796774", "0.67512006", "0.6744672", "0.6722959", "0.6712583", "0.6712583", "0.6712583", "0.659057", "0.65314245", "0.6507085", "0.64613783", "0.64039415", "0.6398271", "0.6361919", "0.635866", "0.62855756", "0.62445736", "0.62442636", "0.6209393", "0.62016845", "0.6140946", "0.61342967", "0.6111261", "0.61025673", "0.60783476", "0.6059408", "0.60416526", "0.6041476", "0.6007409", "0.6000339", "0.5986806", "0.5986383", "0.5973446", "0.5966449", "0.59611225", "0.5946208", "0.5940164", "0.59327716", "0.59124947", "0.5900904", "0.5889837", "0.588836", "0.58866477", "0.58836293", "0.5861725", "0.5847616", "0.582292", "0.5820051", "0.58178", "0.5816771", "0.5812599", "0.5812599", "0.5807126", "0.5787929", "0.5765463", "0.5763925", "0.5762869", "0.5762869", "0.5762869", "0.57621264", "0.576014", "0.57574934", "0.5756926", "0.5756174", "0.5743407", "0.57363874", "0.57306284", "0.572646", "0.57262784", "0.5724636", "0.5714627", "0.57119465", "0.57119465", "0.5706879", "0.57013756", "0.569858", "0.5697864", "0.5681257", "0.5674859", "0.567312", "0.5664891", "0.5660211", "0.565152", "0.5644777", "0.5628437", "0.5625577", "0.56176186", "0.5610968", "0.5610968", "0.5610968", "0.56089026", "0.56076175", "0.5607456" ]
0.0
-1
Defines a sort order so that the smallest dots are drawn on top.
function order(a, b) { return radius(b) - radius(a); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set sortingOrder(value) {}", "function setSortOrder() {\n\tif (sortOrder == \"high to low\") {\n\t\tsortOrder = \"low to high\";\n\t} else {\n\t\tsortOrder = \"high to low\";\n\t}\n}", "get sortingOrder() {}", "function simulateSorting() {\n for (let i = 0; i < values.length; i++) {\n stroke(100, 143, 143);\n fill(50);\n rect(i * 8, height, 8, -values[i], 20);\n }\n}", "sortAlpha(rev) {\n this.allBoxes = this.allBoxes.sort(compare);\n function compare(a, b) {\n let val;\n rev ? val = -1 : val = 1; \n let nameA = a.dataset.name;\n let nameB = b.dataset.name;\n if (nameA < nameB) {\n return -(val);\n }\n if (nameA >= nameB) {\n return val;\n }\n }\n this.allBoxes.forEach(function(el, i) {el.style.order = i});\n }", "function renderSortArrows(g, x, y, sort) {\n g.append(\"path\")\n .attr(\"d\", \"M3,0 L0,5 L6,5 L3,0\")\n .attr(\"transform\", `translate(${x} ${y})`)\n .attr(\"stroke\", \"black\")\n .attr(\"fill\", sort === false ? \"black\" : \"transparent\");\n\n g.append(\"path\")\n .attr(\"d\", \"M3,13 L0,8 L6,8 L3,13\")\n .attr(\"transform\", `translate(${x} ${y})`)\n .attr(\"stroke\", \"black\")\n .attr(\"fill\", sort === true ? \"black\" : \"transparent\");\n}", "function toogleSort(){\r\n\t\tif(settings.sort_type=='desc'){\r\n\t\t\tsettings.sort_type='asc';\r\n\t\t }else{\r\n\t\t\t settings.sort_type='desc';\r\n\t\t }\r\n\t}", "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }", "function sortRenderOrder() {\n \n var sortBy = function(field, reverse, primer){\n var key = primer ? function(x) {return primer(x[field])} : function(x) {return x[field]};\n reverse = [-1, 1][+!!reverse];\n return function (a, b) {\n\treturn a = key(a), b = key(b), reverse * ((a > b) - (b > a));\n } \n }\n \n gadgetRenderOrder.sort(sortBy(\"tabPos\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"paneId\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"parentColumnId\", true, parseInt));\n }", "getSortOptions () {\n return [\n {value: 0, label: 'Price - Low to High'},\n {value: 1, label: 'Price - High to Low'},\n {value: 2, label: 'Distance - Close to Far'},\n {value: 3, label: 'Recomended'}\n ];\n }", "function renderSortAux(e1, e2)\n{\n\tif (e1.y <= e2.y && e1.y > e2.y - Math.floor(e1.height * 0.8) && e1.z > e2.z) // if you're standing on top of them, you get drawn second\n\t{\n\t\treturn true;\n\t}\n\telse if (e1.y > e2.y) // if you're standing in front of them, you get drawn second\n\t{\n\t\treturn true;\n\t}\n\telse // otherwise, you're behind them and get drawn first\n\t{\n\t\treturn false;\n\t}\n}", "function Sort() {}", "set overrideSorting(value) {}", "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 order() {\n\n root = d3.hierarchy({\n children: test\n })\n .sum(function(d) {\n return d.atom;\n })\n .sort(function(a, b) {\n return a.value - b.value;\n });\n\n pack(root);\n\n svg.selectAll(\"circle\")\n .data(root.descendants().slice(1));\n\n circles.transition()\n .duration(4000)\n .attr(\"r\", function(d) {\n return d.r;\n })\n .attr(\"cx\", function(d) {\n return d.x;\n })\n .attr(\"cy\", function(d) {\n return d.y;\n })\n .style(\"fill\", function(d) {\n return color(d.data.atom);\n });\n }", "function defaultOrderFn (a, b) {\n return a - b; // asc order\n}", "function sortNumericallyAscending() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utLinesUtility,\n }, function (up) {\n var keylines = up.inlines.map((function (line) {\n var match = line.match(/(\\d+)/);\n var key = match ? parseInt(match[0]) : 0;\n return [key, line];\n }));\n keylines.sort(function (a, b) { return a[0] - b[0]; });\n return keylines.map(function (keypair) { return keypair[1]; });\n });\n }", "function draw() {\n background(220);\n bubbleSort();\n simulateSorting();\n}", "async function TopologicalSort(){}", "function changeSort(d){\n\n\t\tdata.sort(function(a, b){\n\t\t\treturn d3.descending(a[d.key], b[d.key])\n\t\t})\n\n\t\tpaths.transition()\n\t\t\t.duration(300)\n\t\t\t.delay(function(d, i){\n\t\t\t\treturn i*150;\n\t\t\t})\n\t\t\t.attr('d', function(d, i){\n\t\t\t\treturn templateLine(d)\n\t\t\t})\n\t}", "Sort()\n {\n Tw2Curve.Sort(this, this.states);\n }", "function selectionSetSorted(){\n setClass(nodes[selectionSmallest], 2, \"Default\");\n setClass(nodes[selectionCurrent], 2, \"Sorted\"); //sets the current node to \"sorted\" color\n addStep(\"Current Node \" + (selectionCurrent + 1) + \" is now sorted.\");\n sortedSwitchStep++;\n}", "Sort() {\n\n }", "sortDonation(rev) {\n console.log(this.allBoxes);\n this.allBoxes = this.allBoxes.sort(compare);\n function compare(a, b) {\n let val;\n rev ? val = 1 : val = -1; \n let nameA = a.dataset.fundsNeeded;\n let nameB = b.dataset.fundsNeeded;\n return val * (nameA - nameB);\n }\n this.allBoxes.forEach(function(el, i) {el.style.order = i});\n }", "get overrideSorting() {}", "sort() {\n if (this.sortOrder === 'asc') {\n this.set('sortOrder', 'desc');\n\n } else if (this.sortOrder === '') {\n this.set('sortOrder', 'asc');\n\n } else {\n this.set('sortOrder', '');\n\n }\n }", "OrderGameObjects()\n {\n this.gameObjects.sort(function(a, b) {return a.object.drawOrder - b.object.drawOrder});\n }", "function bubbleSetSorted(){\n addStep(\"Node \" + (bubbleIndex + 1) + \" is now sorted.\");\n if(bubbleIsSorted){\n bubbleEarlyEnd();\n return;\n }\n setClass(nodes[bubbleIndex], 2, \"Sorted\"); //set node to sorted color\n setClass(nodes[bubbleIndex - 1], 2, \"Default\"); //set previous node to default\n bubbleEndStep++;\n bubbleLimit--;\n}", "static getSortOrder(marker) {\n const destructured = UsfmMarkers.destructureMarker(marker);\n if (!destructured)\n return NaN;\n const { baseMarker, number } = destructured;\n const markerCategory = markerToCategoryMap.get(baseMarker);\n if (!markerCategory)\n return NaN;\n const baseOrder = Object.keys(markerCategory).indexOf(baseMarker);\n if (parseInt(number)) {\n return baseOrder + parseInt(number) * 0.1;\n }\n return baseOrder;\n }", "function sort() {\n renderContent(numArray.sort());\n}", "_orderSort(l, r) {\n return l.order - r.order;\n }", "changeSorting() {\n this.currentlySelectedOrder =\n (this.currentlySelectedColumn === this.columnName) ? !this.currentlySelectedOrder : false;\n this.currentlySelectedColumn = this.columnName;\n }", "function SortDistributionsByRank(){\n\tdistros.sort(Sort);\n\tvar lastPlace = 1;\n\tfor (var i = 1; i < distros.length;i++){\n\t\tdistros[i].Place = 1;\n\t\tif (distros[i].ChoosedBy == distros[i-1].ChoosedBy)\n\t\t\tdistros[i].Place = lastPlace;\n\t\telse\n\t\t\tdistros[i].Place = ++lastPlace;\n\t}\n}", "static sortItems()\n {\n //bubble sort\n var length = Explorer.items.length;\n for (var i = 0; i < length; i++) {\n for (var j = 0; j < (length - i - 1); j++) {\n //sort by type, if same type sort by name\n if((Explorer.items[j].type > Explorer.items[j+1].type) ||\n (\n Explorer.items[j].type == Explorer.items[j+1].type &&\n Explorer.items[j].name > Explorer.items[j+1].name\n )\n ) {\n //Swap the numbers\n var tmp = Explorer.items[j]; //Temporary variable to hold the current number\n Explorer.items[j] = Explorer.items[j+1]; //Replace current number with adjacent number\n Explorer.items[j+1] = tmp; //Replace adjacent number with current number\n }\n }\n }\n }", "function sortOrder(a,b) {\n return b.size - a.size;\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 sortOrder(a, b) {\n\t return b.size - a.size;\n\t }", "function sortOrder(a, b) {\n return b.size - a.size;\n }", "function ComparisonSort(e,t,n){this.init(e,t,n)}", "function onPrioritySortChange() {\n\t$(\"#newest\").css({'font-weight': 'normal', 'color': '#A00000'});\n\t$(\"#priority\").css({'font-weight': 'bold', 'color': 'black'});\n window.sort = \"Priority\";\n $sid = $.cookie('sid');\n getFeed($sid, window.filter, window.sort, printToScreen);\n}", "function sortOrder(a, b) {\n return b.size - a.size;\n }", "function sortOrder(a, b) {\n return b.size - a.size;\n }", "sort(){\n\n }", "function GetSortOrder(prop) {\n return function (a, b) {\n if (a[prop] > b[prop]) {\n return direction ? 1 : -1;\n } else if (a[prop] < b[prop]) {\n return direction ? -1 : 1;\n }\n return 0;\n };\n }", "function GetSortOrder(prop) {\n return function (a, b) {\n if (a[prop] > b[prop]) {\n return direction ? 1 : -1;\n } else if (a[prop] < b[prop]) {\n return direction ? -1 : 1;\n }\n return 0;\n };\n }", "function handleSortOrder(e) {\n setSortOrder(+e.target.value)\n }", "priceBasedSort(a, b) {\n if (this.state.sortOrder === \"Descending\") {\n return (\n b.price - a.price\n );\n } else {\n return (\n a.price - b.price\n );\n }\n }", "function order(value) {\n if (value === \"name\" || value === \"count\" || value === \"group\") {\n // if (value !== \"count\")\n console.log(\"value for sort\",value);\n\t x.domain(ordersClaim[value]);\n\t y.domain(ordersSource[value])\n\n //d3.selectAll(\".boundaryLines\").remove();\n var t = svg.transition().duration(1500);\n\n t.selectAll(\".boundaryLines\").attr(\"opacity\", 0);\n\n t.selectAll(\".row\")\n .delay(function(d, i) {\n return y(i) * 4;\n })\n .attr(\"transform\", function(d, i) {\n return \"translate(0,\" + y(i) + \")\";\n })\n .selectAll(\".cell\")\n .delay(function(d) {\n return x(d.x) * 4;\n })\n .attr(\"x\", function(d) {\n // console.log(d.name,y(d.x));\n return x(d.x);\n });\n t.selectAll(\".column\")\n .delay(function(d, i) {\n return x(i) * 4;\n })\n .attr(\"transform\", function(d, i) {\n return \"translate(\" + x(i) + \")rotate(-90)\";\n });\n t.selectAll(\".boundaryLines\").remove();\n } else if (value === \"distance\") {\n alert(\"Please choose a life event from the list below.\");\n } else {\n //chosen life event or service from the drop down, so reorder based on distance to chosen life event / service\n\n //console.log(value);\n\n //reset distances count array\n\n boundaryLines = [];\n for (i = 0; i < n; i++) {\n boundaryLines.push(0);\n }\n //console.log(\"1: \" + boundaryLines);\n\n //get the ID of the chosen node\n chosenNodeID = 0;\n nodes.forEach(function(d) {\n if (d.name === value) {\n chosenNodeID = d.index;\n }\n });\n\n //calculate distances from each node to chosen node\n //update distances count array\n nodes.forEach(function(d, i) {\n var route = sp.findRoute(d.index, chosenNodeID);\n d.distancetocentre = route.distance;\n boundaryLines[d.distancetocentre]++;\n });\n\n //remove any zero value groups\n //console.log(\"2: \" + boundaryLines);\n\n var i;\n while ((i = boundaryLines.indexOf(0)) !== -1) {\n boundaryLines.splice(i, 1);\n }\n\n //console.log(\"3: \" + boundaryLines);\n\n //sort rows, cells, columns\n // orders[\"distance\"] = d3.range(n).sort(function(a, b) {\n // return d3.ascending(\n // nodes[a].distancetocentre,\n // nodes[b].distancetocentre\n // );\n // });\n\n // x.domain(orders[\"distance\"]);\n\n var t1 = svg.transition().duration(1500);\n //remove any boundary lines if they exist\n t1.selectAll(\".boundaryLines\").attr(\"opacity\", 0);\n t1.selectAll(\".boundaryLines\").remove();\n\n t1.selectAll(\".row\")\n .delay(function(d, i) {\n return x(i) * 4;\n })\n .attr(\"transform\", function(d, i) {\n return \"translate(0,\" + x(i) + \")\";\n })\n .selectAll(\".cell\")\n .delay(function(d) {\n return x(d.x) * 4;\n })\n .attr(\"x\", function(d) {\n return x(d.x);\n });\n\n t1.selectAll(\".column\")\n .delay(function(d, i) {\n return x(i) * 4;\n })\n .attr(\"transform\", function(d, i) {\n return \"translate(\" + x(i) + \")rotate(-90)\";\n });\n\n d3.selectAll(\".boundaryLines\").remove();\n\n //draw new boundary lines\n boundaryLines.forEach(function(d, i) {\n if (i != 0 && i != boundaryLines.length - 1) {\n var lineData;\n var xyCoord, zeroCoord;\n\n xyCoord = 0;\n zeroCoord = 0;\n\n boundaryLines.forEach(function(e, j) {\n if (j <= i) {\n //console.log(j + \" - \" + i);\n xyCoord += e;\n }\n });\n\n //console.log(\"xyCoord for \" + i + \": \" + xyCoord);\n\n lineData = [\n {\n x: xyCoord,\n y: zeroCoord\n },\n {\n x: xyCoord,\n y: xyCoord\n },\n {\n x: zeroCoord,\n y: xyCoord\n }\n ];\n\n //console.log(lineData);\n\n boundaryLinesG\n .append(\"path\")\n .attr(\"d\", lineFunction(lineData))\n .classed(\"boundaryLines\", true)\n .attr(\"stroke\", \"DarkGray\")\n .attr(\"stroke-width\", 2)\n .attr(\"fill\", \"none\")\n .attr(\"opacity\", 0);\n }\n });\n\n var t2 = t1.transition();\n t2.selectAll(\".boundaryLines\").attr(\"opacity\", 1);\n }\n }", "function getOrderOptions() {\n const sort = sortOptions[vm.activeSort] || vm.activeSort\n\n if (Array.isArray(sort)) {\n return sort.map(s => {\n const isReverse = s.startsWith('-')\n const str = isReverse ? s.substring(1) : s\n\n return `${isReverse ? '-' : ''}scores.${vm.sT}.${str}`\n })\n }\n\n return `scores.${vm.sT}.${sort}`\n }", "sortTwitsByText( ) {\n this.twits.sort( (a, b) => {\n \n if (this.switchPosition == \"normal\");\n if (a.text > b.text) {\n return 1;\n }\n if (a.text < b.text) {\n return -1;\n }\n if (this.switchPosition == \"reversed\"){\n if (a.text < b.text) {\n return 1;\n }\n if (a.text > b.text) {\n return -1;\n }\n }\n return 0;\n });\n }", "function smartSort(a, b) {\n switch (typeof(a)) {\n case \"string\": return d3.ascending(a, b);\n case \"number\": return a - b; //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n default: return d3.ascending(a, b);\n }\n }", "function initOrder(g){var visited={},simpleNodes=_.filter(g.nodes(),function(v){return!g.children(v).length}),maxRank=_.max(_.map(simpleNodes,function(v){return g.node(v).rank})),layers=_.map(_.range(maxRank+1),function(){return[]});function dfs(v){if(_.has(visited,v))return;visited[v]=true;var node=g.node(v);layers[node.rank].push(v);_.forEach(g.successors(v),dfs)}var orderedVs=_.sortBy(simpleNodes,function(v){return g.node(v).rank});_.forEach(orderedVs,dfs);return layers}", "sortByPriority(){\n this.list.sort(function(a,b){\n var aprio = a.priority; \n var bprio = b.priority; \n if (aprio === bprio){\n return 0; \n }\n else if (aprio === \"high\" && (bprio === \"medium\" || bprio === \"low\")\n || (aprio === \"medium\" && bprio === \"low\")){\n return -1;\n }\n return 1;\n\n });\n $(\"#theTasks\").empty();\n this.list.forEach(function(item){\n item.addToDom();\n });\n }", "function sortOrder(a,b) {\n return b.size - a.size;\n }", "nameSort() {\n orders.sort( \n function(a,b) {\n return (a[0] < b[0]) ? -1 : (a[0] > b[0]) ? 1 : 0; \n }\n ); \n }", "function initializeSortingState() {\n let datasetFields = Object.values(classNameToKeyMap);\n datasetFields.forEach(function(field) {\n ascendingOrder[field] = false;\n });\n}", "function sortInDom(selection) {\n selection.sort((a, b) => {\n if (a.primaryCircle === b.primaryCircle) {\n if (a.primaryCircle) return a.depth - b.depth;\n else return b.depth - a.depth;\n } else if (a.primaryCircle) return 1;\n else return -1;\n });\n\n}", "order_() {\n const lines = Array.from(document.querySelectorAll(cssSelector.TUBE_LINE));\n const sorted = lines.sort((a, b) => {\n return +b.getAttribute(\"score\") - +a.getAttribute(\"score\");\n });\n\n Array.from(this.children).forEach((child) => {\n if (!child.classList.contains(cssClass.FILTER)) {\n this.removeChild(child);\n }\n });\n\n // insert sorted lines back into DOM\n sorted.forEach((line) => this.appendChild(line));\n }", "function selection_sort(){\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 if (data1[p] > data1[j]) {\n p=j;\n }\n if(p!=i){\n \n let temp = data1[i];\n data1[i] = data1[p];\n data1[p] = temp;\n }\n \n \n \n }\n draw_chart2();\n \n }\n \n draw_chart3();\n \n \n}", "sortGraphics(a, b) {\n if (a.z === b.z) {\n return a.id - b.id;\n }\n return a.z - b.z;\n }", "setDrawOrder(drawOrder) {\n this.drawOrder = drawOrder;\n entities.sort(compareDrawOrder);\n }", "sortTxsByHeight (txs, sortingOrder = 'ASCENDING') {\n if (sortingOrder === 'ASCENDING') {\n return txs.sort((a, b) => a.height - b.height)\n }\n return txs.sort((a, b) => b.height - a.height)\n }", "_sortValues() {\n if (this.multiple) {\n const options = this.options.toArray();\n this._selectionModel.sort((a, b) => {\n return this.sortComparator ? this.sortComparator(a, b, options) :\n options.indexOf(a) - options.indexOf(b);\n });\n this.stateChanges.next();\n }\n }", "set renderOrder(value) {}", "sort (sort = {}) {\n let obj = Helpers.is(sort, 'Object') ? sort : { default: sort };\n Object.keys(obj).forEach((key, idx) => {\n Array.prototype.sort.call(this, (a, b) => {\n let vals = (Helpers.is(a.value, 'Object') && Helpers.is(b.value, 'Object')) ? Helpers.dotNotation(key, [a.value, b.value]) : [a, b];\n return (vals[0] < vals[1]) ? -1 : ((vals[0] > vals[1]) ? 1 : 0);\n })[obj[key] === -1 ? 'reverse' : 'valueOf']().forEach((val, idx2) => {\n return this[idx2] = val;\n });\n });\n return this;\n }", "sort() {\n\t}", "sort() {\n\t}", "sortData() {\n this.data.sort(($val1, $val2 ) => {\n const a = JSON.stringify($val1[this.sortBy]);\n const b = JSON.stringify($val2[this.sortBy]);\n if ( a < b ){\n return -this.sortDir;\n }\n if ( a > b ){\n return this.sortDir;\n }\n return 0;\n });\n }", "function byOrder(a,b) {\n if (a.order < b.order) return -1;\n if (a.order > b.order) return 1;\n return 0;\n }", "function increaseSubSort(iOrder) {\n\t\t\tfSubSort += 0.01;\n\t\t\treturn iOrder + fSubSort;\n\t\t}", "function sortByLabel(x,y) {\n return ((x.label == y.label) ? 0 : ((x.label > y.label) ? 1 : -1 ));\n }", "function sort() {\n elementArray.sort(function (x, y) {\n return x.elem - y.elem;\n });\n render(elementArray);\n }", "onUparrow() {\n const ascendingOrder = this.state.columnList.sort((a, b) => a.order - b.order);\n console.log(\"Asc: \", ascendingOrder)\n this.setState({\n columnList: ascendingOrder\n })\n }", "static zSort(up, type, elements_data) {\t\n\t\t\tlet layer = canvas.getLayerByEmbeddedName(type);\n\t\t\tconst siblings = layer.placeables;\t\n\t\t\t// Determine target sort index\n\t\t\tlet z = 0;\n\t\t\tif ( up ) {\n\t\t\t\telements_data.sort((a, b) => a.z - b.z);\n\t\t\t \tz = siblings.length ? Math.max(...siblings.map(o => o.data.z)) + 1 : 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\telements_data.sort((a, b) => b.z - a.z);\n\t\t\t \tz = siblings.length ? Math.min(...siblings.map(o => o.data.z)) - 1 : -1;\n\t\t\t}\n\t\t\n\t\t\t// Update all controlled objects\n\t\t\tfor (let i = 0; i < elements_data.length; i++) {\n\t\t\t\tlet d = up ? i : i * -1;\n\t\t\t\telements_data[i].z = z + d;\t\t\t\t\n\t\t\t}\n\t\t\treturn elements_data;\n\t\t}", "function onSortLabelClick() {\n openFacetHeading.currentComparator =\n (openFacetHeading.currentComparator + 1) %\n openFacetHeading.comparators.length\n refreshFilterPane()\n }", "set order(value) {}", "set order(value) {}", "function sortByPages() {\n let nodes = document.querySelectorAll('.bookCard')\n let lengths = []\n nodes.forEach(node => lengths.push(library[node.dataset.index].numPages))\n lengths.sort((a, b) => a - b)\n console.log(lengths)\n let order\n nodes.forEach((node) => {\n console.log(node)\n order = lengths.findIndex(x => x === library[node.dataset.index].numPages)\n node.style.order = order\n })\n}", "function sortByOrder(values) {\n let vals = [...values]\n return vals.sort((a, b) => Math.sign(a.data.order - b.data.order))\n }", "sort() {\n let time = 0;\n this.toggleSortButton(time);\n\n switch (this.state.currSelection) {\n case MERGESORT:\n time = this.mergeSort();\n break;\n case QUICKSORT:\n time = this.quickSort();\n break;\n case HEAPSORT:\n time = this.heapSort();\n break;\n case BUBBLESORT:\n time = this.bubbleSort();\n break;\n default:\n break;\n }\n\n this.toggleSortButton(time);\n }", "function onSortChanged() {\n\n //Update the style values\n Object.keys($scope.sort)\n .forEach(updateValue);\n\n function updateValue(name) {\n var val = $scope.sort[name],\n field,\n desc;\n switch (val) {\n case true:\n field = name;\n desc = '';\n $scope.style.sort[name] = iconDown;\n break;\n case false:\n field = name;\n field += ' desc';\n $scope.style.sort[name] = iconUp;\n break;\n default:\n $scope.style.sort[name] = '';\n break;\n }\n\n if (field) {\n $scope.sortValue = field;\n }\n }\n }", "function sortByTitle() {\n let nodes = document.querySelectorAll('.bookCard')\n let titles = []\n nodes.forEach(node => titles.push(library[node.dataset.index].title))\n console.log(titles)\n titles.sort()\n console.log(titles)\n\n let order\n nodes.forEach((node) => {\n console.log(node)\n order = titles.findIndex(x => x === library[node.dataset.index].title)\n node.style.order = order\n }) \n}", "function sortThings( order,asc ){\r\n var things = $('#siteTable .thing').sort(function(a,b){\r\n (asc)?(A=a,B=b):(A=b,B=a);\r\n\r\n switch( order )\r\n {\r\n case 'age':\r\n var timeA = new Date( $(A).find('time:first').attr('datetime') ).getTime(),\r\n timeB = new Date( $(B).find('time:first').attr('datetime') ).getTime();\r\n return timeA - timeB;\r\n case 'score':\r\n var scoreA = $(A).find('.score:visible' ).text().match( numberRX ),\r\n scoreB = $(B).find('.score:visible' ).text().match( numberRX );\r\n return scoreA - scoreB;\r\n case 'reports':\r\n var reportsA = $(A).find('.reported-stamp').text().match( numberRX ),\r\n reportsB = $(B).find('.reported-stamp').text().match( numberRX );\r\n return reportsA - reportsB;\r\n };\r\n });\r\n $('#siteTable').empty().append( things );\r\n }", "function sortByPos$1(a, b) {\n return a.pos - b.pos;\n }", "function order(g){var maxRank=util.maxRank(g),downLayerGraphs=buildLayerGraphs(g,_.range(1,maxRank+1),\"inEdges\"),upLayerGraphs=buildLayerGraphs(g,_.range(maxRank-1,-1,-1),\"outEdges\");var layering=initOrder(g);assignOrder(g,layering);var bestCC=Number.POSITIVE_INFINITY,best;for(var i=0,lastBest=0;lastBest<4;++i,++lastBest){sweepLayerGraphs(i%2?downLayerGraphs:upLayerGraphs,i%4>=2);layering=util.buildLayerMatrix(g);var cc=crossCount(g,layering);if(cc<bestCC){lastBest=0;best=_.cloneDeep(layering);bestCC=cc}}assignOrder(g,best)}", "defaultSortBy(a, b) {\n let me = this;\n\n a = a[me.property];\n b = b[me.property];\n\n if (me.useTransformValue) {\n a = me.transformValue(a);\n b = me.transformValue(b);\n }\n\n if (a > b) {\n return 1 * me.directionMultiplier;\n }\n\n if (a < b) {\n return -1 * me.directionMultiplier;\n }\n\n return 0;\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 }", "visualizeSelectionSort() {\n console.log(\"Selection Sort\");\n const array = this.state.array;\n array.forEach((element) => {\n element.visited = false; // if already sorted and clicked the sort function again... we just need to reset the visited flags\n });\n\n for (let i = 0; i < BAR_COUNT - 1; i++) {\n let minPos = i;\n for (let j = i + 1; j < BAR_COUNT; j++) {\n setTimeout(() => {\n if (array[minPos].number > array[j].number) {\n minPos = j;\n }\n let key = array[minPos];\n while (minPos > i) {\n array[minPos] = array[minPos - 1];\n minPos--;\n }\n array[i] = key;\n array[i].visited = true;\n this.setState({array:array,sorted:i === BAR_COUNT - 2 && j === BAR_COUNT - 1});\n }, i * SORTING_SPEED);\n }\n }\n }", "function newOrder(numeros) {\n\n numeros.sort(function(a,b) {\n return a -b ;\n });\n return console.log(numeros);\n}", "function order(value) {\n\t select = heapselect_by(valueOf);\n\t heap = heap_by(valueOf);\n\t function valueOf(d) { return value(d.value); }\n\t return group;\n\t }", "sort(label) {\n // Clean slate\n var labelsTemp = ['Portrait', 'Name'];\n \n // Holds sorted comicdata\n var dataTemp = [];\n \n // Need to re-insert 'render options' because getDerivedStateFromProps removed the first three elements of the area\n // Don't care what data is here\n const renderOptions = [false, true, false, false, false];\n\n if (label.includes('^')) {\n labelsTemp[1] = 'Name v';\n dataTemp = this.sortAscending();\n } else {\n labelsTemp[1] = 'Name ^';\n dataTemp = this.sortDescending();\n }\n \n // Combine render options and comic list data\n const everything = renderOptions.concat(dataTemp);\n // Update state with new comic data and return user to first page of list\n this.setState({displayData: dataTemp, currentPage: 1, labels: labelsTemp});\n // Return data to parent, just in case they care\n this.props.changeDisplayData(everything, true);\n }", "function choiceHowToSort(i, j, arr, symbol) {\n // En cada caso llamaremos a una funcion diferente para hacerlo \n if (symbol == \"<\") {\n // Si el simbolo es el de menor, llamo a la funcion que ordena de menor a mayor\n lowestToHighest(i, j, arr);\n }\n else {\n // Si el simbolo es el de mayor, llamo a la funcion que ordena de mayor a menor\n highestToLowest(i, j, arr);\n }\n}", "sort_by(by){\n\n if(by == \"category\"){\n //its a special case where we can't use value sort..\n this.agents.sort(function(a,b){\n return category_sort(a,b);\n })\n }else{\n //we can use value_sort as a comparator.\n this.agents.sort(function(a,b){\n return value_sort(a,b,by);\n })\n }\n\n //update agent list.\n\n this.div.selectAll(\"p\")\n .data(this.agents)\n .transition()\n .text(function(d,i){\n return d.behavior+d.ID;\n })\n\t .style(\"background-color\",(d,i)=>{\n\t\t return color_back[AGENT_BEHAVIORS.indexOf(d.behavior)];\n\t });\n\n }", "function calibration_sort_points()\n{\n // From http://stackoverflow.com/questions/3240508/javascript-sort-select-elements\n // at 16:07 on 11/02/2013\n x = []\n for(var i=length-1; i>=0; --i) {\n x.push(pointsBox.options[i]);\n pointsBox.removeChild(pointsBox.options[i]);\n }\n x.sort(function(o1,o2){\n if(o1.value < o2.value) {\n return 1;\n } else if(o1.value > o2.value) {\n return -1;\n }\n return 0;\n });\n for(var i=0; i<length; ++i) {\n pointsBox.appendChild(x[i]);\n }\n}", "function sortAscending(){\n \n var series = [1, 0, 0, 0, 1, 1,0];\n return series.sort()\n}", "function sortByRichestAsc() {\n data.sort((a, b) => a.money - b.money);\n updateDOM();\n}", "function SortByName(x, y) {\n return x.state == y.state ? 0 : x.state > y.state ? 1 : -1\n }", "function orderSet() {\n document.getElementById(\"redBlock\").style.order = \"0\";\n document.getElementById(\"blueBlock\").style.order = \"0\";\n document.getElementById(\"greenBlock\").style.order = \"0\";\n document.getElementById(\"pinkBlock\").style.order = \"0\";\n document.getElementById(\"grayBlock\").style.order = \"0\";\n}", "function sortFromOption(){\n // console.log(\"sortFromOption\");\n getSortMethod(nowArray);\n pageNumber = 1;\n changeDisplayAmount(displayType,1);\n}", "function order(value) {\n select = heapselect_by(valueOf);\n heap = heap_by(valueOf);\n function valueOf(d) { return value(d.value); }\n return group;\n }", "function _addNumericSort ( decimalPlace ) {\n\t\t$.each(\n\t\t\t{\n\t\t\t\t// Plain numbers\n\t\t\t\t\"num\": function ( d ) {\n\t\t\t\t\treturn __numericReplace( d, decimalPlace );\n\t\t\t\t},\n\t\n\t\t\t\t// Formatted numbers\n\t\t\t\t\"num-fmt\": function ( d ) {\n\t\t\t\t\treturn __numericReplace( d, decimalPlace, _re_formatted_numeric );\n\t\t\t\t},\n\t\n\t\t\t\t// HTML numeric\n\t\t\t\t\"html-num\": function ( d ) {\n\t\t\t\t\treturn __numericReplace( d, decimalPlace, _re_html );\n\t\t\t\t},\n\t\n\t\t\t\t// HTML numeric, formatted\n\t\t\t\t\"html-num-fmt\": function ( d ) {\n\t\t\t\t\treturn __numericReplace( d, decimalPlace, _re_html, _re_formatted_numeric );\n\t\t\t\t}\n\t\t\t},\n\t\t\tfunction ( key, fn ) {\n\t\t\t\t_ext.type.order[ key+decimalPlace+'-pre' ] = fn;\n\t\t\t}\n\t\t);\n\t}" ]
[ "0.70932597", "0.6748984", "0.65615803", "0.6527891", "0.65183043", "0.648535", "0.63484126", "0.63200426", "0.6301433", "0.6278715", "0.6212716", "0.62029046", "0.618244", "0.61444837", "0.6119178", "0.6102705", "0.6078246", "0.6061914", "0.60590714", "0.605402", "0.6027519", "0.60115945", "0.60063344", "0.59825796", "0.59676653", "0.59663504", "0.5957368", "0.5939624", "0.58930475", "0.58918226", "0.5885122", "0.58788705", "0.5873504", "0.58665633", "0.58517295", "0.5851148", "0.5847324", "0.58457786", "0.5841573", "0.5819244", "0.58167857", "0.58167857", "0.5815355", "0.5799294", "0.5799294", "0.5798683", "0.57817036", "0.5775287", "0.5774516", "0.5771468", "0.5765396", "0.5763663", "0.575821", "0.57513857", "0.5748968", "0.57476014", "0.5744338", "0.5739825", "0.5738663", "0.57346475", "0.5731325", "0.5726149", "0.57163674", "0.5713496", "0.57122594", "0.5700744", "0.5700744", "0.56871486", "0.5687007", "0.56854737", "0.56782824", "0.56561756", "0.5655328", "0.56525457", "0.56516063", "0.56486523", "0.56486523", "0.5637802", "0.562873", "0.56285644", "0.56266075", "0.5616245", "0.5612278", "0.5603271", "0.5602598", "0.5595743", "0.55898017", "0.55878794", "0.55818725", "0.558142", "0.5574987", "0.5570826", "0.5570502", "0.5568596", "0.556501", "0.5563284", "0.5561872", "0.55537546", "0.55393445", "0.55377096", "0.55341804" ]
0.0
-1
After the transition finishes, you can mouseover to change the year.
function enableInteraction() { var yearScale = d3.scale.linear() .domain([1600, 1900]) .range([box.x + 10, box.x + box.width - 10]) .clamp(true); // Cancel the current transition, if any. svg.transition().duration(0); overlay .on("mouseover", mouseover) .on("mouseout", mouseout) .on("mousemove", mousemove) .on("touchmove", mousemove); function mouseover() { label.classed("active", true); } function mouseout() { label.classed("active", false); } function mousemove() { displayYear(yearScale.invert(d3.mouse(this)[0])); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseOverHandle(){\n circle.transition().duration(200).attr('opacity',1);\n caption.transition().duration(200).attr('opacity',1);\n curYear.transition().duration(200).attr('opacity',1);\n d3.selectAll(\".x.axis\")\n .transition()\n .duration(500)\n .attr('opacity',0);\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2005, 2016);\n return function(t) {\n yearLabel.text(Math.round(year(t)));\n transitionYear((year(t)));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(min_year, max_year);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var curYear = $(\"#ci-years-selector\").val();\n if(curYear == endYear) curYear = startYear;\n var year = d3.interpolateNumber(curYear, endYear);\n return function(t) { displayYear(year(t)); };\n }", "function changeYear() {\n let year = d3.select('#selected').property('value')\n buildMap(stateUrl,year)\n}", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function animate(){\n svg.transition()\n .duration(30000)\n .ease(d3.easeLinear)\n .tween(\"year\", tweenYear);\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(1600, 1900);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function year(){\n step=1;\n timeSelector=\"year\";\n resetGraph();\n}", "function tweenYear() {\n\t\t \tvar year = d3.interpolateNumber(1976,2014);\n\t\t return function(t) { updateChart(year(t)); };\n\t }", "function tweenYear() {\n var year = d3.interpolateNumber(bubbleChart.state.year, 2009);\n return function(t) { console.log(t); displayYear(year(t)); };\n }", "updateYear() {\n O('year-label').innerHTML = this.year;\n }", "onYearChange(date) {\n let { value } = this.state;\n value.setFullYear(date.getFullYear());\n this.onChange(value);\n }", "function change_year(e){\n year=parseInt(e.target.id);\n initializing_description();\n document.getElementById('pileups').innerHTML=text;\n document.getElementById('YEAR').innerHTML=year.toString();\n document.getElementById('publications').innerHTML='# publications : '.concat(data_json['publications'][year.toString()].toString());\n document.getElementById('tanom_land').innerHTML='temperature anomaly land : '.concat(temp_anom_land['data'][year.toString()]);\n document.getElementById('tanom_ocean').innerHTML='temperature anomaly ocean : '.concat(temp_anom_ocean['data'][year.toString()]);\n document.getElementById('forest_coverage').innerHTML='forest coverage : '.concat((forest_coverage[year-min_year].toPrecision(3)).toString());\n for(var i=0;i<global_surface_ice.length;i++){\n\tif(global_surface_ice[i]['y']==year) document.getElementById('ice surface (million of km2)').innerHTML='ice surface : '.concat((global_surface_ice[i]['surface'].toPrecision(3)).toString(),' million of km2');\n }\n list_pileups_year();\n list_pairwize_year();\n change();\n}", "updateYears() {\n let years = years_for_decade(this.decade);\n let yearsel = this.year_picker.selectAll('.year-selector').data(years)\n\n yearsel.exit().remove()\n\n let newyears = yearsel.enter()\n .append('a')\n .classed('year-selector', true)\n\n yearsel.merge(newyears)\n .text(year=>year)\n .on('click', year=>this.setYear(year))\n .classed('active', year=>year==this.year)\n }", "changeYear(minYear, maxYear){\n\t\tlet self = this;\n\t\tself.current = minYear;\n\t\tthis.maxYear = maxYear;\n\t\tself.update();\n\t}", "function updateYear(year) {\n yearSelected = year;\n updateShotChart();\n updateSeasonRank();\n}", "function showYear(target, delta) {\n var state = $.data(target, 'calendar');\n var opts = state.options;\n opts.year += delta;\n show(target, state);\n\n var menu = $(target).find('.calendar-menu-year');\n menu.val(opts.year);\n }", "_selectYear(normalizedYear) {\n this.yearSelected.emit(normalizedYear);\n }", "_selectYear(normalizedYear) {\n this.yearSelected.emit(normalizedYear);\n }", "selectYear(normalizedYear) {\r\n this.yearSelected.emit(normalizedYear);\r\n }", "function setYear(value) {\n sliderValue.innerHTML = Math.floor(value);\n slider.viewModel.setValue(0, value);\n //featureLayer.renderer = createRenderer(value);\n queryMun(value).then(displayResults)\n //selectFilter.addEventListener('change', function (event) {\n //setFeatureLayerFilter(value);\n //});\n }", "onYearChange(year) {\n dispatch({\n type: 'SET_YEAR',\n year,\n });\n }", "function next_year(event) {\n $(\"#dialog\").hide(250);\n var date = event.data.date;\n var new_year = date.getFullYear()+1;\n $(\"year\").html(new_year);\n date.setFullYear(new_year);\n init_calendar(date);\n}", "function selectYear(event) {\r\n setRootDate(safeSetYear(listYear.value));\r\n listMonth.dispatchEvent(new Event('change'));\r\n }", "function changeYear(year, currentProvince, settings, topic, titel, subtitel){\n\n\t// Get current chosen province\n\tcurrentProvince = getChosenProvince(currentProvince);\n\tvar texts = getTopic(topic);\n\ttitel = texts.titel;\n\tsubtitel = texts.subtitel;\n\n\tvar nld = settings.nld;\n\tvar years = settings.years;\n\tvar pyramidSettings = settings.pyramidSettings;\n\tvar barSettings = settings.barSettings;\n\tvar mapSettings = settings.mapSettings;\n \tvar data = years[year];\n\n \t// Update visualizations\n \tprovinceDataOne = getProvinceData(data, \"Limburg\");\n \tprovinceDataTwo = getProvinceData(data, currentProvince);\n \tupdatePyramid(provinceDataOne, provinceDataTwo, currentProvince, pyramidSettings);\n \tupdateBarchart(provinceDataOne, provinceDataTwo, currentProvince, topic, titel, subtitel, barSettings);\n \tupdateMap(nld, data, year, currentProvince, topic, titel, subtitel, settings);\n\n}", "onHeaderShowYearPress(event) {\n\t\tthis._currentPickerDOM._autoFocus = false;\n\t\tthis._currentPicker = \"year\";\n\t\tthis.fireEvent(\"show-year-press\", event);\n\t}", "function inputHandler(event) {\n stopAnimation();\n setYear(event.value);\n }", "function dropdownChange() {\n var newYear = d3.select(this).property('value');\n axes(slide,newYear);\n cars(slide,newYear);\n}", "_yearSelected(event) {\n const year = event.value;\n this.yearSelected.emit(this._dateAdapter.createDate(year, 0, 1));\n let month = this._dateAdapter.getMonth(this.activeDate);\n let daysInMonth = this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(year, month, 1));\n this.selectedChange.emit(this._dateAdapter.createDate(year, month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));\n }", "_yearSelected(event) {\n const year = event.value;\n this.yearSelected.emit(this._dateAdapter.createDate(year, 0, 1));\n let month = this._dateAdapter.getMonth(this.activeDate);\n let daysInMonth = this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(year, month, 1));\n this.selectedChange.emit(this._dateAdapter.createDate(year, month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));\n }", "handleYearChange(date) {\n this.setState({\n year: date\n })\n }", "function copyrightYear() {\n var year = new Date().getFullYear();\n document.getElementById(\"year\").innerHTML = year;\n}", "function slideRelease() {\n year = Number(document.getElementById(\"myRange\").value) + begin_year;\n updateYear();\n update();\n}", "function changeYearTexts(yearIndex) {\n var yearTexts = d3.selectAll(\".yearText\")\n for (var i = 0; i < yearTexts[0].length; i++) {\n yearTexts[0][i].innerHTML = parseInt(yearIndex) + 1970;\n };\n}", "function prev_year(event) {\n $(\"#dialog\").hide(250);\n var date = event.data.date;\n var new_year = date.getFullYear()-1;\n $(\"year\").html(new_year);\n date.setFullYear(new_year);\n init_calendar(date);\n}", "function changeData(){\n\tcurYear = sel.value();\n\tmyTitle.html(curYear + \": \" + lev);\n}", "function update2() {\n if (!(year in data)) return;\n title.text(year);\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob2=year;})\n\n .attr(\"sum\", function(value) {value3.push(value);})//new\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob2;\n var tempor=value3.length;\n var newtem= 2014-glob2;\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem)\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n if(tem>12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem+(12-tem))\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n }", "function draw_map_by_year(data, year)\n{\n //Get this year's data\n current_year = get_year_data(data, year);\n\n //Update map's year text\n d3.selectAll(\"#year_text\").text(year)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"60px\")\n .attr(\"fill\", \"black\");\n\n d3.selectAll(\"path\")\n .datum(function(d)\n {\n return {\"name\" : d3.select(this).attr(\"id\")};\n })\n .data(current_year, //Ensure we map correctly\n function(d, i)\n {\n return d.name;\n })\n .transition()\n //The reason that it is 500 and not 750 as the update interval is that I want to color\n //transition be noticeably stable before the start of next year's transition\n .duration(500)\n .style('fill',\n function(d)\n {\n return emissions_scale(d.total_emissions);\n });\n}", "function yearOnclickEvt (year) {\n\t\treturn function () {\n\t\t\thideAll ();\n\t\t\tshowYear (year);\n\t\t}\n\t}", "function displayYear(year) {\n d3.selectAll(\".dot\").data(interpolateData(year), key)\n .call(position)\n .sort(order);\n $(\"#ci-years-selector\").val(Math.round(year));\n }", "function changeYear(){\n\tvar yearView= document.getElementById(\"changeYear\");\n\tyearView.style.display= \"none\";\n\tvar tempYear= yearView.innerHTML;\n\tvar inputYear= document.createElement(\"input\");\n\tinputYear.setAttribute(\"type\", \"number\");\n\ttempDate=getTempDate();\n\tvar tempYear=tempDate.getFullYear();\n\tinputYear.setAttribute(\"value\", tempYear);\n\tyearView.parentNode.insertBefore(inputYear, yearView);\n\tinputYear.onblur= function(){\n\t\ttempYear=inputYear.value;\n\t\tyearView.innerHTML=tempYear;\n\t\tyearView.parentNode.removeChild(inputYear);\n\t\tyearView.style.display = \"\";\n\t\ttempDate.setFullYear(tempYear);\n\t\tdrawCalendar(tempDate);\n\t};\n}", "setStartYear(startyear) {\n this.setState({\n startYear: startyear\n })\n }", "function transition2014() {\n \n svgc.selectAll(\"rect\")\n .data(dataset_2014)\n .transition()\n .duration(700)\n .delay(function (d, i){return i*100;})\n .attr(\"y\", function(d) { return yScale(d.Frequency);})\n .attr(\"height\", function(d) { return height - yScale(d.Frequency); });\n \n}", "function update(value) {\n Year = value;\n // Attribue l'année au span \"range\"\n document.getElementById(\"range\").innerHTML=Year;\n // Attribue l'année à la valeur du input-range\n d3.select(\"#timeslide\").property(\"value\", Year);\n\n ColorMap(Year,MapL,Data);\n }", "updateYear() {\n const newYear = this.state.year + 1;\n this.setState({\n year: newYear\n })\n }", "next() {\n return this.d.clone().add(1, 'year')\n }", "function toggleYearIndicator() {\n\td3.select(\"#yearIndicator\")\n\t\t.style(\"top\", iconYear.offsetTop + \"px\")\n\t\t.transition()\n\t\t.style(\"right\", \"66px\")\n\t\t.text(year);\n\n\tlet timer = d3.timer(() => {\n\t\td3.select(\"#yearIndicator\")\n\t\t\t.transition()\n\t\t\t.style(\"right\", \"-1200px\");\n\t\ttimer.stop();\n\t}, 3000);\n}", "function setDynamicCopyrightYear() {\n var anio = (new Date).getFullYear();\n $( '.copyright' ).find( 'span.year' ).text( anio );\n }", "function createYearDropdown() {\n\n var selectYearDropDown = document.getElementsByClassName('select-year');\n\n for (var i = 0; i < selectYearDropDown.length; i++) {\n selectYearDropDown[i].onclick = function() {\n\n if (prerequisiteTable != null) {\n var text = this.innerHTML.split(/[ ,]+/);\n var year = stringToYear[text[0]] - 1;\n\n var date = new Date();\n\n if (date.getMonth() < 4 || date.getMonth() > 10) { // winter\n prerequisiteTable.selectTerm(year * 2 - 2);\n } else { // fall\n prerequisiteTable.selectTerm(year * 2 - 1);\n }\n\n // updateProgramTitle(this.innerHTML);\n document.getElementById('year-select-subtitle').innerHTML = this.innerHTML;\n }\n }\n }\n}", "setYear(year) {\n this.year = year;\n Object.keys(this.featureIdToObjectDetails).forEach(featureId => {\n const objectDetails = this.featureIdToObjectDetails[featureId];\n objectDetails.object3D.visible = App.featureVisibleInYear(objectDetails, year);\n });\n this.requestRender();\n }", "function update2() {\n if (!(year in data)) return;\n title.text(year);\n// var value3=[];\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob2=year;})\n\n .attr(\"sum\", function(value) {value3.push(value);})//new where temps are stored\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob2;\n var tempor=value3.length;\n var newtem= 2014-glob2;\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem)\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n if(tem>12)\n {\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem+(12-tem))\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n }", "function displayYear(year) {\n dot.data(interpolateData(Math.round(year)), key).call(position).sort(order);\n label.text(Math.round(year));\n dotNames.data(interpolateData(Math.round(year)), key).call(showLabel);\n\n // Updates texts in sidebar.\n titles.data(interpolateTeleData(year), key).call(changeTitle);\n texts.data(interpolateTeleData(year), key).call(changeText);\n if ( year >= 1842 && year < 1847) {\n document.getElementById(\"description\").style.height = \"285px\";\n }\n else {\n document.getElementById(\"description\").style.height = \"350px\";\n }\n }", "function CalendarPopup_showYearNavigation() \r\n{ \r\n this.isShowYearNavigation = true; \r\n}", "function $currentYear() {\n\tvar d = new Date();\n\tvar n = d.getFullYear();\n\tdocument.getElementById(\"copyright\").innerHTML = '&copy; ' + n + ' - Gallery';\n}", "function next() {\r\n saveYearText();\r\n calendar.innerHTML = \"\";\r\n generateYear(++currentYear);\r\n loadFromCalendarData();\r\n}", "function displayInfo(year){\n console.log(year);\n deaths(year);\n current=year;\n \n }", "function selectYear() {\n currentYear = Number(years.val());\n initBodyTable();\n}", "handlePreYearRange(){\n this.setState({\n year: this.state.year - 12,\n });\n }", "function showYear (year) {\n\t\tyearcount++;\n\t\tAQ (\"Year\", \"Select\", year + \"\", yearcount + \"\");\n\t\tvar divs = display [year];\n\t\tvar rand = Math.floor (Math.random () * divs.length);\n\t\tshowImage (divs [rand].children [0], index [year][rand]);\n\t\tfor (var i = 0; i < divs.length; i++)\n\t\t\tdivs [i].className = \"thumbnail-item gallery\";\n\t}", "handleNextYearRange(){\n this.setState({\n year: this.state.year + 12,\n });\n }", "function filterByYearAndSlider() {\n if (running) {\n\n displayYear = displayYear + 1;\n if (displayYear > 2017) {\n displayYear = 2007;\n }\n slider.value = displayYear;\n yearDisplay.innerText = displayYear;\n }\n}", "function setCopyrightDate(){\n year = new Date().getFullYear();\n document.write(year);\n }", "function addCurrentYear() {\n addCurrentYear = document.querySelectorAll(\".current-year\");\n for (let i = 0; i < addCurrentYear.length; i++) {\n addCurrentYear[i].textContent = new Date().getFullYear();\n }\n}", "updateYear(year) {\n\t\tthis.year = year;\n\t\t/*this.chartData = this.allData[this.category]\n\t\t\t.filter(function(d) {\n\t\t\t\tif (d.yr === year) return d;\n\t\t\t});*/\n\t}", "_yearSelectedInMultiYearView(normalizedYear) {\n this.yearSelected.emit(normalizedYear);\n }", "_yearSelectedInMultiYearView(normalizedYear) {\n this.yearSelected.emit(normalizedYear);\n }", "function Year(parent){var _this=_super.call(this,parent)||this;_this.viewClass='e-year-view';_this.isInverseTableSelect=false;return _this;}", "function onChange(a) {\r\n yearcompare = a.year;\r\n this.classList.add(\"active\");\r\n data2 = [];\r\n newData = [];\r\n data2 = data.filter(filterYear);\r\n butterObject[\"name\"] = \"butter\";\r\n butterObject[\"number\"] = data2[0].butter;\r\n cheeseObject[\"name\"] = \"cheese\";\r\n cheeseObject[\"number\"] = data2[0].cheese;\r\n newData.push(butterObject);\r\n newData.push(cheeseObject);\r\n\r\n // variable for the transition of the bars from the second graph. It checks the attributes and changes them to the correct data\r\n var movingBar = svg2.selectAll(\".bar\")\r\n .data(newData);\r\n movingBar.transition().duration(750)\r\n .attr(\"class\", \"bar\")\r\n .attr(\"x\", function(d) {\r\n return x2(d.name);\r\n })\r\n .attr(\"y\", function(d) {\r\n return y2(d.number);\r\n })\r\n .attr(\"width\", x2.bandwidth())\r\n .attr(\"height\", function(d) {\r\n return height - y2(d.number);\r\n });\r\n }", "function yearSelected(item) {\n\n d3.select(\"#years-toolbar\")\n .selectAll(\"*\")\n .classed(\"active\", false);\n\n d3.select(item)\n .classed(\"active\", true);\n\n let previousYear = bubbleChart.selectedYear;\n bubbleChart.selectedYear = $(item).attr(\"name\");\n\n if (bubbleChart.selectedYear !== previousYear) {\n updateBubbleChartVisualisation();\n }\n\n\n}", "function cars(slide,carYear) {\n if (slide == 3) {\n var cars = svg.selectAll(\".cars\").data(data.filter(function(d) { if (d[\"ModelYear\"] == carYear) { return d; }}).filter(function(d) { if (d[\"FuelUnit\"] == \"MPG\") { return d; }}));\n } else {\n var cars = svg.selectAll(\".cars\").data([]);\n }\n\n var carCircles = cars.enter().append(\"circle\").attr(\"class\",\"cars\").merge(cars);\n carCircles.transition().duration(3000).style(\"opacity\",100) \n .attr(\"cx\",function(d) { return xlog(d.CombFE); })\n .attr(\"cy\",function(d) { return ylog(d.AnnualFuelCost); })\n .attr(\"r\",5)\n .style(\"fill\", function(d) { if (d.Type == \"Gas\") { return \"red\"; } else if (d.Type == \"Electric\") { return \"blue\"; } else if (d.Type == \"Plug-In\") { return \"purple\"; } else if (d.Type == \"Fuel Cell\") { return \"green\"; } });\n carCircles\n .on(\"mouseover\",mouseOver)\n .on(\"mousemove\", mouseMove)\n .on(\"mouseleave\",mouseLeave);\n \n cars.exit().transition().duration(1000).style(\"opacity\",0).remove();\n}", "function updateYear(year) {\n\t\t// First set the beggining and end dates\n\t\t/* Variables */\n\n\t\tvar yearStartDate = year + \"-01-01\";\n\t\tvar yearEndDate = year + \"-12-31\";\n\t\t//URL\n\t\tvar yearTotalEnergyURL = POWER_DATA_URL + \"?mode=watts&startDate=\" + yearStartDate + \"%2000:00:00&endDate=\" + yearEndDate + \"%2000:00:00&device=\" + devices[0];\n\t\tconsole.log(yearTotalEnergyURL);\n\n\t\tvar yearTotalEnergyOptions = {\n\t\t\t\txaxis : {\n\t\t\t\t\tmode : 'time',\n\t\t\t\t\tmin : (new Date(yearStartDate)).getTime(),\n\t\t\t\t\tmax : (new Date(yearEndDate)).getTime()\n\t\t\t\t},\n\t\t\t\tyaxis : {\n\t\t\t\t\ttickFormatter : wattFormatter\n\t\t\t\t},\n\t\t\t\tlegend : {\n\t\t\t\t\tshow : true,\n\t\t\t\t\tmargin : 10,\n\t\t\t\t\tbackgroundOpacity : 0.5\n\t\t\t\t},\n\t\t\t\tseries : {\n\t\t\t\t\tlines: { show: true, fill: true }\n\t\t\t\t},\n\t\t\t\tgrid : {\n\t\t\t\t\thoverable : true\n\t\t\t\t}\n\t\t};\n\n\t\tvar yearTotalEnergyData = [];\n\n\t\tvar yearTotalEnergyPlaceholder = $(\"#year_view\");\n\n\t\t// fetch one series, adding to what we got\n\t\tvar yearAlreadyFetched = {};\n\n\t\t// then fetch the data with jQuery\n\t\tfunction onDataReceived_yearTotalEnergyOptions(series) {\n\n\t\t\t// extract the first coordinate pair so you can see that\n\t\t\t// data is now an ordinary Javascript object\n\t\t\tvar firstcoordinate = '(' + series.data[0][0] + ', ' + series.data[0][1] + ')';\n\n\t\t\t// let's add it to our current data\n\t\t\tif(!yearAlreadyFetched[series.label]) {\n\t\t\t\tyearAlreadyFetched[series.label] = true;\n\t\t\t\tyearTotalEnergyData.push(series);\n\t\t\t}\n\t\t\t//debugger;\n\n\t\t\t// and plot all we got\n\t\t\t$.plot(yearTotalEnergyPlaceholder, yearTotalEnergyData, yearTotalEnergyOptions);\n\n\t\t\t//Now, for shits and giggles, lets do some maths!\n\n\t\t};\n\n\t\tvar previousPoint = null;\n\t\t$(\"#year_view\").bind(\"plothover\", function(event, pos, item) {\n\t\t\t$(\"#x\").text(pos.x.toFixed(2));\n\t\t\t$(\"#y\").text(pos.y.toFixed(2));\n\n\t\t\tif(item) {\n\t\t\t\tif(previousPoint != item.dataIndex) {\n\t\t\t\t\tpreviousPoint = item.dataIndex;\n\n\t\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\t\tvar x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);\n\n\t\t\t\t\tshowTooltip(item.pageX, item.pageY, y + \" watts\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\tpreviousPoint = null;\n\t\t\t}\n\n\t\t});\n\n\t\t$.plot(yearTotalEnergyPlaceholder, yearTotalEnergyData, yearTotalEnergyOptions);\n\n\t\t//Now lets do some temp stuff, much simpler *ahhhh*\n\t\t$.ajax({url : yearTotalEnergyURL,method : 'GET',dataType : 'json',success : onDataReceived_yearTotalEnergyOptions});\n\n\t}", "function myFunction() {\n var d = new Date();\n var n = d.getFullYear();\n document.getElementById(\"year\").innerHTML = n;\n}", "removeYearOverview () {\n this.items\n .selectAll ('.item-circle')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .remove ();\n this.labels.selectAll ('.label-day').remove ();\n this.labels.selectAll ('.label-month').remove ();\n this.hideBackButton ();\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "setEndYear(endyear) {\n this.setState({\n endYear: endyear\n })\n }", "function getYear() {\n\n\t//Initate date\n\tlet date = new Date(),\n\t\tdateElement = document.getElementById('siteDate'); //Get the time element from page\n\n\tdateElement.setAttribute('datetime', date); //Set datetiem attribute\n\tdateElement.innerHTML = date.getFullYear(); //Output current year to the page and inside time element\n}", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function mouseover( d ) {\n\t\t// set x and y location\n\t\tvar dotX = iepX( parseYear( d.data.year ) ),\n\t\t\tdotY = iepY( d.data.value ),\n\t\t\tdotBtu = d3.format( \".2f\" )( d.data.value ),\n\t\t\tdotYear = d.data.year,\n\t\t\tdotSource = d.data.name;\n\n\t\t// console.log( \"SOURCE:\", dotSource, index( lineColors( dotSource ) ) );\n\n\t\t// add content to tooltip text element\n\t\t/*tooltip.select( \".tooltip_text\" )\n\t\t\t.style( \"border-color\", lineColors( [ dotSource ] - 2 ) );*/\n\n\t\ttooltip.select( \".tooltip_title\" )\n\t\t\t.text( dotYear )\n\t\t/*.style( \"color\", lineColors( dotSource ) )*/\n\t\t;\n\n\t\ttooltip.select( \".tooltip_data\" )\n\t\t\t.text( dotBtu + \" \" + yUnitsAbbr );\n\n\t\ttooltip.select( \".tooltip_marker\" )\n\t\t\t.text( \"▼\" )\n\t\t/*.style( \"color\", lineColors( dotSource ) )*/\n\t\t;\n\n\t\t//Change position of tooltip and text of tooltip\n\t\ttooltip.style( \"visibility\", \"visible\" )\n\t\t\t.style( \"left\", dotX + ( chart_margins.left / 2 ) + \"px\" )\n\t\t\t.style( \"top\", dotY + ( chart_margins.top / 2 ) + \"px\" );\n\t} //mouseover", "function onClickPreYear(preYear, month, year) {\n preYear.onclick = function() {\n selectCbo(parseInt(year.options[year.selectedIndex].value) - 1, \n month.options[month.selectedIndex].value, \n daysInMonth(month.options[month.selectedIndex].value, \n parseInt(year.options[year.selectedIndex].value) - 1));\n var newDate = new Date();\n newDate.setFullYear(parseInt(year.options[year.selectedIndex].value) - 1, \n month.options[month.selectedIndex].value,\n 1);\n updateYear(year, newDate);\n }\n}", "function MouseOver(d, i) { // Add interactivity\r\n\r\n // Use D3 to select element, change color and size\r\n d3.select(this).attr({\r\n fill: \"green\",\r\n r: radius * 4\r\n });\r\n\r\n // Specify where to put label of text\r\n svg.append(\"text\").attr({\r\n id: \"t\" + d.Year + \"-\" + d.Value + \"-\" + i, // Create an id for text so we can select it later for removing on mouseout\r\n x: function() { return xScale(d.Year) - 30; }, \r\n y: function() { return yScale(d.Value) - 15; }\r\n })\r\n .text(function() {\r\n return [\"Year: \"+d.Year+\" Population: \"+d.Value]; // Value of the text\r\n });\r\n }", "function updateYear(year, date) {\n year.getElementsByTagName(\"option\")[date.getFullYear() - 1900].selected = \"selected\";\n}", "function mouseover(d){ \n var selectedYear = myData.filter(function(s){ \n return s.year == d[0]\n ;})[0];\n var yearSentiment = d3\n .keys(selectedYear.sentiment)\n .map(function(s){ \n return {type:s, sentiment:selectedYear.sentiment[s]};\n });\n \n// call the functions that update the pie chart and legend, to connect this to the mouseover of bar chart\n// refer to the yearSentiment, becaue this new variable tells what data is selected \n pC.update(yearSentiment);\n leg.update(yearSentiment);\n }", "function animate() {\n\n\t\t\tbubbleChartGroup.transition()\n\t\t\t\t.duration(30000)\n\t\t\t\t.ease(d3.easeLinear) /*use linear transition*/\n\t\t\t\t.tween(\"year\",tweenYear); /*use customized tween method to create transitions frame by frame*/\n\n\t\t\t/*show observations text only after the animation is completed*/\n\t\t\tsetTimeout(showObservation, 30500);\n\n\t\t\tfunction showObservation() {\n\t\t\t\t/*change the color of text so that they become visible*/\n\t\t\t\td3.selectAll(\"#observationSection\")\n\t\t\t\t\t.style(\"color\",\"black\");\n\t\t\t\td3.selectAll(\"#observations\")\n\t\t\t\t\t.style(\"color\",\"red\");\n\t\t\t}\n\t }", "function update() {\n if (!(year in data)) return;\n title.text(year);\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob=year;})\n\n .attr(\"sum\", function(value) {value2.push(value);})//new\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob; //find distance from ends of arrays\n var tempor=value2.length;\n var newtem= 2014-glob;\n\n //manipulate arrays to end up with temps\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12)\n {\n while(value2.length!=12)\n {\n while(value2.length>tempor-newtem)\n {\n value2.pop();\n }\n value2.shift();\n\n }\n }\n if(tem==113)\n {\n while (value2.length!=12)\n {\n value2.pop();\n }\n\n }\n if(tem>12)\n {\n while(value2.length!=12)\n {\n while(value2.length>tempor-newtem+(12-tem))\n {\n value2.pop();\n }\n value2.shift();\n }\n }\n \n }//end of update()", "function TimelineYear(parent){var _this=_super.call(this,parent)||this;_this.viewClass='e-timeline-year-view';_this.isInverseTableSelect=true;return _this;}", "function selectYear() {\n\tyearSelected = document.getElementById(\"year\").value;\t// Save the new year\n\trefreshIFrame();\t// Refresh the preview with the new variables\n}", "update_roll(){\n this.circles.transition()\n .duration(this.parent.speed)\n .ease(d3.easeLinear)\n .attr('transform', `translate(${this.year_to_x_for_g(this.parent.year0)}, ${this.label_height})`)\n }", "function copyrightDate() {\n var theDate = new Date();\n $('#copyright p span').text(theDate.getFullYear());\n}", "function onClickNextYear(nextYear, month, year) {\n nextYear.onclick = function() {\n selectCbo(parseInt(year.options[year.selectedIndex].value) + 1, \n month.options[month.selectedIndex].value, \n daysInMonth(month.options[month.selectedIndex].value, \n parseInt(year.options[year.selectedIndex].value) + 1));\n var newDate = new Date();\n newDate.setFullYear(parseInt(year.options[year.selectedIndex].value) + 1, \n month.options[month.selectedIndex].value,\n 1);\n updateYear(year, newDate);\n }\n}", "function update(value) {\n document.getElementById(\"range\").innerHTML = year[value];\n inputValue = year[value];\n d3.selectAll(\".towns\")\n .attr(\"fill\", data => {\n return color(yearSelector(value)[data.properties.town])\n });\n }", "function update(value) {\n document.getElementById(\"range\").innerHTML = year[value];\n inputValue = year[value];\n d3.selectAll(\".towns\")\n .attr(\"fill\", data => {\n return color(yearSelector(value)[data.properties.town])\n });\n }" ]
[ "0.7115008", "0.70984393", "0.7043693", "0.70283806", "0.70166534", "0.7011093", "0.7011093", "0.7011093", "0.6968958", "0.696625", "0.6958392", "0.68476284", "0.68476284", "0.68476284", "0.677184", "0.67223704", "0.6708116", "0.6690718", "0.6662201", "0.6662063", "0.66049767", "0.6553376", "0.6512644", "0.6482716", "0.6450581", "0.6450581", "0.64480245", "0.6435368", "0.640776", "0.6403573", "0.633059", "0.6326771", "0.63150537", "0.62990665", "0.62886095", "0.6284244", "0.6284244", "0.62598974", "0.6211231", "0.61994636", "0.61970687", "0.6192462", "0.6166456", "0.6158947", "0.61412466", "0.613094", "0.6125123", "0.6124843", "0.61040395", "0.6097103", "0.6092926", "0.60761964", "0.6051915", "0.60273534", "0.6013239", "0.5987343", "0.59840196", "0.59836066", "0.597861", "0.5961158", "0.5937876", "0.5932061", "0.59304196", "0.5896055", "0.58950496", "0.5894062", "0.588317", "0.5859239", "0.58578146", "0.58524054", "0.585171", "0.58479005", "0.58479005", "0.58100474", "0.5802521", "0.57992446", "0.57929134", "0.57885504", "0.578448", "0.5784033", "0.5782819", "0.5782819", "0.5782819", "0.57817596", "0.5781736", "0.5779219", "0.5779219", "0.57678175", "0.5760659", "0.5754498", "0.5740959", "0.57368416", "0.5730709", "0.57139707", "0.57111806", "0.56989735", "0.56965464", "0.56957734", "0.5691751", "0.5687006", "0.5687006" ]
0.0
-1
Tweens the entire chart by first tweening the year, and then the data. For the interpolated data, the dots and label are redrawn.
function tweenYear() { var year = d3.interpolateNumber(1600, 1900); return function(t) { displayYear(year(t)); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tweenYear() {\n\t\t \tvar year = d3.interpolateNumber(1976,2014);\n\t\t return function(t) { updateChart(year(t)); };\n\t }", "function tweenYear() {\n var year = d3.interpolateNumber(2005, 2016);\n return function(t) {\n yearLabel.text(Math.round(year(t)));\n transitionYear((year(t)));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(bubbleChart.state.year, 2009);\n return function(t) { console.log(t); displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(min_year, max_year);\n return function(t) { displayYear(year(t)); };\n }", "function updateChart(year) {\n\t\t \tlabel_bubbleChart.text(Math.round(year)); /*update year label, since year could be a fraction of years, round it to the whole year number*/\n\t\t \tcircleGroup\n\t\t /*bind new data interpolated from the dataset based on the tweenYear, and use key to match up with existing bound data*/\n\t\t \t\t.data(interpolateData(year),key) \n\t\t \t\t .attr(\"r\", data=>radiusScale_bubbleChart(data.population))\n\t\t \t\t .attr(\"cx\", data=>xScale_bubbleChart(data.crimeRate))\n\t\t \t\t .attr(\"cy\", data=>yScale_bubbleChart(data.unemploymentRate))\n\t\t \t\t .attr(\"opacity\",.8)\n\t\t \t\t .style(\"fill\", data=>colorScale_bubbleChart(data.category))\n\t\t \t\t .sort(order)\n\t }", "function tweenYear() {\n var curYear = $(\"#ci-years-selector\").val();\n if(curYear == endYear) curYear = startYear;\n var year = d3.interpolateNumber(curYear, endYear);\n return function(t) { displayYear(year(t)); };\n }", "function update() {\n if (!(year in data)) return;\n title.text(year);\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob=year;})\n\n .attr(\"sum\", function(value) {value2.push(value);})//new\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob; //find distance from ends of arrays\n var tempor=value2.length;\n var newtem= 2014-glob;\n\n //manipulate arrays to end up with temps\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12)\n {\n while(value2.length!=12)\n {\n while(value2.length>tempor-newtem)\n {\n value2.pop();\n }\n value2.shift();\n\n }\n }\n if(tem==113)\n {\n while (value2.length!=12)\n {\n value2.pop();\n }\n\n }\n if(tem>12)\n {\n while(value2.length!=12)\n {\n while(value2.length>tempor-newtem+(12-tem))\n {\n value2.pop();\n }\n value2.shift();\n }\n }\n \n }//end of update()", "function interpolateData(year) {\n return testData.map(function(d) {\n return {\n xPos: d.xPos,\n yPos: d.yPos,\n name: d.name,\n size: d.size,\n region: d.region,\n number: interpolateValues(d.number, year),\n textLabel: setLabel(d.name, d.number, year),\n magnitude: d.magnitude,\n image: d.image,\n caption: d.caption\n };\n });\n }", "function animate(){\n svg.transition()\n .duration(30000)\n .ease(d3.easeLinear)\n .tween(\"year\", tweenYear);\n }", "function update() {\nif (!(year in data)) return;\ntitle.text(year);\n\ntempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\ntempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n\n.transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n\n .attr(\"year\",function(d){return glob=year;})\n\n .attr(\"sum\", function(value) {value2.push(value);})//new temps stored here\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); })\n\n\n//manipulating array for temps\nvar tem= 2014-glob; //distance away from ends of arrays\nvar tempor=value2.length;\nvar newtem= 2014-glob;\n\nif(tem >12){newtem=tem*2-tem;}\n\nif(tem<=12){\nwhile(value2.length!=12)\n {\n while(value2.length>tempor-newtem)\n {\n value2.pop();\n }\n value2.shift();\n\n }\n}\nif(tem==113){\n while (value2.length!=12)\n {\n value2.pop();\n } \n}\nif(tem>12){\n while(value2.length!=12)\n {\n while(value2.length>tempor-newtem+(12-tem))\n {\n value2.pop();\n }\n value2.shift();\n }\n}\n\n}//end of update()", "function makeChart(data){\n\n\tvar giniYear = \"gini\" + YEAR_CHOICE;\n\tvar gdpYear = \"gdp\" + YEAR_CHOICE;\n\n\tvar update = svg.selectAll(\".dot\")\n\t\t\t\t .data(data, function(d){ return d.key })\n\n\tvar enter = update.enter()\n .append(\"circle\")\n .attr(\"class\", \"dot\")\n\n update.transition().duration(500)\n .attr(\"cx\", function(d){ return x(d.values[0][gdpYear]); })\n .attr(\"cy\", function(d){ return y(d.values[0][giniYear]); })\n\t .attr(\"r\", 5)\n\n \tvar exit = update.exit();\n\n\texit.remove();\n\n}", "function interpolateData(year) {\n if (!bubbleChart.data) return;\n return bubbleChart.data.map(function(d) {\n return {\n name: d.name,\n region: d.region,\n income: interpolateValues(d.income, year),\n population: interpolateValues(d.population, year),\n lifeExpectancy: interpolateValues(d.lifeExpectancy, year)\n };\n });\n }", "function update2() {\n if (!(year in data)) return;\n title.text(year);\n// var value3=[];\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob2=year;})\n\n .attr(\"sum\", function(value) {value3.push(value);})//new where temps are stored\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob2;\n var tempor=value3.length;\n var newtem= 2014-glob2;\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem)\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n if(tem>12)\n {\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem+(12-tem))\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n }", "function update2() {\n if (!(year in data)) return;\n title.text(year);\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob2=year;})\n\n .attr(\"sum\", function(value) {value3.push(value);})//new\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob2;\n var tempor=value3.length;\n var newtem= 2014-glob2;\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem)\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n if(tem>12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem+(12-tem))\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n }", "function lollipopChart(data) {\r\n\r\n var nest = d3.nest()\r\n .key(d=>d.Year)\r\n .entries(data)\r\n\r\n zScale.domain([d3.min(data, d=>d.Magnitude),d3.max(data,d=>d.Magnitude)])\r\n\r\n var quakes = svgMap.selectAll('quake')\r\n .data(data)\r\n .enter()\r\n .append(\"circle\")\r\n .attr(\"class\", \"quake\")\r\n .attr(\"cx\", d=> projection([d.Longitude, d.Latitude])[0])\r\n .attr(\"cy\", d => projection([d.Longitude, d.Latitude])[1])\r\n .attr(\"r\", d=>zScale(d.Magnitude))\r\n\r\n xScale.domain([d3.min(nest,d=>d3.min(d.values,d=>d.Date)),d3.max(nest,d=>d3.max(d.values,d=>d.Date))])\r\n yScale.domain([d3.min(nest,d=>d3.min(d.values,d=>d.Magnitude)),d3.max(nest,d=>d3.max(d.values,d=>d.Magnitude))])\r\n rScale.domain([d3.min(nest,d=>d3.min(d.values,d=>d.Magnitude)), d3.max(nest, d=>d3.max(d.values,d=>d.Magnitude))])\r\n \r\n \r\n xAxis.scale(xScale)\r\n yAxis.scale(yScale)\r\n\r\n axisX.attr(\"class\", \"x-axis\")\r\n .call(xAxis)\r\n \r\n axisY.attr(\"class\", \"y-axis\")\r\n .call(yAxis)\r\n \r\n\r\n var selectLineG = svgGraph.selectAll(\"lineG\")\r\n .data(nest)\r\n .enter()\r\n .append(\"g\")\r\n .attr(\"class\",\"lineG\")\r\n\r\n var line = selectLineG.selectAll(\"line\")\r\n .data(d=>d.values)\r\n .enter()\r\n .append(\"line\")\r\n\r\n line.attr(\"x1\", d=>xScale(d.Date))\r\n .attr(\"y1\", d=>yScale(d.Magnitude))\r\n .attr(\"x2\", d=>xScale(d.Date))\r\n .attr(\"y2\",graphHeight)\r\n .attr(\"class\", \"line\")\r\n\r\n var bubble = svgGraph.selectAll(\"bubble\")\r\n .data(data)\r\n .enter()\r\n .append(\"circle\")\r\n .attr(\"cx\", d=>xScale(d.Date))\r\n .attr(\"cy\", d=>yScale(d.Magnitude))\r\n .attr(\"r\",d=>rScale(d.Magnitude))\r\n .attr(\"class\", \"bubble\")\r\n\r\n //create the brush\r\n var brush = svgGraph.append(\"g\")\r\n .attr(\"class\", \"brush\")\r\n .call(d3.brush()\r\n .extent([[0,0], [graphWidth, graphHeight+5]])\r\n .on(\"brush\", highlightedBubble)\r\n .on(\"end\",displayQuake))\r\n \r\n //function for the brush function\r\n function highlightedBubble() {\r\n if (d3.event.selection != null) {\r\n bubble.attr(\"class\", \"nonBrush\")\r\n var brushCoordinate = d3.brushSelection(this)\r\n bubble.filter(function() {\r\n var cx = d3.select(this).attr(\"cx\"),\r\n cy = d3.select(this).attr(\"cy\")\r\n return isBrushed(brushCoordinate, cx, cy)\r\n })\r\n .attr(\"class\", \"brushed\")\r\n }}\r\n \r\n //function for displaying the earthquakes on the world map based on the brushed data on the graph.\r\n function displayQuake() {\r\n if (!d3.event.selection) return\r\n d3.select(this).on(brush.move, null)\r\n var d_brushed = d3.selectAll(\".brushed\").data()\r\n if (d_brushed.length>0) {\r\n clearQuake()\r\n populateQuake(d_brushed)} \r\n \r\n else {clearQuake()}}\r\n\r\n }", "function updateYear(year) {\n\t\t// First set the beggining and end dates\n\t\t/* Variables */\n\n\t\tvar yearStartDate = year + \"-01-01\";\n\t\tvar yearEndDate = year + \"-12-31\";\n\t\t//URL\n\t\tvar yearTotalEnergyURL = POWER_DATA_URL + \"?mode=watts&startDate=\" + yearStartDate + \"%2000:00:00&endDate=\" + yearEndDate + \"%2000:00:00&device=\" + devices[0];\n\t\tconsole.log(yearTotalEnergyURL);\n\n\t\tvar yearTotalEnergyOptions = {\n\t\t\t\txaxis : {\n\t\t\t\t\tmode : 'time',\n\t\t\t\t\tmin : (new Date(yearStartDate)).getTime(),\n\t\t\t\t\tmax : (new Date(yearEndDate)).getTime()\n\t\t\t\t},\n\t\t\t\tyaxis : {\n\t\t\t\t\ttickFormatter : wattFormatter\n\t\t\t\t},\n\t\t\t\tlegend : {\n\t\t\t\t\tshow : true,\n\t\t\t\t\tmargin : 10,\n\t\t\t\t\tbackgroundOpacity : 0.5\n\t\t\t\t},\n\t\t\t\tseries : {\n\t\t\t\t\tlines: { show: true, fill: true }\n\t\t\t\t},\n\t\t\t\tgrid : {\n\t\t\t\t\thoverable : true\n\t\t\t\t}\n\t\t};\n\n\t\tvar yearTotalEnergyData = [];\n\n\t\tvar yearTotalEnergyPlaceholder = $(\"#year_view\");\n\n\t\t// fetch one series, adding to what we got\n\t\tvar yearAlreadyFetched = {};\n\n\t\t// then fetch the data with jQuery\n\t\tfunction onDataReceived_yearTotalEnergyOptions(series) {\n\n\t\t\t// extract the first coordinate pair so you can see that\n\t\t\t// data is now an ordinary Javascript object\n\t\t\tvar firstcoordinate = '(' + series.data[0][0] + ', ' + series.data[0][1] + ')';\n\n\t\t\t// let's add it to our current data\n\t\t\tif(!yearAlreadyFetched[series.label]) {\n\t\t\t\tyearAlreadyFetched[series.label] = true;\n\t\t\t\tyearTotalEnergyData.push(series);\n\t\t\t}\n\t\t\t//debugger;\n\n\t\t\t// and plot all we got\n\t\t\t$.plot(yearTotalEnergyPlaceholder, yearTotalEnergyData, yearTotalEnergyOptions);\n\n\t\t\t//Now, for shits and giggles, lets do some maths!\n\n\t\t};\n\n\t\tvar previousPoint = null;\n\t\t$(\"#year_view\").bind(\"plothover\", function(event, pos, item) {\n\t\t\t$(\"#x\").text(pos.x.toFixed(2));\n\t\t\t$(\"#y\").text(pos.y.toFixed(2));\n\n\t\t\tif(item) {\n\t\t\t\tif(previousPoint != item.dataIndex) {\n\t\t\t\t\tpreviousPoint = item.dataIndex;\n\n\t\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\t\tvar x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);\n\n\t\t\t\t\tshowTooltip(item.pageX, item.pageY, y + \" watts\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\tpreviousPoint = null;\n\t\t\t}\n\n\t\t});\n\n\t\t$.plot(yearTotalEnergyPlaceholder, yearTotalEnergyData, yearTotalEnergyOptions);\n\n\t\t//Now lets do some temp stuff, much simpler *ahhhh*\n\t\t$.ajax({url : yearTotalEnergyURL,method : 'GET',dataType : 'json',success : onDataReceived_yearTotalEnergyOptions});\n\n\t}", "function setCountryData(countryIndex) {\n// instead of setting whole data array, we modify current raw data so that a nice animation would happen\nfor (var i = 0; i < lineChart.data.length; i++) {\nvar di = covid_cc_timeline[i].list;\n\nvar countryData = di[countryIndex];\nvar dataContext = lineChart.data[i];\nif (countryData) {\ndataContext.confirmed = countryData.confirmed;\ndataContext.deaths = countryData.deaths;\n\ndataContext.recovered = countryData.recovered;\ndataContext.active = countryData.confirmed - countryData.recovered - countryData.deaths;\nvalueAxis.min = undefined;\nvalueAxis.max = undefined;\n}\nelse {\ndataContext.confirmed = 0;\ndataContext.deaths = 0;\n\ndataContext.deaths = 0;\ndataContext.active = 0;\nvalueAxis.min = 0;\nvalueAxis.max = 10;\n}\n}\n\nlineChart.invalidateRawData();\nupdateTotals(currentIndex);\nsetTimeout(updateSeriesTooltip, 1000);\n}", "function setupChart(chart, data, year) {\n\t\tchart\n\t\t\t.append('g')\n\t\t\t\t.attr('transform', 'translate('+ 110 +', '+margin.top+')')\n\t\t\t\t.selectAll('polyline')\n\t\t\t\t.data(data)\n\t\t\t\t.enter()\n\t\t\t\t.append('polyline')\n\t\t\t\t.attr({\n\t\t\t\t\tfill: \"none\",\n\t\t\t\t\tstroke: function(d) {\n\t\t\t\t\t\treturn that.utilities.crimeColors[d.type];\n\t\t\t\t\t},\n\t\t\t\t\tpoints: function(d) {\n\t\t\t\t\t\tvar points = \"\";\n\n\t\t\t\t\t\t// add a point on the polyline for each value in points\n\t\t\t\t\t\td.points.forEach(function(point, index) {\n\t\t\t\t\t\t\tpoints += \" \" + xScale(index) + \",\" + yScale(point);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn points;\n\t\t\t\t\t},\n\t\t\t\t\topacity: 1\n\t\t\t\t});\n\n\t\t// underneath the polylines, draw a bunch of bars\n\t\t// these will be used to show when a month is selected\n\t\tvar monthBars = chart\n\t\t\t.append('g')\n\t\t\t\t.attr('transform', 'translate('+ 110 +', '+margin.top+')')\n\t\t\t\t.selectAll('rect')\n\t\t\t\t.data(months)\n\t\t\t\t.enter()\n\t\t\t\t.append('rect')\n\t\t\t\t.attr({\n\t\t\t\t\tclass: \"month-bar\",\n\t\t\t\t\tx: function(d, i) {\n\t\t\t\t\t\treturn xScale(i) - 4;\n\t\t\t\t\t},\n\t\t\t\t\ty: 0,\n\t\t\t\t\twidth: 9,\n\t\t\t\t\theight: 120\t\n\t\t\t\t});\n\n\t\t// draw the axes\n\n\t\tvar vGuideScale = d3.scale.linear()\n\t\t\t.domain([0, 30])\n\t\t\t.range([height, 0]);\n\n\t\tvar vAxis = d3.svg.axis()\n\t\t\t.scale(vGuideScale)\n\t\t\t.orient('left')\n\t\t\t.ticks(10);\n\n\t\tvar vGuide = chart.append('g');\n\n\t\tvAxis(vGuide);\n\n\t\tvGuide.attr('transform', 'translate('+margin.left+', '+margin.top+')')\n\t\t\t.append(\"text\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .attr(\"x\", height/-2)\n\t .attr(\"y\", -45)\n\t .attr(\"dy\", \".71em\")\n\t .style(\"text-anchor\", \"middle\")\n\t .style(\"font-size\",\"16px\")\n\t .text(\"Number of Crimes\");\n\n\t\tvGuide.selectAll('path')\n\t\t\t.style({fill: 'none', stroke: \"#000\"});\n\n\t\tvGuide.selectAll('line')\n\t\t\t.style({stroke: '#000'});\n\n\t\tvar hAxis = d3.svg.axis()\n\t\t\t.scale(xScale)\n\t\t\t.tickFormat(function(d){\n\t\t\t\treturn months[d];\n\t\t\t})\n\t\t\t.orient('bottom');\n\n\t\tvar hGuide = chart.append('g');\n\n\t\thAxis(hGuide);\n\t\thGuide.attr('transform', 'translate('+margin.left+', '+(height+margin.top)+')');\n\n\t\thGuide.selectAll('path')\n\t\t\t.style({\n\t\t\t\tfill: 'none', \n\t\t\t\tstroke: \"#000\"\n\t\t\t});\n\n\t\thGuide.selectAll('line')\n\t\t\t.style({stroke: '#000'});\n\n\t\thGuide.selectAll('text')\n\t\t\t.style(\"text-anchor\", \"end\")\n\t\t\t.attr({\n\t\t\t\tdx: \"-.8em\",\n\t\t\t\tdy: \".15em\",\n\t\t\t\ttransform: function(d) {\n\t \treturn \"rotate(-65)\" \n\t }\n\t\t\t});\n\n\t\thGuide.selectAll('.tick')\n\t\t\t.attr(\"data-month\", function(d, i) {\n\t\t\t\treturn months[i];\n\t\t\t})\n\t\t\n\t\t// add title to chart\n\t\tchart.append('text')\n\t\t\t.text(year)\n\t\t\t.attr('transform', 'translate('+ 220 +', '+margin.top+')')\n\t\t\t.attr('text-anchor', 'middle');\n\n\t\t\n\n\t\t// add events to chart\n\n\t\t// when the mouse moves this chart, we want to highlight the month the mouse is currently over\n\t\tchart.on(\"mousemove\", function(d,i) {\n\t\t\t$(this).find(\"[data-month]\").each(function(monthIndex, tick) {\n\t\t\t\t// check if the mouse is within the bounding rect for this tick\n\t\t\t\t// if so, move the marker to this tick\n\t\t\t\t\n\t\t\t\tif (d3.event.pageX >= tick.getBoundingClientRect().left && d3.event.pageX <= tick.getBoundingClientRect().right) {\n\t\t\t\t\t// position the marker over the line for this tick\n\t\t\t\t\td3.select(\"#month-selection\").style( \"left\", $(tick).find(\"line\").position().left );\n\t\t\t\t\td3.select(\"#month-selection\").style( \"display\", \"block\" );\n\n\t\t\t\t\t// show the tooltip for this month\n\t\t\t\t\tshowGraphToolTip(data, monthIndex, year, $(tick).find(\"line\").position().left, tick.getBoundingClientRect().bottom);\n\n\t\t\t\t\t// break out of the loop - don't need to check any other months\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t// on click, we want to select this month\n\t\tchart.on(\"click\", function() {\n\t\t\t$(this).find(\"[data-month]\").each(function(i, tick) {\n\t\t\t\t// check if the mouse is within the bounding rect for this tick\n\t\t\t\tif (d3.event.pageX >= tick.getBoundingClientRect().left && d3.event.pageX <= tick.getBoundingClientRect().right && d3.event.pageY <= tick.getBoundingClientRect().bottom) {\n\t\t\t\t\t// select this month\n\t\t\t\t\tevents.publish('crime/month_selected', {\n\t\t\t\t\t\tmonth: months[i],\n\t\t\t\t\t\tyear: year\n\t\t\t\t\t});\n\n\t\t\t\t\t// select the bar for this month\n\t\t\t\t\t// and display it if the month is selected\n\t\t\t\t\tchart.select(\".month-bar:nth-child(\" + (i + 1) + \")\")\n\t\t\t\t\t\t.classed(\"month-bar-selected\", that.selectedMonths.indexOf(months[i] + year) != -1);\n\n\t\t\t\t\t// break out of the loop - don't need to check any other months\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function changeYearTexts(yearIndex) {\n var yearTexts = d3.selectAll(\".yearText\")\n for (var i = 0; i < yearTexts[0].length; i++) {\n yearTexts[0][i].innerHTML = parseInt(yearIndex) + 1970;\n };\n}", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function interpolateData(year) {\n return data.map(function(d) {\n return {\n country: d.country,\n region: d.region,\n code: d.code,\n xVal: interpolateValues(d.x, year),\n yVal: interpolateValues(d.y, year),\n zVal: interpolateValues(d.z, year)\n };\n });\n }", "function updateLineChart() {\n\n // Scales\n var x = d3.scaleLinear()\n .range([0, width]);\n\n var y = d3.scaleLinear()\n .range([height, 0]);\n\n // transition\n var t = d3.transition().duration(750);\n\n // get option for data type\n var option = d3.select(\"#data-type\").property('value');\n\n var startyr = tooltipSlider.noUiSlider.get()[0];\n var endyr = tooltipSlider.noUiSlider.get()[1];\n\n // filter according to start and end years to update data\n filtered_alldata = data.filter(function(d){return d.YEAR >= startyr && d.YEAR <= endyr;});\n\n // add two more lines for males and females\n filtered_male = male.filter(function(d){return d.YEAR >= startyr && d.YEAR <= endyr;});\n filtered_female = female.filter(function(d){return d.YEAR >= startyr && d.YEAR <= endyr;});\n\n // var line\n var line = d3.line()\n .x(function (d) { return x(d.YEAR);})\n .y(function (d) { return y(d[option]);});\n\n // var axes\n x.domain([d3.min(filtered_alldata, function(d) { return d.YEAR; }), d3.max(filtered_alldata, function(d) { return d.YEAR; })]);\n y.domain([d3.min(filtered_alldata, function(d) { return d[option]; })-0.5, d3.max(filtered_alldata, function(d) { return d[option]; })+0.5]);\n\n var xAxis = d3.axisBottom(x).tickValues(d3.range(startyr, endyr)).tickFormat(d3.format(\".0f\"));\n var yAxis = d3.axisLeft(y);\n\n //axes\n var xxx = svg.selectAll(\".axis--x\")\n .data(filtered_alldata);\n\n var yyy = svg.selectAll(\".axis--y\")\n .data(filtered_alldata);\n\n xxx.enter().append(\"g\")\n .merge(xxx)\n .attr(\"class\", \"axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n yyy.enter().append(\"g\")\n .merge(yyy)\n .transition(t)\n .attr(\"class\", \"axis--y\")\n .call(yAxis);\n\n xxx.exit().remove();\n yyy.exit().remove();\n \n // two more paths for male and female\n var male_path = svg.selectAll(\".mline\")\n .data(filtered_male);\n male_path.enter().append(\"path\")\n .merge(male_path)\n .transition(t)\n .attr(\"class\", \"mline\")\n .attr(\"data-legend\",\"Male\")\n .attr(\"d\", line(filtered_male));\n male_path.exit().remove();\n\n var female_path = svg.selectAll(\".fline\")\n .data(filtered_female);\n female_path.enter().append(\"path\")\n .merge(female_path)\n .transition(t)\n .attr(\"class\", \"fline\")\n .attr(\"data-legend\",\"Female\")\n .attr(\"d\", line(filtered_female));\n female_path.exit().remove();\n\n\n // path\n var path = svg.selectAll(\".line\")\n .data(filtered_alldata);\n path.enter().append(\"path\")\n .merge(path)\n .transition(t)\n .attr(\"class\", \"line\")\n .attr(\"data-legend\",\"Total\")\n .attr(\"d\", line(filtered_alldata));\n path.exit().remove();\n\n\n // axes titles\n svg.append(\"text\")\n .attr(\"text-anchor\", \"middle\") // this makes it easy to centre the text as the transform is applied to the anchor\n .attr(\"transform\", \"translate(\"+ (-margin.left/1.8) +\",\"+(height/2)+\")rotate(-90)\") // text is drawn off the screen top left, move down and out and rotate\n .text(\"Percetage\")\n .style(\"font-weight\", 400);\n\n svg.append(\"text\")\n .attr(\"text-anchor\", \"middle\") // this makes it easy to centre the text as the transform is applied to the anchor\n .attr(\"transform\", \"translate(\"+ (width/2) +\",\"+(height+(margin.bottom-10))+\")\") // centre below axis\n .text(\"Year\")\n .style(\"font-weight\", 400);\n\n // chart title\n svg.append(\"text\")\n .attr(\"text-anchor\", \"middle\") // this makes it easy to centre the text as the transform is applied to the anchor\n .attr(\"transform\", \"translate(\"+ (width/2) +\",\" + (-10)+\")\") // centre below axis\n .text(\"Survey Results over Selected Years\")\n .attr(\"class\", \"chart-title\")\n .style(\"font-weight\", 400);\n\n d3.selectAll(\".chart-title\").html(\"Suicidal \" + option.toLowerCase() + \" data from \" + startyr + \" to \" + endyr);\n\n // create option-specific tip\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-20, 0])\n .html(function(d) {\n selected_year = d.YEAR;\n male_data = male.filter(function(d){return d.YEAR == selected_year})[0][option];\n female_data = female.filter(function(d){return d.YEAR == selected_year})[0][option];\n\n return \"<strong>\" + d.YEAR + \" survey results on suicidal \" + option.toLowerCase()+ \"</strong>\" +\n \"<br>\" + \"Total: \" + \"<span style='color:yellow'>\"+ d[option] + \"%\" + \"</span>\" +\n \"<br>\" + \"Female: \" + \"<span style='color:yellow'>\"+ female_data + \"%\" + \"</span>\" +\n \"<br>\" + \"Male: \" + \"<span style='color:yellow'>\"+ male_data + \"%\" + \"</span>\";\n });\n\n svg.call(tip);\n\n // dots\n var dots = svg.selectAll(\".dot\")\n .data(filtered_alldata);\n\n dots.enter().append(\"circle\")\n .merge(dots)\n .attr(\"class\", \"dot\")\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .on(\"click\", function(d){return updateBarChart(d);})\n .transition(t)\n .attr(\"cx\", line.x())\n .attr(\"cy\", line.y())\n .attr(\"r\", 8);\n dots.exit().remove();\n\n}", "function drawPyramidsChart() {\r\n aleph.years = d3.keys(aleph.data.pyramid[0]).filter(function (d, i) {\r\n return aleph.PyramidNonYearFields.indexOf(d) == -1;\r\n });\r\n\r\n aleph.nested_pure_year_all_data = [];\r\n\r\n aleph.years.forEach(function (d, i) {\r\n // locally store year value ...\r\n var year = d;\r\n\r\n // rollup nest data to count demographic per year\r\n nested_all_data = d3\r\n .nest()\r\n .key(function () {\r\n return +year;\r\n })\r\n .key(function (d) {\r\n return d.Age;\r\n })\r\n .rollup(function (leaves) {\r\n return {\r\n d: d3.sum(leaves, function (d) {\r\n return +d[year];\r\n }),\r\n };\r\n })\r\n .entries(aleph.data.pyramid);\r\n\r\n // ALL DATA\r\n aleph.nested_pure_year_all_data.push({\r\n year: nested_all_data[0].key,\r\n yearTotalPopulation: sumYear(nested_all_data[0].values),\r\n });\r\n });\r\n\r\n console.log(aleph.nested_pure_year_all_data);\r\n\r\n d3.selectAll(\".pyramid-slider\")\r\n .selectAll(\".ui-slider-handle.ui-corner-all.ui-state-default.left\")\r\n .append(\"label\")\r\n .attr(\"class\", \"aleph-slider-year-label selected-year aleph-hide\")\r\n .text(\"\");\r\n\r\n /* d3.select(\"#pyramid-slider\") */\r\n d3.selectAll(\".pyramid-slider\")\r\n .append(\"span\")\r\n .attr(\r\n \"class\",\r\n \"aleph-slider-year-label-locked-year-marker-span aleph-hide\"\r\n );\r\n\r\n d3.selectAll(\".aleph-slider-year-label-locked-year-marker-span\")\r\n .append(\"div\")\r\n .attr(\"class\", \"aleph-slider-year-label-locked-year-marker\");\r\n\r\n d3.selectAll(\".pyramid-slider\")\r\n .append(\"label\")\r\n .attr(\"class\", \"aleph-slider-year-label locked-year aleph-hide\")\r\n .text(\"\");\r\n\r\n // loop through each pyramid\r\n aleph.pyramids.forEach(function (d) {\r\n // call function to build both new pyramids\r\n buildPyramids(d, \"onload\");\r\n }); // end forEach\r\n\r\n return;\r\n}", "function displayYear(year) {\n dot.data(interpolateData(Math.round(year)), key)\n .call(position)\n .sort(order);\n label.text(Math.round(year));\n }", "function interpolate_years(data){\n\n // Adds interpolated data points to data\n\t\n var years = _.range(2002, 2030+1);\n\n\n for (var i = 0; i < data.length; i++) {\n \tdata[i]\n\n\n\n var p_years = _.map(data[i]['Points'], function(o){\n \treturn o['Y']\n });\n\n\n // mean sample n for interpolated data points\n var mean_n = _.mean(\n _.map(data[i]['Points'], function(p){\n return p['n'];\n }\n )\n )\n\n data[i]['mean_n'] = mean_n;\n\n\n for (var j=0; j<years.length; j++) {\n\n\n \tif (_.includes(p_years, years[j])) {\n\n // not interpolated\n _.filter(data[i]['Points'], function(o){\n \treturn o['Y'] == years[j]\n })[0]['intp'] = 0\n\n \t\t}\n\n else {\n var r = data[i]['Curve']['r']\n var c = data[i]['Curve']['c']\n\n data[i]['Points'].push(\n {Y: years[j], GR: curv(c, r, years[j], 1), intp: 1}\n )\n }\n }\n };\n}", "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 updateDisplay(year) {\n featureValues = []; \n\n d3.select(\"#yearInfo\").text(year); \n \n mapProp = geoJsonData.properties.mapProp; // Propery name to map to on each geoJSON feature object\n scaleValue = geoJsonData.properties.scaleValue; // Map scaling\n xOffset = geoJsonData.properties.xOffset; // Map xoffset\n yOffset = geoJsonData.properties.yOffset; // Map yoffset\n \n // DON'T NEED TO DO THESE EVERY TIME!! TODO: MOVE THEM\n totalProdExtent = d3.extent(chartData.map(function(d){return parseFloat(d.totalprod);}));\n console.log(\"totalProdExtent \" , totalProdExtent);\n\n totalProdColors = d3.scaleLinear()\n .domain(totalProdExtent)\n .range(['#FFF9CC', '#bc8600'])\n .interpolate(d3.interpolateHcl); \n\n \n // d3.nest() groups data\n var groupByYear = d3.nest()\n .key(function(d) {\n return d.year;\n })\n .entries(chartData);\n //console.log(groupByYear);\n \n groupByYear.forEach(function(d) {\n d.total = d3.sum(d.values, function(d2) {\n return d2.totalprod;\n });\n d.average = d3.mean(d.values, function(d3) {\n return d3.totalprod;\n });\n }); \n\n var currentData = groupByYear.filter(obj => {\n return obj.key == year.toString();\n }) \n console.log(\"currentData \", currentData);\n var ctFormat = d3.format(\".2s\");\n d3.select(\"#totalProdInfo\").text(ctFormat(currentData[0].total)); \n\n d3.select(\"#avgProdInfo\").text(ctFormat(currentData[0].average)); \n\n console.log(\"Current Year Data\", currentData[0].values);\n var currentYearData = currentData[0].values;\n \n // Assign state abbreviations to each shape\n $.each(geoJsonData.features, function(key, value) { \n var featureName = value.properties[mapProp];\n var stateAbbr = value.properties[\"HASC_1\"].split(\".\")[1]; \n \n var myDataRow = currentYearData.filter(obj => {\n return obj.state == stateAbbr;\n })\n\n var myVal = 0;\n if(myDataRow[0] != undefined) {\n myVal = myDataRow[0].totalprod; // Get total honey production\n }\n \n var dataObj = {\"name\": featureName, \"value\": myVal, \"state\": stateAbbr}; \n featureValues.push(dataObj); \n });\n\n renderMap(); // Render the map\n\n\n }", "init() {\n // add parent div for each year row\n $chart\n .selectAll('.year')\n .data(data, d => d.year)\n .join(enter => {\n const year = enter.append('div').attr('class', 'year');\n\n // add a p element for the year\n year\n .append('p')\n .attr('class', 'year__number')\n .text(d => d.year);\n\n // and another div to contain the bars\n const container = year.append('div').attr('class', 'year__barCont');\n return year;\n });\n\n $chart;\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function updateLine(selectedYear) {\n // Create new data with the selection?\n let tradesFilter = JSON.parse(JSON.stringify(trades));\n if (selectedYear == 'All') {\n x.domain(\n d3.extent(prices, function (d) {\n return d3.timeParse('%Y-%m-%d')(d[0]);\n })\n );\n } else {\n let year = Number(selectedYear);\n if (year == Date.today().getFullYear()) {\n x.domain([\n d3.timeParse('%Y-%m-%d')(''.concat(year, '-01-01')),\n d3.timeParse('%Y-%m-%d')(Date.today().toString('yyyy-MM-dd')),\n ]);\n } else {\n x.domain([\n d3.timeParse('%Y-%m-%d')(''.concat(year, '-01-01')),\n d3.timeParse('%Y-%m-%d')(''.concat(year, '-12-31')),\n ]);\n }\n tradesFilter = tradesFilter.filter(\n (d) => Date.parse(d[0]).getFullYear() == year\n );\n }\n xAxis\n .transition()\n .duration(1000)\n .call(d3.axisBottom(x).tickSize(0).tickPadding(10));\n\n // xAxis.select('.domain').remove()\n\n // filter out trades that don't match\n for (let date of tradesFilter) {\n date[1][1] = date[1][1].filter(passFilterTests);\n if (date[1][1].length > 0) {\n date[1][0] = date[1][1].reduce(function (acc, curr) {\n return acc + getVolume(curr.amount);\n }, 0);\n }\n }\n\n // remove dates with no matching trades\n tradesFilter = tradesFilter.filter((date) => date[1][1].length > 0);\n svg.select('#bubbles').remove();\n\n gradient.transition().duration(500).style('opacity', 0);\n\n var bub = svg\n .append('g')\n .attr('id', 'bubbles')\n .selectAll('dot')\n .data(tradesFilter);\n\n var bubbleColor = function (trades) {\n let [buy, sell] = [false, false];\n for (const trade of trades) {\n if (trade.transaction_type == 'Purchase') {\n buy = true;\n } else if (\n trade.transaction_type == 'Sale (Full)' ||\n trade.transaction_type == 'Sale (Partial)'\n ) {\n sell = true;\n } else {\n sell = true;\n buy = true;\n }\n }\n\n if (buy && sell) {\n return 'grey';\n } else {\n return buy ? 'red' : 'green';\n }\n };\n\n var bubEnter = bub.enter();\n\n // draw bubbles for each trade\n bubEnter\n .append('circle')\n .attr('class', 'tradeBubble')\n .attr('cx', function (d) {\n return x(d3.timeParse('%Y-%m-%d')(d[0]));\n })\n .attr('cy', function (d) {\n return y(prices_obj[d[0]]);\n })\n .attr('r', function (d) {\n return 0;\n })\n .style('fill', (d) => bubbleColor(d[1][1]))\n .style('opacity', '0.3')\n .attr('stroke', 'white')\n .style('stroke-width', '2px');\n\n // draw center dot in bubble\n bubEnter\n .append('circle')\n .attr('class', 'centerDot')\n .attr('cx', function (d) {\n return x(d3.timeParse('%Y-%m-%d')(d[0]));\n })\n .attr('cy', function (d) {\n return y(prices_obj[d[0]]);\n })\n .attr('r', 0)\n .style('fill', 'black')\n .style('opacity', '0.5')\n .attr('pointer-events', 'none');\n\n // add mouseover behavior for bubbles\n bubEnter\n .selectAll('circle')\n .on('mouseover', function (event, d) {\n selectBubble(event.target);\n\n tooltip.transition().duration(200).style('opacity', 1);\n tooltip.style('visibility', 'visible').style('display', '');\n })\n .on('mousemove', function (event, d) {\n let xy = d3.pointer(event, bub.node());\n tooltip\n .html(\n '<b>' +\n d[1][1].length +\n ' trades </b>on ' +\n Date.parse(d[0]).toString('MMM dd, yyyy') +\n '<br><b>Closing stock price:</b> $' +\n Number(prices_obj[d[0]]).toFixed(2)\n )\n .style('left', xy[0] + 10 + 'px')\n .style('top', xy[1] + 10 + 'px');\n })\n .on('mouseleave', function (event, d) {\n if (event.target != selectedBubble) {\n unselectBubble(event.target);\n }\n\n tooltip\n .transition()\n .duration(200)\n .style('opacity', 0)\n .on('end', () => {\n tooltip.style('visibility', 'hidden').style('display', 'none');\n });\n })\n .on('click', onClick);\n\n // Give these new data to update line\n line\n .transition()\n .duration(1000)\n .attr(\n 'd',\n d3\n .line()\n .curve(d3.curveCardinal)\n .x(function (d) {\n return x(d3.timeParse('%Y-%m-%d')(d[0]));\n })\n .y(function (d) {\n return y(d[1]);\n })\n )\n .attr('stroke', function (d) {\n return 'steelblue';\n })\n .on('end', function (d) {\n bubEnter\n .selectAll('.tradeBubble')\n .transition()\n .duration(1000)\n .attr('r', function (d) {\n return z(d[1][0]);\n });\n\n bubEnter\n .selectAll('.centerDot')\n .transition()\n .duration(1000)\n .attr('r', 3);\n\n gradient.attr('d', area).transition().duration(500).style('opacity', 1);\n });\n\n bub.exit().remove();\n updateSenatorSelect(tradesFilter);\n return tradesFilter;\n }", "function ready(datapoints) {\n var nested = d3\n .nest()\n .key(function(d) {\n return d.Year\n })\n .entries(datapoints)\n\n container\n .selectAll('.year-graph')\n .data(nested)\n .enter()\n .append('svg')\n .attr('class', 'year-graph')\n .attr('height', height + margin.top + margin.bottom)\n .attr('width', width + margin.left + margin.right)\n .append('g')\n .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')')\n .each(function(d) {\n // which svg are we looking at?\n\n var svg = d3.select(this)\n\n svg\n .append('path')\n .datum(d.values)\n .attr('d', areaUS)\n .attr('stroke', 'none')\n .attr('fill', 'blue')\n .attr('fill-opacity', 0.25)\n\n svg\n .append('path')\n .datum(d.values)\n .attr('d', areaJapan)\n .attr('stroke', 'none')\n .attr('fill', 'red')\n .attr('fill-opacity', 0.25)\n\n svg\n .append('text')\n .text(d.key)\n .attr('x', width / 2)\n .attr('y', 0)\n .attr('font-size', 15)\n .attr('dy', -2)\n .attr('text-anchor', 'middle')\n .attr('font-weight', 'bold')\n\n var datapoints = d.values\n var usSum = d3.sum(datapoints, d => +d.ASFR_us).toFixed(2)\n var japanSum = d3.sum(datapoints, d => +d.ASFR_jp).toFixed(2)\n\n svg\n .append('text')\n .text(usSum)\n .attr('x', xPositionScale(45))\n .attr('y', yPositionScale(0.2))\n .attr('font-size', 13)\n .attr('text-anchor', 'middle')\n .attr('fill', 'blue')\n .attr('font-weight', 'bold')\n\n svg\n .append('text')\n .text(japanSum)\n .attr('x', xPositionScale(45))\n .attr('y', yPositionScale(0.15))\n .attr('font-size', 13)\n .attr('text-anchor', 'middle')\n .attr('fill', 'red')\n .attr('font-weight', 'bold')\n\n var xAxis = d3.axisBottom(xPositionScale).tickValues([15, 30, 45])\n svg\n .append('g')\n .attr('class', 'axis x-axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(xAxis)\n\n var yAxis = d3.axisLeft(yPositionScale).tickValues([0, 0.1, 0.2, 0.3])\n svg\n .append('g')\n .attr('class', 'axis y-axis')\n .call(yAxis)\n })\n}", "circleChart() {\n\n var circleData = this.yearData;\n\n // If trace checkbox is ticked, add country traces to dataset.\n if (traceChecked && Object.keys(this.trace).length) {\n for (var country in this.trace) {\n // remove final element so country can do an animated \"update\" into it instead\n var trace_circles = this.trace[country].slice(0, -1)\n circleData = circleData.concat(trace_circles);\n }\n }\n\n /******** PERFORM DATA JOIN ************/\n var circles = svgBubble.selectAll(\"circle\")\n .data(circleData, function key(d) { return d.Country; });\n\n /******** HANDLE UPDATE SELECTION ************/\n // Update the display of existing elements to match new data\n circles\n .transition()\n .duration(1000)\n .ease(d3.easeLinear)\n .attr(\"cx\", function(d) { return xScaleBubble(d.GDP); })\n .attr(\"cy\", function(d) { return yScaleBubble(d.Global_Competitiveness_Index); })\n .attr(\"r\", function(d) { return Math.sqrt(rScaleBubble(+d.Population)/Math.PI); })\n .style(\"fill\", function(d) { return colour[d['Forum classification']]; });\n\n /******** HANDLE ENTER SELECTION ************/\n // Create new elements in the dataset\n circles.enter()\n .append(\"circle\")\n .attr(\"cx\", function(d) { return xScaleBubble(d.GDP); })\n .attr(\"cy\", function(d) { return yScaleBubble(d.Global_Competitiveness_Index); })\n .attr(\"r\", function(d) { return Math.sqrt(rScaleBubble(+d.Population)/Math.PI); })\n .style(\"fill\", function(d) { return colour[d['Forum classification']]; })\n .on(\"mouseover\", function(d) { return countryLabel.style(\"visibility\", \"visible\").html(\"<b>Country: </b>\" + d.Country + \"<br><b>Population: </b>\" + (+d.Population).toLocaleString());})\n .on(\"mousemove\", function() {\n return countryLabel.style(\"top\", (d3.event.pageY - 10) + \"px\").style(\"left\", (d3.event.pageX + 10) + \"px\");\n })\n .on(\"mouseout\", function() { return countryLabel.style(\"visibility\", \"hidden\"); });\n\n /******** HANDLE EXIT SELECTION ************/\n // Remove dom elements that no longer have a matching data element\n circles.exit().remove();\n }", "function transform() {\n\tdata.forEach(function(d){\n\t\td.timecreate = new Date(d.timecreate.split(\" \")[0]);\n\t});\n\n\tnest = d3.nest()\n\t\t.key(function(d){ return d.timecreate; })\n\t\t.key(function(d){ return d.typetext; })\n\t\t.entries(data);\n\n\tfor(i in nest) { days.push(nest[i].key) }\n\n\ttypeNest = d3.nest()\n\t\t\t.key(function(d) { return d.type_ })\n\t\t\t.entries(data);\n\n\tpastData.forEach(function(d){\n\t\td.timecreate = new Date(d.timecreate.split(\" \")[0]);\n\t});\n\n\tpastNest = d3.nest()\n\t\t\t\t.key(function(d){ return d.timecreate; })\n\t\t\t\t.key(function(d){ return d.typetext; })\n\t\t\t\t.entries(pastData);\n\n\tpastTypeNest = d3.nest()\n\t\t\t\t\t.key(function(d) { return d.type_ })\n\t\t\t\t\t.entries(pastData);\n\n\t// this is a hacky way of getting data objects that compare to this time last year\n\tpastNestDelim = pastNest.slice(0, days.length);\n\n\tpastDataDelim = [];\n\n\tfor (i in pastNestDelim) {\n\t\tfor(l in pastNestDelim[i].values) {\n\t\t\tfor(j in pastNestDelim[i].values[l].values)\n\t\t\t\tpastDataDelim.push(pastNestDelim[i].values[l].values[j]);\n\t\t}\n\t}\n\n\tpastTypeNestDelim = d3.nest()\n\t\t\t\t\t\t.key(function(d) { return d.type_ })\n\t\t\t\t\t\t.entries(pastDataDelim);\n\n\t// wait a little bit for d3 to make nest objects before calling next function, which requires them\n\tsetTimeout(function() {\n\t\tlog.text('> Comparing 2013 and 2014 data...');\n\t\tqueue(fns);\n\t}, 500);\n}", "function year(){\n step=1;\n timeSelector=\"year\";\n resetGraph();\n}", "function chartAnimator(x, y) { \n d3.csv(\"assets/data/data.csv\").then((Data) => {\n Data.forEach((data) => {\n data[x] = +data[x];\n data[y] = +data[y];\n });\n \n // Define x axis and y axis range\n var xExtent = d3.extent(Data, d => d[x]);\n var xRange = xExtent[1] - xExtent[0];\n var yExtent = d3.extent(Data, d => d[y]);\n var yRange = yExtent[1] - yExtent[0];\n\n var xScale = d3.scaleLinear()\n .domain([xExtent[0] - (xRange * 0.05), xExtent[1] + (xRange * 0.05)])\n .range([0, width]);\n var yScale = d3.scaleLinear()\n .domain([yExtent[0] - (yRange * 0.05), yExtent[1] + (yRange * 0.05)])\n .range([height, 0]);\n\n var bottomAxis = d3.axisBottom(xScale);\n var leftAxis = d3.axisLeft(yScale);\n\n var duration = 1000\n var radius = 10\n\n chartGroup.select(\".x\")\n .transition()\n .duration(duration)\n .call(bottomAxis);\n chartGroup.select(\".y\")\n .transition()\n .duration(duration)\n .call(leftAxis); \n \n chartGroup.selectAll(\"circle\")\n .transition()\n .duration(duration)\n .attr(\"cx\", d => xScale(d[x]))\n .attr(\"cy\", d => yScale(d[y]));\n\n chartGroup.selectAll(\".chartText\")\n .transition()\n .duration(duration)\n .attr(\"x\", d => xScale(d[x]))\n .attr(\"y\", d => yScale(d[y]) + radius/2);\n\n tip = d3.tip()\n .attr('class', 'd3-tip')\n .html((d) => { return(d.state + '<br>' + x + \": \" + d[x] + \"<br>\" + y + \": \" + d[y]) });\n // vis.call(tip)\n chartGroup.append(\"g\")\n .attr(\"class\", \"tip\")\n .call(tip);\n });\n}", "function drawYear(off, angle, arr, i, points){\n\t\tsvg.append(\"path\")\n\t\t\t.datum(d3.range(points))\n\t\t .attr(\"class\", \"year_scale\")\n\t\t .attr(\"d\", d3.svg.line.radial()\n\t\t \t\t\t\t.radius(radiScale(arr[i]))\n\t\t \t\t\t\t.angle(function(d, j) { return angle(j); }))\n\t\t .attr(\"transform\", \"translate(\" + center.x + \", \" + (center.y + off) + \")\")\n\t\t .attr(\"opacity\", 0)\n\t\t\t.transition()\n\t\t\t.duration(inTransLength)\n\t\t\t.attr(\"opacity\", 1);\n\t}", "update(data) {\r\n\r\n\r\n let ctx = this;\r\n let width = this.svgWidth;\r\n let height = this.svgHeight;\r\n let setsperyear = new Array();\r\n\r\n for (var i = 0; i < 45; i++) {\r\n setsperyear[i] = 0;\r\n }\r\n for (var i = 0; i < data.length; i++) {\r\n for (var j = 0; j < this.years.length; j++) {\r\n if (data[i].Year == this.years[j]) {\r\n setsperyear[j]++;\r\n }\r\n }\r\n }\r\n\r\n var onclickdata;\r\n\r\n let brushed = function () {\r\n let selectedYears = [];\r\n if (d3.event.selection != null && !(d3.event.selection[0] == 0 && d3.event.selection[1] == 0)) {\r\n let lowBound = d3.event.selection[0];\r\n let highBound = d3.event.selection[1];\r\n let circles = d3.select(\"#year-chart\").select(\"svg\").selectAll(\"circle\");\r\n let xVals = circles.nodes().map((d) => d.getAttribute(\"cx\"));\r\n let indices = [];\r\n for (let i = 0; i < xVals.length; i++) {\r\n if (xVals[i] > lowBound && xVals[i] < highBound) {\r\n indices.push(i);\r\n }\r\n }\r\n indices.forEach(function (index) {\r\n selectedYears.push(1971 + index);\r\n });\r\n ctx.updateYearSelStr(selectedYears);\r\n ctx.updateCharts(selectedYears);\r\n }\r\n }\r\n let brush = d3.brushX().extent([[0, 0], [ctx.svgWidth, ctx.svgHeight]])\r\n .on(\"end\", brushed);\r\n\r\n let yearPopup = new YearPopup(this.legos);\r\n\r\n let mouseMove = function (d) {\r\n yearPopup.mousemove(d)\r\n };\r\n\r\n this.svg.attr(\"class\", \"brush\").call(brush);\r\n\r\n let colorScale = d3.scaleLinear()\r\n .domain([350, 0])\r\n .range([\"#b3cde0\", \"#03396c\"]);\r\n\r\n // Create the chart by adding circle elements representing each election year\r\n this.svg.append('line')\r\n .attr(\"x1\", 0)\r\n .attr(\"y1\", (this.svgHeight / 2) - 10)\r\n .attr(\"x2\", width)\r\n .attr(\"y2\", (this.svgHeight / 2) - 10)\r\n .style(\"stroke\", \"#A0A0A0\")\r\n .style(\"stroke-dasharray\", \"2,2\");\r\n\r\n this.svg.selectAll('circle')\r\n .data(data)\r\n .enter()\r\n .append('circle')\r\n .data(setsperyear)\r\n .style(\"fill\", d => colorScale(d))\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\")\r\n .data(data)\r\n .attr(\"cx\", function (d, i) {\r\n return (width / 45) * i + 10;\r\n })\r\n .attr(\"cy\", (this.svgHeight / 2) - 10)\r\n .data(setsperyear)\r\n .attr(\"r\", d => Math.log(d) * 3)\r\n .data(this.years)\r\n .on(\"mousemove\", mouseMove)\r\n .on('mouseover', function (d, i) {\r\n d3.select(this)\r\n .transition()\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"3\");\r\n yearPopup.mouseover(d);\r\n })\r\n .on('mouseout', function (d, i) {\r\n d3.select(this)\r\n .transition()\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\");\r\n yearPopup.mouseout(d)\r\n })\r\n .on('click', function (d, i) {\r\n\r\n ctx.updateYearSelStr([d]);\r\n ctx.updateCharts([d]);\r\n\r\n d3.select(this)\r\n .transition()\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"3\");\r\n d3.select(\"rect.selection\")\r\n .attr(\"width\", 0);\r\n\r\n })\r\n .attr(\"pointer-events\", \"all\")\r\n ;\r\n\r\n this.svg.selectAll('text')\r\n .data(this.years)\r\n .enter()\r\n .append('text')\r\n .attr(\"text-anchor\", \"middle\")\r\n .attr(\"transform\", function (d, i) {\r\n let xval = (width / 45) * i + 6;\r\n let yval = ((height / 2) + 23);\r\n return \"translate(\" + xval + \",\" + yval + \")rotate(90)\"\r\n })\r\n .style(\"font-size\", \"12px\")\r\n .style(\"stroke\", \"black\")\r\n .html(d => d);\r\n d3.select(\".brush\").call(brush.move, [[0], [0]], [[0], [0]]);\r\n\r\n //This builds the legend on the bottom of the yearchart\r\n let legend = d3.select('#year-chart').append('svg')\r\n .attr(\"id\", \"legolegend\")\r\n .attr(\"width\", width)\r\n .attr(\"height\", \"50\")\r\n .append('rect')\r\n .attr(\"x\", 0)\r\n .attr(\"y\", 0)\r\n .attr(\"width\", 190)\r\n .attr(\"height\", 50)\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"2\")\r\n .style(\"fill\", \"white\");\r\n\r\n let smallcircle = d3.select('#legolegend').append('circle')\r\n .attr(\"cx\", \"12\")\r\n .attr(\"cy\", \"25\")\r\n .attr(\"r\", \"7\")\r\n .style(\"fill\", \"#03396c\")\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\");\r\n\r\n let smalltext = d3.select('#legolegend').append('text')\r\n .attr(\"x\", \"49\")\r\n .attr(\"y\", \"29\")\r\n .attr(\"text-anchor\", \"middle\")\r\n .style(\"font-size\", \"12px\")\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\")\r\n .html(\"Fewer Sets\");\r\n\r\n let largecircle = d3.select('#legolegend').append('circle')\r\n .attr(\"cx\", \"100\")\r\n .attr(\"cy\", \"25\")\r\n .attr(\"r\", \"15\")\r\n .style(\"fill\", \"#b3cde0\")\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\");\r\n\r\n let moretext = d3.select('#legolegend').append('text')\r\n .attr(\"x\", \"145\")\r\n .attr(\"y\", \"29\")\r\n .attr(\"text-anchor\", \"middle\")\r\n .style(\"font-size\", \"12px\")\r\n .style(\"stroke\", \"black\")\r\n .style(\"stroke-width\", \"1\")\r\n .html(\"More Sets\");\r\n\r\n\r\n }", "function drawViz(){\n\n let currentYearData = incomingData.filter(filterYear);\n console.log(\"---\\nthe currentYearData array now carries the data for year\", currentYear);\n\n\n // Below here is where your coding should take place! learn from lab 6:\n // https://github.com/leoneckert/critical-data-and-visualization-spring-2020/tree/master/labs/lab-6\n // the three steps in the comments below help you to know what to aim for here\n\n // bind currentYearData to elements\n function getGroupLocation(d,i){\n let x = xScale(d.fert);\n let y = yScale(d.life);\n return \"translate(\" + x + \",\" + y + \")\";\n }\n\n let datagroups = vizGroup.selectAll(\".datagroup\").data(currentYearData,function(d,i){\n console.log(d.Country);\n return d.Country;\n });\n\n // take care of entering elements\n let enteringElements = datagroups.enter()\n .append(\"g\")\n .attr(\"class\",\"datagroup\")\n ;\n\n enteringElements.append(\"circle\")\n .attr(\"r\",10)\n .attr(\"fill\",color)\n ;\n\n enteringElements.append(\"text\")\n .text(function(d,i){\n return d.Country;\n })\n .attr(\"x\",12)\n .attr(\"y\",7)\n .attr(\"font-family\",\"sans-serif\")\n .attr(\"font-size\",\"15px\")\n .attr(\"fill\",\"purple\")\n ;\n\n // take care of updating elements\n enteringElements.transition().attr(\"transform\",getGroupLocation);\n datagroups.transition().ease(d3.easeLinear).attr(\"transform\",getGroupLocation);\n\n function color(d,i){\n country = d.Country;\n if (country == \"Afghanistan\" || country == \"Albania\" || country == \"Algeria\" || country == \"Angola\" || country == \"Argentina\" || country == \"Australia\" || country == \"Austria\"){\n color = \"#9FE7F7\";\n }else if (country == \"Bahrain\" || country == \"Bangladesh\" || country == \"Belgium\" || country == \"Benin\" || country == \"Bolivia\" || country == \"Bosnia and Herzegovina\" || country == \"Botswana\" || country == \"Brazil\" || country == \"Bulgaria\" || country == \"Burkina Faso\" || country == \"Burundi\"){\n color = \"#F7D59F\";\n }else if (country == \"Cambodia\" || country == \"Cameroon\" || country == \"Canada\" || country == \"Central African Republic\" || country == \"Chad\" || country == \"Chile\" || country == \"China\" || country == \"Colombia\" || country == \"Comoros\" || country == \"Congo, Dem. Rep.\" || country == \"Congo, Rep.\" || country == \"Costa Rica\" || country == \"Cote d'Ivoire\" || country == \"Croatia\" || country == \"Cuba\" || country == \"Czech Republic\"){\n color = \"#F7F39F\"\n }else if (country == \"Denmark\" || country == \"Djibouti\" || country == \"Dominican Republic\" ){\n color = \"#D9F99C\"\n }else if (country == \"Ecuador\" || country == \"Egypt\" || country == \"El Salvador\" || country == \"Equatorial Guinea\" || country == \"Eritrea\" || country == \"Ethiopia\" ){\n color = \"#C1C1FB\"\n }else if (country == \"Finland\" || country == \"France\" ){\n color = \"#EFC1FB\"\n }else if (country == \"Gabon\" || country == \"Gambia\" || country == \"Germany\" || country == \"Ghana\" || country == \"Greece\" || country == \"Guatemala\" || country == \"Guinea\" || country == \"Guinea-Bissau\" ){\n color = \"#C1DFFB\"\n }else if (country == \"Haiti\" || country == \"Honduras\" || country == \"Hong Kong, China\" || country == \"Hungary\"){\n color = \"#3297F6\"\n }else if (country == \"Iceland\" || country == \"India\" || country == \"Indonesia\" || country == \"Iran\" || country == \"Iraq\" || country == \"Ireland\" || country == \"Israel\" || country == \"Italy\"){\n color = \"#6FFBAC\"\n }else if (country == \"Jamaica\" || country == \"Japan\" || country == \"Jordan\" ){\n color = \"#FBD86F\"\n }else if (country == \"Kenya\" || country == \"Kuwait\" ){\n color = \"#FEA4B2\"\n }else if (country == \"Lebanon\" || country == \"Lesotho\" || country == \"Liberia\" || country == \"Libya\"){\n color = \"#FC6179\"\n }else if (country == \"Madagascar\" || country == \"Malawi\" || country == \"Malaysia\" || country == \"Mali\" || country == \"Mauritania\" || country == \"Mauritius\" || country == \"Mexico\" || country == \"Mongolia\" || country == \"Montenegro\" || country == \"Morocco\" || country == \"Mozambique\" || country == \"Myanmar\" ){\n color = \"#F7A5E4\"\n }else if (country == \"Namibia\" || country == \"Nepal\" || country == \"Netherlands\" || country == \"New Zealand\" || country == \"Nicaragua\" || country == \"Niger\" || country == \"Nigeria\" || country == \"Norway\"){\n color = \"#4E62F7\"\n }else if (country == \"Oman\"){\n color = \"#4EF7E5\"\n }else if (country == \"Pakistan\" || country == \"Panama\" || country == \"Paraguay\" || country == \"Peru\" || country == \"Philippines\" || country == \"Poland\" || country == \"Portugal\" || country == \"Puerto Rico\" ){\n color = \"#D2AF6D\"\n }else if (country == \"Reunion\" || country == \"Romania\" || country == \"Rwanda\"){\n color = \"#6DD295\"\n }else if (country == \"Sao Tome and Principe\" || country == \"Saudi Arabia\" || country == \"Senegal\" || country == \"Serbia\" || country == \"Sierra Leone\" || country == \"Singapore\" || country == \"Slovak Republic\" || country == \"Slovenia\" || country == \"Somalia\" || country == \"South Africa\" || country == \"Spain\" || country == \"Sri Lanka\" || country == \"Sudan\" || country == \"Swaziland\" || country == \"Sweden\" || country == \"Switzerland\" || country == \"Syria\"){\n color = \"#D2976D\"\n }else if (country == \"Taiwan\" || country == \"Tanzania\" || country == \"Thailand\" || country == \"Togo\" || country == \"Trinidad and Tobago\" || country == \"Tunisia\" || country == \"Turkey\"){\n color = \"#6D6FD2\"\n }else if (country == \"Uganda\" || country == \"United Kingdom\" || country == \"United States\" || country == \"Uruguay\"){\n color = \"#74C443\"\n }else if (country == \"Venezuela\" || country == \"Vietnam\"){\n color = \"#E88022\"\n }else if (country == \"West Bank and Gaza\"){\n color = \"#139236\"\n }else if (country == \"Zambia\" || country == \"Zimbabwe\"){\n color = \"white\"\n }\n return color;\n }\n\n }", "function trend(country)\r\n{\r\n\tif(country.includes(\"All\"))\r\n\t{\r\n\t\t\r\n\t\t$(\"#LinechartTitle\").text(\"Distribution of Movies over the Years 1990-2016 for \"+country+\" \"+ \"countries\" );\r\n\t\t\r\n\t}else{\r\n\t$(\"#LinechartTitle\").text(\"Distribution of Movies over the Years 1990-2016 for \"+country);\r\n\t\r\n\t}\r\n\tvar colors=d3.scale.category20();\r\n\tvar newData={};\r\n\tvar graphData=[];\r\n\td3.json(\"data.json\",function(error,data){\r\n\t\t $.each(data,function(i,movie)\r\n\t\t {\r\n\t\t\t if(movie[\"country\"].includes(country) || country.includes(\"All\"))\r\n\t\t\t {\r\n\t\t\t\t if(movie[\"genre\"] in newData)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(movie[\"year\"] in newData[movie[\"genre\"]])\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\tnewData[movie[\"genre\"]][movie[\"year\"]] +=1;\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else{\r\n\t\t\t\t\t\tnewData[movie[\"genre\"]][movie[\"year\"]]=1;\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t else{\r\n\t\t\t\t\t newData[movie[\"genre\"]]={};\r\n\t\t\t\t\t newData[movie[\"genre\"]][movie[\"year\"]]=1;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t });\r\n\t\t \r\n\t\t var maxScale=0;\r\n\t\t for(var y=1990;y<=2016;y++)\r\n\t\t {\r\n\t\t\t var yearData={\"Date\":y};\r\n\t\t\t for(key in newData)\r\n\t\t\t {\r\n\t\t\t\t if(y in newData[key])\r\n\t\t\t\t {\r\n\t\t\t\t\t if (newData[key][y]>=maxScale){\r\n\t\t\t\t\t\t maxScale=newData[key][y];\r\n\t\t\t\t\t }\r\n\t\t\t\t\t yearData[key]=newData[key][y];\r\n\t\t\t\t }else{\r\n\t\t\t\t\t yearData[key]=0;\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t graphData.push(yearData);\r\n\t\t }\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t // set the dimensions and margins of the graph\r\n\t\t \r\nvar margin = {top: 20, right: 20, bottom: 30, left: 50},\r\n width = 960 - margin.left - margin.right,\r\n height = 600 - margin.top - margin.bottom ;\r\n\t\r\n\tvar legendSpace = width/21;\r\n\r\n// parse the date / time\r\nvar parseTime = d3.timeParse(\"%Y\");\r\n\r\n// set the ranges\r\nvar x = d3.scaleTime().range([0, width]);\r\nvar y = d3.scaleLinear().range([height, 0]);\r\n\r\n // format the data\r\n graphData.forEach(function(d) {\r\n d.Date = parseTime(d.Date);\r\n });\r\n \r\n // sort years ascending\r\n graphData.sort(function(a, b){\r\n return a[\"Date\"]-b[\"Date\"];\r\n\t})\r\n\r\n\t\r\n\t// append the svg obgect to the body of the page\r\n// appends a 'group' element to 'svg'\r\n// moves the 'group' element to the top left margin\r\nvar svg = d3.select(\"#trend\").append(\"svg\")\r\n .attr(\"width\", width + margin.left + margin.right)\r\n .attr(\"height\", height + margin.top + margin.bottom)\r\n .append(\"g\")\r\n .attr(\"transform\",\r\n \"translate(\" + margin.left + \",\" + margin.top + \")\");\r\n\t\t \r\n var i=0;\r\n\t var textPosX=0;\r\n\t var textPosY=0;\r\n\tfor(key in graphData[0])\r\n\t{\r\n\t\tif(key != \"Date\"){\r\n\t\t\ttextPosX += 80;\r\n\t\t\tvar mycolor=colors(i);\r\n\t\t\t var j=0;\r\n\t\t\t if(textPosX > width -50 || j>=1)\r\n\t\t\t {\r\n\t\t\t\t if(i==20)\r\n\t\t\t\t {\r\n\t\t\t\t\t textPosY=40;\r\n\t\t\t\t\t mycolor=\"#000000\";\r\n\t\t\t\t }\r\n\t\t\t\t else{\r\n\t\t\t\t\t textPosY=20;\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t\t textPosX=80;\r\n\t\t\t\t j +=1;\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t// define the line\r\n\t\t\t\tvar valueline = d3.line()\r\n\t\t\t\t.x(function(d) { return x(d.Date); })\r\n\t\t\t\t.y(function(d) { return y(d[key]); });\r\n\t\t\t \r\n\t\t\t // Scale the range of the data\r\n\t\t\t x.domain(d3.extent(graphData, function(d) { return d.Date; }));\r\n\t\t\t y.domain([0,maxScale]);\r\n\t\t\t // y.domain([0, d3.max(graphData, function(d) {\r\n\t\t\t\t// return Math.max(d.Action, d[key]); })]);\r\n\t\t\t \r\n\t\t\t // Add the valueline path.\r\n\t\t\t svg.append(\"path\")\r\n\t\t\t\t .data([graphData])\r\n\t\t\t\t .attr(\"class\", \"line\")\r\n\t\t\t\t .style(\"stroke\",mycolor)\r\n\t\t\t\t .attr(\"d\", valueline);\r\n\t\t\t\r\n\t\t\t \r\n\t\t\t\r\n\t\t\t\r\n\t\t\t \r\n\t\t\t i +=1;\r\n\t\t\t \r\n\t\t\t console.log(textPosX+\" -- \"+textPosY);\r\n\t\t\t \r\n\t\t\t svg.append(\"text\")\r\n .attr(\"x\", textPosX) // space legend\r\n .attr(\"y\", textPosY)\r\n\t\t\t.attr(\"class\",\"legend-text\")\r\n .attr(\"style\",\"font-weight:bold\") // style the legend\r\n .style(\"fill\",mycolor)\r\n .text(key); \r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\t \r\n // Add the X Axis\r\n svg.append(\"g\")\r\n .attr(\"transform\", \"translate(0,\" + height + \")\")\r\n .call(d3.axisBottom(x));\r\n\r\n // Add the Y Axis\r\n svg.append(\"g\")\r\n .call(d3.axisLeft(y));\r\n\t \r\n\t \r\nsvg.append(\"text\")\r\n .attr(\"transform\", \"translate(\" + (width / 2) + \" ,\" + (height + margin.bottom -2) + \")\")\r\n .style(\"text-anchor\", \"middle\")\r\n .text(\"Year\");\r\n\t\t\r\n\r\n\tsvg.append(\"text\")\r\n .attr(\"transform\", \"rotate(-90)\")\r\n .attr(\"y\", 0 - margin.left)\r\n .attr(\"x\",0 - (height / 2))\r\n .attr(\"dy\", \"1em\")\r\n .style(\"text-anchor\", \"middle\")\r\n .text(\"Number of Movies\");\r\n\r\n\r\n\r\n\t\t \r\n\t});\r\n}", "function interpolateValues(values, year) {\n\t\t /*use bisect function to determine the position of given year in the year list in ascending order*/\n\t\t var i = d3.bisectLeft(yearList,year);\n\t\t /*extract the data value at current position i*/\n\t\t var b = values[i];\n\t\t /*when given year is not the first year in the year list, interpolate the values between a and b*/\n\t\t if (i > 0) {\n\t\t /*extract the data value before position i*/\n\t\t var a = values[i - 1];\n\t\t /*if given year is a whole year number, return 1, otherwise return the delta(fraction)*/\n\t\t var t = (year == Math.floor(year)? 1 : year - Math.floor(year));\n\t\t return a + (b - a) * t;\n\t\t }\n\t\t /*when given year is the first year in the year list, extract the first year's data*/\n\t\t return b;\n\t }", "function draw_map_by_year(data, year)\n{\n //Get this year's data\n current_year = get_year_data(data, year);\n\n //Update map's year text\n d3.selectAll(\"#year_text\").text(year)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"60px\")\n .attr(\"fill\", \"black\");\n\n d3.selectAll(\"path\")\n .datum(function(d)\n {\n return {\"name\" : d3.select(this).attr(\"id\")};\n })\n .data(current_year, //Ensure we map correctly\n function(d, i)\n {\n return d.name;\n })\n .transition()\n //The reason that it is 500 and not 750 as the update interval is that I want to color\n //transition be noticeably stable before the start of next year's transition\n .duration(500)\n .style('fill',\n function(d)\n {\n return emissions_scale(d.total_emissions);\n });\n}", "function update(data) {\n // Set transition\n var t = d3.transition().duration(100);\n\n // JOIN new data with old elements\n var points = g.selectAll(\"circle\").data(data, function(d) {\n return d.country;\n });\n\n // Remove points that no longer correspond to data\n points.exit().remove();\n\n // Draw points for new data\n points\n .enter()\n .append(\"circle\")\n .attr(\"fill\", function(d) {\n return colorScale(d.continent);\n })\n .attr(\"opacity\", 0.5)\n .merge(points)\n .transition(t)\n .attr(\"cx\", function(d) {\n return xScale(d.income);\n })\n .attr(\"cy\", function(d) {\n return yScale(d.life_exp);\n })\n .attr(\"r\", function(d) {\n return aScale(d.population);\n });\n\n // Update existing points\n // points\n // // .transition(t)\n // .attr(\"cx\", function(d) {\n // return xScale(d.income);\n // })\n // .attr(\"cy\", function(d) {\n // return yScale(d.life_exp);\n // })\n // .attr(\"r\", function(d) {\n // return aScale(d.population);\n // })\n // .attr(\"fill\", function(d) {\n // return colorScale(d.continent);\n // })\n // .attr(\"opacity\", 0.5);\n\n var year = 1800 + time;\n yearLabel.text(year);\n}", "update_roll(){\n this.circles.transition()\n .duration(this.parent.speed)\n .ease(d3.easeLinear)\n .attr('transform', `translate(${this.year_to_x_for_g(this.parent.year0)}, ${this.label_height})`)\n }", "drawChart(data_unparsed, data_format) {\n\n // Save object (Timedata) instance\n var self = this;\n\n // Parse data\n var data = [];\n for(var i = 0; i < data_unparsed.length; i++) {\n data.push(\n {\n date: new Date(data_unparsed[i]['date']),\n value: data_unparsed[i]['value']\n })\n }\n\n // Remove old data\n self.timedata_svg.selectAll('*').remove();\n\n // Define display translation on SVG\n var g = self.timedata_svg.append('g')\n .attr('transform', 'translate(' + self.margin.left + ',' + self.margin.top + ')');\n\n // Define x and y axis scale dimensions with respect to SVG\n var x = d3.scaleTime().rangeRound([0, self.svgWidth - 50]);\n var y = d3.scaleLinear().rangeRound([self.svgHeight, 0]);\n\n // Define line graphic from parsed data\n var line = d3.line()\n .x(function(d){ return x(d.date) })\n .y(function(d){ return y(d.value) });\n\n // Define x and y domain values\n x.domain(d3.extent(data, function(d){ return d.date }));\n y.domain(d3.extent(data, function(d){ return d.value }));\n\n // Add background grid to SVG on x axis\n g.append('g')\n .attr('class', 'grid')\n .call(d3.axisBottom(x).ticks(10)\n .tickSize(self.svgHeight)\n .tickFormat('')\n );\n\n // Add background grid to SVG on y axis\n g.append('g')\n .attr('class', 'grid')\n .call(d3.axisLeft(y).ticks(5)\n .tickSize(-(self.svgWidth-50))\n .tickFormat('')\n );\n\n // Add text on x axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .attr('transform', 'translate(0,' + self.svgHeight + ')')\n .call(d3.axisBottom(x))\n\n // Add a thich line over the x axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .call(d3.axisBottom(x))\n .attr('stroke-width', 2)\n .selectAll('text')\n .remove()\n\n // Add a thich line over the y axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .attr('transform', 'translate(' + parseInt(self.svgWidth - 50) + ', 0)')\n .call(d3.axisLeft(y))\n .attr('stroke-width', 2)\n .selectAll('text')\n .remove()\n\n // Add text on y axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .call(d3.axisLeft(y))\n .append('text')\n .attr('id', 'serie_unit')\n .attr('fill', '#000')\n .attr('transform', 'rotate(-90)')\n .attr('y', 6)\n .attr('dy', '0.71em')\n .attr('dx', '-0.71em')\n .attr('text-anchor', 'end')\n .text($(self.dataselection_name).val() +' [' + data_format.units[self.selected_map] +']');\n\n // Add data and line graphic to SVG\n g.append('path')\n .datum(data)\n .attr('fill', 'none')\n .attr('stroke', 'steelblue')\n .attr('stroke-linejoin', 'round')\n .attr('stroke-linecap', 'round')\n .attr('stroke-width', 2)\n .attr('d', line);\n\n // Define the tip position when hovering over data\n var dx_tip = -50;\n var dy_tip = 30;\n\n // Add hovering tip to every point in data\n self.timedata_svg.selectAll('.dot')\n .data(data)\n .enter().append('circle')\n .attr('class', 'dot')\n .attr('cx', function(d){ return x(d.date) + self.margin.left })\n .attr('cy', function(d){ return y(d.value) + self.margin.top })\n .attr('r', 5)\n .attr('opacity', 0.0)\n .on('mouseover', function(d){\n // Add the tip and text when hovering over a point\n\n var x_t = d3.select(this).attr('cx');\n var y_t = d3.select(this).attr('cy');\n var w = d3.select(this).attr('r');\n var h = d3.select(this).attr('r');\n var cx = parseInt(x_t)+parseInt(w)/2;\n var cy = parseInt(y_t)+parseInt(h)/2;\n var dx = cx+dx_tip;\n var dy = cy-dy_tip;\n var asdf = new Date(d.date);\n // Define text background rectangle\n self.timedata_svg.append('rect')\n .attr('id', 'tip_rect')\n .attr('x', parseInt(x_t)-70)\n .attr('y', parseInt(y_t)-60)\n .attr('width', 140)\n .attr('height', 40)\n .attr('fill', 'black')\n .attr('opacity', 0.7)\n .style('pointer-events','none');\n // Define text of the data to show (date)\n self.timedata_svg.append('text')\n .attr('id', 'tip_text_date')\n .text(''+asdf.getDate()+'/'+(asdf.getMonth()+1)+'/'+asdf.getFullYear()+'-'+('0' + asdf.getHours()).slice(-2)+':'+('0' + asdf.getMinutes()).slice(-2))\n .attr('text-anchor', 'end')\n .attr('x', parseInt(x_t)+68)\n .attr('y', parseInt(y_t)-45)\n .attr('fill', 'white')\n .attr('font-size', '16px')\n .style('pointer-events','none');\n // Define text of the data to show (value)\n self.timedata_svg.append('text')\n .attr('id', 'tip_text_value')\n .text(''+d.value.toFixed(3) + data_format.units[self.selected_map])\n .attr('text-anchor', 'end')\n .attr('x', parseInt(x_t)+68)\n .attr('y', parseInt(y_t)-25)\n .attr('fill', 'white')\n .attr('font-size', '16px')\n .style('pointer-events','none');\n // Define tip line\n self.timedata_svg.append('line')\n .attr('id', 'tip_line')\n .attr('x1', x_t)\n .attr('y1', y_t)\n .attr('x2', parseInt(x_t)-70)\n .attr('y2', parseInt(y_t)-20)\n .attr('stroke-width', 1)\n .attr('stroke', 'red')\n .style('pointer-events','none');\n // Define red circle highlight\n self.timedata_svg.append('circle')\n .attr('id', 'tip_circle')\n .attr('cx', x_t)\n .attr('cy', y_t)\n .attr('r', 3)\n .attr('fill', 'red')\n .style('pointer-events','none');\n $(this).attr('class', 'focus')\n })\n .on('mouseout', function(){\n // Delete the tip and text when hovering outside data point\n\n d3.select('#tip_rect').remove();\n d3.select('#tip_text_date').remove();\n d3.select('#tip_text_value').remove();\n d3.select('#tip_line').remove();\n d3.select('#tip_circle').remove();\n $(this).attr('class', 'dot')\n });\n }", "function updateChart() {\n var yearValue = $(\"#yearSelect\").val();\n if (yearValue === \"2014\"){\n //John\n myChart6.data.datasets[0].data[0] = null;\n myChart6.data.datasets[0].data[1] = null;\n // Leonardo\n myChart6.data.datasets[1].data[0] = 18378;\n myChart6.data.datasets[1].data[1] = 22284;\n myChart6.data.datasets[1].data[2] = null;\n myChart6.data.datasets[1].data[3] = null;\n //Donatello\n myChart6.data.datasets[7].data[2] = 24473;\n myChart6.data.datasets[7].data[3] = 16286;\n //Paul\n myChart6.data.datasets[2].data[0] = 21630;\n myChart6.data.datasets[2].data[1] = 19603;\n myChart6.data.datasets[2].data[2] = 23947;\n myChart6.data.datasets[2].data[3] = 22444;\n //George\n myChart6.data.datasets[3].data[0] = null;\n myChart6.data.datasets[3].data[1] = null;\n myChart6.data.datasets[3].data[2] = null;\n //Michelangelo\n myChart6.data.datasets[4].data[0] = 11436;\n myChart6.data.datasets[4].data[1] = 18152;\n myChart6.data.datasets[4].data[2] = 17919;\n myChart6.data.datasets[4].data[3] = 12747;\n //Ringo\n myChart6.data.datasets[5].data[0] = null;\n //Raphael\n myChart6.data.datasets[6].data[0] = 15282;\n myChart6.data.datasets[6].data[1] = 16454;\n myChart6.data.datasets[6].data[2] = 19653;\n myChart6.data.datasets[6].data[3] = 10284;\n\n myChart6.update();\n }\n else{\n //John\n myChart6.data.datasets[0].data[0] = 14013;\n myChart6.data.datasets[0].data[1] = 18600;\n // Leonardo\n myChart6.data.datasets[1].data[0] = null;\n myChart6.data.datasets[1].data[1] = null;\n myChart6.data.datasets[1].data[2] = 23353;\n myChart6.data.datasets[1].data[3] = 20756;\n //Paul\n myChart6.data.datasets[2].data[0] = 24149;\n myChart6.data.datasets[2].data[1] = 13119;\n myChart6.data.datasets[2].data[2] = 23184;\n myChart6.data.datasets[2].data[3] = 12697;\n //George\n myChart6.data.datasets[3].data[0] = 23409;\n myChart6.data.datasets[3].data[1] = 13113;\n myChart6.data.datasets[3].data[2] = 17097;\n //Michelangelo\n myChart6.data.datasets[4].data[0] = null;\n myChart6.data.datasets[4].data[1] = null;\n myChart6.data.datasets[4].data[2] = null;\n myChart6.data.datasets[4].data[3] = 22444;\n //Ringo\n myChart6.data.datasets[5].data[0] = 22486;\n //Raphael\n myChart6.data.datasets[6].data[0] = null;\n myChart6.data.datasets[6].data[1] = 18383;\n myChart6.data.datasets[6].data[2] = 19190;\n myChart6.data.datasets[6].data[3] = 21011;\n //Donatello\n myChart6.data.datasets[7].data[2] = null;\n myChart6.data.datasets[7].data[3] = null;\n\n myChart6.update();\n }\n}", "function updateChart() {\n\n\n /* -------------- */\n /* Circles\n /* -------------- */\n\n // First, we define our data element as the value of theData[currYear].\n // Remember, this is simply an array of objects taht all have the same value for the property \"Year\".\n var data = theData[currYear];\n\n // Select all elements classed \".dot\"\n // Assign the data as the value of \"data\" and match each element to d.Tm.\n var teams = svg.selectAll(\".line\")\n .data(data, function(d) {\n return d.Tm;\n });\n \n // If d.Tm does match any elements classed \".dot\",\n // We create a new one. In other words, it \"enters\" the chart.\n // The first time our page loads, no circles with the class name \"dot\" exist\n // So we append a new one and give it an cx, cy position based on wins and attendance.\n // If the circle already exists for that team, we do nothing here.\n var city = svg.selectAll(\".city\")\n .data(cities)\n .enter().append(\"g\")\n .attr(\"class\", \"city\");\n\n city.append(\"path\")\n .attr(\"class\", \"line\")\n .attr(\"d\", function(d) { return line(d.values); })\n .style(\"stroke\", function(d) { return color(d.name); });\n\n city.append(\"text\")\n .datum(function(d) { return {name: d.name, value: d.values[d.values.length - 1]}; })\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.value.date) + \",\" + y(d.value.temperature) + \")\"; })\n .attr(\"x\", 3)\n .attr(\"dy\", \".35em\")\n .text(function(d) { return d.name; });\n\n\n/*teams.enter()\n .append(\"circle\")\n .attr(\"class\", \"dot\")\n .attr(\"r\", 10)\n .attr(\"cx\", function(d) { return x(d.wins); })\n .attr(\"cy\", function(d) { return y(d.attendance); })\n .style(\"fill\", function(d) { return color(d.Tm); });*/\n\n // By the same token, if an \"circle\" element with the class name \"dot\" is already on the page\n // But the d.Tm property doesn't match anything in the new data,\n // It \"exits\".\n // Exit doesn't actually remove it though.\n // Exit is just what we use to select the elements that aren't represented in our data.\n // If we'd like to remove it, we use .remove().\n // I've left the transition to black in place so you can see it in action.\n city.exit()\n .transition()\n .duration(200)\n .style(\"fill\", \"#000\");\n //.remove();\n\n\n // Finally, we want to reassign the position of all elements that alredy exist on the chart\n // AND are represented in the current batch of data.\n // Here we transition (animate) them to new x,y positions on the page.\n city.transition()\n .duration(200)\n .attr(\"cx\", function(d) { return x(d.wins); })\n .attr(\"cy\", function(d) { return y(d.attendance); })\n .style(\"fill\", function(d) { return color(d.Tm); });\n\n\n // TO READ MORE ABOUT EXIT ENTER, READ MIKE BOSTOCK'S THREE LITTLE CIRCLES TUTORIAL:\n // http://bost.ocks.org/mike/circles/\n\n\n\n /* -------------- */\n /* Labels\n /* -------------- */\n\n //Everything we did above we'll also do with labels.\n //It is literally the exact same pattern.\n\n var labels = svg.selectAll(\".lbl\")\n .data(data, function(d) {\n return d.Tm;\n });\n \n labels.enter()\n .append(\"text\")\n .attr(\"class\", \"lbl\")\n .attr(\"x\", function(d) { return x(d.year); })\n .attr(\"y\", function(d) { return y(d.commute); })\n .text(function(d) {\n return d.Tm;\n });\n\n labels.exit()\n .remove();\n\n labels.transition()\n .duration(200)\n .attr(\"x\", function(d) { return x(d.year); })\n .attr(\"y\", function(d) { return y(d.commute); })\n\n\n\n\n\n}", "function interpolateData(year) {\n\t\t return data.map(function(d) {\n\t\t return {\n\t\t stateCode: d.stateCode,\n\t\t stateName: d.stateName,\n\t\t category: d.category[yearList.indexOf(Math.round(year))],\n\t\t unemploymentRate: interpolateValues(d.unemploymentRate, year),\n\t\t population: interpolateValues(d.population, year),\n\t\t crimeRate: interpolateValues(d.crimeRate, year),\n\t\t murderRate: interpolateValues(d.murderRate, year),\n\t\t rapeRate: interpolateValues(d.rapeRate, year),\n\t\t robberyRate: interpolateValues(d.robberyRate, year),\n\t\t assaultRate: interpolateValues(d.assaultRate, year),\n\t\t }; \n\t\t });\n\t }", "render() {\n const flat = [].concat(...data.map(d => d.values)).map(d => d.days);\n const extentX = d3.extent(flat);\n scaleX.domain(extentX);\n\n $svg\n .transition()\n .duration(DUR)\n .ease(EASE)\n .attr('width', width + marginLeft + marginRight)\n .attr('height', height + marginTop + marginBottom);\n\n // const axisY = endLabel ? d3.axisLeft(scaleY) : d3.axisRight(scaleY);\n const axisY = d3.axisRight(scaleY);\n\n axisY\n .tickValues([0.5, 1, 2])\n // .tickSize(endComp ? -width : width)\n .tickSize(width)\n .tickFormat(d => `${d}x`.replace('0', ''));\n\n $axis\n .select('.axis--y--bg')\n .transition()\n .duration(DUR)\n .ease(EASE)\n .call(axisY);\n\n $axis\n .select('.axis--y--fg')\n .transition()\n .duration(DUR)\n .ease(EASE)\n .call(axisY);\n\n // offset chart for margins\n $axis\n .transition()\n .duration(DUR)\n .ease(EASE)\n .attr('transform', `translate(${marginLeft}, ${marginTop})`);\n $vis\n .transition()\n .duration(DUR)\n .ease(EASE)\n .attr('transform', `translate(${marginLeft}, ${marginTop})`);\n $label\n .transition()\n .duration(DUR)\n .ease(EASE)\n .attr('transform', `translate(${marginLeft}, ${marginTop})`);\n\n $label\n .selectAll('.text-comp')\n .text(mobile && !pre ? '' : comp)\n .transition()\n .duration(DUR)\n .ease(EASE)\n .attr('transform', `translate(${width}, ${scaleY(1)})`);\n\n $label\n .select('.text-label')\n .text(mobile && !pre ? label.replace('Controversy', '') : label)\n .transition()\n .duration(DUR)\n .ease(EASE)\n .attr('transform', `translate(${endLabel ? width : 0}, ${height})`)\n .style('font-size', `${mobile ? 10 : 12}px`);\n\n const generateLine = d3\n .line()\n // .curve(d3.curveMonotoneX)\n .x(d => scaleX(d.days))\n .y(d => scaleY(d.value));\n\n const $person = $vis\n .selectAll('.person')\n .data(data, d => d.key)\n .join(enterPerson);\n\n $person\n .classed('is-focus', d => focus.includes(d.name))\n .classed('is-highlight', d => highlight === d.name)\n .classed('is-beauty', d => {\n if (showBeauty) return d.beauty;\n return focus.includes(d.name) && d.beauty;\n })\n .classed('is-cluster', !showBeauty && !focus.length && showCluster)\n .classed(\n 'is-focus-cluster',\n d => showCluster && focus.includes(d.name)\n );\n\n $person.sort(\n (a, b) =>\n d3.ascending(a.name === highlight, b.name === highlight) ||\n d3.ascending(focus.includes(a.name), focus.includes(b.name))\n );\n\n if (showCluster) {\n $person.sort(\n (a, b) =>\n d3.ascending(a.name === highlight, b.name === highlight) ||\n d3.ascending(focus.includes(a.name), focus.includes(b.name)) ||\n d3.ascending(\n a.growth_delta < -2 || a.growth_delta > 0,\n b.growth_delta < -2 || b.growth_delta > 0\n )\n );\n }\n\n $person\n .select('.path--bg')\n .datum(d => d.values)\n .transition()\n .duration(DUR)\n .ease(EASE)\n .attr('d', generateLine);\n\n $person\n .select('.path--fg')\n .datum(d => d.values)\n .transition()\n .duration(DUR)\n .ease(EASE)\n .attr('d', generateLine);\n\n return Chart;\n }", "function drawYears(){\n var years = [\"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\", \"2010\", \"2011\", \"2012\", \"2013\"];\n\n\t\td3.selectAll(\".time_frame_lable\").remove();\n\t\tvar time_frame_label = top_svg.append(\"g\")\n\t\t\t\t\t\t\t\t .attr(\"class\", \"time_frame_lable\")\n\t\t\t\t\t\t\t\t .attr(\"x\",0)\n\t\t\t\t\t\t\t\t .attr(\"y\", 360)\n\t\t\t\t\t\t\t\t .selectAll(\"text\")\n\t\t\t\t\t\t\t\t .data(function(){return years;})\n\t\t\t\t\t\t\t\t.enter().append(\"text\")\n\t\t\t\t\t\t\t\t .text(function(d,i){return years[i];})\n\t\t\t\t\t\t\t\t .attr(\"x\", function(d,i) {return i*95 + 40;})\n\t\t\t\t\t\t\t\t .attr(\"y\", function(d,i){if ((i>=GLOBALS.time_frame.start-2003)&&(i<=GLOBALS.time_frame.end-2003)){return yheight-8}else{return yheight-3}})\n\t\t\t\t\t\t\t\t .attr(\"font-family\", \"sans-serif\")\n\t\t\t\t\t\t\t\t .attr(\"font-size\", 14)\n\t\t\t\t\t\t\t\t .attr(\"fill\", function(d,i){if ((i>=GLOBALS.time_frame.start-2003)&&(i<=GLOBALS.time_frame.end-2003)){return \"red\"}else{return \"black\"}})\n\t\t\t\t\t\t\t\t ;\n\t}", "function drawYears(){\n var years = [\"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\", \"2010\", \"2011\", \"2012\", \"2013\"];\n\n\t\td3.selectAll(\".time_frame_lable\").remove();\n\t\tvar time_frame_label = top_svg.append(\"g\")\n\t\t\t\t\t\t\t\t .attr(\"class\", \"time_frame_lable\")\n\t\t\t\t\t\t\t\t .attr(\"x\",0)\n\t\t\t\t\t\t\t\t .attr(\"y\", 360)\n\t\t\t\t\t\t\t\t .selectAll(\"text\")\n\t\t\t\t\t\t\t\t .data(function(){return years;})\n\t\t\t\t\t\t\t\t.enter().append(\"text\")\n\t\t\t\t\t\t\t\t .text(function(d,i){return years[i];})\n\t\t\t\t\t\t\t\t .attr(\"x\", function(d,i) {return i*95 + 40;})\n\t\t\t\t\t\t\t\t .attr(\"y\", function(d,i){if ((i>=GLOBALS.time_frame.start-2003)&&(i<=GLOBALS.time_frame.end-2003)){return yheight-8}else{return yheight-3}})\n\t\t\t\t\t\t\t\t .attr(\"font-family\", \"sans-serif\")\n\t\t\t\t\t\t\t\t .attr(\"font-size\", 14)\n\t\t\t\t\t\t\t\t .attr(\"fill\", function(d,i){if ((i>=GLOBALS.time_frame.start-2003)&&(i<=GLOBALS.time_frame.end-2003)){return \"red\"}else{return \"black\"}})\n\t\t\t\t\t\t\t\t ;\n\t}", "function timeSeries() {\n var TRANSITION_DURATION = 1500;\n var data = [];\n var width = 640;\n var height = 480;\n var backgroundColor = 'white';\n var lineColor = 'red';\n var padding = {\n top: 50,\n bottom: 50,\n left: 50,\n right: 50\n };\n\n var xScale, yScale;\n\n\n // Chart generation closure.\n var chart = function(selection) {\n selection.each(function(data) {\n var container = d3.select(this);\n var svg = container.selectAll('svg').data([data]);\n\n var svgEnter = svg.enter()\n .append('svg')\n .attr('class', 'time-series');\n\n svg.attr('width', width)\n .attr('height', height)\n .style('background-color', backgroundColor);\n\n svgEnter.append('g')\n .attr('class', 'points-container')\n .attr('transform', 'translate(' + padding.left + ',' + padding.top + ')')\n .append('path')\n .attr('class', 'value line');\n\n svgEnter.append('g')\n .attr('class', 'x axis')\n .attr('transform', 'translate(' + padding.left + ',' + (height - padding.top) + ')');\n\n svgEnter.append('g')\n .attr('class', 'y axis')\n .attr('transform', 'translate(' + padding.left + ',' + padding.top + ')');\n\n svgEnter.append('g')\n .attr('class', 'x text')\n .attr('transform', 'translate(' + (padding.left + innerWidth()/2) + ',' + (innerHeight() + padding.top + 30) + ')')\n .attr('class', 'chart-title')\n .text('time');\n\n svgEnter.append('g')\n .attr('class', 'y text')\n .attr('transform', 'translate(' + (padding.left - 30) + ',' + (height/2) + ') rotate(-90)')\n .attr('class', 'chart-title')\n .text('counts');\n\n setScales(data);\n setAxes(container.select('.x.axis'),\n container.select('.y.axis'));\n var adjustedWidth = innerWidth();\n var adjustedHeight = innerHeight();\n\n var points = svg.select('.points-container')\n .selectAll('circle').data(data);\n\n points.enter().append('circle')\n .attr('r', 3)\n .attr('cx', function(d) { return xScale(d.date); })\n .attr('cy', function(d) { return yScale(d.frequency); })\n .style('opacity', 0.7)\n .attr('fill', lineColor);\n\n\n points.exit().remove();\n\n points.transition()\n .attr('cx', function(d) { return xScale(d.date); })\n .attr('cy', function(d) { return yScale(d.frequency); });\n\n container.select('.value.line')\n .transition()\n .attr('d', valueLine(data))\n .attr('stroke', lineColor);\n });\n };\n\n // Gets/sets the data associated with this chart.\n chart.data = function(val) {\n if (!arguments.length) return data;\n data = val;\n if (typeof updateData === 'function') {\n updateData();\n }\n };\n\n // Gets/sets the width of this chart.\n chart.width = function(val) {\n if (!arguments.length) return width;\n\n width = val;\n return this;\n };\n\n // Gets/sets the height of this chart.\n chart.height = function(val) {\n if (!arguments.length) return height;\n\n height = val;\n return this;\n };\n\n // Gets/sets the background color of this chart.\n chart.backgroundColor = function(val) {\n if (!arguments.length) return backgroundColor;\n\n backgroundColor = val;\n return this;\n }\n\n // Returns the width of the chart, excluding the paddings.\n var innerWidth = function() {\n return width - padding.left - padding.right;\n };\n\n // Returns the height of the chart, excluding the paddings.\n var innerHeight = function() {\n return height - padding.top - padding.bottom;\n };\n\n var setScales = function(data) {\n xScale = d3.time.scale()\n .domain([data[0].date, data[data.length - 1].date])\n .range([0, innerWidth()]);\n\n var yMin = d3.min(data, function(d) { return d.frequency });\n var yMax = d3.max(data, function(d) { return d.frequency });\n\n yScale = d3.scale.linear()\n .domain([yMin * 0.9, yMax])\n .range([innerHeight(), 0]);\n };\n\n var setAxes = function(xAxisLabel, yAxisLabel) {\n var xAxis = d3.svg.axis()\n .scale(xScale)\n .orient('bottom')\n .tickFormat(d3.time.format('%a'))\n .ticks(7);\n\n var yAxis = d3.svg.axis()\n .scale(yScale)\n .orient('left');\n\n xAxisLabel.transition().duration(TRANSITION_DURATION).call(xAxis);\n\n yAxisLabel.transition().duration(TRANSITION_DURATION).call(yAxis);\n };\n\n var valueLine = d3.svg.line()\n .x(function (d) { return xScale(d.date); })\n .y(function (d) { return yScale(d.frequency); });\n\n return chart;\n}", "drawPlot() {\n let parent = this;\n let svgSelect = d3.select(\"#vis-8-svg\");\n let groupSelect = svgSelect.selectAll(\".yearGroup\").data(this.data)\n .join(\"g\")\n .attr(\"class\", \"yearCircles\");\n groupSelect.each(function(d, i) {\n d3.select(this).selectAll(\".yearHiddenLine\").data(d => [d])\n .join(\"line\")\n .attr(\"class\", \"yearHiddenLine\")\n .attr(\"x1\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"x2\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"y1\", d => parent.scaleNumFires(parent.scaleNumFires.domain()[0]))\n .attr(\"y2\", d => parent.scaleNumFires(parent.scaleNumFires.domain()[1]));\n d3.select(this).selectAll(\".yearLine\").data(d => [d])\n .join(\"line\")\n .attr(\"class\", \"yearLine\")\n .attr(\"x1\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"x2\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"y1\", d => parent.scaleNumFires(parent.scaleNumFires.domain()[0]))\n .attr(\"y2\", d => parent.scaleNumFires(parent.scaleNumFires.domain()[1]));\n d3.select(this).selectAll(\".numFires\").data(d => [d])\n .join(\"circle\")\n .attr(\"class\", \"numFires\")\n .attr(\"r\", 6)\n .attr(\"cx\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"cy\", d => parent.scaleNumFires(d.numFires));\n d3.select(this).selectAll(\".totalAcres\").data(d => [d])\n .join(\"circle\")\n .attr(\"class\", \"totalAcres\")\n .attr(\"r\", 6)\n .attr(\"cx\", d => parent.scaleYears(new Date(d.year, 0, 1)))\n .attr(\"cy\", d => parent.scaleTotalAcres(d.totalAcres));\n\n d3.select(this).selectAll(\".yearNumber\").data(d => [d])\n .join(\"text\")\n .attr(\"class\", \"yearNumber\")\n .attr(\"x\", d => parent.scaleYears(new Date(d.year, 0, 1)) - 10)\n .attr(\"y\", d => parent.scaleNumFires(parent.scaleNumFires.domain()[0] + 1000))\n .text(d => d.year);\n\n\n\n });\n groupSelect.on(\"mouseover\", function(event, d) {\n d3.select(this).selectAll(\".numFires\")\n .classed(\"numFires-hover\", true)\n .attr(\"r\", 8);\n d3.select(this).selectAll(\".totalAcres\")\n .classed(\"totalAcres-hover\", true)\n .attr(\"r\", 8);\n d3.select(this).selectAll(\".yearLine\")\n .classed(\"yearLine-hover\", true);\n d3.select(this).selectAll(\".yearNumber\")\n .classed(\"yearNumber-hover\", true);\n\n //Display Tooltip:\n let tooltip = d3.select(\"#national-tooltip\");\n tooltip.style(\"opacity\", 0);\n\n let year = d.year;\n let numFires = parent.numberWithCommas(d.numFires);\n let totalAcres = parent.numberWithCommas(d.totalAcres);\n\n //Populate header:\n tooltip.select(\".card-title\").select(\"span\").text(year);\n //populate body:\n tooltip.select(\".card-body\").selectAll(\"span\").data([numFires, totalAcres])\n .text(d => d);\n\n //Tooltip transition and position:\n tooltip\n .style(\"left\", (event.pageX + 20) + 'px')\n .style(\"top\", (event.pageY + 20) + 'px')\n .classed(\"d-none\", false)\n .style(\"opacity\", 1.0)\n .style(\"transform\", \"scale(1)\");\n tooltip.select(\".card\").raise();\n\n\n })\n .on(\"mouseout\", function(event, d) {\n d3.select(this).selectAll(\".numFires\")\n .classed(\"numFires-hover\", false)\n .attr(\"r\", () => parent.isHighlightNumFires ? 10 : 6);\n d3.select(this).selectAll(\".totalAcres\")\n .classed(\"totalAcres-hover\", false)\n .attr(\"r\", () => parent.isHighlightTotalAcres ? 10 : 6);\n d3.select(this).selectAll(\".yearLine\")\n .classed(\"yearLine-hover\", false);\n d3.select(this).selectAll(\".yearNumber\")\n .classed(\"yearNumber-hover\", false);\n\n //Remove tooltip:\n let tooltip = d3.select(\"#national-tooltip\")\n .style(\"opacity\", 0)\n .classed(\"d-none\", true)\n .style(\"transform\", \"\");\n })\n }", "function draw() {\n // + FILTER DATA BASED ON STATE\n let filteredData = [];\n if (state.selectedCountry !== null) {\n filteredData = state.data.filter(d => d.country === state.selectedCountry)\n }\n console.log(filteredData);\n //\n // + UPDATE SCALE(S), if needed\n yScale.domain([0, d3.max(filteredData, d => d.number)]);\n // + UPDATE AXIS/AXES, if needed\n d3.select(\"g.y-axis\")\n .transition()\n .duration(1000)\n .call(yAxis.scale(yScale));\n\n // we define our line function generator telling it how to access the x,y values for each point\n\n const lineFunc = d3\n .line()\n .x(d => xScale(d.year))\n .y(d => yScale(d.number));\n const areaFunc = d3\n .area()\n .x(d => xScale(d.year))\n .y1(d => yScale(d.number))\n .y0(yScale(0));\n\n // + DRAW CIRCLES, if you decide to\n const dot = svg\n .selectAll(\".dot\")\n .data(filteredData, d => d.country) // use `d.year` as the `key` to match between HTML and data elements\n .join(\n enter => // + HANDLE ENTER SELECTION\n enter // enter selections -- all data elements that don't have a `.dot` element attached to them yet\n .append(\"circle\")\n .attr(\"fill\", \"green\")\n .attr(\"class\", \"dot\")\n .attr(\"r\", radius)\n .attr(\"cx\", d => xScale(d.year))\n .attr(\"cy\", d => yScale(d.number)),\n\n\n\n update => update, // + HANDLE UPDATE SELECTION\n exit => // + HANDLE EXIT SELECTION\n exit.call(exit =>\n // exit selections -- all the `.dot` element that no longer match to HTML elements \n exit\n .remove()\n\n )\n )\n\n .call(\n selection =>\n selection\n .transition()\n .duration(1000)\n .attr(\"cy\", d => yScale(d.number))\n );\n //\n // + DRAW LINE AND AREA\n const line = svg\n .selectAll(\"path.trend\")\n .data([filteredData])\n .join(\n enter =>\n enter\n .append(\"path\")\n .attr(\"class\", \"trend\")\n .attr(\"opacity\", 0),\n // .attr(0, \"opacity\"), // start them off as opacity 0 and fade them in\n update => update, // pass through the update selection\n exit => exit\n .transition()\n .remove(),\n )\n .call(selection =>\n selection\n .transition()\n .duration(1000)\n .attr(\"opacity\", 0.8)\n .attr(\"d\", d => lineFunc(d))\n )\n const area = svg\n .selectAll(\".area\")\n .data([filteredData])\n .join(\"path\")\n .attr(\"class\", \"area\")\n .attr(\"cx\", (width - margin.left))\n .attr(\"d\", d => areaFunc(d));\n\n\n\n\n}", "function ready(datapoints) {\n // Group your data together\n var nested = d3\n .nest()\n .key(d => d.Year)\n .entries(datapoints)\n // console.log(nested)\n\n // pull out ages on x axis\n var ages = datapoints.map(d => d.Age)\n xPositionScale.domain(d3.extent(ages))\n\n // Draw your lines\n container\n .selectAll('.fertility-svg')\n .data(nested)\n .enter()\n .append('svg')\n .attr('class', 'fertility-svg')\n .attr('height', height + margin.top + margin.bottom)\n .attr('width', width + margin.left + margin.right)\n .append('g')\n .attr('transform', `translate(${margin.left},${margin.top})`)\n .each(function(d) {\n var svg = d3.select(this)\n\n var datapoints = d.values\n // console.log(datapoints)\n\n let rateUS = d3.sum(datapoints, d => +d.ASFR_us).toFixed(2)\n let rateJP = d3.sum(datapoints, d => +d.ASFR_jp).toFixed(2)\n\n // Add your pathes\n svg\n .append('path')\n // why I cannot use .data(datapoints)\n .datum(datapoints)\n .attr('d', line_us)\n .attr('stroke', 'lightblue')\n .attr('fill', 'lightblue')\n .attr('opacity', 0.6)\n\n svg\n .append('path')\n .datum(datapoints)\n .attr('d', line_jp)\n .attr('stroke', 'red')\n .attr('fill', 'red')\n .attr('opacity', 0.4)\n .lower()\n\n // Add your notations\n svg\n .append('text')\n .attr('x', (width * 3) / 4)\n .attr('y', height / 2)\n .attr('text-anchor', 'middle')\n .style('font-size', 8)\n .attr('stroke', 'lightblue')\n .attr('fill', 'lightblue')\n .attr('opacity', 0.6)\n .text(rateUS)\n\n svg\n .append('text')\n .attr('x', (width * 3) / 4)\n .attr('y', height / 2 + 10)\n .attr('text-anchor', 'middle')\n .style('font-size', 8)\n .attr('stroke', 'red')\n .attr('fill', 'red')\n .attr('opacity', 0.4)\n .text(rateJP)\n\n // Add your title\n svg\n .append('text')\n .attr('x', width / 2)\n .attr('y', 0 - margin.top / 2)\n .attr('text-anchor', 'middle')\n .style('font-size', 10)\n .text(d.key)\n\n // Add your axes\n var xAxis = d3.axisBottom(xPositionScale).tickValues([15, 30, 45])\n\n svg\n .append('g')\n .attr('class', 'axis x-axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(xAxis)\n\n var yAxis = d3\n .axisLeft(yPositionScale)\n .tickValues([0.0, 0.1, 0.2, 0.3])\n .ticks(4)\n\n svg\n .append('g')\n .attr('class', 'axis y-axis')\n .call(yAxis)\n })\n}", "function clicked(p, dataX, root, path, label) {\n\n // Update barchart when clicked on a year\n if (p.data.name[0] == 2) {\n var foodname = d3.selectAll(\"#sunburstTitle\").text()\n updateUnderBarChart(dataX, foodname, p.data.name)\n updateYear(dataX, p.data.name)\n }\n parent.datum(p.parent || root);\n root.each(d => d.target = {\n x0: Math.max(0, Math.min(1, (d.x0 - p.x0) / (p.x1 - p.x0))) * 2 * Math.PI,\n x1: Math.max(0, Math.min(1, (d.x1 - p.x0) / (p.x1 - p.x0))) * 2 * Math.PI,\n y0: Math.max(0, d.y0 - p.depth),\n y1: Math.max(0, d.y1 - p.depth)\n });\n\n const t = g.transition().duration(450);\n\n // Transition the data on all arcs\n path.transition(t)\n .tween(\"data\", d => {\n const i = d3.interpolate(d.current, d.target);\n return t => d.current = i(t);\n })\n .filter(function(d) {\n return +this.getAttribute(\"fill-opacity\") || arcVisible(d.target);\n })\n .attr(\"fill-opacity\", d => arcVisible(d.target) ? (d.children ? 0.9 : 0.7) : 0)\n .attrTween(\"d\", d => () => arc(d.current));\n\n label.filter(function(d) {\n return +this.getAttribute(\"fill-opacity\") || labelVisible(d.target);\n }).transition(t)\n .attr(\"fill-opacity\", d => +labelVisible(d.target))\n .attrTween(\"transform\", d => () => labelTransform(d.current));\n}", "function displayYear(year) {\n d3.selectAll(\".dot\").data(interpolateData(year), key)\n .call(position)\n .sort(order);\n $(\"#ci-years-selector\").val(Math.round(year));\n }", "update () {\n\n //Domain definition for global color scale\n let domain = [-60, -50, -40, -30, -20, -10, 0, 10, 20, 30, 40, 50, 60];\n\n //Color range for global color scale\n let range = [\"#063e78\", \"#08519c\", \"#3182bd\", \"#6baed6\", \"#9ecae1\", \"#c6dbef\", \"#fcbba1\", \"#fc9272\", \"#fb6a4a\", \"#de2d26\", \"#a50f15\", \"#860308\"];\n\n //ColorScale be used consistently by all the charts\n this.colorScale = d3.scaleQuantile()\n .domain(domain)\n .range(range);\n\n // ******* TODO: PART I *******\n\n // Create the chart by adding circle elements representing each election year\n //The circles should be colored based on the winning party for that year\n //HINT: Use the .yearChart class to style your circle elements\n //HINT: Use the chooseClass method to choose the color corresponding to the winning party.\n\n //Append text information of each year right below the corresponding circle\n //HINT: Use .yeartext class to style your text elements\n\n //Style the chart by adding a dashed line that connects all these years.\n //HINT: Use .lineChart to style this dashed line\n\n //Clicking on any specific year should highlight that circle and update the rest of the visualizations\n //HINT: Use .highlighted class to style the highlighted circle\n\n //Election information corresponding to that year should be loaded and passed to\n // the update methods of other visualizations\n\n\n //******* TODO: EXTRA CREDIT *******\n\n //Implement brush on the year chart created above.\n //Implement a call back method to handle the brush end event.\n //Call the update method of shiftChart and pass the data corresponding to brush selection.\n //HINT: Use the .brush class to style the brush.\n\n }", "function updateChart(init) {\n svg.selectAll('circle')\n .transition()\n .duration(500)\n .ease(d3.easeQuad)\n .attr('cx', function(d) {\n return (!isNaN(d.GDPCapita) && d.GDPCapita != 0 && d[yAxisKey[yAxis]] != 0 && d.Year == YEAR) ? xScale(d.GDPCapita) : d3.select(this).attr('cx');\n })\n .attr('cy', function(d) {\n return (!isNaN(d[yAxisKey[yAxis]]) && d.GDPCapita != 0 && d[yAxisKey[yAxis]] != 0 && d.Year == YEAR) ? yScale(d[yAxisKey[yAxis]]) : d3.select(this).attr('cy');\n })\n .attr('r', function(d) {\n return (!isNaN(d.GDPCapita) && d.GDPCapita != 0 && d[yAxisKey[yAxis]] != 0 && d.Year == YEAR) || (!isNaN(d[yAxisKey[yAxis]]) && d.Year == 2018) ? 5 : 0;\n })\n .style(\"fill\", \"black\");\n\n // Update axis labels\n d3.select('#yLabel')\n .text(descriptions[yAxis]);\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 updateYearLabels(opt_yearRange) {\n const [firstYear, lastYear] = opt_yearRange || yearRange;\n const width = $('.time-chart-bg').width();\n const leftPx = Math.floor((firstYear - MIN_YEAR) / (MAX_YEAR - MIN_YEAR) * width);\n const rightPx = Math.ceil((lastYear - MIN_YEAR) / (MAX_YEAR - MIN_YEAR) * width);\n const $fg = $('.time-chart-fg');\n $fg.css({\n 'background-position-x': `-${leftPx}px`,\n 'margin-left': `${leftPx}px`,\n 'width': (rightPx - leftPx) + 'px'\n })\n\n $('#time-range-label-first').text(firstYear).css({left: `${leftPx}px`});\n $('#time-range-label-last').text(lastYear).css({left: `${rightPx}px`});\n}", "function buildCharts(golfstat) {\n\n // Use d3.json to load the samples.json file \n d3.csv(\"https://raw.githubusercontent.com/joelapsansky/red-team/main/Excel%20%26%20CSV/reshaped_full_cleaned_dataset.csv\", function(data) {\n console.log(data);\n\n // Filter 5 years\n var data2017 = data.filter(golfdata => golfdata[\"Year\"]==2017)\n\n var data2018 = data.filter(golfdata => golfdata[\"Year\"]==2018)\n\n var data2019 = data.filter(golfdata => golfdata[\"Year\"]==2019)\n\n var data2020 = data.filter(golfdata => golfdata[\"Year\"]==2020)\n\n var data2021 = data.filter(golfdata => golfdata[\"Year\"]==2021)\n\n // New x, y, and player name variables for trace\n var yvalues2017 = data2017.map(golfdata => golfdata[\"money_MONEY\"])\n\n var xvalues2017 = data2017.map(golfdata => golfdata[golfstat])\n\n var playername2017 = data2017.map(golfdata => golfdata[\"PLAYER NAME\"])\n\n var yvalues2018 = data2018.map(golfdata => golfdata[\"money_MONEY\"])\n\n var xvalues2018 = data2018.map(golfdata => golfdata[golfstat])\n\n var playername2018 = data2018.map(golfdata => golfdata[\"PLAYER NAME\"])\n\n var yvalues2019 = data2019.map(golfdata => golfdata[\"money_MONEY\"])\n\n var xvalues2019 = data2019.map(golfdata => golfdata[golfstat])\n\n var playername2019 = data2019.map(golfdata => golfdata[\"PLAYER NAME\"])\n\n var yvalues2020 = data2020.map(golfdata => golfdata[\"money_MONEY\"])\n\n var xvalues2020 = data2020.map(golfdata => golfdata[golfstat])\n\n var playername2020 = data2020.map(golfdata => golfdata[\"PLAYER NAME\"])\n\n var yvalues2021 = data2021.map(golfdata => golfdata[\"money_MONEY\"])\n\n var xvalues2021 = data2021.map(golfdata => golfdata[golfstat])\n\n var playername2021 = data2021.map(golfdata => golfdata[\"PLAYER NAME\"])\n\n // Make 5 traces (one for each year)\n var trace2021 = {\n x: xvalues2021,\n y: yvalues2021,\n mode: 'markers',\n type: 'scatter',\n text: playername2021,\n name: \"2021\"\n };\n\n var trace2020 = {\n x: xvalues2020,\n y: yvalues2020,\n mode: 'markers',\n type: 'scatter',\n text: playername2020,\n name: \"2020\"\n };\n\n var trace2019 = {\n x: xvalues2019,\n y: yvalues2019,\n mode: 'markers',\n type: 'scatter',\n text: playername2019,\n name: \"2019\"\n };\n\n var trace2018 = {\n x: xvalues2018,\n y: yvalues2018,\n mode: 'markers',\n type: 'scatter',\n text: playername2018,\n name: \"2018\"\n };\n \n var trace2017 = {\n x: xvalues2017,\n y: yvalues2017,\n mode: 'markers',\n type: 'scatter',\n text: playername2017,\n name: \"2017\"\n };\n \n // Define legend (and filters) for scatter plot\n var scatterData = [trace2021, trace2020, trace2019, trace2018, trace2017];\n\n // Define layout\n var layout = {\n xaxis: {title: golfstat},\n yaxis: {title: \"Annual Winnings (millions $)\"},\n title:'Relationship between Performance Stat and Winnings',\n legend: {\n y: 0.5,\n yref: 'paper',\n font: {\n family: 'Arial, sans-serif',\n size: 20,\n color: 'grey',\n }\n }\n };\n\n // Use Plotly to plot the data with the layout\n Plotly.newPlot(\"scatter\",scatterData, layout);\n });\n}", "function plotData(dataset) {\n // update the scale with the domain, on the basis of the dataset\n xScale\n .domain([0, d3.max(dataset, d => d.value) * 1.1]);\n yScale\n .domain(dataset.map(d => d.country));\n\n // select the axes and update their appearance\n // ! technically it is only the y axis changing, as the added values are always less than the existing ones\n // updating the x axis is overkill\n d3\n .select('g.x.axis')\n .transition()\n .call(d3\n .axisBottom(xScale)\n .tickSize(0)\n .tickPadding(5));\n\n d3\n .select('g.y.axis')\n .transition()\n .call(d3\n .axisLeft(yScale)\n .tickSize(0)\n .tickPadding(10));\n\n /*\n update-enter-exit pattern\n update: existing elements, alter only the properties which need adjusting (like the size and coordinates)\n enter: new elements, create and append elements\n exist: old elements, delete\n */\n\n const update = containerFrame\n .selectAll('g.group')\n .data(dataset, d => d.country);\n\n const enter = update\n .enter();\n\n const exit = update\n .exit();\n\n\n // update the position (and the dimension) of the existing elements\n // ! the elements making up the visualization are wrapped in a container\n // ! this container allows to describe the different elements of the u-e-e pattern\n update\n .attr('transform', (d) => `translate(0, ${yScale(d.country)})`);\n\n update\n .selectAll('circle')\n .transition()\n .attr('cy', yScale.bandwidth() / 2)\n .attr('cx', d => xScale(d.value))\n .attr('r', yScale.bandwidth() / 5);\n\n update\n .selectAll('path')\n .transition()\n .attr('stroke-width', yScale.bandwidth() / 15)\n .attr('d', (d, i) => `M 0 ${yScale.bandwidth() / 2} h ${xScale(d.value)}`);\n\n update\n .selectAll('rect')\n .attr('height', yScale.bandwidth());\n\n\n // introduce elements for the new selection\n const enterGroup = enter\n .append('g')\n .attr('class', 'group')\n .attr('opacity', 0.7)\n .attr('transform', (d) => `translate(0, ${yScale(d.country)})`)\n // mouse events are registered when interacting with any child element of the group elements\n .on('mouseenter', function (d) {\n d3\n .select(this)\n .attr('opacity', 1);\n\n tooltip\n .append('p')\n .html(`Country: <strong>${d.country}</strong>`);\n\n tooltip\n .append('p')\n .html(`<strong>${d.value}%</strong> frequent a cinema 4 or more times in a week`);\n\n tooltip\n .style('opacity', 1)\n .style('top', `${d3.event.pageY}px`)\n .style('left', `${d3.event.pageX}px`);\n })\n .on('mouseout', function () {\n d3\n .select(this)\n .attr('opacity', 0.7);\n\n tooltip\n .style('opacity', 0)\n .selectAll('p')\n .remove();\n });\n\n\n enterGroup\n .append('circle')\n .attr('cy', yScale.bandwidth() / 2)\n .attr('r', yScale.bandwidth() / 5)\n .attr('fill', '#f24537')\n .attr('cx', 0)\n .transition()\n .duration(1000)\n .delay((d, i) => i * 50)\n .attr('cx', d => xScale(d.value));\n\n enterGroup\n .append('path')\n .attr('stroke-width', yScale.bandwidth() / 15)\n .attr('stroke', '#f24537')\n .attr('d', (d, i) => `M 0 ${yScale.bandwidth() / 2} h 0`)\n .transition()\n .duration(1000)\n .delay((d, i) => i * 50)\n .attr('d', (d, i) => `M 0 ${yScale.bandwidth() / 2} h ${xScale(d.value)}`);\n\n enterGroup\n .append('rect')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', width)\n .attr('height', yScale.bandwidth())\n .attr('fill', 'transparent');\n\n // remove elements for the no-longer-necessary selection\n exit.remove();\n}", "constructor(legos, tableChart, topThemesChart, biggestSetsChart, mostExpensiveSetsChart, priceVTimeChart, sizeVTimeChart) {\r\n\r\n this.legos = legos;\r\n this.years = new Array();\r\n for (var i = 1971; i < 2016; i++) {\r\n this.years.push(i);\r\n }\r\n this.firstTime = true;\r\n this.tableChart = tableChart;\r\n this.biggestSetsChart = biggestSetsChart;\r\n this.topThemesChart = topThemesChart;\r\n this.mostExpensiveSetsChart = mostExpensiveSetsChart;\r\n this.priceVTimeChart = priceVTimeChart;\r\n this.sizeVTimeChart = sizeVTimeChart;\r\n\r\n this.updateCharts(this.years);\r\n\r\n // Initializes the svg elements required for this chart\r\n this.margin = { top: 10, right: 20, bottom: 30, left: 50 };\r\n let divyearChart = d3.select(\"#year-chart\").classed(\"fullView\", true);\r\n\r\n //fetch the svg bounds\r\n this.svgBounds = divyearChart.node().getBoundingClientRect();\r\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\r\n this.svgHeight = 120;\r\n\r\n //add the svg to the div\r\n this.svg = divyearChart.append(\"svg\")\r\n .attr(\"width\", this.svgWidth)\r\n .attr(\"height\", this.svgHeight);\r\n\r\n this.selected = null;\r\n }", "updateYear(year) {\n\t\tthis.year = year;\n\t\t/*this.chartData = this.allData[this.category]\n\t\t\t.filter(function(d) {\n\t\t\t\tif (d.yr === year) return d;\n\t\t\t});*/\n\t}", "function drawYearsChart(data) {\n\n // data\n // x scale\n // y scale\n // draw bar shapes based on year\n\n if (!yearScaleX) {\n\n let domain = [...Array(97).keys()];\n domain = domain.map(d => d + 1925);\n\n yearScaleX = d3.scaleBand()\n .domain(domain) // data extent\n .range([0, size.w]) // svg values\n .padding(0.2);\n }\n // console.log(yearScaleX.domain());\n\n let nestedData = d3.group(data, d => d.releaseYear);\n nestedData = Array.from(nestedData);\n\n // console.log(nestedData);\n\n if (!yearScaleY) {\n yearScaleY = d3.scaleLinear()\n .domain([0, d3.max(nestedData, d => d[1].length)])\n .range([size.h, 0]);\n }\n\n yearG.selectAll('rect')\n .data(nestedData)\n .join('rect')\n .attr('width', yearScaleX.bandwidth())\n // .attr('height', d => size.h - yearScaleY(d[1].length))\n .attr('height', d => {\n // console.log(d[1].length, yearScaleY(d[1].length))\n return size.h - yearScaleY(d[1].length)\n })\n // .attr('x', d => yearScaleX(d[0]))\n .attr('x', function(d) {\n // console.log(d[0], yearScaleX(d[0]))\n return yearScaleX(d[0]);\n })\n .attr('y', d => yearScaleY(d[1].length))\n\n}", "function dataViz() {\n let index = document.getElementById(\"whatyear\").value;\n var stats;\n d3.csv(\"js/ADP_Employment_History.csv\").then(function(data) {\n stats = data[index];\n $( \"#data-month\" ).text(stats.month);\n $( \"#data-year\" ).text(stats.year);\n\n $( \"#graph-1-num\" ).text(stats.privateThousands);\n $( \"#graph-2-num\" ).text(stats.goodsThousands);\n $( \"#graph-3-num\" ).text(stats.serviceThousands);\n\n $( \"#graph-1-perc\" ).text(stats.privatePercent);\n $( \"#graph-2-perc\" ).text(stats.goodsPercent);\n $( \"#graph-3-perc\" ).text(stats.servicePercent);\n let privatePerc = mapped(stats.privatePercent,-0.64,0.32,0,900);\n let goodsPerc = mapped(stats.goodsPercent,-0.97,0.42,0,900);\n let servicePer = mapped(stats.servicePercent,-0.47,0.33,0,900);\n\n if (privatePerc > 900) {\n privatePerc = 900;\n }\n\n if (goodsPerc > 900) {\n goodsPerc = 900;\n }\n if (servicePer > 900) {\n servicePer = 900;\n };\n\n if (privatePerc < 300) {\n privatePerc = 300;\n }\n if (goodsPerc < 300) {\n goodsPerc = 300;\n }\n if (servicePer < 300) {\n servicePer = 300;\n };\n\n let graph1 = document.getElementById(\"graph-1-num\");\n let graph2 = document.getElementById(\"graph-2-num\");\n let graph3 = document.getElementById(\"graph-3-num\");\n\n graph1.style.fontVariationSettings = \" 'wght' \" + privatePerc;\n graph2.style.fontVariationSettings = \" 'wght' \" + goodsPerc;\n graph3.style.fontVariationSettings = \" 'wght' \" + servicePer;\n });\n\n //requestAnimationFrame(dataViz);\n}", "function updateLabels(svg, data) {\n\n var texts = svg.selectAll(\"text\").data(data)\n\n texts.exit().remove() \n\n var entered_texts = texts\n .enter().append(\"text\")\n .merge(texts)\n .attr(\"fill\", d => 'black')\n .attr('dy', '0.35em')\n .attr('font-size', '0.8em')\n .attr(\"transform\", d=> d.key=='xaxis_label' ? \"translate(\" + d.x + \",\" + d.y + \")rotate(45)\" : \"translate(\" + d.x + \",\" + d.y + \")\") \n .attr('text-anchor', d=> d.key=='xaxis_label' ? 'start' : 'middle')\n .text(d=>d.value)\n\n //texts = texts.merge(entered_texts)\n\n //texts\n //.transition().duration(2000)\n //.attr(\"transform\", d=> d.key=='xaxis_label' ? \"translate(\" + d.x + \",\" + d.y + \")rotate(45)\" : \"translate(\" + d.x + \",\" + d.y + \")\") \n //.text(d=>d.value)\n\n }", "function init() {\n \n // + SCALES\n\n xScale = d3.scaleTime()\n .domain(d3.extent(state.data, d=> d.year)) // getFullYear() function to parse only the year\n .range([margin.left, width - margin.right])\n \n\n yScale = d3.scaleLinear()\n .domain(d3.extent(state.data, d => d.death_count))\n .range([height - margin.bottom, margin.bottom])\n\n// + AXES \nconst x = d3.axisBottom(xScale) \nconst y = d3.axisLeft(yScale)\n\n//Create the svg\n\nsvg = d3.select(\"#d3-container\")\n.append(\"svg\")\n.attr(\"width\", width)\n.attr(\"height\",height)\n\n// + UI ELEMENT SETUP\n// add labels - xAxis\n // + CALL AXES\nconst xAxisGroup = svg.append(\"g\")\n.attr(\"class\", 'xAxis')\n.attr(\"transform\", `translate(${0}, ${height - margin.bottom})`) // move to the bottom\n.call(x)\n\nconst yAxisGroup = svg.append(\"g\")\n.attr(\"class\", 'yAxis')\n.attr(\"transform\", `translate(${margin.left}, ${0})`) // align with left margin\n.call(y)\n\n// add labels - xAxis\nxAxisGroup.append(\"text\")\n.attr(\"class\", 'axis-title')\n.attr(\"x\", width / 2)\n.attr(\"y\", 40)\n.attr(\"text-anchor\", \"middle\")\n.style(\"fill\",\"#FFFF00\")\n.style(\"font\", \"15px courier,arial,helvetica\")\n.text(\"Year\")\n\n// add labels - yAxis\nyAxisGroup.append(\"text\")\n.attr(\"class\", 'axis-title')\n.attr(\"x\", -40)\n.attr(\"y\", height / 2)\n.attr(\"writing-mode\", \"vertical-rl\")\n.attr(\"text-anchor\", \"middle\")\n.style(\"fill\",\"#FFFF00\")\n.style(\"font\", \"15px courier,arial,helvetica\")\n.text(\"Deaths per Year\")\n\n// append a new group, g stands for group\nsvg.append(\"g\")\n.attr(\"class\", \"xAxis\")\n.attr(\"transform\", `translate(${0},${height-margin.bottom})`)\n.call(x)\n\nsvg.append(\"g\")\n.attr(\"class\", \"yAxis\")\n.attr(\"transform\", `translate(${margin.left},${0})`)\n.call(y)\n\n\n// Setting up the UI Elements\n\n /** const selectElement = d3.select(\"#dropdown\").on(\"change\", function() {\n\n state.selection = this.value; // + UPDATE STATE WITH YOUR SELECTED VALUE\n console.log(\"new value is\", this.value);\n\n selectElement\n .selectAll(\"option\")\n .data([\"All\", \"1\", \"2\", \"3\"]) // + ADD DATA VALUES FOR DROPDOWN\n .join(\"option\")\n .attr(\"value\", d => d)\n .text(d => d);\n\n\n\n draw(); // re-draw the graph based on this new selection\n }); */\n\n \n const selectElement = d3.select(\"#dropdown\")\n\n // add in dropdown options from the unique values in the data\n selectElement.selectAll(\"option\")\n .data([\n \n // add in all the unique values from the dataset\n ...new Set(state.data.map(d => d.death_cause))])\n .join(\"option\")\n .attr(\"attr\", d => d)\n .text(d => d)\n\n selectElement.on(\"change\", event =>{\n\n state.selection = event.target.value\n draw();\n\n})\n\n draw(); // calls the draw function\n}", "createScales(){\n let dv = this;\n\n // set scales\n dv.x = d3.scaleTime().range([0, dv.width]);\n dv.y = d3.scaleLinear().range([dv.height, 0]);\n\n // Update scales\n dv.x.domain(d3.extent(dv.data[0].values, d => {\n return (d.date); }));// this needs to be dynamic dv.date!!\n \n // for the y domain to track negative numbers \n const minValue = d3.min(dv.data, d => {\n return d3.min(d.values, d => { return d[dv.value]; });\n });\n\n // Set Y axis scales 0 if positive number else use minValue\n dv.y.domain([ minValue >=0 ? 0 : minValue,\n d3.max(dv.data, d => { \n return d3.max(d.values, d => { return d[dv.value]; });\n })\n ]);\n\n dv.xLabel.text(dv.titleX);\n dv.yLabel.text(dv.titleY);\n\n dv.drawGridLines();\n // dv.tickNumber = 0 ; //= dv.data[0].values.length;\n\n // Update axes\n dv.tickNumber !== \"undefined\" ? dv.xAxisCall.scale(dv.x).ticks(dv.tickNumber) : dv.xAxisCall.scale(dv.x);\n\n // // Update axes - what about ticks for smaller devices??\n // dv.xAxisCall.scale(dv.x).ticks(d3.timeYear.filter((d) => {\n // return d = parseYear(\"2016\");\n // }));\n // dv.xAxisCall.scale(dv.x).ticks(dv.tickNumber).tickFormat( (d,i) => {\n // return i < dv.tickNumber ? dv.data[0].values[i].label : \"\";\n // });\n \n // .tickFormat(dv.formatQuarter);\n dv.xAxis.transition(dv.t()).call(dv.xAxisCall);\n \n //ticks(dv.tickNumberY)\n dv.yScaleFormat !== \"undefined\" ? dv.yAxisCall.scale(dv.y).tickFormat(dv.yScaleFormat ) : dv.yAxisCall.scale(dv.y);\n dv.yAxis.transition(dv.t()).call(dv.yAxisCall);\n\n // Update x-axis label based on selector\n // dv.xLabel.text(dv.variable);\n\n // Update y-axis label based on selector\n // var selectorKey = dv.keys.findIndex( d => { return d === dv.variable; });\n // var newYLabel =[selectorKey];\n // dv.yLabel.text(newYLabel);\n\n dv.update();\n }", "function UpdateSlider(year) {\n d3.selectAll(\"#nodata\").remove();\n var value = brush.extent()[0];\n year = formatDate(value);\n UpdateMap(data, year);\n drawScatterPlot(data[year], year);\n drawpiechart(populationdata[year], countrycode, year);\n\n d3.select('.btn.btn-primary').on('click', function() {\n $('html,body').animate({\n scrollTop: $(\".third\").offset().top},\n 'slow');\n sunburstSelected(populationdata[year], countrycode, year);\n }); \n \n if (d3.event.sourceEvent) {\n d3.select(\"#sunburstsvg\").remove();\n value = timeScale.invert(d3.mouse(this)[0]);\n year = formatDate(value);\n UpdateMap(data, year);\n drawScatterPlot(data[year], year);\n drawpiechart(populationdata[year], countrycode, year);\n\n d3.select('.btn.btn-primary').on('click', function() {\n $('html,body').animate({\n scrollTop: $(\".third\").offset().top},\n 'slow');\n sunburstSelected(populationdata[year], countrycode, year)\n });\n\n brush.extent([value, value]);\n }\n\n handle.attr(\"transform\", \"translate(\" + timeScale(value) + \",0)\");\n handle.select('text').text(year);\n\n }", "function interpolateData(year) {\n return fullTimeData.completeSetmRel.map(function (d) {\n return {\n name: d.name,\n region: d.region,\n area: interpolateValues(d.area, year),\n population: interpolateValues(d.population, year),\n pops: interpolateValues(d.pops, year)\n };\n });\n }", "function drawHovers(year) {\n // Bisector function to get closest data point: note, this returns an *index* in your array\n var bisector = d3.bisector(function (d, x) {\n return +d.year - x;\n }).left;\n\n // Get hover data by using the bisector function to find the y value\n var years = selectedData.map(function (d) {\n d.values.sort(function (a, b) {\n return +a.year - +b.year;\n });\n return (d.values[bisector(d.values, year)]);\n })\n\n // Do a data-join (enter, update, exit) to draw circles\n var circles = g.selectAll('circle').data(years, function (d) {\n return d.country_area;\n });\n\n circles.enter().append('circle').attr('fill', 'none').attr('stroke', function (d) {\n return colorScale(d.country_area);\n });\n\n circles.transition().duration(0).attr('cx', function (d) {\n return xScale(d.year);\n }).attr('cy', function (d) {\n return yScale(d.value);\n }).attr('r', 15);\n\n circles.exit().remove();\n\n // Do a data-join (enter, update, exit) draw text\n var labels = g.selectAll('.label').data(years, function (d) {\n return d.country_area;\n })\n\n labels.enter().append('text').attr('class', 'label');\n\n labels\n .attr(\"dy\", \".35em\")\n .style('font-size', '0.75em')\n .text(function(d){\n return d.State + \": \" + (Math.round(d.value));})\n .attr('transform', function(d){\n return 'translate(' + xScale(d.year) + \", \" + yScale(d.value) + \")\";\n });\n labels\n .exit().remove();\n\n // labels.transition().duration(0).attr('x', function (d) {\n // return xScale(d.year);\n // }).attr('y', function (d) {\n // return yScale(d.value);\n // }).text(function (d) {\n // return d.State + \": \" + d.value;\n // })\n\n // labels.exit().remove()\n\n }", "function interpolateData(year) {\n return fullTimeData.completeSetRel.map(function (d) {\n return {\n name: d.name,\n region: d.region,\n area: interpolateValues(d.area, year),\n population: interpolateValues(d.population, year),\n pops: interpolateValues(d.pops, year)\n };\n });\n }", "function interpolateData(year) {\n return fullTimeData.completeSet.map(function (d) {\n return {\n name: d.name,\n region: d.region,\n area: interpolateValues(d.area, year),\n population: interpolateValues(d.population, year),\n pops: interpolateValues(d.pops, year)\n };\n });\n }", "function draw({ key: currentDate, values }, transition) {\r\n const { innerHeight, titlePadding } = chartSettings;\r\n\r\n //oder data of provinces by the one with most infected first\r\n const dataSetDescendingOrder = values.sort(\r\n ({ value: firstValue }, { value: secondValue }) =>\r\n secondValue - firstValue\r\n );\r\n\r\n //removes the current date label\r\n //I do this to redraw the date at every render so it stays on top of svg\r\n chartContainer.select(\".current-date\").remove();\r\n\r\n //add the current date label and set its position\r\n chartContainer\r\n .append(\"text\")\r\n .text(currentDate)\r\n .attr(\"class\", \"current-date\")\r\n .attr(\r\n \"transform\",\r\n `translate(${chartSettings.innerWidth}, ${chartSettings.innerHeight})`\r\n );\r\n\r\n //get the max amount of infected. Since data has been previously ordered i get the first slice's value\r\n const maxValue = dataSetDescendingOrder[0].value;\r\n\r\n //ticks are lines over the x axis\r\n var ticks = 1;\r\n if (maxValue > 50) ticks = 5;\r\n if (maxValue > 100) ticks = 10;\r\n\r\n //get only the names of the ordered dataset\r\n var names = dataSetDescendingOrder.map(({ name }) => name);\r\n\r\n //set axis domains\r\n xAxisScale.domain([0, maxValue]);\r\n yAxisScale.domain(names);\r\n\r\n const xAxis = d3\r\n .axisTop(xAxisScale)\r\n .ticks(ticks) //ticks podria ser variable segun la barra mas larga/5\r\n .tickSizeOuter(0)\r\n .tickSizeInner(-innerHeight);\r\n\r\n //updates xAxis scale and ticks\r\n xAxisContainer.transition(transition).call(xAxis);\r\n\r\n //updates yAxis scale\r\n yAxisContainer\r\n .transition(transition)\r\n .call(d3.axisLeft(yAxisScale).tickSize(0));\r\n\r\n // Data Binding of columns-containers added in previous render draw iterations with previously ordered dataSet\r\n const barGroups = chartContainer\r\n .select(\".columns\")\r\n .selectAll(\"g.column-container\")\r\n .data(dataSetDescendingOrder, ({ name }) => name);\r\n\r\n //Append the columns-containers and set their position to bottom left\r\n const barGroupsEnter = barGroups\r\n .enter()\r\n .append(\"g\")\r\n .attr(\"class\", \"column-container\")\r\n .attr(\"transform\", `translate(0,${innerHeight})`);\r\n\r\n //gets the max height of the column container to avoid rects too large\r\n const maxHeight = Math.min(yAxisScale.step(), chartSettings.height / 8);\r\n\r\n //appends a rect of width 0 filled with the color that was set in the columnStyle of the province by name\r\n barGroupsEnter\r\n .append(\"rect\")\r\n .attr(\"class\", ({ name }) => \"column-rect \" + columnStyles[name])\r\n .attr(\"width\", 0)\r\n .attr(\"height\", maxHeight * (1 - chartSettings.columnPadding));\r\n\r\n //appends column-title to the left side of the previously added rect\r\n barGroupsEnter\r\n .append(\"text\")\r\n .attr(\"class\", \"column-title\")\r\n .attr(\"y\", maxHeight * (1 - chartSettings.columnPadding))\r\n .attr(\"x\", -titlePadding)\r\n .text(({ name }) => name);\r\n\r\n //appends column-value to the right side of the previously added rect\r\n barGroupsEnter\r\n .append(\"text\")\r\n .attr(\"class\", \"column-value\")\r\n .attr(\r\n \"y\",\r\n Math.round((maxHeight * (1 - chartSettings.columnPadding)) / 2)\r\n )\r\n .attr(\"x\", titlePadding)\r\n .text(0);\r\n\r\n // merge bargroups for update its position\r\n const barUpdate = barGroupsEnter.merge(barGroups);\r\n\r\n //updates column position\r\n barUpdate\r\n .transition(transition)\r\n .attr(\"transform\", ({ name }) => `translate(0,${yAxisScale(name)})`);\r\n\r\n //updates rect width and height\r\n barUpdate\r\n .select(\".column-rect\")\r\n .transition(transition)\r\n .attr(\"width\", ({ value }) => xAxisScale(value))\r\n .attr(\"height\", maxHeight * (1 - chartSettings.columnPadding));\r\n\r\n //upates column title position\r\n barUpdate\r\n .select(\".column-title\")\r\n .transition(transition)\r\n .attr(\r\n \"y\",\r\n Math.round((maxHeight * (1 - chartSettings.columnPadding)) / 2)\r\n );\r\n\r\n //updates column value position and text\r\n barUpdate\r\n .select(\".column-value\")\r\n .transition(transition)\r\n .attr(\"x\", ({ value }) => xAxisScale(value) + titlePadding)\r\n .attr(\r\n \"y\",\r\n Math.round((maxHeight * (1 - chartSettings.columnPadding)) / 2)\r\n )\r\n .tween(\"text\", function({ value }) {\r\n const interpolateStartValue =\r\n elapsedTime === chartSettings.duration\r\n ? this.currentValue || 0\r\n : +this.innerHTML;\r\n\r\n const interpolate = d3.interpolate(interpolateStartValue, value);\r\n this.currentValue = value;\r\n\r\n return function(t) {\r\n d3.select(this).text(Math.ceil(interpolate(t)));\r\n };\r\n });\r\n return this;\r\n }", "updateBarChart(selectedDimension) {\n\n\n\n // ******* TODO: PART I *******\n\n\n // Create the x and y scales; make\n // sure to leave room for the axes\n let height = 400;\n let width = 500;\n let padding = 55;\n let data = this.allData;\n let map = this.worldMap;\n let infoSection = this.infoPanel;\n let minYear = d3.min(this.allData, d => parseInt(d.YEAR));\n let maxYear = d3.max(this.allData, d => parseInt(d.YEAR));\n let xScale = d3.scaleLinear()\n .domain([0, this.allData.length-1])\n .range([10, width-padding-10]);\n\n let yScaleKey = selectedDimension;\n let yMax = d3.max(this.allData, d => parseInt(d[yScaleKey]));\n let yMin = d3.min(this.allData, d => parseInt(d[yScaleKey]));\n let yScale = d3.scaleLinear()\n .domain([0, yMax])\n .range([height-padding, 0]);\n\n // Create colorScale\n\n let colorScale = d3.scaleLinear()\n // notice the three interpolation points\n .domain([yMin, yMax])\n // each color matches to an interpolation point\n .range([\"steelblue\",\"#000080\"]);\n\n // Create the axes (hint: use #xAxis and #yAxis)\n let xAxis = d3.axisBottom(xScale).tickFormat(function(d){\n return data[data.length-1-d].YEAR;\n }).ticks(20);\n d3.select(\"#xAxis\")\n .attr(\"transform\", \"translate(\"+padding+\",\" + (height-padding) + \")\")\n .call(xAxis)\n .selectAll(\"text\")\n .attr(\"dx\", \"-2em\")\n .attr(\"dy\", \"-.3em\")\n .attr(\"transform\", \"rotate(-90)\");\n\n d3.select(\"#xAxis\")\n .append(\"path\")\n .attr(\"d\", \"M 0 0 L 10.5 0\");\n\n d3.select(\"#xAxis\")\n .append(\"path\")\n .attr(\"d\", \"M 435.5 0 L 455 0\");\n\n let yAxis = d3.axisLeft(yScale);\n d3.select(\"#yAxis\")\n .attr(\"transform\", \"translate(\"+53+\",\" + 0 + \")\")\n .transition()\n .duration(2000)\n .call(yAxis);\n\n // Create the bars (hint: use #bars)\n let bars = d3.select(\"#bars\")\n .attr(\"transform\", \"translate(\"+45+\",\" + 0 + \")\")\n .selectAll(\"rect\")\n .data(this.allData);\n\n let newBars = bars.enter().append(\"rect\")\n .attr(\"x\", function(d,i){\n return xScale(data.length-1-i);\n })\n .attr(\"y\", function(d,i){\n return yScale(d[yScaleKey]);\n })\n .attr(\"width\", 20)\n .attr(\"height\", function(d,i){\n return height-padding-yScale(d[yScaleKey]);\n }).style(\"fill\", function(d, i){\n return colorScale(d[yScaleKey]);\n });\n\n bars = newBars.merge(bars);\n\n bars.transition()\n .duration(2000)\n .attr(\"x\", function(d,i){\n return xScale(data.length-1-i);\n })\n .attr(\"y\", function(d,i){\n return yScale(d[yScaleKey]);\n })\n .attr(\"width\", 20)\n .attr(\"height\", function(d,i){\n return height-padding-yScale(d[yScaleKey]);\n })\n .style(\"fill\", function(d){\n return colorScale(d[yScaleKey]);\n });\n\n\n\n\n // ******* TODO: PART II *******\n\n // Implement how the bars respond to click events\n // Color the selected bar to indicate is has been selected.\n // Make sure only the selected bar has this new color.\n bars.on(\"click\", function(d, i){\n bars.classed(\"selected\", false);\n d3.select(this).classed(\"selected\", true);\n map.updateMap(d);\n infoSection.updateInfo(d);\n });\n\n // Call the necessary update functions for when a user clicks on a bar.\n // Note: think about what you want to update when a different bar is selected.\n\n\n }", "function animate() {\n\n\t\t\tbubbleChartGroup.transition()\n\t\t\t\t.duration(30000)\n\t\t\t\t.ease(d3.easeLinear) /*use linear transition*/\n\t\t\t\t.tween(\"year\",tweenYear); /*use customized tween method to create transitions frame by frame*/\n\n\t\t\t/*show observations text only after the animation is completed*/\n\t\t\tsetTimeout(showObservation, 30500);\n\n\t\t\tfunction showObservation() {\n\t\t\t\t/*change the color of text so that they become visible*/\n\t\t\t\td3.selectAll(\"#observationSection\")\n\t\t\t\t\t.style(\"color\",\"black\");\n\t\t\t\td3.selectAll(\"#observations\")\n\t\t\t\t\t.style(\"color\",\"red\");\n\t\t\t}\n\t }", "function makeTimeline(svg, x, y, width, height, start, end, interval, years, index) {\n \n // draw the line\n var timelineY = y + 0.2 * height;\n var timeline = svg.append('path')\n .attr('d', line([\n [x, timelineY],\n [x + width, timelineY]\n ]))\n .attr('stroke', timelineColor)\n .attr('stroke-width', 4);\n \n // compute ranges where dates can exist\n var dateStartX = x + 0.1 * width;\n var dateEndX = x + width - 0.1 * width;\n var dateLength = dateEndX - dateStartX;\n\n function getXOfYear(year) {\n return dateStartX + ((year - start) / (end - start)) * dateLength;\n }\n\n // draw the labels\n for (var i = start; i <= end; i += interval) {\n var yearX = getXOfYear(i);\n \n // show the tick mark\n var tick = svg.append('path')\n .attr('d', line([\n [yearX, timelineY - (tickSize / 2)],\n [yearX, timelineY + (tickSize / 2)]\n ]))\n .attr('stroke', timelineColor)\n .attr('stroke-width', 2);\n \n // show the year \n var label = svg.append('text')\n .attr('x', yearX)\n .attr('y', timelineY - (tickSize / 2) - (padding / 2))\n .attr('width', interval)\n .attr('height', labelHeight)\n .style('font-family', mainFont)\n .style('font-size', timelineFontSize)\n .style('text-anchor', 'middle')\n .text(i);\n }\n \n // compute point sizes\n buttonSize = (dateLength / (years.length));\n buttonRadius = (buttonSize - padding) / 2;\n var currentButtonX = dateStartX;\n \n // create layer for points to prevent overlap\n var lineLayer = svg.append('g');\n\n // draw the points\n for (var i = 0; i < years.length; i++) {\n var yearX = getXOfYear(years[i]);\n \n // show the larger button\n var buttonStartY = timelineY + (tickSize / 2) + labelHeight + padding;\n var buttonCenterX = currentButtonX + (buttonSize / 2);\n var buttonCenterY = buttonStartY + buttonRadius;\n\n // show a point at the appropriate place\n var point = svg.append('circle')\n .attr('cx', yearX)\n .attr('cy', timelineY)\n .attr('r', 4)\n .attr('fill', timelineColor);\n \n // show the large button\n var button = svg.append('circle')\n .attr('cx', buttonCenterX)\n .attr('cy', buttonCenterY)\n .attr('r', buttonRadius)\n .attr('fill', buttonColor)\n .attr('index', index - 1) // for referencing purposes on click\n .on('mouseover', function() {\n showDetail(svg, d3.select(this).attr('index'));\n })\n .on('click', function() {\n showDetail(svg, d3.select(this).attr('index'));\n });\n animatePoint(button, buttonCenterX, buttonCenterY, buttonRadius,\n 1, 1000 * index / years.length);\n\n // fill the larger button with the number\n var label = svg.append('text')\n .attr('x', currentButtonX + (buttonSize / 2))\n .attr('y', buttonStartY + 1.4 * buttonRadius )\n .attr('width', buttonRadius * 2)\n .attr('height', buttonRadius * 2)\n .attr('index', index - 1) // for referencing purposes on click\n .style('font-family', mainFont)\n .style('font-size', buttonFontSize)\n .style('text-anchor', 'middle')\n .text(index)\n .on('mouseover', function() {\n showDetail(svg, d3.select(this).attr('index'));\n })\n .on('click', function() {\n showDetail(svg, d3.select(this).attr('index'));\n });\n disableSelection(label);\n\n // draw the connecting line\n var conLine = lineLayer.append('path')\n .attr('d', line([\n [yearX, timelineY],\n [buttonCenterX, buttonStartY]\n ]))\n .attr('stroke', timelineColor)\n .attr('stroke-dasharray', '5 5')\n .attr('stroke-width', 1);\n \n index++;\n currentButtonX += buttonSize;\n }\n\n}", "function annotation(slide) {\n if (slide == 0) {\n var annotations = \n [{\"x1\": 2010, \"y1\": 16, \"x2\": 2011, \"y2\": 15, \"text\": \"Congress estabilishes Corporate Average Fuel Economy standards in 1975.\"},\n {\"x1\": 2010, \"y1\": 20, \"x2\": 2010.5, \"y2\": 17, \"text\": \"Agreement reached to estabilsh national program to implement first fuel efficency improvements in 34 years in 2009.\"},\n {\"x1\": 2012, \"y1\": overall.filter(function(d) { return d.key === \"2012\"; })[0].value.averageFE, \"x2\": 2011, \"y2\": 19.5, \"text\": \"First phase of national program goes into effect calling for an annual ~5% increase in fuel economy from 2012 to 2016.\"},\n {\"x1\": 2017, \"y1\": overall.filter(function(d) { return d.key === \"2017\"; })[0].value.averageFE, \"x2\": 2012.5, \"y2\": 21.5, \"text\": \"Second phase of nation program goes into effect. Fuel efficiency expected to increase to 36-37 mpg by 2025.\"}];\n } else if (slide == 1) {\n var annotations = \n [{\"x1\": 2010, \"y1\": 16, \"x2\": 2011, \"y2\": 15, \"text\": \"Congress estabilishes Corporate Average Fuel Economy standards in 1975.\"},\n {\"x1\": 2010, \"y1\": 20, \"x2\": 2010.5, \"y2\": 17, \"text\": \"Agreement reached to estabilsh national program to implement first fuel efficency improvements in 34 years in 2009.\"},\n {\"x1\": 2012, \"y1\": overall.filter(function(d) { return d.key === \"2012\"; })[0].value.averageFE, \"x2\": 2011, \"y2\": 19.5, \"text\": \"First phase of national program goes into effect calling for an annual ~5% increase in fuel economy from 2012 to 2016.\"},\n {\"x1\": 2017, \"y1\": overall.filter(function(d) { return d.key === \"2017\"; })[0].value.averageFE, \"x2\": 2012.5, \"y2\": 21.5, \"text\": \"Second phase of nation program goes into effect. Fuel efficiency expected to increase to 36-37 mpg by 2025.\"}];\n } else if (slide == 2) {\n var annotations = \n [{\"x1\": 2017, \"y1\": electric.filter(function(d) { return d.key === \"2017\"; })[0].value.averageFE, \"x2\": 2016.5, \"y2\": 95, \"text\": \"The best selling electric vehicle, the Tesla Model 3, is released.\"},\n {\"x1\": 2013, \"y1\": electric.filter(function(d) { return d.key === \"2013\"; })[0].value.averageFE, \"x2\": 2013.5, \"y2\": 80, \"text\": \"Nissan begins assembling the Leaf, the first zero tailpipe emissions mass market vehicle.\"},\n {\"x1\": 2012, \"y1\": overall.filter(function(d) { return d.key === \"2012\"; })[0].value.averageFE, \"x2\": 2011, \"y2\": 10, \"text\": \"First phase of national program goes into effect calling for an annual ~5% increase in fuel economy from 2012 to 2016.\"},\n {\"x1\": 2017, \"y1\": overall.filter(function(d) { return d.key === \"2017\"; })[0].value.averageFE, \"x2\": 2012.5, \"y2\": 15, \"text\": \"Second phase of nation program goes into effect. Fuel efficiency expected to increase to 36-37 mpg by 2025.\"}];\n } else if (slide == 3) {\n var annotations = [];\n }\n \n var annotationLine = svg.selectAll(\".annotationline\").data(annotations);\n var annotationText = svg.selectAll(\".annotationtext\").data(annotations);\n\n if (slide == 0) {\n annotationLine = annotationLine.enter().append(\"line\").attr(\"class\",\"annotationline\").merge(annotationLine);\n annotationText = annotationText.enter().append(\"text\").attr(\"class\",\"annotationtext\").merge(annotationText);\n } else {\n annotationLine.exit().transition().duration(1000).style(\"opacity\",0).remove();\n annotationText.exit().transition().duration(1000).style(\"opactiy\",0).remove();\n annotationLine = annotationLine.enter().append(\"line\").attr(\"class\",\"annotationline\").merge(annotationLine).transition().duration(3000).style(\"opacity\",100);\n annotationText = annotationText.enter().append(\"text\").attr(\"class\",\"annotationtext\").merge(annotationText).transition().duration(3000).style(\"opacity\",100);\n }\n\n annotationLine\n .attr(\"x1\",function(d) { return x(d.x1) })\n .attr(\"y1\",function(d) { return y(d.y1) })\n .attr(\"x2\",function(d) { return x(d.x2) })\n .attr(\"y2\",function(d) { return y(d.y2) });\n\n annotationText\n .attr(\"x\",function(d) { return x(d.x2) })\n .attr(\"y\",function(d) { return y(d.y2) + 7 })\n .attr(\"text-anchor\",\"start\")\n .text(function(d) { return d.text });\n}", "function ready(datapoints) {\n let ages = datapoints.map(d => d.Age)\n xPositionScale.domain(d3.extent(ages))\n\n let nested = d3\n .nest()\n .key(d => d.Year)\n .entries(datapoints)\n\n container\n .selectAll('.fertility-graph')\n .data(nested)\n .enter()\n .append('svg')\n .attr('class', 'fertility-graph')\n .attr('height', height + margin.top + margin.bottom)\n .attr('width', width + margin.left + margin.right)\n .append('g')\n .attr('transform', `translate(${margin.left},${margin.top})`)\n .each(function(d) {\n let svg = d3.select(this)\n\n svg\n .append('path')\n .datum(d.values)\n .attr('d', line_jp)\n .attr('stroke', 'lightblue')\n .attr('fill', 'lightblue')\n .attr('stroke-width', 0.5)\n .attr('opacity', 0.6)\n\n svg\n .append('path')\n .datum(d.values)\n .attr('d', line_us)\n .attr('stroke', 'pink')\n .attr('fill', 'pink')\n .attr('stroke-width', 0.5)\n .attr('opacity', 0.9)\n .lower()\n\n svg\n .append('text')\n .text(d.key)\n .attr('font-size', 14)\n .attr('x', width / 2)\n .attr('y', 0)\n .attr('text-anchor', 'middle')\n .attr('dy', -10)\n\n let xAxis = d3.axisBottom(xPositionScale)\n svg\n .append('g')\n .attr('class', 'axis x-axis')\n .attr('transform', `translate(0,${height})`)\n .call(xAxis.ticks(5))\n\n let yAxis = d3.axisLeft(yPositionScale)\n svg\n .append('g')\n .attr('class', 'axis y-axis')\n .call(yAxis.ticks(4))\n })\n}", "function drawDefault() {\n \n var margin = {top: 10, right: 60, bottom: 20, left:150},\n width = 1100 - margin.left - margin.right,\n height = 600 - margin.top - margin.bottom;\n\n\n var margin2 = {top: 20, right: 20, bottom: 20, left: 150},\n width2 = 1100 - margin2.left - margin2.right,\n height2 = 500 - margin2.top - margin2.bottom;\n\n //used to parse time data on \"year\" only\n var parseTime = d3.timeParse(\"%Y\");\n var xValue = function(d) { return d.year;}\n var xScale = d3.scaleTime().range([0, width-80]);\n var xMap = function(d) { return xScale(xValue(d));};\n\n var yValue = function(d) { return d.category;};\n //var yScale = d3.scalePoint().range([height, 0]).padding(1);\n\n var yScale = d3.scaleLinear().range([height, 0]);\n\n //var yMap = function(d) { return yScale(yValue(d))+d3.randomUniform(15, 45)();};\n var yMap = function(d) { return yScale(yValue(d));};\n\n\n var color = d3.scaleOrdinal().domain([\"All\",\"North America\",\"South America\", \"Europe\",\"Africa\",\"Asia\",\"Australia\" ]).range([\"#9b989a\",\"#beaed4\",\"#fb9a99\",\"#a6d854\",\"#80b1d3\",\"#ffd92f\",\"#ff9933\"]);\n\n var circles;\n\n //#fbb4ae \n var xAxis = d3.axisBottom().scale(xScale).ticks(13).tickSize(0,9,0);\n var yAxis = d3.axisLeft().scale(yScale).ticks(11).tickSize(0,9,0).tickFormat( function(d) { return mapfunc(d);});\n\n //.tickFormat(function(d) { return mapping[d.category2]; });\n var svg = d3.select('body')\n .append('svg')\n .attr(\"id\", 'default')\n .attr('width', width + margin.left + margin.right)\n .attr('height', height + margin.top + margin.bottom)\n .append('g')\n .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n //For draw cell\n // var svg2 = d3.select('body')\n // .append('svg')\n // .attr(\"id\", 'cell')\n // .attr('width', width2 + margin2.left + margin2.right)\n // .attr('height', height2 + margin2.top + margin2.bottom);\n var svg2 = d3.select('body')\n .append('svg')\n .attr(\"id\", 'cell')\n .attr('width', width2 + margin2.left + margin2.right)\n .attr('height', height2 + margin2.bottom + margin2.top);\n\n\n var tooltip = d3.select(\"body\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n \n function rowConverter(d) {\n return {\n year2: +d.year,\n year: parseTime(d.yearMap),\n cat: d.cat,\n name: d.name,\n category: d.catMap,\n country: d.country,\n award: d.award,\n Rationale: d.Rationale,\n continent: d.continent\n }\n }\n\n d3.csv('full.csv',rowConverter).then(function(data){\n// data.forEach(function(d){\n// d.year2 = +d.year;\n// d.year = parseTime(d.yearMap); \n// d.cat = d.cat;\n// d.name=d.name;\n// d.category = d.catMap;\n// d.country=d.country;\n// d.award = d.award;\n// d.Rationale = d.Rationale;\n// d.continent = d.continent;\n// });\n console.log(\"data\", data);\n\n var asia = [];\n var namerica = [\"All\"];\n var samerica = [\"All\"];\n var africa = [\"All\"];\n var europe = [\"All\"];\n var australia = [\"All\"];\n\n // organizing countries by their continent\n for (var i = 0; i < data.length; i++) {\n if (data[i].continent == \"Asia\" && !asia.includes(data[i].country))\n {\n asia.push(data[i].country);\n }\n if (data[i].continent == \"Africa\" && !africa.includes(data[i].country))\n {\n africa.push(data[i].country);\n }\n if (data[i].continent == \"Australia\" && !australia.includes(data[i].country))\n {\n australia.push(data[i].country);\n }\n if (data[i].continent == \"Europe\" && !europe.includes(data[i].country))\n {\n europe.push(data[i].country);\n }\n if (data[i].continent == \"North America\" && !namerica.includes(data[i].country))\n {\n namerica.push(data[i].country);\n }\n if (data[i].continent == \"South America\" && !samerica.includes(data[i].country))\n {\n samerica.push(data[i].country);\n }\n }\n console.log(\"asia\", asia);\n console.log(\"africa\", africa);\n console.log(\"australia\", australia);\n console.log(\"europe\", europe);\n console.log(\"namerica\", namerica);\n console.log(\"samerica\", samerica);\n\n xScale.domain([d3.min(data, function(d){return d.year;}),\n d3.max(data,function(d){return d.year;})]).nice();\n\n yScale.domain([d3.min(data, function(d) { return d.category;})-1, d3.max(data, function(d) { return d.category;})]).nice();\n\n //\t\tyScale.domain(d3.extent(data, function(d){\n //\t\t\treturn d.category2;\n //\t\t})).nice();\n //yScale.domain(data.map(function(d) { return d.category; }));\n\n\n\n\n var x = svg.append('g')\n .attr('transform', 'translate(0,' +height + ')')\n .attr('class', 'x axis')\n .call(xAxis);\n\n var zoom = d3.zoom().on(\"zoom\",zoomed);\n\n // y-axis is translated to (0,0)\n var y = svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n .selectAll(\"text\")\n .attr(\"y\", 26)\n .attr(\"x\",-5)\n .attr(\"cx\", -1000)\n .attr(\"cy\", -1000)\n .attr(\"dy\", \".85em\")\n .attr(\"font-weight\",\"bold\");\n //.attr(\"transform\", \"rotate(60)\")\n\n\n // Draw the x gridlines\n var xgrid = svg.append(\"g\")\n .attr(\"class\", \"grid\")\n .attr(\"transform\", \"translate(0,\" + height+ \")\")\n .call(make_x_gridlines(xScale, 13).tickSize(-height).tickFormat(\"\"))\n\n\n\n // Draw the y gridlines\n var ygrid = svg.append(\"g\")\n .attr(\"class\", \"grid\")\n .call(make_y_gridlines(yScale, 11)\n .tickSize(-width+80)\n .tickFormat(\"\")\n ) \n\n\n circles=svg.selectAll(\".dot\")\n .data(data)\n .enter().append(\"circle\")\n .attr(\"class\", \"dot\")\n .attr(\"r\", 4)\n .attr(\"cx\", xMap)\n .attr(\"cy\", yMap)\n .style(\"fill\", function(d) { return color(d.continent);})\n .on(\"mouseover\", function(d) {\n d3.select(this)\n tooltip.transition()\n .duration(200)\n .attr('r',10)\n .style(\"opacity\", .9);\n tooltip.html(d.name+\"<br/>\"+\"Year: \"+ d.year2+\"<br/>\"+\"Country: \"+d.country+\"<br/>\"+\"Award: \"+d.award+\" - \"+d.cat+\"<br/>\"+\"________________\"+\"<br/>\"+d.Rationale) \n .style(\"left\", (d3.event.pageX -4) + \"px\")\n .style(\"top\", (d3.event.pageY+2 ) + \"px\");\n })\n .on(\"mouseout\", function(d) {\n tooltip.transition()\n .duration(500)\n .style(\"opacity\", 0);\n });\n //TODO: the zoom not looks good \n // svg.call(d3.zoom()\n // .scaleExtent([1/2, 32])\n // .on(\"zoom\", zoomed));\n // \n\n // drop down menu\n // referenced: https://www.d3-graph-gallery.com/graph/connectedscatter_select.html\n var dropdownArray = [\"namerica\", \"samerica\", \"europe\", \"africa\", \"asia\", \"australia\"];\n \n namerica = namerica.sort();\n namerica.splice(1, 0, \"None\");\n d3.select(\"#namerica\")\n .selectAll('myOptions')\n .data(namerica)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n samerica = samerica.sort();\n samerica.splice(1, 0, \"None\");\n d3.select(\"#samerica\")\n .selectAll('myOptions')\n .data(samerica)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n // drop down menu\n europe = europe.sort();\n europe.splice(1, 0, \"None\");\n d3.select(\"#europe\")\n .selectAll('myOptions')\n .data(europe)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n // drop down menu\n africa = africa.sort();\n africa.splice(1, 0, \"None\");\n d3.select(\"#africa\")\n .selectAll('myOptions')\n .data(africa)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n // drop down menu\n asia = asia.sort();\n asia.splice(0, 0, \"All\");\n asia.splice(1, 0, \"None\");\n d3.select(\"#asia\")\n .selectAll('myOptions')\n .data(asia)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n // drop down menu\n australia = australia.sort();\n australia.splice(1, 0, \"None\");\n d3.select(\"#australia\")\n .selectAll('myOptions')\n .data(australia)\n .enter()\n .append('option')\n .text(function (d) { return d; }); // text showed in the menu\n \n d3.selectAll(\".dropdown\").on(\"change\", function() {\n // color.domain()[ind] is the continent the country belongs to\n // connecting the dropdown with the legend\n var ind = dropdownArray.indexOf(d3.select(this).attr(\"id\")) + 1;\n update(d3.select(this), data, color.domain()[ind], color.domain());\n });\n \n // draw legend\n var legend = svg.selectAll(\".legend\")\n .data(color.domain())\n .enter().append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"id\", function(d, i){\n return color.domain()[i];}) // assign ID to each legend\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 27 + \")\"; });\n \n legend.append(\"select\");\n \n // draw legend colored rectangles\n legend.append(\"rect\")\n .attr(\"x\", width - 50)\n .attr(\"rx\",5)\n .attr(\"ry\",5)\n .attr(\"width\", 110)\n .attr(\"height\", 25)\n .style(\"fill\", color)\n .attr(\"id\", function(d){\n return \"rect\"+d.replace(\" \",\"\");});\n \n // Adding click event\n legend.on(\"click\", function(type) {\n\n\n //dim all of the legends\n //d3.selectAll(\".legend\")\n // .style(\"opacity\", 0.1);\n // make the one selected be un-dimmed\n //d3.select(this)\n // .style(\"opacity\", 1);\n\n //Show if 'All' selected\n if (d3.select(this).attr('id') == 'All') {\n // turns on all buttons and dots\n if (d3.select(this).select(\"rect\").style(\"opacity\") == 0.4) {\n d3.selectAll(\".dot\")\n .style(\"opacity\", 1);\n d3.selectAll(\"rect\")\n .style(\"opacity\", 1); \n // ________________________________________________________________________________________________________\n d3.selectAll(\".dropdown\").property(\"value\", \"All\");\n }\n // grays out all buttons and dots\n else {\n d3.selectAll(\".dot\")\n .style(\"opacity\", 0.1);\n d3.selectAll(\"rect\")\n .style(\"opacity\", 0.4);\n d3.selectAll(\".dropdown\").property(\"value\", \"None\");\n }\n } else {\n // ___________________________________________________________________________________________________________\n // if continent button clicked, change dropdown menu of that button to All\n var indx = color.domain().indexOf(d3.select(this).attr('id'));\n var dropdown = \"#\"+dropdownArray[indx-1];\n console.log(\"in legend, dropdown id: \", dropdown);\n \n // grays out the \"All\" button\n d3.select(\"#rectAll\").style(\"opacity\", 0.4);\n // highlights/colors button and dots belonging to continent\n if (d3.select(this).select(\"rect\").style(\"opacity\") == 0.4) {\n d3.selectAll(\".dot\")\n .filter(function(d){\n return d[\"continent\"] == type\n })\n //Make this line seen\n .style(\"opacity\", 1);\n d3.select(this).select(\"rect\").style(\"opacity\", 1);\n d3.select(dropdown).property(\"value\", \"All\");\n }\n // grays out buttons and dots belonging to the continent\n else {\n d3.selectAll(\".dot\")\n .filter(function(d){\n return d[\"continent\"] == type\n })\n //Make this line grayed\n .style(\"opacity\", 0.1);\n d3.select(this).select(\"rect\").style(\"opacity\", 0.4);\n d3.select(dropdown).property(\"value\", \"None\");\n }\n countingIters();\n console.log(d3.select(this).attr('id'));\n\n // PREVIOUS CODE\n // //Select all dot and hide\n // d3.selectAll(\".dot\")\n // .style(\"opacity\", 0.1)\n // .filter(function(d){\n // return d[\"continent\"] == type\n // })\n // //Make this line seen\n // .style(\"opacity\", 1);\n // \n // d3.selectAll(\"rect\")\n // .style(\"opacity\", 0.1);\n // d3.select(this).select(\"rect\").style(\"opacity\", 1);\n // console.log(\"clicked id\", d3.select(this).attr('id'));\n // console.log(\"id rect\", d3.select(this).select(\"rect\").attr('id'));\n // \n // if (d3.select(this).select(\"rect\").style(\"opacity\") == 1)\n // {\n // console.log(\"rectangle opacity is 1\");\n // }\n } \n })\n\n // draw legend text\n legend.append(\"text\")\n .attr(\"x\", width+3)\n .attr(\"y\", 7)\n .attr(\"dy\", \"0.65em\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\",\"14px\")\n .style(\"font-family\",\"sans-serif\")\n .text(function(d) { return d;})\n\n\n //Clickabl legend ref: http://bl.ocks.org/WilliamQLiu/76ae20060e19bf42d774 \n var categoryMap = [\"Art\", \"Literature\", \"Medicine\", \"Chemistry\", \"Physics\", \"Math\", \"Computer\", \"Peace & Leadership\", \"Pioneers\"];\n\n svg.on(\"click\", function() {\n //Get click coordinate\n var coords = d3.mouse(this);\n //Convert pixel to data\n var posX = xScale.invert(coords[0]),\n posY = Math.floor(yScale.invert(coords[1]));\n var category = categoryMap[posY],\n date = new Date(posX),\n year = date.getFullYear();\n\n //Find decade boundary given year\n var decadeLower = year - year%10,\n decadeUpper = decadeLower + 10;\n\n //Get relevant data\n var cellData = data.filter(function(d) {\n return d[\"cat\"] === category && d[\"year2\"] < decadeUpper && d[\"year2\"] >= decadeLower\n });\n clearCell();\n drawCell(margin2, color, decadeLower, decadeUpper, cellData);\n });\n\n function zoomed() {\n //Create new scale based on event\n var new_xScale = d3.event.transform.rescaleX(xScale)\n var new_yScale = d3.event.transform.rescaleX(yScale)\n\n\n //Update axes\n x.call(xAxis.scale(new_xScale));\n xgrid.call(make_x_gridlines(new_xScale, 13).tickFormat(\"\"));\n ygrid.call(make_y_gridlines(new_yScale, 11).tickFormat(\"\"));\n\n //Update scatter plot and associated text\n svg.selectAll(\".dot\")\n .attr(\"transform\", d3.event.transform);\n svg.selectAll(\".text\")\n .attr(\"transform\", d3.event.transform);\n svg.selectAll(\".grid\")\n .attr(\"transform\",\n d3.event.transform);\n } \n }); \n\n}", "function createMultiSeriesLineChart(targetData){\n\t//define chart constants\n\tlet svg = d3.select(\".chart\"),\n\t\tmargin = {top: 70, right: 20, bottom: 40, left: 50},\n\t\twidth = 600 - margin.left - margin.right,\n\t\theight = 300 - margin.top - margin.bottom,\n\t\tg = svg.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" +margin.top + \")\");\n\n\n\tlet chartSpecificData = targetData.data;\n\n\tlet max = d3.max(d3.entries(chartSpecificData), function(d) {\n\t\treturn d3.max(d3.entries(d.value), function(e, i) {\n\t\t\tif(i === 1){\n\t\t\t\treturn d3.max(e.value, function(f) { return +f.value; });\n\t\t\t}\n\t\t});\n\t});\n\n\tlet x = d3.scaleTime().range([0, width]),\n\t\ty = d3.scaleLinear().range([height, 0]);\n\t\n\tlet parseYear = d3.timeParse(\"%Y\");\n\n\tx.domain(d3.extent(targetData.data[0].values, function(d) { return parseYear(d.year); }));\n\ty.domain([0, max]);\n\n\tlet line = d3.line()\n\t\t.curve(d3.curveBasis)\n\t\t.x(function(d) { return x(parseYear(d.year)); })\n\t\t.y(function(d) { return y(d.value); });\n\n\n\tg.append(\"g\")\n\t\t.attr(\"class\", \"axis axis-x\")\n\t\t.attr(\"transform\", \"translate(0,\" + height + \")\")\n\t\t.style(\"stroke-width\", \".1\")\n\t\t.call(d3.axisBottom(x));\n\n\tg.append(\"g\")\n\t\t.attr(\"class\", \"axis axis-y\")\n\t\t.style(\"stroke-width\", \".1\")\n\t\t.call(d3.axisLeft(y));\n\n\tlet lines = g.selectAll(\".paths\")\n\t\t.data(chartSpecificData)\n\t\t.enter()\n\t\t.append(\"g\")\n\t\t.attr(\"class\", \"paths\");\n\n\tlines.append(\"path\")\n\t\t.attr(\"class\", \"line\")\n\t\t.attr(\"d\", function(d) { return line(d.values); })\n\t\t.attr(\"tabindex\", \"0\")\n\t\t.style(\"stroke\", targetData.colors[0])\n\t\t.style(\"stroke-width\", \"2px\")\n\t\t.style(\"fill\", \"none\");\n\n\tlines.append(\"text\")\n\t\t.datum(function(d, i) { return {id: d.country, value: d.values[d.values.length - 1]}; })\n\t\t.attr(\"transform\", function(d, i) { return \"translate(\" + x(parseYear(d.value.year)) + \",\" + y(d.value.value) + \")\"; })\n\t\t.attr(\"x\", -42)\n\t\t.attr(\"y\", -10)\n\t\t.attr(\"dy\", \"0.35em\")\n\t\t.style(\"font\", \"11px sans-serif\")\n\t\t.text(function(d) { return d.id; });\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 interpolateData(year) {\n return states.map(function(d) {\n return {\n name: d.state,\n region: d.state,\n expenses: interpolateValues(d.expenses, year),\n income: interpolateValues(d.income, year),\n perCapita: interpolateValues(d.perCapita, year)\n };\n });\n }", "function interpolateData(year) {\n return states.map(function(d) {\n return {\n name: d.state,\n region: d.state,\n expenses: interpolateValues(d.expenses, year),\n income: interpolateValues(d.income, year),\n perCapita: interpolateValues(d.perCapita, year)\n };\n });\n }", "function interpolateData(year) {\n return states.map(function(d) {\n return {\n name: d.state,\n region: d.state,\n expenses: interpolateValues(d.expenses, year),\n income: interpolateValues(d.income, year),\n perCapita: interpolateValues(d.perCapita, year)\n };\n });\n }", "initializeSerie(data, data_format){\n\n // Save object (Timedata) instance\n var self = this;\n\n // Set SVG Map dimensions\n self.timedata_svg.attr('width', self.svgWidth + self.margin.left + self.margin.right);\n self.timedata_svg.attr('height', self.svgHeight + self.margin.top + self.margin.bottom);\n\n // Define display translation on SVG\n var g = self.timedata_svg.append('g')\n .attr('transform', 'translate(' + self.margin.left + ',' + self.margin.top + ')');\n\n // Define x and y axis scale dimensions with respect to SVG\n var x = d3.scaleTime().rangeRound([0, self.svgWidth - 50]);\n var y = d3.scaleLinear().rangeRound([self.svgHeight, 0]);\n\n // Define line graphic from parsed data\n var line = d3.line()\n .x(function(d){ return x(d.date) })\n .y(function(d){ return y(d.value) });\n\n // Define x and y domain values\n x.domain(d3.extent(data, function(d){ return d.date }));\n y.domain(d3.extent(data, function(d){ return d.value }));\n\n // Add background grid to SVG on x axis\n g.append('g')\n .attr('class', 'grid')\n .call(d3.axisBottom(x).ticks(10)\n .tickSize(self.svgHeight)\n .tickFormat('')\n );\n\n // Add background grid to SVG on y axis\n g.append('g')\n .attr('class', 'grid')\n .call(d3.axisLeft(y).ticks(5)\n .tickSize(-(self.svgWidth-50))\n .tickFormat('')\n );\n\n // Add text on x axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .attr('transform', 'translate(0,' + self.svgHeight + ')')\n .call(d3.axisBottom(x))\n\n // Add a thich line over the x axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .call(d3.axisBottom(x))\n .attr('stroke-width', 2)\n .selectAll('text')\n .remove()\n\n // Add a thich line over the y axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .attr('transform', 'translate(' + parseInt(self.svgWidth - 50) + ', 0)')\n .call(d3.axisLeft(y))\n .attr('stroke-width', 2)\n .selectAll('text')\n .remove()\n\n // Add text on y axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .call(d3.axisLeft(y))\n .append('text')\n .attr('id', 'serie_unit')\n .attr('fill', '#000')\n .attr('transform', 'rotate(-90)')\n .attr('y', 6)\n .attr('dy', '0.71em')\n .attr('dx', '-0.71em')\n .attr('text-anchor', 'end')\n .text($(self.dataselection_name).val() +' [' + data_format.units[self.selected_map] +']');\n }" ]
[ "0.77247405", "0.74827653", "0.7420117", "0.7420117", "0.7420117", "0.7399845", "0.72967744", "0.72514355", "0.72514355", "0.72514355", "0.72077", "0.713376", "0.7099649", "0.67113674", "0.66833615", "0.6644465", "0.66187274", "0.6426622", "0.63636434", "0.6308051", "0.62801135", "0.6216274", "0.6196516", "0.6136863", "0.6131261", "0.6079236", "0.6079236", "0.6079236", "0.6065206", "0.6047061", "0.6047061", "0.6035939", "0.5978631", "0.59470177", "0.5943287", "0.59371126", "0.5928105", "0.5910038", "0.58815426", "0.5876839", "0.5876839", "0.5876839", "0.5868956", "0.5857644", "0.58553046", "0.585322", "0.5844353", "0.58429223", "0.5837389", "0.58360803", "0.5828455", "0.5814308", "0.5794688", "0.5789121", "0.5751956", "0.5732247", "0.57023114", "0.5701144", "0.5699595", "0.56894845", "0.5675737", "0.5673352", "0.5673352", "0.56671214", "0.56570894", "0.5647449", "0.5639677", "0.56356186", "0.5633658", "0.56194943", "0.55934745", "0.5579221", "0.5576216", "0.55744743", "0.55724657", "0.55666333", "0.55648756", "0.55589455", "0.55498254", "0.5544378", "0.5538162", "0.5531886", "0.5526932", "0.551721", "0.55126", "0.55122024", "0.55078703", "0.54976016", "0.5495609", "0.54936856", "0.5485854", "0.54854065", "0.54835564", "0.5481003", "0.54706174", "0.54521465", "0.5451029", "0.5451029", "0.5451029", "0.54480445" ]
0.7283489
7
Updates the display to show the specified year.
function displayYear(year) { dot.data(interpolateData(Math.round(year)), key).call(position).sort(order); label.text(Math.round(year)); dotNames.data(interpolateData(Math.round(year)), key).call(showLabel); // Updates texts in sidebar. titles.data(interpolateTeleData(year), key).call(changeTitle); texts.data(interpolateTeleData(year), key).call(changeText); if ( year >= 1842 && year < 1847) { document.getElementById("description").style.height = "285px"; } else { document.getElementById("description").style.height = "350px"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateYear() {\n O('year-label').innerHTML = this.year;\n }", "function updateYear(year) {\n yearSelected = year;\n updateShotChart();\n updateSeasonRank();\n}", "function displayYear(year) {\n d3.selectAll(\".dot\").data(interpolateData(year), key)\n .call(position)\n .sort(order);\n $(\"#ci-years-selector\").val(Math.round(year));\n }", "function showYear(target, delta) {\n var state = $.data(target, 'calendar');\n var opts = state.options;\n opts.year += delta;\n show(target, state);\n\n var menu = $(target).find('.calendar-menu-year');\n menu.val(opts.year);\n }", "function displayYear(year) {\n dot.data(interpolateData(Math.round(year)), key)\n .call(position)\n .sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "updateYear(year) {\n\t\tthis.year = year;\n\t\t/*this.chartData = this.allData[this.category]\n\t\t\t.filter(function(d) {\n\t\t\t\tif (d.yr === year) return d;\n\t\t\t});*/\n\t}", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function changeYear(){\n\tvar yearView= document.getElementById(\"changeYear\");\n\tyearView.style.display= \"none\";\n\tvar tempYear= yearView.innerHTML;\n\tvar inputYear= document.createElement(\"input\");\n\tinputYear.setAttribute(\"type\", \"number\");\n\ttempDate=getTempDate();\n\tvar tempYear=tempDate.getFullYear();\n\tinputYear.setAttribute(\"value\", tempYear);\n\tyearView.parentNode.insertBefore(inputYear, yearView);\n\tinputYear.onblur= function(){\n\t\ttempYear=inputYear.value;\n\t\tyearView.innerHTML=tempYear;\n\t\tyearView.parentNode.removeChild(inputYear);\n\t\tyearView.style.display = \"\";\n\t\ttempDate.setFullYear(tempYear);\n\t\tdrawCalendar(tempDate);\n\t};\n}", "setYear(year) {\n this.year = year;\n Object.keys(this.featureIdToObjectDetails).forEach(featureId => {\n const objectDetails = this.featureIdToObjectDetails[featureId];\n objectDetails.object3D.visible = App.featureVisibleInYear(objectDetails, year);\n });\n this.requestRender();\n }", "function showYear (year) {\n\t\tyearcount++;\n\t\tAQ (\"Year\", \"Select\", year + \"\", yearcount + \"\");\n\t\tvar divs = display [year];\n\t\tvar rand = Math.floor (Math.random () * divs.length);\n\t\tshowImage (divs [rand].children [0], index [year][rand]);\n\t\tfor (var i = 0; i < divs.length; i++)\n\t\t\tdivs [i].className = \"thumbnail-item gallery\";\n\t}", "function copyrightYear() {\n var year = new Date().getFullYear();\n document.getElementById(\"year\").innerHTML = year;\n}", "changeYear(minYear, maxYear){\n\t\tlet self = this;\n\t\tself.current = minYear;\n\t\tthis.maxYear = maxYear;\n\t\tself.update();\n\t}", "function setDynamicCopyrightYear() {\n var anio = (new Date).getFullYear();\n $( '.copyright' ).find( 'span.year' ).text( anio );\n }", "onHeaderShowYearPress(event) {\n\t\tthis._currentPickerDOM._autoFocus = false;\n\t\tthis._currentPicker = \"year\";\n\t\tthis.fireEvent(\"show-year-press\", event);\n\t}", "function updateYear(year) {\n\t\t// First set the beggining and end dates\n\t\t/* Variables */\n\n\t\tvar yearStartDate = year + \"-01-01\";\n\t\tvar yearEndDate = year + \"-12-31\";\n\t\t//URL\n\t\tvar yearTotalEnergyURL = POWER_DATA_URL + \"?mode=watts&startDate=\" + yearStartDate + \"%2000:00:00&endDate=\" + yearEndDate + \"%2000:00:00&device=\" + devices[0];\n\t\tconsole.log(yearTotalEnergyURL);\n\n\t\tvar yearTotalEnergyOptions = {\n\t\t\t\txaxis : {\n\t\t\t\t\tmode : 'time',\n\t\t\t\t\tmin : (new Date(yearStartDate)).getTime(),\n\t\t\t\t\tmax : (new Date(yearEndDate)).getTime()\n\t\t\t\t},\n\t\t\t\tyaxis : {\n\t\t\t\t\ttickFormatter : wattFormatter\n\t\t\t\t},\n\t\t\t\tlegend : {\n\t\t\t\t\tshow : true,\n\t\t\t\t\tmargin : 10,\n\t\t\t\t\tbackgroundOpacity : 0.5\n\t\t\t\t},\n\t\t\t\tseries : {\n\t\t\t\t\tlines: { show: true, fill: true }\n\t\t\t\t},\n\t\t\t\tgrid : {\n\t\t\t\t\thoverable : true\n\t\t\t\t}\n\t\t};\n\n\t\tvar yearTotalEnergyData = [];\n\n\t\tvar yearTotalEnergyPlaceholder = $(\"#year_view\");\n\n\t\t// fetch one series, adding to what we got\n\t\tvar yearAlreadyFetched = {};\n\n\t\t// then fetch the data with jQuery\n\t\tfunction onDataReceived_yearTotalEnergyOptions(series) {\n\n\t\t\t// extract the first coordinate pair so you can see that\n\t\t\t// data is now an ordinary Javascript object\n\t\t\tvar firstcoordinate = '(' + series.data[0][0] + ', ' + series.data[0][1] + ')';\n\n\t\t\t// let's add it to our current data\n\t\t\tif(!yearAlreadyFetched[series.label]) {\n\t\t\t\tyearAlreadyFetched[series.label] = true;\n\t\t\t\tyearTotalEnergyData.push(series);\n\t\t\t}\n\t\t\t//debugger;\n\n\t\t\t// and plot all we got\n\t\t\t$.plot(yearTotalEnergyPlaceholder, yearTotalEnergyData, yearTotalEnergyOptions);\n\n\t\t\t//Now, for shits and giggles, lets do some maths!\n\n\t\t};\n\n\t\tvar previousPoint = null;\n\t\t$(\"#year_view\").bind(\"plothover\", function(event, pos, item) {\n\t\t\t$(\"#x\").text(pos.x.toFixed(2));\n\t\t\t$(\"#y\").text(pos.y.toFixed(2));\n\n\t\t\tif(item) {\n\t\t\t\tif(previousPoint != item.dataIndex) {\n\t\t\t\t\tpreviousPoint = item.dataIndex;\n\n\t\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\t\tvar x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);\n\n\t\t\t\t\tshowTooltip(item.pageX, item.pageY, y + \" watts\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\tpreviousPoint = null;\n\t\t\t}\n\n\t\t});\n\n\t\t$.plot(yearTotalEnergyPlaceholder, yearTotalEnergyData, yearTotalEnergyOptions);\n\n\t\t//Now lets do some temp stuff, much simpler *ahhhh*\n\t\t$.ajax({url : yearTotalEnergyURL,method : 'GET',dataType : 'json',success : onDataReceived_yearTotalEnergyOptions});\n\n\t}", "function setYear(value) {\n sliderValue.innerHTML = Math.floor(value);\n slider.viewModel.setValue(0, value);\n //featureLayer.renderer = createRenderer(value);\n queryMun(value).then(displayResults)\n //selectFilter.addEventListener('change', function (event) {\n //setFeatureLayerFilter(value);\n //});\n }", "function displayInfo(year){\n console.log(year);\n deaths(year);\n current=year;\n \n }", "function change_year(e){\n year=parseInt(e.target.id);\n initializing_description();\n document.getElementById('pileups').innerHTML=text;\n document.getElementById('YEAR').innerHTML=year.toString();\n document.getElementById('publications').innerHTML='# publications : '.concat(data_json['publications'][year.toString()].toString());\n document.getElementById('tanom_land').innerHTML='temperature anomaly land : '.concat(temp_anom_land['data'][year.toString()]);\n document.getElementById('tanom_ocean').innerHTML='temperature anomaly ocean : '.concat(temp_anom_ocean['data'][year.toString()]);\n document.getElementById('forest_coverage').innerHTML='forest coverage : '.concat((forest_coverage[year-min_year].toPrecision(3)).toString());\n for(var i=0;i<global_surface_ice.length;i++){\n\tif(global_surface_ice[i]['y']==year) document.getElementById('ice surface (million of km2)').innerHTML='ice surface : '.concat((global_surface_ice[i]['surface'].toPrecision(3)).toString(),' million of km2');\n }\n list_pileups_year();\n list_pairwize_year();\n change();\n}", "function filterByYearAndSlider() {\n if (running) {\n\n displayYear = displayYear + 1;\n if (displayYear > 2017) {\n displayYear = 2007;\n }\n slider.value = displayYear;\n yearDisplay.innerText = displayYear;\n }\n}", "function next_year(event) {\n $(\"#dialog\").hide(250);\n var date = event.data.date;\n var new_year = date.getFullYear()+1;\n $(\"year\").html(new_year);\n date.setFullYear(new_year);\n init_calendar(date);\n}", "function selectYear() {\n\tyearSelected = document.getElementById(\"year\").value;\t// Save the new year\n\trefreshIFrame();\t// Refresh the preview with the new variables\n}", "onYearChange(year) {\n dispatch({\n type: 'SET_YEAR',\n year,\n });\n }", "function $currentYear() {\n\tvar d = new Date();\n\tvar n = d.getFullYear();\n\tdocument.getElementById(\"copyright\").innerHTML = '&copy; ' + n + ' - Gallery';\n}", "function updateYear(year, quakes) {\n d3.select(\"text.year\").text(year);\n var toShow = quakes.filter(function(d) {return d.YEAR === year});\n var circle = d3.geoCircle()\n var paths = circles.selectAll(\"path\")\n .data(toShow);\n\n var bpaths = paths.enter()\n .append(\"path\")\n .merge(paths);\n\n bpaths.attr(\"d\", function(d) {\n return path(circle.center([d.LONGITUDE, d.LATITUDE]).radius(radiusScale(d.EQ_PRIMARY))())\n }).attr(\"style\", function(d) {return \"fill: \" + color(d.EQ_PRIMARY)});\n\n paths.exit().remove();\n }", "updateYears() {\n let years = years_for_decade(this.decade);\n let yearsel = this.year_picker.selectAll('.year-selector').data(years)\n\n yearsel.exit().remove()\n\n let newyears = yearsel.enter()\n .append('a')\n .classed('year-selector', true)\n\n yearsel.merge(newyears)\n .text(year=>year)\n .on('click', year=>this.setYear(year))\n .classed('active', year=>year==this.year)\n }", "function updateYear() {\n for (var i = 0; i < root.length ; i++) {\n if (root[i]) {\n if (root[i].year_entry >= year) {\n //hide node\n root[\"_\" + root.id_list[i]] = root[root.id_list[i]];\n root[root.id_list[i]] = null;\n }\n } else {\n if (root[\"_\" + root.id_list[i]].year_entry < year) {\n //Unhide node\n root[root.id_list[i]] = root[\"_\" + root.id_list[i]];\n root[\"_\" + root.id_list[i]] = null;\n }\n }\n }\n}", "function changeYearTexts(yearIndex) {\n var yearTexts = d3.selectAll(\".yearText\")\n for (var i = 0; i < yearTexts[0].length; i++) {\n yearTexts[0][i].innerHTML = parseInt(yearIndex) + 1970;\n };\n}", "updateYear() {\n const newYear = this.state.year + 1;\n this.setState({\n year: newYear\n })\n }", "function changeYear(year, currentProvince, settings, topic, titel, subtitel){\n\n\t// Get current chosen province\n\tcurrentProvince = getChosenProvince(currentProvince);\n\tvar texts = getTopic(topic);\n\ttitel = texts.titel;\n\tsubtitel = texts.subtitel;\n\n\tvar nld = settings.nld;\n\tvar years = settings.years;\n\tvar pyramidSettings = settings.pyramidSettings;\n\tvar barSettings = settings.barSettings;\n\tvar mapSettings = settings.mapSettings;\n \tvar data = years[year];\n\n \t// Update visualizations\n \tprovinceDataOne = getProvinceData(data, \"Limburg\");\n \tprovinceDataTwo = getProvinceData(data, currentProvince);\n \tupdatePyramid(provinceDataOne, provinceDataTwo, currentProvince, pyramidSettings);\n \tupdateBarchart(provinceDataOne, provinceDataTwo, currentProvince, topic, titel, subtitel, barSettings);\n \tupdateMap(nld, data, year, currentProvince, topic, titel, subtitel, settings);\n\n}", "function updateYear(year, date) {\n year.getElementsByTagName(\"option\")[date.getFullYear() - 1900].selected = \"selected\";\n}", "function selectYear() {\n currentYear = Number(years.val());\n initBodyTable();\n}", "function Year(parent){var _this=_super.call(this,parent)||this;_this.viewClass='e-year-view';_this.isInverseTableSelect=false;return _this;}", "function selectYear(event) {\r\n setRootDate(safeSetYear(listYear.value));\r\n listMonth.dispatchEvent(new Event('change'));\r\n }", "set yearConverted(year) {\n year = typeof(year) === 'number' ? year : false;\n this._year = year;\n }", "function changeData(){\n\tcurYear = sel.value();\n\tmyTitle.html(curYear + \": \" + lev);\n}", "function setCopyrightDate(){\n year = new Date().getFullYear();\n document.write(year);\n }", "function update(value) {\n Year = value;\n // Attribue l'année au span \"range\"\n document.getElementById(\"range\").innerHTML=Year;\n // Attribue l'année à la valeur du input-range\n d3.select(\"#timeslide\").property(\"value\", Year);\n\n ColorMap(Year,MapL,Data);\n }", "filterByYear() {\n // Remove cached shows\n if(localStorage.getItem(\"cachedShow\")) {\n localStorage.removeItem(\"cachedShow\");\n }\n\n this.retrieveShowContent();\n }", "selectYear(year) {\n const sampleDate = new Date();\n sampleDate.setFullYear(year);\n const convertedYear = toOtherCalendar(sampleDate).getFullYear();\n\n const optionElement = this.template.querySelector(\n `option[value='${convertedYear}']`\n );\n if (optionElement) {\n optionElement.selected = true;\n }\n }", "onYearChange(date) {\n let { value } = this.state;\n value.setFullYear(date.getFullYear());\n this.onChange(value);\n }", "function updateYearLabels(opt_yearRange) {\n const [firstYear, lastYear] = opt_yearRange || yearRange;\n const width = $('.time-chart-bg').width();\n const leftPx = Math.floor((firstYear - MIN_YEAR) / (MAX_YEAR - MIN_YEAR) * width);\n const rightPx = Math.ceil((lastYear - MIN_YEAR) / (MAX_YEAR - MIN_YEAR) * width);\n const $fg = $('.time-chart-fg');\n $fg.css({\n 'background-position-x': `-${leftPx}px`,\n 'margin-left': `${leftPx}px`,\n 'width': (rightPx - leftPx) + 'px'\n })\n\n $('#time-range-label-first').text(firstYear).css({left: `${leftPx}px`});\n $('#time-range-label-last').text(lastYear).css({left: `${rightPx}px`});\n}", "function pre_nextYear(year) {\n\tcurrent_year = parseInt(current_year) + parseInt(year);\n\t\n\t\n\tif(current_year < 1920){\n\t\tcurrent_year = 2100;\n\t}\n\telse{\n\t\tif(current_year > 2100){\n\t\t\tcurrent_year = 1920;\n\t\t}\n\t}\n\tcreateCalendar(current_month, current_year);\n}", "function myFunction() {\n var d = new Date();\n var n = d.getFullYear();\n document.getElementById(\"year\").innerHTML = n;\n}", "setStartYear(startyear) {\n this.setState({\n startYear: startyear\n })\n }", "function show_yearly_calendar(p_item, p_year, p_format) {\n\t// Load the defaults..\n\tif (p_year == null || p_year == \"\")\n\t\tp_year = new String(gNow.getFullYear().toString());\n\tif (p_format == null || p_format == \"\")\n\t\tp_format = \"YYYY-MM-DD\";\n\n\tvar vWinCal = window.open(\"\", \"Calendar\", \"scrollbars=yes\");\n\tvWinCal.opener = self;\n\tggWinCal = vWinCal;\n\n\tBuild(p_item, null, p_year, p_format);\n}", "function addCurrentYear() {\n addCurrentYear = document.querySelectorAll(\".current-year\");\n for (let i = 0; i < addCurrentYear.length; i++) {\n addCurrentYear[i].textContent = new Date().getFullYear();\n }\n}", "function slideRelease() {\n year = Number(document.getElementById(\"myRange\").value) + begin_year;\n updateYear();\n update();\n}", "function yearFilter(value) {\n return (value.Year == display_year)\n}", "function getYear() {\n\n\t//Initate date\n\tlet date = new Date(),\n\t\tdateElement = document.getElementById('siteDate'); //Get the time element from page\n\n\tdateElement.setAttribute('datetime', date); //Set datetiem attribute\n\tdateElement.innerHTML = date.getFullYear(); //Output current year to the page and inside time element\n}", "function prev_year(event) {\n $(\"#dialog\").hide(250);\n var date = event.data.date;\n var new_year = date.getFullYear()-1;\n $(\"year\").html(new_year);\n date.setFullYear(new_year);\n init_calendar(date);\n}", "function renderContentByYear(year) {\n\twatch = [];\n\tif ($('#' + year).prop('checked')) {\n\t\twatches.forEach(function(item, index) {\n\t\t\tif (parseInt(item.year) < year) {\n\t\t\t\twatch.push(item);\n\t\t\t}\n\t\t});\n\t\trenderContent(watch);\n\t} else {\n\t\trenderContent(watches);\n\t}\n}", "function year(){\n step=1;\n timeSelector=\"year\";\n resetGraph();\n}", "function renderYearList(selectedDate) {\r\n var yearArr = [];\r\n for (var i = 0; i < ((endDate.getFullYear() + 1) - startDate.getFullYear()); i++) {\r\n yearArr.push(startDate.getFullYear() + i);\r\n }\r\n fillSelectList(listYear, yearArr);\r\n listYear.selectedIndex = yearArr.indexOf(selectedDate.getFullYear());\r\n }", "function change_info_year(zone_array)\n{\n\t\n}", "function update(slide) {\n title(slide);\n axes(slide,defaultYear);\n legend(slide);\n lines(slide);\n cars(slide,defaultYear);\n annotation(slide);\n text(slide);\n}", "function show_yearly_calendar(p_item, p_year, p_format) {\r\n\t// Load the defaults..\r\n\tif (p_year == null || p_year == \"\")\r\n\t\tp_year = new String(gNow.getFullYear().toString());\r\n\tif (p_format == null || p_format == \"\")\r\n\t\tp_format = \"YYYY-MM-DD\";\r\n\r\n\tvar vWinCal = window.open(\"\", \"Calendar\", \"scrollbars=yes\");\r\n\tvWinCal.opener = self;\r\n\tggWinCal = vWinCal;\r\n\r\n\tBuild(p_item, null, p_year, p_format);\r\n}", "function getYearFromAbbreviation(year) {\n return round(callDateGet(getNewDate(), 'FullYear') / 100) * 100 - round(year / 100) * 100 + year;\n }", "function InitYearList(thisYear, savedYear)\n{\n var yearoption;\n var yearnum\n var yearrange=100;\n \n recentdate = new Date();\n recentdateYr = recentdate.getUTCFullYear();\n \n yearnum=recentdateYr - yearrange;\n var savedYearIdx = 0 ;\n\n for (yearoption=0;yearoption<yearrange;yearoption++)\n {\n yearnum++;\n thisYear.options[yearoption] = new Option(String(yearnum), String(yearnum));\n if (String(yearnum) == savedYear)\n savedYearIdx = yearoption ;\n }\n\n thisYear.length = yearoption;\n thisYear.options.length = yearoption;\n thisYear.selectedIndex = savedYearIdx;\n}", "function listYears() {\n let currentDate = new Date();\n let currentYear = currentDate.getFullYear() + 1;\n\n for (let i = 0; i < 100; i++) {\n let year = currentYear -= 1\n $('#year-input').append('<option value=\"' + year + '\">' + year + '</option>');\n }\n}", "handleYearChange(date) {\n this.setState({\n year: date\n })\n }", "function toggleYearIndicator() {\n\td3.select(\"#yearIndicator\")\n\t\t.style(\"top\", iconYear.offsetTop + \"px\")\n\t\t.transition()\n\t\t.style(\"right\", \"66px\")\n\t\t.text(year);\n\n\tlet timer = d3.timer(() => {\n\t\td3.select(\"#yearIndicator\")\n\t\t\t.transition()\n\t\t\t.style(\"right\", \"-1200px\");\n\t\ttimer.stop();\n\t}, 3000);\n}", "function goToYear(year) {\n\t\t\tvar selector = $el.find('.' + options.className + '-timeblock[data-year=' + year + ']:not(.inactive) .' + options.className + '-dot').first();\n\t\t\tif (selector.length > 0) {\n\t\t\t\tselector.trigger('click');\n\t\t\t}\n\t\t}", "function show_yearly_calendar(p_item, p_year, p_format) {\r\n\t// Load the defaults..\r\n\tif (p_year == null || p_year == \"\")\r\n\t\tp_year = new String(gNow.getFullYear().toString());\r\n\tif (p_format == null || p_format == \"\")\r\n//\t\tp_format = \"MM/DD/YYYY\";\r\np_format = \"YYYY-MM-DD\";\r\n\r\n\tvar vWinCal = window.open(\"\", \"Calendar\", \"scrollbars=yes\");\r\n\tvWinCal.opener = self;\r\n\tggWinCal = vWinCal;\r\n\r\n\tBuild(p_item, null, p_year, p_format);\r\n}", "function thisYearData(data, userChoice) {\n var startOfYear = moment().startOf('year').toDate();\n var startDate = moment(startOfYear).format(\"D\");\n displayDateData(data, userChoice, startDate); \n}", "function displayMonthYear(year, month) {\n let showHeader = document.querySelector(\".display-header\")\n let selectYear = document.querySelector(\"#select-year\")\n let selectMonth = document.querySelector(\"#select-month\")\n selectYear.value = year;\n selectMonth.value = months[month - 1]\n showHeader.innerText = `${months[month-1]} ${year}` //arr starts with index 0\n return showHeader\n}", "function initOptionYear() {\n for (let i = MIN_YEAR; i <= MAX_YEAR; i++) {\n years.append(`<option value='${i}'>${i}</option>`);\n }\n years.val(currentYear);\n}", "function setYears() {\n var end = 1975;\n var start = new Date().getFullYear();\n var options = \"\";\n for (var year = start; year >= end+1; year--) {\n options += \"<option name='\" + year + \"'>\" + year + \"</option>\";\n }\n document.getElementById(\"vg_year\").innerHTML = options;\n}", "function addYearOption() {\n\t\tlet currentTime = new Date();\n\t\tlet currentYear = currentTime.getFullYear();\n\n\t\tfor (let i = 0; i < 4; i++) {\n\t\t\tlet yearOption = document.createElement(\"option\");\n\t\t\tyearOption.setAttribute(\"value\", currentYear + i)\n\t\t\tyearOption.innerHTML = currentYear + i;\n\t\t\tyear.appendChild(yearOption);\n\t\t}\n\t}", "function yearUp(){\r\n\tintYear++;\r\n\tlistReminders();\r\n\tinitialise();\n\r\n\t}", "function years() {\n let currentYear = new Date().getFullYear();\n //Loop and add the Year values to DropDownList.\n for (var i = 1950; i <= currentYear; i++) {\n releaseYears.push(i);\n }\n }", "function setDate() {\n\nvar today = new Date();\nvar year = today.getFullYear();\n\nvar rok = document.getElementById('mainfooter');\nrok.innerHTML = '<p>Copyright &copy;' + year + ' Adam Stasiun </p>';\n}", "function update(value) {\n document.getElementById(\"range\").innerHTML = year[value];\n inputValue = year[value];\n d3.selectAll(\".towns\")\n .attr(\"fill\", data => {\n return color(yearSelector(value)[data.properties.town])\n });\n }", "function update(value) {\n document.getElementById(\"range\").innerHTML = year[value];\n inputValue = year[value];\n d3.selectAll(\".towns\")\n .attr(\"fill\", data => {\n return color(yearSelector(value)[data.properties.town])\n });\n }", "function BindYearForUpdate(yeartype) {\n $('#ddlITNoticeYear option').remove();\n var selectBox = document.getElementById('ddlITNoticeYear');\n var date = new Date()\n var year = date.getFullYear();\n var month = date.getMonth() + 1;\n\n for (var i = year + 1; i >= year - 10; i--) {\n var option = document.createElement('option');\n var j = i;\n Fyear = (--j) + \"-\" + i\n option.value = Fyear;\n option.innerHTML = Fyear;\n selectBox.appendChild(option);\n }\n //}\n\n\n}", "setEndYear(endyear) {\n this.setState({\n endYear: endyear\n })\n }", "function scrollToYear(year) {\n\tvar curr = $(\"#main\").scrollTop(); // current scroll position\n\tvar position = $(\"#\" + year).position().top; // offset to desired position\n\t$(\"#main\").animate({scrollTop: position + curr - 45}); // animated scroll to year\n\tcurURL = window.location.href; // update new URL\n}", "function setYears() {\n if (self.budgetMonths[0].month === 'January') {\n for (i = 0; i < self.budgetMonths.length; i++) {\n self.budgetMonths[i].year = self.startingYear;\n }\n } else {\n var newYear = false;\n for (i = 0; i < self.budgetMonths.length; i++) {\n if (newYear === false && self.budgetMonths[i].month != 'January') {\n newYear = false;\n self.budgetMonths[i].year = self.startingYear;\n } else if (newYear === false && self.budgetMonths[i].month === 'January') {\n newYear = true;\n self.budgetMonths[i].year = self.startingYear + 1;\n } else {\n self.budgetMonths[i].year = self.startingYear + 1;\n }\n }\n }\n } // end setYears", "function changeYear() {\n let year = d3.select('#selected').property('value')\n buildMap(stateUrl,year)\n}", "function showYearTitles() {\n // Another way to do this would be to create\n // the year texts once and then just hide them.\n let yearsData = d3.keys(yearsTitleX);\n let years = svg.selectAll('.year').data(yearsData);\n\n years\n .enter()\n .append('text')\n .attr('class', 'year')\n .attr('x', function (d) {\n return yearsTitleX[d];\n })\n .attr('y', 40)\n .attr('text-anchor', 'middle')\n .text(function (d) {\n return d;\n });\n }", "function CurrentYear(feet, theYear) {\n feet.innerHTML = \"\\<h5\\>\\&copy 2016 Junior Developer Toolbox. All Rights Reserved. \\<br \\/\\> A Member of the Complete Developer Family \\&copy 2015 - \" + theYear + \" \\<a href=\\\"http:\\/\\/completedeveloperpodcast.com\\\" \\> \\<img class=\\\"CDPlogo\\\" src= \\\"http:\\/\\/completedeveloperpodcast.com\\/wp-content\\/uploads\\/2015\\/09\\/JPEG300_iTunes.jpg\\\" \\> Complete Developer Podcast\\<\\/a\\>. All rights reserved.\\<\\/h5 \\> \";\n document.getElementById(\"footer\").appendChild(feet);\n}", "function footer_text(){\n // Display the footer text with current year\n var text_element = document.getElementById(AllIdNames.footer_text_id);\n var current_year = new Date().getFullYear();\n text_element.innerHTML = '&copy;' + ' Voltex Designs ' + current_year;\n}", "function TimelineYear(parent){var _this=_super.call(this,parent)||this;_this.viewClass='e-timeline-year-view';_this.isInverseTableSelect=true;return _this;}", "function TimelineYear(parent) {\n var _this = _super.call(this, parent) || this;\n _this.viewClass = 'e-timeline-year-view';\n _this.isInverseTableSelect = true;\n return _this;\n }", "_setSelectedYear(value) {\n this._selectedYear = null;\n if (value instanceof DateRange) {\n const displayValue = value.start || value.end;\n if (displayValue) {\n this._selectedYear = this._dateAdapter.getYear(displayValue);\n }\n }\n else if (value) {\n this._selectedYear = this._dateAdapter.getYear(value);\n }\n }", "_setSelectedYear(value) {\n this._selectedYear = null;\n if (value instanceof DateRange) {\n const displayValue = value.start || value.end;\n if (displayValue) {\n this._selectedYear = this._dateAdapter.getYear(displayValue);\n }\n }\n else if (value) {\n this._selectedYear = this._dateAdapter.getYear(value);\n }\n }", "_onYearChange(year) {\n\t\t$(\"#firstBox\").val('');\n\t\t$(\"#middleBox\").val('');\n\t\t$(\"#lastBox\").val('');\n\n\t\tif (year.currentTarget) {\n\t\t\tyear = $(\"#yearBox\").val();\n\t\t\tthis.setState({useYear: (year !== '') });\n\t\t} else {\n\t\t\t$(\"#yearBox\").val(year);\n\t\t\tthis.setState({useYear: !!year });\n\t\t}\n\n\t\tthis._search();\n\t}", "function tweenYear() {\n var year = d3.interpolateNumber(1600, 1900);\n return function(t) { displayYear(year(t)); };\n }", "filterByLaunchYr(year) {\n this.launchYear = year;\n this.isLoading = true;\n this.getSpaceData();\n setTimeout(() => {\n this.isLoading = false;\n }, 2000);\n }", "function draw_map_by_year(data, year)\n{\n //Get this year's data\n current_year = get_year_data(data, year);\n\n //Update map's year text\n d3.selectAll(\"#year_text\").text(year)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"60px\")\n .attr(\"fill\", \"black\");\n\n d3.selectAll(\"path\")\n .datum(function(d)\n {\n return {\"name\" : d3.select(this).attr(\"id\")};\n })\n .data(current_year, //Ensure we map correctly\n function(d, i)\n {\n return d.name;\n })\n .transition()\n //The reason that it is 500 and not 750 as the update interval is that I want to color\n //transition be noticeably stable before the start of next year's transition\n .duration(500)\n .style('fill',\n function(d)\n {\n return emissions_scale(d.total_emissions);\n });\n}", "function filterYear(data) {\n // initialize filter array as false which means not filtered out\n keyValues.forEach(function() {\n state[\"filter\"].push(false);\n });\n d3.select('nav#year-filter').append('ul')\n .selectAll('li')\n .data(keyValues)\n .enter()\n .append('li')\n .on('click', function(d, i) {\n // if an inactive year is clicked\n checkFiltered();\n if (state.filter[i]) {\n state.filter[i] = false;\n d3.select(this).style('opacity', 1);\n // add year to array\n state.keys.push(d);\n // keep array in chronological order\n state.keys.sort();\n // render with inclusion of the clicked year\n render(data, state.keys, percentage);\n }\n // Disable the clicked year if\n // at least two other years are active\n else if (!state.filter[i] && state.keys.length > 2) {\n state.filter[i] = true;\n d3.select(this).style('opacity', 0.3);\n state.keys.splice(i, 1);\n state.keys.sort();\n render(data, state.keys, percentage);\n }\n })\n .text(function(d) {return d;});\n }", "function next() {\r\n saveYearText();\r\n calendar.innerHTML = \"\";\r\n generateYear(++currentYear);\r\n loadFromCalendarData();\r\n}", "function CalendarPopup_showYearNavigation() \r\n{ \r\n this.isShowYearNavigation = true; \r\n}", "selectYear(normalizedYear) {\r\n this.yearSelected.emit(normalizedYear);\r\n }" ]
[ "0.77693564", "0.75446963", "0.72150356", "0.71750224", "0.7142512", "0.70484203", "0.70484203", "0.7007036", "0.7007036", "0.7007036", "0.6965553", "0.69503665", "0.69503665", "0.69503665", "0.6885591", "0.6857341", "0.67369026", "0.67194164", "0.66810894", "0.6652801", "0.6619219", "0.6610112", "0.6555892", "0.6545438", "0.649526", "0.64880157", "0.6465576", "0.6425399", "0.64133453", "0.64044136", "0.6348454", "0.63305324", "0.6323235", "0.62636614", "0.6220441", "0.62185013", "0.6178573", "0.6163462", "0.6145029", "0.61364883", "0.611575", "0.6073384", "0.60684025", "0.60669744", "0.6064341", "0.6064031", "0.6063429", "0.60200876", "0.6008066", "0.5994531", "0.5976481", "0.59743255", "0.59730077", "0.5940074", "0.5937211", "0.5933548", "0.592012", "0.59183335", "0.5905742", "0.5903901", "0.5875294", "0.58719337", "0.5861412", "0.58603317", "0.5859292", "0.5816759", "0.5810157", "0.5798824", "0.57975924", "0.57746536", "0.5757956", "0.5756615", "0.57393503", "0.5736687", "0.573386", "0.5725743", "0.57226145", "0.57195354", "0.57179916", "0.57179916", "0.57121277", "0.57107764", "0.57011473", "0.5701048", "0.56935096", "0.56890637", "0.56765586", "0.5676068", "0.56673884", "0.5652158", "0.56469864", "0.56469864", "0.5641061", "0.56258154", "0.5624486", "0.5616445", "0.5615888", "0.5603758", "0.5603402", "0.56031454" ]
0.77194196
1
Interpolates the dataset for the given (fractional) year.
function interpolateData(year) { return testData.map(function(d) { return { xPos: d.xPos, yPos: d.yPos, name: d.name, size: d.size, region: d.region, number: interpolateValues(d.number, year), textLabel: setLabel(d.name, d.number, year), magnitude: d.magnitude, image: d.image, caption: d.caption }; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolateData(year) {\n return data.map(function(d) {\n return {\n country: d.country,\n region: d.region,\n code: d.code,\n xVal: interpolateValues(d.x, year),\n yVal: interpolateValues(d.y, year),\n zVal: interpolateValues(d.z, year)\n };\n });\n }", "function interpolate_years(data){\n\n // Adds interpolated data points to data\n\t\n var years = _.range(2002, 2030+1);\n\n\n for (var i = 0; i < data.length; i++) {\n \tdata[i]\n\n\n\n var p_years = _.map(data[i]['Points'], function(o){\n \treturn o['Y']\n });\n\n\n // mean sample n for interpolated data points\n var mean_n = _.mean(\n _.map(data[i]['Points'], function(p){\n return p['n'];\n }\n )\n )\n\n data[i]['mean_n'] = mean_n;\n\n\n for (var j=0; j<years.length; j++) {\n\n\n \tif (_.includes(p_years, years[j])) {\n\n // not interpolated\n _.filter(data[i]['Points'], function(o){\n \treturn o['Y'] == years[j]\n })[0]['intp'] = 0\n\n \t\t}\n\n else {\n var r = data[i]['Curve']['r']\n var c = data[i]['Curve']['c']\n\n data[i]['Points'].push(\n {Y: years[j], GR: curv(c, r, years[j], 1), intp: 1}\n )\n }\n }\n };\n}", "function interpolateValues(values, year) {\n\t\t /*use bisect function to determine the position of given year in the year list in ascending order*/\n\t\t var i = d3.bisectLeft(yearList,year);\n\t\t /*extract the data value at current position i*/\n\t\t var b = values[i];\n\t\t /*when given year is not the first year in the year list, interpolate the values between a and b*/\n\t\t if (i > 0) {\n\t\t /*extract the data value before position i*/\n\t\t var a = values[i - 1];\n\t\t /*if given year is a whole year number, return 1, otherwise return the delta(fraction)*/\n\t\t var t = (year == Math.floor(year)? 1 : year - Math.floor(year));\n\t\t return a + (b - a) * t;\n\t\t }\n\t\t /*when given year is the first year in the year list, extract the first year's data*/\n\t\t return b;\n\t }", "function interpolateData(year) {\n return fullTimeData.completeSet.map(function (d) {\n return {\n name: d.name,\n region: d.region,\n area: interpolateValues(d.area, year),\n population: interpolateValues(d.population, year),\n pops: interpolateValues(d.pops, year)\n };\n });\n }", "function interpolateData(year) {\n return fullTimeData.completeSetRel.map(function (d) {\n return {\n name: d.name,\n region: d.region,\n area: interpolateValues(d.area, year),\n population: interpolateValues(d.population, year),\n pops: interpolateValues(d.pops, year)\n };\n });\n }", "function interpolateValues(values, year) {\n let i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n let b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateData(year) {\n return fullTimeData.completeSetmRel.map(function (d) {\n return {\n name: d.name,\n region: d.region,\n area: interpolateValues(d.area, year),\n population: interpolateValues(d.population, year),\n pops: interpolateValues(d.pops, year)\n };\n });\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n // A bisector since many nation's data is sparsely-defined.\n var bisect = d3.bisector(function(d) { return d[0]; });\n\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateData(year) {\n\t\t return data.map(function(d) {\n\t\t return {\n\t\t stateCode: d.stateCode,\n\t\t stateName: d.stateName,\n\t\t category: d.category[yearList.indexOf(Math.round(year))],\n\t\t unemploymentRate: interpolateValues(d.unemploymentRate, year),\n\t\t population: interpolateValues(d.population, year),\n\t\t crimeRate: interpolateValues(d.crimeRate, year),\n\t\t murderRate: interpolateValues(d.murderRate, year),\n\t\t rapeRate: interpolateValues(d.rapeRate, year),\n\t\t robberyRate: interpolateValues(d.robberyRate, year),\n\t\t assaultRate: interpolateValues(d.assaultRate, year),\n\t\t }; \n\t\t });\n\t }", "function interpolateValues(values, year) {\n var i = bisect.right(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n if (b[1] == 0) { return 0; }\n else { return a[1] * (1 - t) + b[1] * t; }\n }\n return a[1];\n }", "function interpolateData(year) {\n if (!bubbleChart.data) return;\n return bubbleChart.data.map(function(d) {\n return {\n name: d.name,\n region: d.region,\n income: interpolateValues(d.income, year),\n population: interpolateValues(d.population, year),\n lifeExpectancy: interpolateValues(d.lifeExpectancy, year)\n };\n });\n }", "function interpolateData(year) {\n return states.map(function(d) {\n return {\n name: d.state,\n region: d.state,\n expenses: interpolateValues(d.expenses, year),\n income: interpolateValues(d.income, year),\n perCapita: interpolateValues(d.perCapita, year)\n };\n });\n }", "function interpolateData(year) {\n return states.map(function(d) {\n return {\n name: d.state,\n region: d.state,\n expenses: interpolateValues(d.expenses, year),\n income: interpolateValues(d.income, year),\n perCapita: interpolateValues(d.perCapita, year)\n };\n });\n }", "function interpolateData(year) {\n return states.map(function(d) {\n return {\n name: d.state,\n region: d.state,\n expenses: interpolateValues(d.expenses, year),\n income: interpolateValues(d.income, year),\n perCapita: interpolateValues(d.perCapita, year)\n };\n });\n }", "function interpolateValues(values, year) {\n for (i in values) {\n if (year == values[i][0] && null != values[i][1]) {\n return values[i][1]\n }\n }\n return null\n }", "function interpolateData(year) {\n return states.map(function(d) {\n return {\n name: d.state,\n region: d.state,\n expenses: interpolateValues(d.expenses, year),\n income: interpolateValues(d.income, year),\n perCapita: interpolateValues(d.perCapita, year)\n };\n });\n }", "function tweenYear() {\n var curYear = $(\"#ci-years-selector\").val();\n if(curYear == endYear) curYear = startYear;\n var year = d3.interpolateNumber(curYear, endYear);\n return function(t) { displayYear(year(t)); };\n }", "updateYear(year) {\n\t\tthis.year = year;\n\t\t/*this.chartData = this.allData[this.category]\n\t\t\t.filter(function(d) {\n\t\t\t\tif (d.yr === year) return d;\n\t\t\t});*/\n\t}", "function tweenYear() {\n\t\t \tvar year = d3.interpolateNumber(1976,2014);\n\t\t return function(t) { updateChart(year(t)); };\n\t }", "function tweenYear() {\n var year = d3.interpolateNumber(min_year, max_year);\n return function(t) { displayYear(year(t)); };\n }", "function updateYear(year) {\n\t\t// First set the beggining and end dates\n\t\t/* Variables */\n\n\t\tvar yearStartDate = year + \"-01-01\";\n\t\tvar yearEndDate = year + \"-12-31\";\n\t\t//URL\n\t\tvar yearTotalEnergyURL = POWER_DATA_URL + \"?mode=watts&startDate=\" + yearStartDate + \"%2000:00:00&endDate=\" + yearEndDate + \"%2000:00:00&device=\" + devices[0];\n\t\tconsole.log(yearTotalEnergyURL);\n\n\t\tvar yearTotalEnergyOptions = {\n\t\t\t\txaxis : {\n\t\t\t\t\tmode : 'time',\n\t\t\t\t\tmin : (new Date(yearStartDate)).getTime(),\n\t\t\t\t\tmax : (new Date(yearEndDate)).getTime()\n\t\t\t\t},\n\t\t\t\tyaxis : {\n\t\t\t\t\ttickFormatter : wattFormatter\n\t\t\t\t},\n\t\t\t\tlegend : {\n\t\t\t\t\tshow : true,\n\t\t\t\t\tmargin : 10,\n\t\t\t\t\tbackgroundOpacity : 0.5\n\t\t\t\t},\n\t\t\t\tseries : {\n\t\t\t\t\tlines: { show: true, fill: true }\n\t\t\t\t},\n\t\t\t\tgrid : {\n\t\t\t\t\thoverable : true\n\t\t\t\t}\n\t\t};\n\n\t\tvar yearTotalEnergyData = [];\n\n\t\tvar yearTotalEnergyPlaceholder = $(\"#year_view\");\n\n\t\t// fetch one series, adding to what we got\n\t\tvar yearAlreadyFetched = {};\n\n\t\t// then fetch the data with jQuery\n\t\tfunction onDataReceived_yearTotalEnergyOptions(series) {\n\n\t\t\t// extract the first coordinate pair so you can see that\n\t\t\t// data is now an ordinary Javascript object\n\t\t\tvar firstcoordinate = '(' + series.data[0][0] + ', ' + series.data[0][1] + ')';\n\n\t\t\t// let's add it to our current data\n\t\t\tif(!yearAlreadyFetched[series.label]) {\n\t\t\t\tyearAlreadyFetched[series.label] = true;\n\t\t\t\tyearTotalEnergyData.push(series);\n\t\t\t}\n\t\t\t//debugger;\n\n\t\t\t// and plot all we got\n\t\t\t$.plot(yearTotalEnergyPlaceholder, yearTotalEnergyData, yearTotalEnergyOptions);\n\n\t\t\t//Now, for shits and giggles, lets do some maths!\n\n\t\t};\n\n\t\tvar previousPoint = null;\n\t\t$(\"#year_view\").bind(\"plothover\", function(event, pos, item) {\n\t\t\t$(\"#x\").text(pos.x.toFixed(2));\n\t\t\t$(\"#y\").text(pos.y.toFixed(2));\n\n\t\t\tif(item) {\n\t\t\t\tif(previousPoint != item.dataIndex) {\n\t\t\t\t\tpreviousPoint = item.dataIndex;\n\n\t\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\t\tvar x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);\n\n\t\t\t\t\tshowTooltip(item.pageX, item.pageY, y + \" watts\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\tpreviousPoint = null;\n\t\t\t}\n\n\t\t});\n\n\t\t$.plot(yearTotalEnergyPlaceholder, yearTotalEnergyData, yearTotalEnergyOptions);\n\n\t\t//Now lets do some temp stuff, much simpler *ahhhh*\n\t\t$.ajax({url : yearTotalEnergyURL,method : 'GET',dataType : 'json',success : onDataReceived_yearTotalEnergyOptions});\n\n\t}", "function tweenYear() {\n var year = d3.interpolateNumber(1600, 1900);\n return function(t) { displayYear(year(t)); };\n }", "function displayYear(year) {\n d3.selectAll(\".dot\").data(interpolateData(year), key)\n .call(position)\n .sort(order);\n $(\"#ci-years-selector\").val(Math.round(year));\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(2000, 2016);\n return function(t) { displayYear(year(t)); };\n }", "function get_year_data(data_array, year)\n{\n //Group data by country and metric\n data_group_by_metric = d3.nest()\n .key(function(d)\n {\n return d.country;\n })\n .key(function(d)\n {\n return d.metric;\n })\n .entries(data_array)\n temp_arr = []; //Function's return variable, will hold country data\n temp_element = {}; //Used to fill the temp_arr\n\n //Loop over each country\n for(var k1 of data_group_by_metric.keys())\n {\n temp_element[\"name\"] = html_compatible_id(data_group_by_metric[k1].key);\n\n //Loop over each metric\n for (var k2 of data_group_by_metric[k1].values.keys() )\n {\n param = data_group_by_metric[k1].values[k2].key;\n temp_element[param] = +data_group_by_metric[k1].values[k2].values[0][year];\n }\n\n //Skip Central Africa, a huge outlier, makes all other nations seem too small on the graph\n //if(temp_element['name'] != \"Central African Republic\")\n if( temp_element.name != \"Lowincome\" &&\n temp_element.name != \"Lowermiddleincome\" &&\n temp_element.name != \"Middleincome\" &&\n temp_element.name != \"Palau\" && //Exclude too countries with extremely low emissions, they distort the colouring scale\n temp_element.name != \"MarshallIslands\" &&\n temp_element.name != \"NorthernMarianaIslands\" &&\n temp_element.name != \"TurksandCaicosIslands\" &&\n temp_element.name != \"Micronesia\" &&\n temp_element.name != \"FaroeIslands\" )\n {\n //Verify if the country has any unspecified\\missing metric for this year\n var has_empty_param = false;\n\n for(var i in numeric_params)\n {\n var element_param = numeric_params[i];\n if (isNaN(temp_element[element_param]) || temp_element[element_param] == 0 )\n {\n has_empty_param = true;\n break;\n }\n }\n\n //If the country has all the data full, push it into the return array\n if(has_empty_param == false)\n {\n //Add the element to the array to be returned\n temp_arr.push(temp_element);\n }//if the country has both values available this year\n\n }//if not any aggregation entity\n\n //Reset temp element for next loop. Not sure why, but it doesn't work otherwise\n //I was expecting that it would just overwrite the older value and no need\n //to clear the temp_element.\n temp_element = {};\n }\n return temp_arr;\n}", "function interpolateYear(decades, statePop) {\n const popRange = decades.reduce((acc, decade) => {\n acc.push(statePop[decade]);\n return acc;\n }, []);\n return scaleLinear().domain(decades).range(popRange).clamp(false);\n}", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function tweenYear() {\n var year = d3.interpolateNumber(0, 2000);\n return function (t) {\n displayYear(year(t));\n };\n }", "function updateYear(year) {\n yearSelected = year;\n updateShotChart();\n updateSeasonRank();\n}", "function displayYear(year) {\n dot.data(interpolateData(Math.round(year)), key)\n .call(position)\n .sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function draw_map_by_year(data, year)\n{\n //Get this year's data\n current_year = get_year_data(data, year);\n\n //Update map's year text\n d3.selectAll(\"#year_text\").text(year)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"60px\")\n .attr(\"fill\", \"black\");\n\n d3.selectAll(\"path\")\n .datum(function(d)\n {\n return {\"name\" : d3.select(this).attr(\"id\")};\n })\n .data(current_year, //Ensure we map correctly\n function(d, i)\n {\n return d.name;\n })\n .transition()\n //The reason that it is 500 and not 750 as the update interval is that I want to color\n //transition be noticeably stable before the start of next year's transition\n .duration(500)\n .style('fill',\n function(d)\n {\n return emissions_scale(d.total_emissions);\n });\n}", "function getYear(station, year, cb) {\n const sqlQuery = 'SELECT * FROM \\`bigquery-public-data.noaa_gsod.gsod' + year + '\\` WHERE stn = \"' + toronto + '\"';\n\n const options = {\n query: sqlQuery,\n location: 'US',\n };\n\n function convert(f) {\n return parseInt((f - 32) * 5 / 9, 10)\n }\n\n // Runs the query\n bigquery.query(options).then(res => {\n let rows = res[0]\n // rows=rows.sort((a, b) => a.da < b.da ? -1 : 1)\n // rows=rows.sort((a, b) => a.mo < b.mo ? -1 : 1)\n rows = rows.map((o) => {\n let date = [o.year, o.mo, o.da].join('-')\n return {\n date: date,\n // temp: convert(o.temp),\n thunder: o.thunder === '1',\n // snow: o.sndp === 999.9 ? 0 : o.sndp,\n rain: o.prcp === 99.99 ? 0 : o.prcp,\n // pressure: o.stp, //=== 99.99 ? 0 : o.stp,\n }\n })\n rows = rows.sort((a, b) => a.date < b.date ? -1 : 1)\n cb(rows)\n })\n}", "function updateYear(year, quakes) {\n d3.select(\"text.year\").text(year);\n var toShow = quakes.filter(function(d) {return d.YEAR === year});\n var circle = d3.geoCircle()\n var paths = circles.selectAll(\"path\")\n .data(toShow);\n\n var bpaths = paths.enter()\n .append(\"path\")\n .merge(paths);\n\n bpaths.attr(\"d\", function(d) {\n return path(circle.center([d.LONGITUDE, d.LATITUDE]).radius(radiusScale(d.EQ_PRIMARY))())\n }).attr(\"style\", function(d) {return \"fill: \" + color(d.EQ_PRIMARY)});\n\n paths.exit().remove();\n }", "function updateChart(year) {\n\t\t \tlabel_bubbleChart.text(Math.round(year)); /*update year label, since year could be a fraction of years, round it to the whole year number*/\n\t\t \tcircleGroup\n\t\t /*bind new data interpolated from the dataset based on the tweenYear, and use key to match up with existing bound data*/\n\t\t \t\t.data(interpolateData(year),key) \n\t\t \t\t .attr(\"r\", data=>radiusScale_bubbleChart(data.population))\n\t\t \t\t .attr(\"cx\", data=>xScale_bubbleChart(data.crimeRate))\n\t\t \t\t .attr(\"cy\", data=>yScale_bubbleChart(data.unemploymentRate))\n\t\t \t\t .attr(\"opacity\",.8)\n\t\t \t\t .style(\"fill\", data=>colorScale_bubbleChart(data.category))\n\t\t \t\t .sort(order)\n\t }", "function tweenYear() {\n var year = d3.interpolateNumber(2005, 2016);\n return function(t) {\n yearLabel.text(Math.round(year(t)));\n transitionYear((year(t)));\n };\n }", "function calcYearProjection(data) {\n\tlet projection = data.ytd;\n\tconst today = new Date();\n\tconst dd = today.getDate();\n\tconst mm = today.getMonth() + 1;\n\tconst yyyy = today.getFullYear();\n\tconst todayStr = mm + '/' + dd + '/' + yyyy;\n\tconst endDate = '12/31/' + yyyy;\n\n\tconst date1 = new Date(todayStr);\n\tconst date2 = new Date(endDate);\n\tconst timeDiff = Math.abs(date2.getTime() - date1.getTime());\n\tconst diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));\n\tconst diffWeek = Math.ceil(diffDays / 7);\n\tconst diffMonth = Math.ceil(diffDays / 30);\n\tconst diffYear = Math.ceil(diffDays / 365);\n\tswitch (data.schedule) {\n\t\tcase \"day\": projection += data.amount * diffDays; break;\n\t\tcase \"week\": projection += data.amount * diffWeek; break;\n\t\tcase \"month\": projection += data.amount * diffMonth; break;\n\t\tcase \"year\": projection += data.amount * diffYear; break;\n\t}\n\treturn projection;\n}", "function setYears(data, i) {\n return data.toString();\n}", "function transformData(year, number){\n\n\t// iterate over countries\n\tfor (var j = 0; j < year.length; j++) {\n\n\t\t// if country has an inflow of asylum\n\t\tif (dataAsylum[number].COU == year[j].country && dataAsylum[number].Value != 0) {\n\t\t\t\n\t\t\t// add them to the inflow array\n\t\t\tyear[j].features.push({ inflow: dataAsylum[number].Value, jaar: dataAsylum[number].YEA})\n\t\t}\n\t}\n}", "function func_year(year, key) {\n var outputs = calculate()\n if (key == 'baseline') {\n var cost_comparison = outputs['cost_proposed']\n var energy_comparison = outputs['energy_proposed']\n } else if (key == 'proposed') {\n var cost_comparison = outputs['cost_baseline']\n var energy_comparison = outputs['energy_baseline']\n }\n\n var lcoe = cost_comparison/energy_comparison\n var om_cost = parseFloat($('#'+key+'_cost_om_text').val())/1000\n var discount_rate = parseFloat($('#'+key+'_discount_rate_text').val())/100.0\n var degradation_rate = parseFloat($('#'+key+'_degradation_rate_text').val())/100.0\n var energy_yield = parseFloat($('#'+key+'_energy_yield_text').val())/1000\n\n cost_val = initial_cost(key) + om_cost * ((1 - 1/Math.pow(1 + discount_rate, year))/discount_rate)\n\n var energy_mult = (1 - Math.pow(1 + discount_rate, year)) / (-1 * discount_rate * Math.pow(1 + discount_rate, year))\n var energy_deg_mult = (1 / Math.pow(1 + discount_rate, year - 1) - 1 - discount_rate) / Math.pow(discount_rate, 2) - ((0.5 - year) / Math.pow(1 + discount_rate, year) - 0.5) / discount_rate\n energy_val = energy_yield * energy_mult + energy_yield * degradation_rate * energy_deg_mult\n\n return lcoe - cost_val/energy_val\n}", "function tweenYear() {\n var year = d3.interpolateNumber(bubbleChart.state.year, 2009);\n return function(t) { console.log(t); displayYear(year(t)); };\n }", "function interpolateData() {\n return company_data.map(function(d){\n return( {\n name: d.name,\n region: d.country,\n industry: d.industry,\n employees: d.employees_num, \n engineers: d.engineers_num\n })\n })\n }", "function setDomain(year) {\n dataArr = [];\n var data = perCapita ? carbonPerCapitaData : carbonData;\n\n // grab only countries and also filter out everything with > 0 emissions\n yearData = data.filter(d => d.Year === String(year) && d.Country !== \"World\" && d.Country !== \"European Union (28)\")\n validData = yearData.filter(d => (d.Emissions) > 0)\n\n colorScale.domain(d3.extent(validData, d => (d.Emissions)));\n flagScale.domain(d3.extent(validData, d => (d.Emissions)));\n\n // generates the data array for this year\n for (var i in validData) {\n var country = validData[i];\n var id;\n var code;\n var region;\n var name = perCapita ? country[\"Code\"] : country[\"Country\"];\n for (var i in countryCodes) {\n var codes = countryCodes[i];\n if (perCapita) {\n if (name === codes[\"alpha-3\"]) {\n code = codes[\"alpha-2\"]\n id = codes[\"country-code\"]\n region = codes[\"region\"]\n break;\n }\n } else {\n if (name === codes[\"name\"]) {\n code = codes[\"alpha-2\"]\n id = codes[\"country-code\"]\n region = codes[\"region\"]\n break;\n }\n }\n }\n // basically normalizes the data across the datasets\n // Country => the name of the country as a String\n // Emissions => the total Emissions as a Number\n // id => the country's ISO-3166 code (for the heatmap)\n // code => the country's ISO-3166 2-letter code (for the flag)\n // region => the country's ISO-3166 region (for the donut graph)\n dataArr.push({\n Country: country.Country,\n Emissions: country.Emissions,\n id: id,\n code: code,\n region: region\n })\n }\n}", "function getFilteredData(data, year) {\n\treturn data.filter(function(d){return d.year == year;})\n}", "function getDataPerYearPerOrigin(year, kind){\n var countriesPerOrigin = d3.nest()\n .key(function(d) {return d[\"Year\"]})\n .key(function(d){ return d[\"Origin\"]})\n .rollup(function(d) {return d3.sum(d, function(g){return g.Value})})\n .entries(the_csv_data)\n .filter(function(d){ return d.key == year})[0].values\n countriesPerOrigin.sort(function(a, b){\n if(a.values < b.values) return 1;\n if(a.values > b.values) return -1;\n return 0;\n });\n\n return countriesPerOrigin.slice(0, 20);\n}", "function getYearVal(d) { return d[1]; }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function initChartYear(parameters){\r\n\turlChartYear = parameters.url;\r\n\tchartYearContainer = parameters.container;\r\n\t\r\n\tupdateChartYear();\r\n}", "function computeYear(inputYear) {\n if (inputYear) parseYear = `&primary_release_year=${inputYear}`;\n}", "function computeYear(inputYear) {\n if (inputYear) parseYear = `&primary_release_year=${inputYear}`;\n}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function buildYearly() {\n yearlyData = [];\n originalData.forEach(buildYearlyForEach);\n}", "function drawYear(off, angle, arr, i, points){\n\t\tsvg.append(\"path\")\n\t\t\t.datum(d3.range(points))\n\t\t .attr(\"class\", \"year_scale\")\n\t\t .attr(\"d\", d3.svg.line.radial()\n\t\t \t\t\t\t.radius(radiScale(arr[i]))\n\t\t \t\t\t\t.angle(function(d, j) { return angle(j); }))\n\t\t .attr(\"transform\", \"translate(\" + center.x + \", \" + (center.y + off) + \")\")\n\t\t .attr(\"opacity\", 0)\n\t\t\t.transition()\n\t\t\t.duration(inTransLength)\n\t\t\t.attr(\"opacity\", 1);\n\t}", "function setYear(value) {\n sliderValue.innerHTML = Math.floor(value);\n slider.viewModel.setValue(0, value);\n //featureLayer.renderer = createRenderer(value);\n queryMun(value).then(displayResults)\n //selectFilter.addEventListener('change', function (event) {\n //setFeatureLayerFilter(value);\n //});\n }", "function reloadData(year) {\n\n var candidates = [];\n\n // This is the callback which is called when the fetch is complete\n function doneFetch() {\n var sublists = createSublists(candidates);\n\n createStudentGenderChart('.student-gender-chart', sublists['genderList']);\n createStudentEthnicityChart('.student-enthnicty-chart', sublists['ethnicityList']);\n createStudentScoresChart('.student-scores-chart', sublists['satScoresList']);\n createStudentDepartmentsChart('.student-departments-chart', sublists['departmentCandidateList']);\n createDepartmentGenderChart('.department-gender-chart', sublists['departmentGenderList']);\n\n d3.select('.main').style('z-index', '1');\n d3.select('.loading').style('display', 'none');\n }\n\n // This function fetches data recursively until there is\n // nothing left to fetch\n function fetch(url) {\n\n d3.select('.main').style('z-index', '-1');\n d3.select('.loading').style('display', 'block');\n\n d3.json(url, function(data) {\n\n candidates = candidates.concat(data['objects']);\n\n if (data['meta'] !== undefined) {\n if (data['meta']['next'] !== undefined) {\n if (data['meta']['next'] !== null) {\n next_url = BASE_URL + data['meta']['next'];\n fetch(next_url);\n } else {\n doneFetch();\n }\n } else {\n doneFetch();\n }\n } else {\n doneFetch();\n }\n });\n }\n\n var filter_url = '&admission_year=' + year;\n var fetch_url = CANDIDATES_URL + filter_url;\n\n //fetch_url = '/sampleData.json';\n fetch(fetch_url);\n }", "function update() {\n if (!(year in data)) return;\n title.text(year);\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob=year;})\n\n .attr(\"sum\", function(value) {value2.push(value);})//new\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob; //find distance from ends of arrays\n var tempor=value2.length;\n var newtem= 2014-glob;\n\n //manipulate arrays to end up with temps\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12)\n {\n while(value2.length!=12)\n {\n while(value2.length>tempor-newtem)\n {\n value2.pop();\n }\n value2.shift();\n\n }\n }\n if(tem==113)\n {\n while (value2.length!=12)\n {\n value2.pop();\n }\n\n }\n if(tem>12)\n {\n while(value2.length!=12)\n {\n while(value2.length>tempor-newtem+(12-tem))\n {\n value2.pop();\n }\n value2.shift();\n }\n }\n \n }//end of update()", "setYear(year) {\n this.year = year;\n Object.keys(this.featureIdToObjectDetails).forEach(featureId => {\n const objectDetails = this.featureIdToObjectDetails[featureId];\n objectDetails.object3D.visible = App.featureVisibleInYear(objectDetails, year);\n });\n this.requestRender();\n }", "function changeYear(year, currentProvince, settings, topic, titel, subtitel){\n\n\t// Get current chosen province\n\tcurrentProvince = getChosenProvince(currentProvince);\n\tvar texts = getTopic(topic);\n\ttitel = texts.titel;\n\tsubtitel = texts.subtitel;\n\n\tvar nld = settings.nld;\n\tvar years = settings.years;\n\tvar pyramidSettings = settings.pyramidSettings;\n\tvar barSettings = settings.barSettings;\n\tvar mapSettings = settings.mapSettings;\n \tvar data = years[year];\n\n \t// Update visualizations\n \tprovinceDataOne = getProvinceData(data, \"Limburg\");\n \tprovinceDataTwo = getProvinceData(data, currentProvince);\n \tupdatePyramid(provinceDataOne, provinceDataTwo, currentProvince, pyramidSettings);\n \tupdateBarchart(provinceDataOne, provinceDataTwo, currentProvince, topic, titel, subtitel, barSettings);\n \tupdateMap(nld, data, year, currentProvince, topic, titel, subtitel, settings);\n\n}", "function changeYear() {\n let year = d3.select('#selected').property('value')\n buildMap(stateUrl,year)\n}", "function filterYear(d) {\r\n return (d.year === yearcompare)\r\n }", "function calculateAnnualPerf(years) {\n years.map(function (item, index) {\n const previousYear = years.find((q) => q.year == item.year - 1);\n // check if previous year available. present year and previous have 4 qtrs.\n if (\n isDefined(previousYear) &&\n item.qtrs4Year == 4 &&\n previousYear.qtrs4Year == 4\n ) {\n item.epsPerf = calculatePercentChange(item.eps, previousYear.eps);\n item.revPerf = calculatePercentChange(item.rev, previousYear.rev);\n }\n });\n}", "function getFilteredData(data, year, state) {\n return data.filter(function(d){return d.year == year;})\n}", "function getYearFromAbbreviation(year) {\n return round(callDateGet(getNewDate(), 'FullYear') / 100) * 100 - round(year / 100) * 100 + year;\n }", "function change_year(e){\n year=parseInt(e.target.id);\n initializing_description();\n document.getElementById('pileups').innerHTML=text;\n document.getElementById('YEAR').innerHTML=year.toString();\n document.getElementById('publications').innerHTML='# publications : '.concat(data_json['publications'][year.toString()].toString());\n document.getElementById('tanom_land').innerHTML='temperature anomaly land : '.concat(temp_anom_land['data'][year.toString()]);\n document.getElementById('tanom_ocean').innerHTML='temperature anomaly ocean : '.concat(temp_anom_ocean['data'][year.toString()]);\n document.getElementById('forest_coverage').innerHTML='forest coverage : '.concat((forest_coverage[year-min_year].toPrecision(3)).toString());\n for(var i=0;i<global_surface_ice.length;i++){\n\tif(global_surface_ice[i]['y']==year) document.getElementById('ice surface (million of km2)').innerHTML='ice surface : '.concat((global_surface_ice[i]['surface'].toPrecision(3)).toString(),' million of km2');\n }\n list_pileups_year();\n list_pairwize_year();\n change();\n}", "function yearX(d) {\n var years = (endYear + 1) - startYear;\n var yearWidth = (width - leftBuffer)/ years;\n var counter = d.Year - startYear;\n return leftBuffer + yearWidth * counter;\n}", "function getYearFromAbbreviation(year) {\n return round(callDateGet(new date(), 'FullYear') / 100) * 100 - round(year / 100) * 100 + year;\n }", "function updateDisplay(year) {\n featureValues = []; \n\n d3.select(\"#yearInfo\").text(year); \n \n mapProp = geoJsonData.properties.mapProp; // Propery name to map to on each geoJSON feature object\n scaleValue = geoJsonData.properties.scaleValue; // Map scaling\n xOffset = geoJsonData.properties.xOffset; // Map xoffset\n yOffset = geoJsonData.properties.yOffset; // Map yoffset\n \n // DON'T NEED TO DO THESE EVERY TIME!! TODO: MOVE THEM\n totalProdExtent = d3.extent(chartData.map(function(d){return parseFloat(d.totalprod);}));\n console.log(\"totalProdExtent \" , totalProdExtent);\n\n totalProdColors = d3.scaleLinear()\n .domain(totalProdExtent)\n .range(['#FFF9CC', '#bc8600'])\n .interpolate(d3.interpolateHcl); \n\n \n // d3.nest() groups data\n var groupByYear = d3.nest()\n .key(function(d) {\n return d.year;\n })\n .entries(chartData);\n //console.log(groupByYear);\n \n groupByYear.forEach(function(d) {\n d.total = d3.sum(d.values, function(d2) {\n return d2.totalprod;\n });\n d.average = d3.mean(d.values, function(d3) {\n return d3.totalprod;\n });\n }); \n\n var currentData = groupByYear.filter(obj => {\n return obj.key == year.toString();\n }) \n console.log(\"currentData \", currentData);\n var ctFormat = d3.format(\".2s\");\n d3.select(\"#totalProdInfo\").text(ctFormat(currentData[0].total)); \n\n d3.select(\"#avgProdInfo\").text(ctFormat(currentData[0].average)); \n\n console.log(\"Current Year Data\", currentData[0].values);\n var currentYearData = currentData[0].values;\n \n // Assign state abbreviations to each shape\n $.each(geoJsonData.features, function(key, value) { \n var featureName = value.properties[mapProp];\n var stateAbbr = value.properties[\"HASC_1\"].split(\".\")[1]; \n \n var myDataRow = currentYearData.filter(obj => {\n return obj.state == stateAbbr;\n })\n\n var myVal = 0;\n if(myDataRow[0] != undefined) {\n myVal = myDataRow[0].totalprod; // Get total honey production\n }\n \n var dataObj = {\"name\": featureName, \"value\": myVal, \"state\": stateAbbr}; \n featureValues.push(dataObj); \n });\n\n renderMap(); // Render the map\n\n\n }", "function init() {\r\n\tvar year = [];\n\tvar dataset = [];\r\n\r\n\t/*\r\n\t * Pull in data from csv file\r\n\t */\r\n\td3.csv('data/11yearAUSOpenMatches.csv', function(d) {\r\n\t\tfor (key in d) {\r\n\t\t\tyear.push(d[key].year);\n\t\t\t// My JSON object used as dataset\r\n\t\t\tvar data = {\n\t\t\t\tyear : d[key].year,\n\t\t\t\tround : d[key].round,\n\t\t\t\tresults : d[key].results,\n\t\t\t\twinnerName : d[key].winnerName,\n\t\t\t\tplayer1 : d[key].player1,\n\t\t\t\twinner1 : d[key].winner1,\n\t\t\t\terror1 : d[key].error1,\n\t\t\t\tace1 : d[key].ace1,\n\t\t\t\tdouble1 : d[key].double1,\n\t\t\t\tplayer2 : d[key].player2,\n\t\t\t\twinner2 : d[key].winner2,\n\t\t\t\terror2 : d[key].error2,\n\t\t\t\tace2 : d[key].ace2,\n\t\t\t\tdouble2 : d[key].double2\n\t\t\t};\n\n\t\t\tdataset.push(data);\n\r\n\t\t}\n\n\t\t/*\n\t\tD3 Initializations\n\t\t*/\r\n\t\t//filtering dataset\n\t\tvar filteredData = d3.nest().key(function(d) {\n\t\t\treturn d.year;\n\t\t}).map(dataset, d3.map);\n\n\t\t//different arrays for each round\n\t\tvar uniqueYear = d3.set(year).values();\n\t\tvar rounds = [\"Final\", \"semi\", \"quarter\", \"Fourth\"];\n\t\tvar roundFourth = [];\n\t\tvar roundQuarter = [];\n\t\tvar roundSemi = [];\n\t\tvar roundFinal = [];\n\t\tfor (var item in uniqueYear) {\n\t\t\tfor ( i = 0; i < filteredData.get(uniqueYear[item]).length; i++) {\n\t\t\t\tswitch(filteredData.get(uniqueYear[item])[i].round) {\n\t\t\t\tcase 'Final' :\n\t\t\t\t\troundFinal.push(filteredData.get(uniqueYear[item])[i]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'semi' :\n\t\t\t\t\troundSemi.push(filteredData.get(uniqueYear[item])[i]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'quarter' :\n\t\t\t\t\troundQuarter.push(filteredData.get(uniqueYear[item])[i]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Fourth' :\n\t\t\t\t\troundFourth.push(filteredData.get(uniqueYear[item])[i]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t Code to assign dataset based on user selection\n\t\t */\n\t\tswitch(selRound) {\n\t\tcase 'Final' :\n\t\t\tfor (var val in roundFinal) {\n\t\t\t\tif (selYear == roundFinal[val].year) {\n\t\t\t\t\tresultSet.push(roundFinal[val]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'semi' :\n\t\t\tfor (var val in roundSemi) {\n\t\t\t\tif (selYear == roundSemi[val].year) {\n\t\t\t\t\tresultSet.push(roundSemi[val]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'quarter' :\n\t\t\tfor (var val in roundQuarter) {\n\t\t\t\tif (selYear == roundQuarter[val].year) {\n\t\t\t\t\tresultSet.push(roundQuarter[val]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'Fourth' :\n\t\t\tfor (var val in roundFourth) {\n\t\t\t\tif (selYear == roundFourth[val].year) {\n\t\t\t\t\tresultSet.push(roundFourth[val]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault :\n\t\t\tbreak;\n\t\t}\n\n\t\tif (auth) {\r\n\t\t\tvar r = 170,\n\t\t\t m = 10;\r\n\t\t\tvar color = d3.scale.category20c();\r\n\r\n\t\t\tvar arc = d3.svg.arc().innerRadius(r - 30).outerRadius(r);\r\n\r\n\t\t\tvar arcOver = d3.svg.arc().innerRadius(r - 25).outerRadius(r + 5);\r\n\n\t\t\tsvg = d3.select('.divElement').selectAll('svg').data(resultSet).enter().append('svg').attr(\"width\", (r + m) * 2).attr(\"height\", (r + m) * 2).append(\"svg:g\").attr(\"transform\", \"translate(\" + (r + m) + \",\" + (r + m) + \")\");\n\n\t\t\tvar textTop = svg.append(\"svg:text\").attr(\"text-anchor\", \"middle\").attr('dy', -50).attr(\"class\", \"textTop\");\n\t\t\ttextTop.append('svg:tspan').attr(\"text-anchor\", \"middle\").attr('class', 'first').style(\"fill\", '#29A629').text(function(d) {\n\t\t\t\treturn d.player1;\n\t\t\t});\n\t\t\ttextTop.append('svg:tspan').attr(\"text-anchor\", \"middle\").attr('class', 'second').attr('x', 0).attr('dy', 30).text(function(d) {\n\t\t\t\treturn \"Vs\";\n\t\t\t});\n\t\t\ttextTop.append('svg:tspan').attr(\"text-anchor\", \"middle\").attr('class', 'third').style(\"fill\", '#FF3300').attr('x', 0).attr('dy', 30).text(function(d) {\n\t\t\t\treturn d.player2;\n\t\t\t});\n\t\t\ttextTop.append('svg:tspan').attr(\"text-anchor\", \"middle\").attr('class', 'fourth').style(\"fill\", '#000').attr('x', 0).attr('dy', 30).text(function(d) {\n\t\t\t\treturn d.results;\n\t\t\t});\n\n\t\t\tvar myPie = d3.layout.pie();\n\t\t\tmyPie.value(function(d) {\n\t\t\t\treturn d;\n\t\t\t});\n\n\t\t\tvar g = svg.selectAll(\"g\").data(function(d) {\n\t\t\t\t// code to change values in pie\n\t\t\t\treturn myPie([(parseInt(d.winner1) + parseInt(d.ace1) + parseInt(d.double2) - parseInt(d.error1) + 40), (parseInt(d.winner2) + parseInt(d.ace2) + parseInt(d.double1) - parseInt(d.error2) + 40)]);\n\t\t\t}).enter().append(\"svg:g\").on('mouseover', function(d, i) {\n\t\t\t\td3.select(this).select(\"path\").transition().duration(200).style('opacity', 0.3).attr(\"d\", arcOver);\n\t\t\t\t//get the data from parent node\n\t\t\t\tvar player = d3.select(this.parentNode).datum().player1;\n\t\t\t\tvar winner = d3.select(this.parentNode).datum().winner1;\n\t\t\t\tvar error = d3.select(this.parentNode).datum().error1;\n\t\t\t\tvar aces = d3.select(this.parentNode).datum().ace1;\n\t\t\t\tif (i) {\n\t\t\t\t\tplayer = d3.select(this.parentNode).datum().player2;\n\t\t\t\t\td3.select(this.parentNode).datum().winner2;\n\t\t\t\t\terror = d3.select(this.parentNode).datum().error2;\n\t\t\t\t\taces = d3.select(this.parentNode).datum().ace2;\n\t\t\t\t}\n\t\t\t\td3.select(this.parentNode).select('text').select('.first').style(\"fill\", '#000').html(player);\n\t\t\t\td3.select(this.parentNode).select('text').select('.second').style(\"fill\", '#29A629').html(\"Winners : \" + winner);\n\t\t\t\td3.select(this.parentNode).select('text').select('.third').style(\"fill\", '#29A629').html(\"Aces : \" + aces);\n\t\t\t\td3.select(this.parentNode).select('text').select('.fourth').style(\"fill\", '#FF3300').html(\"Errors : \" + error);\n\n\t\t\t}).on('mouseout', function(d) {\n\t\t\t\td3.select(this).select(\"path\").transition().duration(100).style('opacity', 1).attr(\"d\", arc);\n\n\t\t\t\tvar res = d3.select(this.parentNode).datum();\n\t\t\t\td3.select(this.parentNode).select('text').select('.first').style(\"fill\", '#29A629').html(res.player1);\n\t\t\t\td3.select(this.parentNode).select('text').select('.second').style(\"fill\", '#000').html(\"Vs\").attr(\"dy\", 30);\n\t\t\t\td3.select(this.parentNode).select('text').select('.third').style(\"fill\", '#FF3300').html(res.player2);\n\t\t\t\td3.select(this.parentNode).select('text').select('.fourth').style(\"fill\", '#000').html(res.results);\n\t\t\t});\n\n\t\t\tg.append(\"svg:path\").attr(\"d\", arc).attr('fill', function(d, i) {\n\t\t\t\treturn color(i);\n\t\t\t});\n\n\t\t\tg.append(\"svg:text\")\n\t\t\t.attr(\"text-anchor\", \"middle\").attr(\"transform\", function(d) {\n\t\t\t\treturn \"translate(\" + arc.centroid(d) + \")rotate(\" + angle(d) + \")\";\n\t\t\t}).text(function(d) {\n\t\t\t\treturn d.data;\n\t\t\t}).style('font-size', '1.5em');\n\n\t\t\tfunction angle(d) {\n\t\t\t\tvar a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n\t\t\t\treturn a > 90 ? a - 180 : a;\n\t\t\t}\n\n\t\t}\n\r\n\t});\n\n}", "function get_data_by_year(periodo, data_inicial){\n var data_moments_config = [];\n if(typeof Const.year !='undefined' && Const.year!=null && Const.year != get_current_date().year){\n var d_inicial\n if(typeof data_inicial !='undefined'){\n d_inicial = data_inicial;\n } else {\n d_inicial = Const.year+'-12-02';\n }\n\n data_moments_config = config_moments('undefined', ''+d_inicial+'', ''+Const.year+'-12-31');//ultimo mes do anos selecionado\n\n } else {\n data_moments_config = config_moments(periodo);\n }\n\n return data_moments_config;\n}", "filterAndSortDataByYear () {\n }", "function displayYear(year) {\n dot.data(interpolateData(Math.round(year)), key).call(position).sort(order);\n label.text(Math.round(year));\n dotNames.data(interpolateData(Math.round(year)), key).call(showLabel);\n\n // Updates texts in sidebar.\n titles.data(interpolateTeleData(year), key).call(changeTitle);\n texts.data(interpolateTeleData(year), key).call(changeText);\n if ( year >= 1842 && year < 1847) {\n document.getElementById(\"description\").style.height = \"285px\";\n }\n else {\n document.getElementById(\"description\").style.height = \"350px\";\n }\n }", "function filterByYearAndSlider() {\n if (running) {\n\n displayYear = displayYear + 1;\n if (displayYear > 2017) {\n displayYear = 2007;\n }\n slider.value = displayYear;\n yearDisplay.innerText = displayYear;\n }\n}", "function changeYearTexts(yearIndex) {\n var yearTexts = d3.selectAll(\".yearText\")\n for (var i = 0; i < yearTexts[0].length; i++) {\n yearTexts[0][i].innerHTML = parseInt(yearIndex) + 1970;\n };\n}", "function calcCurrent(data, year) {\n // for each country in our dataset:\n data.forEach(function(country) {\n\n // iterate over each of the indicators we want to find the latest\n // value for the year by finding the data point with that year\n indicators.forEach(function(indicator) {\n\n // create a new property called current that\n // will contain the values for the specific year\n // we are operating in.\n country.current = country.current || {};\n country.current[indicator] = null;\n\n // if the country has values for this indicator to begin with...\n if (country[indicator]) {\n country[indicator].forEach(function(datum) {\n if (datum.year === year) {\n country.current[indicator] = datum.value;\n }\n });\n }\n });\n });\n}", "function loadAustlii(ext, acts_by_year, austlii, yearDraw){\n var from = Number(ext[0].getFullYear());\n var to = Number(ext[1].getFullYear());\n\n var years=[];\n for(var year=from; year<=to; year++){\n if(! acts_by_year.has(year)) years.push(year);\n }\n\n // https://developers.google.com/fusiontables/docs/v1/sql-reference\n if (years.length>0){\n // d3.csv(\n // \"https://www.googleapis.com/fusiontables/v1/query?\"\n // +\"sql=SELECT * FROM \" + fusiontable_id.acts\n // +\" WHERE year IN (\" + years.join() + \")\"\n // // +\" AND name CONTAINS 'TAX'\"\n // +\"&alt=csv&key=\" + fusiontable_api_key,\n // function(data){\n\n // nested = d3.nest()\n // .key(function(d) { return d.year; })\n // .entries(data);\n\n // for (var i = 0; i < nested.length; i++) {\n // acts_by_year.set( nested[i].key, nested[i].values );\n // };\n // plotAustlii(from,to, acts_by_year, austlii,yearDraw);\n // }\n // );\n\nd3.csv(\n \"https://www.googleapis.com/fusiontables/v1/query?\"\n +\"sql=SELECT * FROM \" + fusiontable_id.acts\n +\" WHERE year IN (\" + years.join() + \")\"\n // +\" AND name CONTAINS 'TAX'\"\n +\"&alt=csv&key=\" + fusiontable_api_key)\n\n // .header('Accept-Encoding', 'gzip')\n // .header('User-Agent','my program(gzip)') // won't work as you can't change user-agent in browser\n // http://stackoverflow.com/questions/5771878/jquery-ajax-request-change-user-agent\n // github pages gzips json but not csv (experimentally confirmed) so http://stackoverflow.com/questions/24490168/ungzip-csv-files-in-web-browser-with-javascript\n // or if we use \n .get(\n function(error,data){\n \n nested = d3.nest()\n .key(function(d) { return d.year; })\n .entries(data);\n\n for (var i = 0; i < nested.length; i++) {\n acts_by_year.set( nested[i].key, nested[i].values );\n };\n plotAustlii(from,to, acts_by_year, austlii,yearDraw);\n }\n );\n\n\n }\n else plotAustlii(from,to, acts_by_year, austlii,yearDraw);\n}", "interpolate(y2, y1, y3, n) {\n /* Equation from Astronomical Algorithms page 24 */\n const a = y2 - y1;\n const b = y3 - y2;\n const c = b - a;\n return y2 + n / 2 * (a + b + n * c);\n }" ]
[ "0.75805336", "0.7532873", "0.74065244", "0.731408", "0.7296949", "0.72798663", "0.72255176", "0.71993214", "0.71993214", "0.71993214", "0.7172246", "0.7163488", "0.7104056", "0.7104056", "0.7104056", "0.70994294", "0.7004463", "0.69604856", "0.691536", "0.6687981", "0.6687981", "0.6687981", "0.6647314", "0.6619214", "0.6362549", "0.6361567", "0.6205758", "0.61311424", "0.6024136", "0.6012719", "0.599819", "0.5874489", "0.5874489", "0.5874489", "0.58545715", "0.58314395", "0.58031976", "0.5731417", "0.5731417", "0.5731417", "0.57303756", "0.5722591", "0.5702606", "0.5702606", "0.5702606", "0.56900144", "0.56900144", "0.56822723", "0.5628286", "0.562777", "0.56261563", "0.561957", "0.5610975", "0.55583453", "0.550435", "0.54893416", "0.5467502", "0.546353", "0.54491514", "0.5443044", "0.54275495", "0.5425503", "0.54238397", "0.54238397", "0.54238397", "0.53833765", "0.53819454", "0.53819454", "0.5314939", "0.5314939", "0.5314939", "0.5314939", "0.5314939", "0.5314939", "0.5314939", "0.529881", "0.52741766", "0.52619386", "0.5257844", "0.52507573", "0.52440596", "0.52404755", "0.52302915", "0.5229892", "0.52260673", "0.52155745", "0.51929325", "0.51867986", "0.51820505", "0.5173165", "0.51643103", "0.5162621", "0.51599944", "0.51546746", "0.5151271", "0.51337963", "0.512878", "0.5119574", "0.51082546", "0.51070344" ]
0.7617787
0
Finds (and possibly interpolates) the value for the specified year.
function interpolateValues(values, year) { var i = bisect.right(values, year, 0, values.length - 1), a = values[i]; if (i > 0) { var b = values[i - 1], t = (year - a[0]) / (b[0] - a[0]); if (b[1] == 0) { return 0; } else { return a[1] * (1 - t) + b[1] * t; } } return a[1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolateValues(values, year) {\n for (i in values) {\n if (year == values[i][0] && null != values[i][1]) {\n return values[i][1]\n }\n }\n return null\n }", "function interpolateValues(values, year) {\n let i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n let b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function getYearVal(d) { return d[1]; }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "getBirthYearForUserProvidedValue(birthYear) {\n // Prepend 0 as necessary\n if (birthYear >= 0 && birthYear <= 9) {\n return parseInt(`200${birthYear}`, 10);\n } else if (birthYear >= 10 && birthYear <= 99) {\n if (parseInt(`20${birthYear}`, 10) > this.nowFunction().getFullYear()) {\n return parseInt(`19${birthYear}`, 10);\n } else {\n return parseInt(`20${birthYear}`, 10);\n }\n }\n\n return birthYear;\n }", "function yearFilter(value) {\n return (value.Year == display_year)\n}", "function interpolateValues(values, year) {\n // A bisector since many nation's data is sparsely-defined.\n var bisect = d3.bisector(function(d) { return d[0]; });\n\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "function interpolateValues(values, year) {\n\t\t /*use bisect function to determine the position of given year in the year list in ascending order*/\n\t\t var i = d3.bisectLeft(yearList,year);\n\t\t /*extract the data value at current position i*/\n\t\t var b = values[i];\n\t\t /*when given year is not the first year in the year list, interpolate the values between a and b*/\n\t\t if (i > 0) {\n\t\t /*extract the data value before position i*/\n\t\t var a = values[i - 1];\n\t\t /*if given year is a whole year number, return 1, otherwise return the delta(fraction)*/\n\t\t var t = (year == Math.floor(year)? 1 : year - Math.floor(year));\n\t\t return a + (b - a) * t;\n\t\t }\n\t\t /*when given year is the first year in the year list, extract the first year's data*/\n\t\t return b;\n\t }", "function getYearPublished(yearObj){\n //takes in an objects and returns the value behind the \"year_published\" key\n var year = yearObj.year_published;\n return year; // similar setip to prev #87\n}", "function getYear(station, year, cb) {\n const sqlQuery = 'SELECT * FROM \\`bigquery-public-data.noaa_gsod.gsod' + year + '\\` WHERE stn = \"' + toronto + '\"';\n\n const options = {\n query: sqlQuery,\n location: 'US',\n };\n\n function convert(f) {\n return parseInt((f - 32) * 5 / 9, 10)\n }\n\n // Runs the query\n bigquery.query(options).then(res => {\n let rows = res[0]\n // rows=rows.sort((a, b) => a.da < b.da ? -1 : 1)\n // rows=rows.sort((a, b) => a.mo < b.mo ? -1 : 1)\n rows = rows.map((o) => {\n let date = [o.year, o.mo, o.da].join('-')\n return {\n date: date,\n // temp: convert(o.temp),\n thunder: o.thunder === '1',\n // snow: o.sndp === 999.9 ? 0 : o.sndp,\n rain: o.prcp === 99.99 ? 0 : o.prcp,\n // pressure: o.stp, //=== 99.99 ? 0 : o.stp,\n }\n })\n rows = rows.sort((a, b) => a.date < b.date ? -1 : 1)\n cb(rows)\n })\n}", "function val(d) {return d.GEN_VAL_YR;}", "function computeYear(inputYear) {\n if (inputYear) parseYear = `&primary_release_year=${inputYear}`;\n}", "function computeYear(inputYear) {\n if (inputYear) parseYear = `&primary_release_year=${inputYear}`;\n}", "function yearFilter(value) {\n return (value.Year == displayYear\n && value.GDP != 0 && value.Global_Competitiveness_Index != 0 \n && value.Population != 0);\n}", "function filterYear(d) {\r\n return (d.year === yearcompare)\r\n }", "function func_year(year, key) {\n var outputs = calculate()\n if (key == 'baseline') {\n var cost_comparison = outputs['cost_proposed']\n var energy_comparison = outputs['energy_proposed']\n } else if (key == 'proposed') {\n var cost_comparison = outputs['cost_baseline']\n var energy_comparison = outputs['energy_baseline']\n }\n\n var lcoe = cost_comparison/energy_comparison\n var om_cost = parseFloat($('#'+key+'_cost_om_text').val())/1000\n var discount_rate = parseFloat($('#'+key+'_discount_rate_text').val())/100.0\n var degradation_rate = parseFloat($('#'+key+'_degradation_rate_text').val())/100.0\n var energy_yield = parseFloat($('#'+key+'_energy_yield_text').val())/1000\n\n cost_val = initial_cost(key) + om_cost * ((1 - 1/Math.pow(1 + discount_rate, year))/discount_rate)\n\n var energy_mult = (1 - Math.pow(1 + discount_rate, year)) / (-1 * discount_rate * Math.pow(1 + discount_rate, year))\n var energy_deg_mult = (1 / Math.pow(1 + discount_rate, year - 1) - 1 - discount_rate) / Math.pow(discount_rate, 2) - ((0.5 - year) / Math.pow(1 + discount_rate, year) - 0.5) / discount_rate\n energy_val = energy_yield * energy_mult + energy_yield * degradation_rate * energy_deg_mult\n\n return lcoe - cost_val/energy_val\n}", "function getYearFromAbbreviation(year) {\n return round(callDateGet(new date(), 'FullYear') / 100) * 100 - round(year / 100) * 100 + year;\n }", "function filterByYearAndSlider() {\n if (running) {\n\n displayYear = displayYear + 1;\n if (displayYear > 2017) {\n displayYear = 2007;\n }\n slider.value = displayYear;\n yearDisplay.innerText = displayYear;\n }\n}", "function displayYear(year) {\n d3.selectAll(\".dot\").data(interpolateData(year), key)\n .call(position)\n .sort(order);\n $(\"#ci-years-selector\").val(Math.round(year));\n }", "function getYearFromAbbreviation(year) {\n return round(callDateGet(getNewDate(), 'FullYear') / 100) * 100 - round(year / 100) * 100 + year;\n }", "function filterByYear(year){\n year = year.toString();\n console.log(year + \"I was called!\");\n return _.filter(window.cleanData, function(data){\n return data[0] === year;\n\n });\n}", "getYearNumerals(year) { return `${year}`; }", "function getStatForYear(stats, year) {\n return stats\n .filter(stat => stat.includes(year))\n .map(stat => {\n const [x, y, ...teamStat] = stat;\n return teamStat;\n });\n }", "function checkYear(value, yearArr) {\n\n return yearArr.some(element => {\n\n return element.year === value.year\n\n })\n}", "function displayYear(year) {\n dot.data(interpolateData(Math.round(year)), key)\n .call(position)\n .sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "function interpolateData(year) {\n return data.map(function(d) {\n return {\n country: d.country,\n region: d.region,\n code: d.code,\n xVal: interpolateValues(d.x, year),\n yVal: interpolateValues(d.y, year),\n zVal: interpolateValues(d.z, year)\n };\n });\n }", "function getFilteredData(data, year) {\n\treturn data.filter(function(d){return d.year == year;})\n}", "function filterByYear(e) {\n setYear(e.target.value);\n const filteredData = props.expenses.filter(item => (parseInt(item.date.getFullYear()) === parseInt(e.target.value)))\n props.filteredData(filteredData);\n }", "function selectYear(){\n var restriction = \"1=1\";\n if (valueExistsNotEmpty(getFieldRes('bl.site_id'))) {\n restriction += \" and exists(select 1 from bl where gb_fp_setup.bl_id = bl.bl_id and \" + getFieldRes('bl.site_id') + \")\";\n }\n \n if (valueExistsNotEmpty(getFieldRes('gb_fp_setup.scenario_id'))) {\n restriction += \" and \" + getFieldRes('gb_fp_setup.scenario_id');\n }\n View.selectValue(\"abGbFpEsExpConsole\", '', [\"gb_fp_setup.calc_year\"], \"gb_fp_setup\", [\"gb_fp_setup.calc_year\"], [\"gb_fp_setup.calc_year\"], restriction, null, null, null, null, null, null, 'multiple');\n \n}", "function isYear(year){\n if(a%100==0 && a%400==0){\n return 'leap year';\n }else if(a%100!=0 && a%4==0){\n return 'leap year';\n }else{\n return 'not leap year';\n }\n}", "updateYear(year) {\n\t\tthis.year = year;\n\t\t/*this.chartData = this.allData[this.category]\n\t\t\t.filter(function(d) {\n\t\t\t\tif (d.yr === year) return d;\n\t\t\t});*/\n\t}", "function setYear(value) {\n sliderValue.innerHTML = Math.floor(value);\n slider.viewModel.setValue(0, value);\n //featureLayer.renderer = createRenderer(value);\n queryMun(value).then(displayResults)\n //selectFilter.addEventListener('change', function (event) {\n //setFeatureLayerFilter(value);\n //});\n }", "function interpolateData(year) {\n return testData.map(function(d) {\n return {\n xPos: d.xPos,\n yPos: d.yPos,\n name: d.name,\n size: d.size,\n region: d.region,\n number: interpolateValues(d.number, year),\n textLabel: setLabel(d.name, d.number, year),\n magnitude: d.magnitude,\n image: d.image,\n caption: d.caption\n };\n });\n }", "function energy(key, year) {\n energy_yield = parseFloat($('#'+key+'_energy_yield_text').val())/1000.0\n degradation_rate = parseFloat($('#'+key+'_degradation_rate_text').val())/100.0\n\n if(year == 0){\n return 0\n } else {\n var energy_thisyear = energy_yield * (1 - degradation_rate * (year - 0.5)) // linear degradation rate\n\n if(energy_thisyear > 0){\n return energy_thisyear\n } else {\n return 0\n }\n }\n}", "function findCentury(year) {\n return Math.ceil(year / 100);\n}", "function parseYear(term, origin, control,node) {\n\tvar yearQuery = \"\";\n\tvar valid = false;\n\tvar operator = \"=\";\n\t//regex for year, four digits\n\tvar url = /\\d{4}/;\n\n\tif( term.indexOf(\"<\")>-1){\n\t\tterm=term.substr(1,term.length);\n\t\toperator=\"<\";\n\t}\n\tif( term.indexOf(\"=\")>-1){\n\t\tterm=term.substr(1,term.length);\n\t\toperator=\"=\";\n\t}\n\tif( term.indexOf(\">\")>-1){\n\t\tterm=term.substr(1,term.length);\n\t\toperator=\">\";\n\t}\n\n\tif( term.match(url)!=null){\n \t\tvalid=true; \n\t\tyearQuery=yearQuery+\"remakes/remake[\"+node+operator+term+\"] \" + $('input[name=refine]:radio:checked')[0].value +\" \"; \n\t\t\n\t\t//for now\n\t\tglobalQuery = globalQuery + yearQuery;\n\t} \n\t\t\t\t\t\t \n\treturn yearQuery; \n}", "function opacityYear(d) {\n if (d.Year == \"2006\") \n return 1.0;\n else if (d.Year == \"2007\")\n return 0.85; \n else if (d.Year == \"2008\")\n return 0.68;\n else if (d.Year == \"2009\")\n return 0.51;\n else if (d.Year == \"2010\")\n return 0.34; \n else //2011\n return 0.17;\n }", "function solve(year){\r\n // Complete this function\r\n}", "function getColorBy(year) {\n var color;\n if (year < 1910) {\n color = \"#00ffff\";\n } else if (year > 1910 && year < 1920) {\n color = \"#00c8ff\";\n } else if (year > 1920 && year < 1930) {\n color = \"#0096ff\";\n } else if (year > 1930 && year < 1940) {\n color = \"#0064ff\";\n } else if (year > 1940 && year < 1950) {\n color = \"#6432ff\";\n } else if (year > 1950 && year < 1960) {\n color = \"#9600ff\";\n } else if (year > 1960 && year < 1970) {\n color = \"#c800ff\";\n } else if (year > 1970 && year < 1980) {\n color = \"#ff00ff\";\n } else {\n color = \"#ff6cd9\";\n }\n return color;\n }", "function interpolateData(year) {\n return fullTimeData.completeSetRel.map(function (d) {\n return {\n name: d.name,\n region: d.region,\n area: interpolateValues(d.area, year),\n population: interpolateValues(d.population, year),\n pops: interpolateValues(d.pops, year)\n };\n });\n }", "function fromShortYear(fn) {\n return function(match) {\n var short_year = fn(match);\n\n if (short_year >= 69) {\n short_year += 1900;\n } else {\n short_year += 2000;\n }\n return short_year;\n }\n }", "function fromShortYear(fn) {\n return function(match) {\n var short_year = fn(match);\n\n if (short_year >= 69) {\n short_year += 1900;\n } else {\n short_year += 2000;\n }\n return short_year;\n }\n }", "function interpolateData(year) {\n return fullTimeData.completeSetmRel.map(function (d) {\n return {\n name: d.name,\n region: d.region,\n area: interpolateValues(d.area, year),\n population: interpolateValues(d.population, year),\n pops: interpolateValues(d.pops, year)\n };\n });\n }", "function searchForMovieBasedOnYear() {\r\n let givenYear = document.getElementById('year-input').value\r\n if (givenYear.length > 0 && !isNaN(givenYear)) {\r\n let parseGivenYear = parseInt(givenYear)\r\n\r\n //Year cannot be less than zero\r\n if (parseGivenYear < 1) {\r\n alert(\"Year must be a positive number. Please refine your query and try again.\")\r\n }\r\n //Year cannot be after the current year\r\n else if (parseGivenYear > CURRENT_YEAR) {\r\n alert(\"Year cannot be in the future.\")\r\n }\r\n else {\r\n //Fetching movies using primary_release_year will return values if certain years are entered (e.g. year 0, 100, etc.) \r\n // let primaryReleaseYear = `&primary_release_year=${parseGivenYear}`\r\n\r\n let primaryReleaseYearGte = `&primary_release_date.gte=${parseGivenYear}-01-01`\r\n let primaryReleaseYearLte = `&primary_release_date.lte=${parseGivenYear}-12-31`\r\n\r\n let searchQueryPrimaryReleaseYear = SEARCH_QUERY + primaryReleaseYearGte + primaryReleaseYearLte\r\n\r\n let ajaxRequest = new XMLHttpRequest()\r\n ajaxRequest.open('GET', searchQueryPrimaryReleaseYear)\r\n\r\n ajaxRequest.onreadystatechange = function() {\r\n handler(ajaxRequest);\r\n };\r\n \r\n ajaxRequest.send(null);\r\n }\r\n }\r\n else {\r\n alert(NOT_A_YEAR_ERROR_MESSAGE)\r\n }\r\n}", "function yearSearch(key, array){\n for (var i=0; i < array.length; i++){\n if (array[i] === key.feature.properties.YR){\n createView(key);\n }\n }\n }", "function interpolateData(year) {\n return fullTimeData.completeSet.map(function (d) {\n return {\n name: d.name,\n region: d.region,\n area: interpolateValues(d.area, year),\n population: interpolateValues(d.population, year),\n pops: interpolateValues(d.pops, year)\n };\n });\n }", "function myYear(year){\n return year * 365 * 24 * 60 * 60;\n}", "selectYear(year) {\n const sampleDate = new Date();\n sampleDate.setFullYear(year);\n const convertedYear = toOtherCalendar(sampleDate).getFullYear();\n\n const optionElement = this.template.querySelector(\n `option[value='${convertedYear}']`\n );\n if (optionElement) {\n optionElement.selected = true;\n }\n }", "function getYear() {\n var n = TAW.yearIndex;\n return TAW.allYears[n];\n }", "function getReleaseDateWithYear(movieTitle, year){\n\tvar movieUrl = 'https://api.themoviedb.org/3/search/movie?api_key=feae45a67d6335347f12949a4fe25c77&language=en-US&query='+ movieTitle+ '&page=1&include_adult=false&region=US&year='+year;\n\n\tvar json = JSON.parse(Get(movieUrl));\n\n\tconsole.log(json);\n\tconsole.log(json.total_results);\n\n\tif(json.total_results !== 0){\n\t\tfor(var i = 0; i < json.results.length; i++){\n\t\t\tif(json.results[i].title.toUpperCase() === movieTitle.toUpperCase()){\n\t\t\t\tvar movieInfo = makeMovie(json.results[i].title, json.results[i].release_date);\n\t\t\t\treturn movieInfo;\n\t\t\t}\n\t\t}\n\t\treturn \"Nothing\";\n\t}\n\telse{\n\t\treturn \"Nothing\";\n\t}\n}", "_onYearChange(year) {\n\t\t$(\"#firstBox\").val('');\n\t\t$(\"#middleBox\").val('');\n\t\t$(\"#lastBox\").val('');\n\n\t\tif (year.currentTarget) {\n\t\t\tyear = $(\"#yearBox\").val();\n\t\t\tthis.setState({useYear: (year !== '') });\n\t\t} else {\n\t\t\t$(\"#yearBox\").val(year);\n\t\t\tthis.setState({useYear: !!year });\n\t\t}\n\n\t\tthis._search();\n\t}", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n dotLabels.data(interpolateData(year), key).call(position2).sort(order);\n\n\n label.text(Math.round(year));\n arrangeLabels();\n\n }", "function which(dataset, year, variable) {\n var sub = d3.map();\n dataset.forEach(function(d) {\n if (variable == \"Residential Land Price\") {\n sub.set(d.cityid, +d.resid_price[year - 2007]);\n } else if (variable == \"Housing Price\") {\n sub.set(d.cityid, +d.housing_price[year - 2007]);\n } else if (variable == \"New Land Sales\") {\n sub.set(d.cityid, +d.resid_area[year - 2007]);\n } else if (variable == \"Urban Population\") {\n sub.set(d.cityid, +d.pop[year - 2007]);\n } else if (variable == \"Salary\") {\n sub.set(d.cityid, +d.salary[year - 2007]);\n }\n });\n return sub;\n}", "function interpolateData(year) {\n\t\t return data.map(function(d) {\n\t\t return {\n\t\t stateCode: d.stateCode,\n\t\t stateName: d.stateName,\n\t\t category: d.category[yearList.indexOf(Math.round(year))],\n\t\t unemploymentRate: interpolateValues(d.unemploymentRate, year),\n\t\t population: interpolateValues(d.population, year),\n\t\t crimeRate: interpolateValues(d.crimeRate, year),\n\t\t murderRate: interpolateValues(d.murderRate, year),\n\t\t rapeRate: interpolateValues(d.rapeRate, year),\n\t\t robberyRate: interpolateValues(d.robberyRate, year),\n\t\t assaultRate: interpolateValues(d.assaultRate, year),\n\t\t }; \n\t\t });\n\t }", "function calcYear(y){\n\tyear = 12;\n\thrYear = y * year;\n\treturn hrYear;\n}", "function calcYearProjection(data) {\n\tlet projection = data.ytd;\n\tconst today = new Date();\n\tconst dd = today.getDate();\n\tconst mm = today.getMonth() + 1;\n\tconst yyyy = today.getFullYear();\n\tconst todayStr = mm + '/' + dd + '/' + yyyy;\n\tconst endDate = '12/31/' + yyyy;\n\n\tconst date1 = new Date(todayStr);\n\tconst date2 = new Date(endDate);\n\tconst timeDiff = Math.abs(date2.getTime() - date1.getTime());\n\tconst diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));\n\tconst diffWeek = Math.ceil(diffDays / 7);\n\tconst diffMonth = Math.ceil(diffDays / 30);\n\tconst diffYear = Math.ceil(diffDays / 365);\n\tswitch (data.schedule) {\n\t\tcase \"day\": projection += data.amount * diffDays; break;\n\t\tcase \"week\": projection += data.amount * diffWeek; break;\n\t\tcase \"month\": projection += data.amount * diffMonth; break;\n\t\tcase \"year\": projection += data.amount * diffYear; break;\n\t}\n\treturn projection;\n}", "function getGlobalYearfromMaps() {\n\tvar years = Array.from(new Set(getYearsfromMaps())); // get unique years from #mapN .map_year\n\tvar year = \"none\";\n\t//if (years.length == 5) year = \"each\";\n\tif (years.length == (app.m - 1)) year = \"each\";\n\tif (years.length == 1) year = years[0];\n\treturn year;\n}", "function centuryFromYear(year) {\n let century = 0;\n if (year > 0) {\n century = Math.ceil(year/100);\n return `The ${century} century`\n }\n else if (year < 0) {\n century = Math.floor(year/100);\n return `The ${century} century BC`;\n }\n}", "function lookupStation(stationID, year){\n if (year == 13){\n stations = stations13;\n }\n else if (year == 17) {\n stations = stations17;\n };\n\n return stations.filter(\n function(stations){ return stations.id == stationID; }\n );\n}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function centuryFromYear(year)\n{\n let century = year / 100;\n\n if (year % 10 > 0)\n century++;\n\n return Math.floor(century);\n\n}", "function centuryFromYear(year){\n var t=year%100;\n var rs=1;\n if(year<=100)\n return rs;\n else {\n if(t==0)\n rs=Math.round(year/100);\n else\n if(t>=50)\n rs=Math.round(year/100);\n else\n rs=Math.round(year/100)+1;\n }\n console.log(rs);\n return rs;\n}", "function leapFinder(year) {\n if ((year % 4 === 0) && (year % 100 !== 0) || (year % 400 === 0)) {\n year = 'Leap year'; \n } else {\n year = 'Not a leap year'; \n }\n\n return year; \n}", "_setSelectedYear(value) {\n this._selectedYear = null;\n if (value instanceof DateRange) {\n const displayValue = value.start || value.end;\n if (displayValue) {\n this._selectedYear = this._dateAdapter.getYear(displayValue);\n }\n }\n else if (value) {\n this._selectedYear = this._dateAdapter.getYear(value);\n }\n }", "_setSelectedYear(value) {\n this._selectedYear = null;\n if (value instanceof DateRange) {\n const displayValue = value.start || value.end;\n if (displayValue) {\n this._selectedYear = this._dateAdapter.getYear(displayValue);\n }\n }\n else if (value) {\n this._selectedYear = this._dateAdapter.getYear(value);\n }\n }", "function centuryFromYear(year) {\n\tvar century;\n if(year % 100 === 0){\n century = year / 100;\n } else {\n //year might be like 19.05 - so 20th century\n century = ((year / 100) | 0) + 1;\n }\n return century; \n}", "get yearFormat() {\n\t\treturn this.nativeElement ? this.nativeElement.yearFormat : undefined;\n\t}", "function tweenYear() {\n var curYear = $(\"#ci-years-selector\").val();\n if(curYear == endYear) curYear = startYear;\n var year = d3.interpolateNumber(curYear, endYear);\n return function(t) { displayYear(year(t)); };\n }", "function filterYear(yearMin,yearMax) {\n if (yearMin == 1980 && yearMax == 2016) { //if filter includes all years, avoid filtering so that games with unknown years are included\n return filteredData;\n }\n else {\n var yearData = filteredData.filter(function(d){\n return d.year <= yearMax && d.year >= yearMin;\n });\n return yearData;\n }\n}", "function getFilteredData(data, year, state) {\n return data.filter(function(d){return d.year == year;})\n}", "function get_data_by_year(periodo, data_inicial){\n var data_moments_config = [];\n if(typeof Const.year !='undefined' && Const.year!=null && Const.year != get_current_date().year){\n var d_inicial\n if(typeof data_inicial !='undefined'){\n d_inicial = data_inicial;\n } else {\n d_inicial = Const.year+'-12-02';\n }\n\n data_moments_config = config_moments('undefined', ''+d_inicial+'', ''+Const.year+'-12-31');//ultimo mes do anos selecionado\n\n } else {\n data_moments_config = config_moments(periodo);\n }\n\n return data_moments_config;\n}", "function getThreeDigitYear(year) {\n if (isNaN(year)) {\n return -1;\n }\n\n if (year < 0) {\n year = year * -1;\n }\n\n var century = Math.floor(year / YEARS_PER_CENTURY);\n century -= BASE_CENTURY;\n century *= YEARS_PER_CENTURY;\n return century + (year % YEARS_PER_CENTURY);\n}", "function getThreeDigitYear(year) {\n if (isNaN(year)) {\n return -1;\n }\n\n if (year < 0) {\n year = year * -1;\n }\n\n var century = Math.floor(year / YEARS_PER_CENTURY);\n century -= BASE_CENTURY;\n century *= YEARS_PER_CENTURY;\n return century + (year % YEARS_PER_CENTURY);\n}", "function interpolate_years(data){\n\n // Adds interpolated data points to data\n\t\n var years = _.range(2002, 2030+1);\n\n\n for (var i = 0; i < data.length; i++) {\n \tdata[i]\n\n\n\n var p_years = _.map(data[i]['Points'], function(o){\n \treturn o['Y']\n });\n\n\n // mean sample n for interpolated data points\n var mean_n = _.mean(\n _.map(data[i]['Points'], function(p){\n return p['n'];\n }\n )\n )\n\n data[i]['mean_n'] = mean_n;\n\n\n for (var j=0; j<years.length; j++) {\n\n\n \tif (_.includes(p_years, years[j])) {\n\n // not interpolated\n _.filter(data[i]['Points'], function(o){\n \treturn o['Y'] == years[j]\n })[0]['intp'] = 0\n\n \t\t}\n\n else {\n var r = data[i]['Curve']['r']\n var c = data[i]['Curve']['c']\n\n data[i]['Points'].push(\n {Y: years[j], GR: curv(c, r, years[j], 1), intp: 1}\n )\n }\n }\n };\n}", "function displayYear(year) {\n dot.data(interpolateData(Math.round(year)), key).call(position).sort(order);\n label.text(Math.round(year));\n dotNames.data(interpolateData(Math.round(year)), key).call(showLabel);\n\n // Updates texts in sidebar.\n titles.data(interpolateTeleData(year), key).call(changeTitle);\n texts.data(interpolateTeleData(year), key).call(changeText);\n if ( year >= 1842 && year < 1847) {\n document.getElementById(\"description\").style.height = \"285px\";\n }\n else {\n document.getElementById(\"description\").style.height = \"350px\";\n }\n }", "function movieYear (array, year) {\n for (i = 0; i < array.length; i++) {\n if (array[i].year == year) {\n console.log(array[i]);\n }\n }\n}", "set yearConverted(year) {\n year = typeof(year) === 'number' ? year : false;\n this._year = year;\n }", "get yearString(){\n if (parseInt(this.timeSavedMonthes/12) === 1){\n return 'YEAR'\n }\n return 'YEARS'\n }", "function getYear(date) {\n var year = date.substring(0, 2);\n return \"20\" + year;\n}", "function transformYear(year) {\n if (year < 10) {\n year = \"190\" + year;\n } else if (year > 10 && year < 100) {\n year = \"19\" + year;\n } else {\n year = \"20\" + year[1] + year[2];\n }\n\n return year;\n}" ]
[ "0.7394559", "0.67821807", "0.6722554", "0.6722554", "0.6722554", "0.6698918", "0.6695649", "0.66823447", "0.66584456", "0.66584456", "0.66584456", "0.6650481", "0.6599824", "0.6586608", "0.6535596", "0.62672585", "0.6051055", "0.6016964", "0.5964394", "0.5964394", "0.5893825", "0.5859629", "0.5823483", "0.5799248", "0.5785517", "0.57810104", "0.57348377", "0.56643844", "0.5656564", "0.5653359", "0.56148726", "0.5587097", "0.5568917", "0.5568917", "0.5563484", "0.5563484", "0.5563484", "0.5546645", "0.5536976", "0.5529124", "0.5515982", "0.5502101", "0.54974926", "0.5463075", "0.5405062", "0.53932846", "0.5389474", "0.5381792", "0.5378197", "0.5354656", "0.5352921", "0.53238934", "0.53227776", "0.53227776", "0.5298087", "0.52863425", "0.5286273", "0.52827275", "0.52799124", "0.52659595", "0.5254773", "0.5246591", "0.5232725", "0.52304083", "0.52304083", "0.52304083", "0.5225857", "0.52222884", "0.5207812", "0.52059627", "0.5197073", "0.5189886", "0.5162196", "0.5156198", "0.5156198", "0.5156198", "0.5156198", "0.5156198", "0.5156198", "0.5156198", "0.51414925", "0.5119397", "0.5117245", "0.511708", "0.511708", "0.5114753", "0.51077527", "0.5105502", "0.5102185", "0.50992477", "0.50927913", "0.508517", "0.508517", "0.50832206", "0.5082108", "0.5073645", "0.50720835", "0.5059658", "0.5050743", "0.5050363" ]
0.66540956
11
VERIFICA SE O USUARIO ESTA CONECTADO
function isOnlineLogin(){ //var page = prefix+"adx/mobile/professor/leitura/testeConecao.php"; //TESTE!! var page = prefix+unidade+"/mobile/professor/leitura/testeConecao.php"; //OFICIAL //var page = prefix+"/mobile/professor/leitura/testeConecao.php"; //teste basse de dados oficial var resultado = 0; $.ajax({ url: page, data: {}, dataType: "text", method: "post", async: false, }).done(function(dados){ resultado = dados; }).fail(function(a,b,c){ console.log(a); console.log(b); console.log(c); }); return resultado; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function iniciarSesion(dataUsuario) {\n usuarioLogueado = new Usuario(dataUsuario.data._id, dataUsuario.data.nombre, dataUsuario.data.apellido, dataUsuario.data.email, dataUsuario.data.direccion, null);\n tokenGuardado = dataUsuario.data.token;\n localStorage.setItem(\"AppUsuarioToken\", tokenGuardado);\n navegar('home', true, dataUsuario);\n}", "function cambiausuario() {\n var f = document.getElementById(\"editar\");\n if(f.f2nom.value==\"\" || f.f2nick.value==\"\" || f.f2pass.value==\"\" || f.f2mail.value==\"\") {\n alert(\"Deben llenarse todos los campos para proceder\");\n } else {\n var x = new paws();\n x.addVar(\"nombre\",f.f2nom.value);\n x.addVar(\"nick\",f.f2nick.value);\n x.addVar(\"pass\",f.f2pass.value);\n x.addVar(\"email\",f.f2mail.value);\n x.addVar(\"estatus\",f.f2est.selectedIndex);\n x.addVar(\"cliente_id\",f.f2cid.value);\n x.addVar(\"usuario_id\",f.f2usrid.value);\n x.go(\"clientes\",\"editausr\",llenausr);\n }\n}", "function iniciar(){\r\n\tlocalStorage.clear();\r\n\tvar boton= document.getElementById('btnenviar');\r\n\tif(boton.addEventListener){\r\n\t\tboton.addEventListener(\"click\",function(){\r\n\t\t\tvar nuevousuario= new User(document.frmregistro.nombres.value, document.frmregistro.apellidos.value, document.frmregistro.correo.value, document.frmregistro.contra.value, document.frmregistro.confirm_contra.value, document.frmregistro.departamento.value, document.frmregistro.municipio.value, document.frmregistro.colonia.value, document.frmregistro.calle_pasaje.value, document.frmregistro.num_casa.value, document.frmregistro.pregunta.value, document.frmregistro.DUI.value, document.frmregistro.NIT.value, document.frmregistro.num_cel.value, document.frmregistro.fecha.value);\r\n\t\t\tnuevousuario.comprobar();\r\n\t\t},false);\r\n\t}\r\n}", "function arearecaudacion(){\n this.usuario;\n}", "function registrar_pantalla(conexion)\n{\n\tconexion.send(json_msj({type:'screen_conect'}));\n}", "function acceder(usuario){\n console.log(`2. ${usuario} Ahora puedes acceder`)\n entrar();\n}", "function obtieneLogueo(){\n $.ajax({\n url: \"vista/user/registro_user/traeFormLogin.html\",\n method: \"POST\",\n success: function (data) {\n $(\"#ventanaModal\").html(data)\n }\n })\n }", "function iniciar() {\n cuerpoTablaUsuario = document.getElementById('cuerpoTablaUsuario'); \n divRespuesta = document.getElementById('divRespuesta');\n var botonAlta = document.getElementById('botonAlta');\n botonAlta.addEventListener('click', altaUsuario); \n}", "function iniciar_Sesion()\n{\n\t// obtiene el nombre del usuario\n\tvar nombre_usuario = document.getElementById(\"user\").value;\n\t// obtiene la contraseña del usuario\n\tvar contrasenna = document.getElementById(\"password\").value;\n\t// pregunta si el nombre es admin y la contraseña es $uperadmin para saber si es el administrador\n\tif(nombre_usuario === \"admin\" && contrasenna === \"$uper4dmin\"){\n\t\t// si es asi validar va a decir que el que va a iniciar sesion es el administrador\n\t\tvalidar = \"Entra como administracion\";\n\t\t// entonces el usuario actual va a ser admin\n\t\tuser_actual = 'Admin';\n\t\t// se va al localstorage y guarda el usuario actual para saber quien fue el que entró\n\t\tlocalStorage.setItem(\"Usuario_Actual\",user_actual);\n\t\t// si no fuera así\n\t}else{\n\t\t// se va a la funcion donde valida si el usuario existe o no y si existe cual es\n\t\tvalidacion();\n\t}\n\t// si validar fuera igual a nulo\n\tif(validar === null){\n\t\t// se muestra un mensaje donde le indica que lo debe crear primero entonces no puede iniciar sesion\n\t\talert(\"Debe crearlo primero antes de iniciar sesion\");\n\t\t// si validar fuera que entra coo administrador\n\t}else if(validar === \"Entra como administracion\"){\n\t\t// entonces entra como administrador\n\t\tlocation.href=\"tablero-de-instrucciones.html\";\n\t\t// muestra un mensaje de bienvenida\n\t\talert(\"BIENVENIDO\");\n\t\t// si validar fuera que entra como particular\n\t}else if(validar === \"Entra como particular\"){\n\t\t// entonces se valida el nombre de usuario para saber quien es.\n\t\tuser_actual = document.getElementById(\"user\").value;\n\t\t//lo guarda en el localstorage\n\t\tlocalStorage.setItem(\"Usuario_Actual\", user_actual);\n\t\t// entra como particular\n\t\tlocation.href=\"tablero-de-instrucciones.html\";\n\t\t// muestra un mensaje de bienvenida\n\t\talert(\"BIENVENIDO\");\n\t}\n\n}", "function criaUser() {\r\n var Usuarios = {\r\n email: formcliente.email.value,\r\n nome: formcliente.nome.value,\r\n pontos: formcliente.pontos.value,\r\n senha: formcliente.senha.value,\r\n sexo : formcliente.sexo.value\r\n };\r\n addUser(Usuarios);\r\n}", "constructor(usuarioService) {\n this.usuarioService = usuarioService;\n this.title = 'chutesfutmesa';\n this.blnLogado = false;\n }", "function usuario(variable){\n alert(prompt(\"cual es su nombre?\") + \" \" + \"si decea cambia de usuario solo desinstale su app y vuelva a registrarla, por el momento no tenemos la opcion de \\\"volver a registrarse\\\"\");\n }", "function update(OID_USUARIO,USUARIO){\n\t\n\t/*INSERCION DE DATOS*/\n\t\n\t$(\"#txt_usuario\").val(USUARIO);\n\t\n\t$(\"#txt_usuario\").attr(\"USER\",OID_USUARIO);\n\t\n\t$(\"#btn_enviar_usuario\").text(\"Actualizar\")\n\t\t\n\t\n}//FINAL DE LA ACTUALIZACION DE UN REGISTRO", "function alIniciar(){\n usuario.email = localStorage.getItem(\"email\");\n modalContacto.usuarioEmail = localStorage.getItem(\"email\");\n modalContacto.usuarioRol = localStorage.getItem(\"rol\");\n if(modalContacto.usuarioRol == \"Periodista\"){\n usuario.rol = 1;\n } else{\n usuario.rol = 2;\n }\n modalContacto.usuarioNombre = localStorage.getItem(\"nombre\");\n modalContacto.usuarioApellido = localStorage.getItem(\"apellido\");\n modalContacto.usuarioPuntos = localStorage.getItem(\"puntaje\");\n}", "function conexion(usr,contra,ip,puert,db) {\n this.usuario=usr;\n this.contraseña=contra;\n this.IP =ip;\n this.puerto=puert;\n this.DB=db;\n}", "function cambiarIdioma(idioma) {\n\t\tvar elTitulo = document.getElementById(\"form-signin-heading\");\n\t\tvar elEmail = document.getElementById(\"ingresoEmail\");\n\t\tvar elRemember = document.getElementById(\"remember\");\n\t\tvar elIngresarCta = document.getElementById(\"ingresarCta\");\n\n\t\tif(idioma == \"es\") {\n\t\t\telTitulo.innerHTML = \"Ingresa a tu cuenta\";\n\t\t\telEmail.innerHTML = \"Ingresa tu email\";\n\t\t\tdocument.getElementById(\"inputPassword\").setAttribute(\"placeholder\",\"Contraseña\");\n\t\t\telRemember.innerHTML = \"Recordar contraseña\";\n\t\t}\n\t\telse if(idioma == \"en\") {\n\t\t\telTitulo.innerHTML = \"Please sing in\";\n\t\t\telEmail.innerHTML = \"Please enter your email\";\n\t\t\tdocument.getElementById(\"inputPassword\").setAttribute(\"placeholder\",\"Password\");\n\t\t\telRemember.innerHTML = \"Remeber me\";\n\t}\n}", "function getUsuarioActivo(nombre){\n return{\n uid: 'ABC123',\n username: nombre\n\n }\n}", "function inicializar() {\n // Chequeo si en el localStorage hay token guardado.\n tokenGuardado = window.localStorage.getItem(\"AppUsuarioToken\");\n // Al chequeo de la sesión, le paso como parámetro una función anónima que dice qué hacer después.\n chequearSesion(function () {\n // Muestro lo que corresponda en base a si hay o no usuario logueado.\n if (!usuarioLogueado) {\n navegar('login', true);\n } else {\n navegar('home', false);\n }\n });\n}", "function logear(){\n let correo = document.getElementById('correo').value;\n let usuario = $('#login_form #usuario').val();\n socket.emit('datos_usuario', { correo: correo, usuario: usuario } );\n yo = usuario;\n // id_user = socket.id;\n document.getElementById('usuarioLogeado').innerText = yo;\n}", "function guardausuario() {\n var f = document.getElementById(\"editar\");\n if(f.f2nom.value==\"\" || f.f2nick.value==\"\" || f.f2pass.value==\"\" || f.f2mail.value==\"\") {\n alert(\"Deben llenarse todos los campos para proceder\");\n } else {\n var x = new paws();\n x.addVar(\"nombre\",f.f2nom.value);\n x.addVar(\"nick\",f.f2nick.value);\n x.addVar(\"pass\",f.f2pass.value);\n x.addVar(\"email\",f.f2mail.value);\n x.addVar(\"estatus\",f.f2est.selectedIndex);\n x.addVar(\"cliente_id\",f.f2cid.value);\n x.go(\"clientes\",\"guardausr\",llenausr);\n }\n}", "function mostrarVentanaInicio(){\n\t//verificar el rol\n\tif (datosUsuario[0][\"idRol\"] == 3) {\n\t\tmostrarVentanaChef1(datosUsuario[0][\"nombre\"]);\t// Invoca la ventana de Cocina y envia nombre del empleado\n\t}\n\telse if(datosUsuario[0][\"idRol\"] == 2) {\n\t\tmostrarVentanaCajero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Cajero y envia nombre del empleado\n\t}\n\telse{\n\t\tmostrarVentanaMesero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Mesero y envia nombre del empleado\n\t}\n\n}", "function comprobar_sesion() {\n console.log(\"Comprobar login\");\n $.ajax({\n url: \"php/peticiones/comprobar_sesion.php\",\n type: \"POST\",\n dataType: \"json\",\n success: function(data) {\n if (data.Res == \"OK\") {\n NombreUsuario = data.Nombre;\n }\n },\n error: function(err) {\n console.log(\"Error sucedido en la peticion ajax, Funcion que falla comprobar_sesion()\");\n errorServ(err, \"sesion.js: comprobar_sesion()\");\n }\n });\n}", "function entrar() {\n\t\tif (debug) {\n\t\t\tconsole.log(\"Entrando...\");\t\n\t\t}\n\n\t\tif ($(\"#email\").val().length <= 0 || $(\"#senha\").val().length <= 0) {\n\t\t\tmensagemErro(\"Informe o usu&aacute;rio / senha!\");\n\t\t\t$(\"#email\").focus();\n\t\t} else {\n\t\t\tvar params = {\n\t\t\t\t'email' : $(\"#email\").val(),\n\t\t\t\t'senha' : $(\"#senha\").val(),\n\t\t\t\t'lembrarSenha' : $(\"#lembrarSenha\").prop('checked') ? \"1\" : \"0\"\n\t\t\t};\n\n\t\t\t$.ajax({\n\t\t\t\turl : \"login.login.action\",\n\t\t\t\ttype : \"POST\",\n\t\t\t\tdata : params,\n\n\t\t\t\tbeforeSend : function(data) {\n\t\t\t\t\t// debug(\"loading...\");\n\t\t\t\t},\n\n\t\t\t\tsuccess : function(data) {\n\t\t\t\t\tif (debug) {\n\t\t\t\t\t\tconsole.log(data);\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar retorno = $.parseJSON(data);\n\t\t\t\t\t\n\t\t\t\t\tif (retorno.sucesso) {\n\t\t\t\t\t\tfinalLogin();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmensagemErro(retorno.mensagem);\n\t\t\t\t\t\t$(\"#login\").focus();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror : function(erro) {\n\t\t\t\t\t// debug(\"Erro no load ajax! \" + erro);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function SeleccionarUsuario($scope, ServiciosUsuarios) {\n $scope.usuarios = ServiciosUsuarios.usuarios;\n\n $scope.guardar_usuario = function(user) {\n ServiciosUsuarios.SeleccionarUsuario(user);\n ServiciosUbicacion.Geolocalizar();\n };\n \n //SERVICIOS INICIO\n $scope.$on('UsuarioElegido', function() {\n $scope.usuario = ServiciosUsuarios.usuario;\n }); \n //SERVICIOS FIN \n }", "function cadastrarSolicitante(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tvar notSolicitante = DWRUtil.getValue(\"comboUnidadesNaoSolicitantes\");\n\tif((notSolicitante==null ||notSolicitante=='')){\n\t\talert(\"Selecione uma unidade do TRE.\");\n\t}else{\n\t\tFacadeAjax.adicionaUnidadeSolicitante(unidade,notSolicitante);\n\t\tcarregaUnidadesSolicitantes()\t\n\t}\t\n}", "function userConnect()\n {\n $.ajax({\n // On définit l'URL appelée\n url: 'http://localhost/tchat/API/index.php',\n // On définit la méthode HTTP\n type: 'GET',\n // On définit les données qui seront envoyées\n data: {\n action: 'userAdd',\n userNickname: $('#userNickname').val()\n },\n // l'équivalent d'un \"case\" avec les codes de statut HTTP\n statusCode: {\n // Si l'utilisateur est bien créé\n 201: function (response) {\n // On stocke l'identifiant récupéré dans la variable globale userId\n window.userId = response.userId;\n // On masque la fenêtre, puis on rafraichit la liste de utilisateurs\n // (à faire...)\n },\n // Si l'utilisateur existe déjà\n 208: function (response) {\n // On fait bouger la fenêtre de gauche à droite\n // et de droite à gauche 3 fois\n // (à faire...)\n }\n }\n })\n }", "function cadastrarTecnico(){\n\tvar matriculaTecnico = DWRUtil.getValue(\"comboTecnicoTRE\");\n\tvar login = DWRUtil.getValue(\"login\"); \n\tif((matriculaTecnico==null ||matriculaTecnico=='')){\n\t\talert(\"Selecione um tecnico do TRE.\");\n\t}else{\n\t\tFacadeAjax.integrarTecnico(matriculaTecnico,login);\n\t\tcarregaTecnicos();\t\n\t}\n\t\n}", "function enviar() {\n const formulario = document.getElementById('formulario');\n \n formulario.addEventListener('submit', (e) => {\n const correoValue = correo.value.trim();\n const contraseñaValue = contraseña.value.trim();\n \n e.preventDefault();//evita que se envien los datos y se refresque la pagina\n \n if (correoValue === \"\") {\n alert(\"Correo vacio\");\n }if (contraseñaValue === \"\") {\n alert(\"Contraseña vacia\")\n }\n \n if (campos.correo && campos.contraseña) {\n //Enviar AJAX\n buscarUsuario(formulario);\n \n //Iniciar sessión\n\n //Cargando\n document.querySelector('#cargando').classList.remove('invisible');//Logo de carga\n document.querySelector('#loguearse').classList.add('invisible');//Esconde el texto del boton\n }else{\n alert(\"No se pudo iniciar sesión\");\n }\n \n }); \n}", "function comprobar_login(){\n\n //obtenemos los valores de las casillas\n var usuario = document.getElementById(\"user\").value;\n var contrasena = document.getElementById(\"password\").value;\n console.log(usuario);\n console.log(contrasena);\n var casillasCompletas = comprobar_casillas();\n console.log(casillasCompletas);\n if(casillasCompletas){\n //hacemos la peticion al servidor con los datos\n fetch(\"/sesion/acceso?user=\" + usuario + \"&pass=\" + contrasena).then(function(respuesta){\n\n // comparamos la respuesta para saber si el usuario existe o no\n if(respuesta.status == 200){//si todo va correcto, respuesta.ok seria\n //equivalente pero devolveria true o false\n cuadro.style.display = 'none';\n\n respuesta.json().then(function (datos){\n\n document.cookie = 'email=' + datos.email;//añadimos el correo a la cookie, tienen la funcion de nombre de usuario\n document.cookie = 'contrasena=' + datos.contrasena;//añadimos la contraseña a la cookie\n document.cookie = 'id_usuario=' + datos.id_usuario;//anyadimos el id del usuario a las cookies\n\n if(datos.activo == 'false'){// si el usuario no ha activado la cuenta todavia\n location.href = \"/perfil\"//va a la pagina de perfil\n }else{//por el contrario, si activo vale true, la cuenta esta activa y va directamente a campos\n location.href = \"/mapa\" // va a la pagina de campos\n }\n });\n }else if(respuesta.status == 401){//si el estado es 401, muestra un mensaje al usuario\n cuadro.style.display = 'block';\n aviso.innerHTML = \"Error en los datos\";\n }else{// si no es ninguno de los dos estados anteriores debera ser el 500 debido a un error con la base de datos.\n //tambien puede tratarse de un error de red.\n cuadro.style.display = 'block';\n aviso.innerHTML = \"Error en el servidor, inténtelo mas tarde\";\n }\n });\n }\n}", "function cambiarDatosDeUsuarioEnElSitio(){\n\tvar mail=document.getElementById(\"formUserEmail\").value;\n\tvar firstName=document.getElementById(\"formUserFirstName\").value;\n\tvar lastName=document.getElementById(\"formUserLastName\").value;\n\tvar nickname=document.getElementById(\"formUserNick\").value;\n\tif(mail.length < 1 || firstName.length < 1 || lastName.length < 1 || nickname.length < 1 ){\n\t\t\tvar camposVacios=\"\";\n\t\t\tif(mail.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Correo electrónico</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (firstName.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Nombre</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (lastName.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Apellido</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (nickname.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Apodo</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\t// Termina el tipo de mensaje\n\t\t\tavisoEmergenteJugaPlay(\"<span class='trn'>Campos vacíos</span>\",camposVacios);\n\treturn false ;\n\t}// Si paso es que los campos estan bien\n\tvar json=JSON.stringify({ \"user\": { \"first_name\": firstName,\"last_name\": lastName, \"email\": mail, \"nickname\":nickname } });\n\tif(startLoadingAnimation()==true){\n\tmensajeAlServidorConContenidoRegistro(json);}\n}", "function registro(){ \r\n limpiarMensajesError();//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombre = document.querySelector(\"#txtNombre\").value;\r\n let nombreUsuario = document.querySelector(\"#txtNombreUsuario\").value;\r\n let clave = document.querySelector(\"#txtContraseña\").value;\r\n let perfil = Number(document.querySelector(\"#selPerfil\").value); //Lo convierto a Number directo del html porque yo controlo qu'e puede elegir el usuario\r\n let recibirValidacion = validacionesRegistro (nombre, nombreUsuario, clave); //\r\n if(recibirValidacion && perfil != -1){ \r\n crearUsuario(nombre, nombreUsuario, clave, perfil);\r\n if(perfil === 2){\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n alumnoIngreso();\r\n }else{\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado\r\n docenteIngreso();//Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n }\r\n }\r\n if(perfil === -1){\r\n document.querySelector(\"#errorPerfil\").innerHTML = \"Seleccione un perfil\";\r\n }\r\n}", "function agregar(usuario) {\n let data = {\n 'thing': usuario\n };\n\n fetch(`${baseUrl}/${groupID}/${collectionID}`, {\n 'method': 'POST',\n 'headers': {\n 'content-type': 'application/json'\n },\n 'body': JSON.stringify(data)\n }).then(res => {\n return res.json();\n }).then(dato => {\n precargarUsers();\n }).catch((error) => {\n console.log(error);\n })\n\n document.querySelector(\"#userName\").value = \"\";\n document.querySelector(\"#resetsUser\").value = \"\";\n document.querySelector(\"#viplevelUser\").value = \"\";\n document.querySelector(\"#levelUser\").value = \"\";\n }", "function iniciar() {\n \n }", "function nombreCliente(){\n //obtenes el nombre del input.\n const nombre = document.querySelector('#nombre').value ;\n //Agregarlo a cita\n cita.nombre = nombre;\n}", "function crearUsuario(){\n var nombre = document.getElementsByName(\"nombre\")[0];\n document.cookie = nombre.value + \"=\" + nombre.value + \";path=/\";\n document.cookie = nombre.value + \"p=\" + document.getElementById(\"password\").value + \";path=/\";\n alert(\"Se creado el usuario \" + nombre.value);\n //Si ya hay una sesion iniciada permite seguir creando usuarios sino te redirige a la pantalla de login\n if(sesion==null){\n window.location='index.html';\n }else {\n window.location='formulario.html';\n }\n}", "function ConvalidaLogin() {\r\n\t\t// definisce la variabile booleana blnControllo e la setta a false\r\n\t\tvar blnControllo = false;\r\n \r\n\t\t// controllo del nome utente inserito \r\n if (document.getElementById(\"txtNomeUtente\").value.length ==0) {\r\n\t\t\t//alert (\"Non hai inserito il nome utente!\");\r\n\t\t\tsetTimeout(\"document.getElementById(\\\"txtNomeUtente\\\").focus();\", 1);\t\t\t// la setTimeout serve a farlo funzionare con FF\r\n\t\t\treturn;\r\n } \r\n\t\telse {\r\n\t\t\tblnControllo = true;\r\n }\r\n \r\n\t\t// controllo della password inserita\r\n if (document.getElementById(\"txtPassword\").value.length ==0) {\r\n\t\t\t//alert (\"Non hai inserito la password!\");\r\n\t\t\tsetTimeout(\"document.getElementById(\\\"txtPassword\\\").focus();\", 1);\t\t\t// la setTimeout serve a farlo funzionare con FF\r\n\t\t\treturn;\r\n } \r\n\t\telse {\r\n blnControllo = true;\r\n }\r\n \r\n return;\r\n } // chiusura della function ConvalidaLogin\t", "function saludarUsuario(nombreUsuario){\n\n console.log(\"Buenas tardes \"+nombreUsuario);\n\n}", "function cargarNombreEnPantalla() {\n if (loggedIn) {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + usuarioLogeado.nombre;\n }\n}", "function Registrar(){\r\n if(txtCor.value==\"\" || txtCor.value==null){\r\n alert(\"Ingrese el correo\");\r\n txtCor.focus();\r\n }else if(txtCon.value==\"\" || txtCon.value==null){\r\n alert(\"Ingrese la contraseña\");\r\n txtCon.focus();\r\n }else{\r\n var cor=txtCor.value;\r\n var con=txtCon.value;\r\n \r\n auth.createUserWithEmailAndPassword(cor,con)\r\n .then((userCredential) => {\r\n alert(\"Se registro el usuario\");\r\n Limpiar();\r\n })\r\n .catch((error) =>{\r\n alert(\"No se registro el usuario\");\r\n var errorCode = error.code;\r\n var errorMessage = error.message;\r\n });\r\n\r\n }\r\n}", "function get_sucursal(){\n\tvar ids=sessionStorage.getItem(\"id\");\n\tvar idd=JSON.parse(ids);\n\tvar parametros = {\n \"id\" : idd.id,\n \"user\": idd.nombre,\n \"suc\": idd.s\n \t};\n\t$.ajax({\n\t\t/*paso los paramentros al php*/\n\t\tdata:parametros,\n\t\turl: 'getsucursal.php',\n\t\ttype:'post',\n\t\t/*defino el tipo de dato de retorno*/\n\t\tdataType:'json',\n\t\t/*funcion de retorno*/\n\t\tsuccess: function(data){\n\t\t\t/*Agrego el numero de sucursal y los datos respectivos en la etiqueta para mostrar al usuario \n\t\t\tla sucursal en la que se esta registrando el nuevo usuario*/\n\t\t\tvar cadenaP=data['name']+\" \"+data['dir'];\n\t\t\t$(\"#suc\").val(data['id']);\n\t\t\t$(\"#label_suc\").html(cadenaP);\n\t\t}\n\t});\n}", "function userStudent() {\n //Chiedo i dati\n let userName = prompt(\"Inserisci il nome\");\n let userSurname = prompt(\"Inserisci il cognome\");\n let userEta = parseInt(prompt(\"Inserisci l'età\"));\n //Creo oggetto per l'utente\n userInfo = {};\n userInfo.nome = userName;\n userInfo.cognome = userSurname;\n userInfo.eta = userEta;\n}", "function acceder(){\r\n limpiarMensajesError()//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombreUsuario = document.querySelector(\"#txtUsuario\").value ;\r\n let clave = document.querySelector(\"#txtClave\").value;\r\n let acceso = comprobarAcceso (nombreUsuario, clave);\r\n let perfil = \"\"; //variable para capturar perfil del usuario ingresado\r\n let i = 0;\r\n while(i < usuarios.length){\r\n const element = usuarios[i].nombreUsuario.toLowerCase();\r\n if(element === nombreUsuario.toLowerCase()){\r\n perfil = usuarios[i].perfil;\r\n usuarioLoggeado = usuarios[i].nombreUsuario;\r\n }\r\n i++\r\n }\r\n //Cuando acceso es true \r\n if(acceso){\r\n if(perfil === \"alumno\"){\r\n alumnoIngreso();\r\n }else if(perfil === \"docente\"){\r\n docenteIngreso();\r\n }\r\n }\r\n}", "function mostrarInicio(usuario,permiso) {\n\tconsole.log('Mostramos Inicio');\n\n\tlet url = \"http://localhost:3000/usuario\";\n\n\tlet promise = llamadaAjax(\"GET\",url);\n\n\tpromise.then((data) => {\n\t\tconsole.log('Obteniendo datos.');\n\n\t\tconsole.log(data);\n\t\t//let json_temp={\"User Data\":JSON.parse(data)};\n\t\t//printUsuarios(json_temp,\"#logged\");\n\n\t\tif(permiso===\"Admin\"){\n\t\t\tprintUsuarios({\"usuarios\":JSON.parse(data)},\"#usuarios\");\n\t\t}\n\n\t\tgenerarCola(usuario,permiso);\n\n\t}, (error) => {\n\t\tconsole.log('Promesa rechazada.');\n\t\tconsole.log(error.message);\n\t\tdocument.querySelector(\"#salida\").textContent = \"Se ha producido un error\";\n\t});\n\n}", "function mostrarRegistrarseComoColaborador(){\n mostrarComo('colaborador')\n}", "function EnviarUsuario(){\n $('#lblUsuario, #lblNombreC, #lblPass, #lblPassC, #lblRol').hide();\n \n var user = $('#Usuario').val(); var nombre = $('#NombreC').val();\n var clave = $('#Pass').val(); var clave2 = $('#PassC').val();\n var rol = $('#rol option:selected').val();\n \n //alert(rol);\n \n if (user==\"\"){$('#lblUsuario').show(); return false;\n }else if (nombre==\"\"){$('#lblNombreC').show(); return false;\n }else if (clave==\"\"){$('#lblPass').show();return false;\n }else if (clave2==\"\" || clave!=clave2) {$('#lblPassC').show();return false;\n }else if (rol==\"\") {$('#lblRol').show();return false;}\n\n $('#Adduser').hide();\n \n $.ajax({\n url: \"GuardarUsuario/\"+user+\"/\"+nombre+\"/\"+clave+\"/\"+rol,\n type: \"post\",\n async:true,\n success:\n function(){\n swal({title: \"EL USUARIO SE AGREGO CORRECTAMENTE!\",\n type: \"success\",\n confirmButtonText: \"CERRAR\",\n }).then(\n function(){gotopage(\"Usuarios\");}\n )\n }\n });\n}", "function _inicioSesionUsuario(aUsuario){\n\n var usuarioValido = false.\n tipoUsuario = '';\n\n for (var i = 0; i < usuarios.length; i++) {\n if (usuarios[i].correo == aUsuario.correo && usuarios[i].contrasenna == aUsuario.contrasenna) {\n if (usuarios[i].tipo == 'administrador') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }else if (usuarios[i].tipo == 'estudiante') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }else if (usuarios[i].tipo == 'asistente') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }else if (usuarios[i].tipo == 'profesor') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }\n }\n }\n\n if (usuarioValido == true) {\n return tipoUsuario;\n alert(tipoUsuario);\n }else {\n alert('Usuario No existe');\n }\n\n\n }", "function login(params) {\n let query = 'SELECT * FROM USUARIO_SISTEMA WHERE CORREO = $1 AND CONTRASENA = $2';\n let {correo, contrasena} = params.datos,\n values = [correo, contrasena]\n return database.query(query, values)\n .then(response => {\n return response.rows[0];\n })\n .catch(err => { console.log(\"errorr: \" + err) });\n}", "function loginPostgres() {\n\n var usuario=validarFormulario();\n if(usuario != null) {\n usuarioActual=usuario;\n conectarPOSTGRES(usuario);\n }\n else { alert(\"Error verifique que el formulario este lleno\");}\n}", "function usuario() {\n entity = 'usuario';\n return methods;\n }", "iniciarSesion() {\n this.presentLoadingA();\n this.Servicios.userState().subscribe((user) => {\n this.Servicios.iniciarsesion(this.account.email, this.account.password).then(res => {\n this.cargandoA.dismiss();\n this.Servicios.getUsuario(user.uid).subscribe(res => {\n const UsuarioA = res.payload.val();\n console.log(UsuarioA);\n if (UsuarioA !== undefined) {\n this.account.email = \"\";\n this.account.password = \"\";\n console.log(UsuarioA.admin);\n if (UsuarioA.admin == true) {\n this.navCtrl.navigateRoot('/admin');\n }\n else {\n this.navCtrl.navigateRoot('/mainmenu');\n }\n }\n else {\n console.log(\"Error al iniciar\");\n }\n });\n this.storage.set('log', 'si');\n }).catch(err => {\n this.cargandoA.dismiss();\n console.log(\"Error al iniciar\");\n });\n });\n }", "function start() {\n if (sessionStorage.getItem(\"usuarioSessionStore\") === null) {\n datos.innerHTML = `Participante no registrado... tenga en cuenta`;\n }else{\n createNombre();\n }\n}", "function usuario(){\n\tvar nombreDelUsuario = document.getElementById(\"user\");\n\tasignarNombre(nombreDelUsuario);\n}", "function saludar()\n {\n // Recojo el valor introducido por el usuario\n let user = oDom.eInputName.value\n // Saco en el html, en la etiqueta output introduzco el valor que teniamos en console antes\n oDom.eOutSaludo.innerHTML = `Hola ${user}` // Podria poner un parrafo = `<p>Hola ${user}</p>`\n console.log(user)\n //console.log(`Hola ${user}`)\n }", "function cargarUsuarioPersistente(){\n\tvar db = obtenerBD();\n\tvar query = 'SELECT * FROM Usuario';\n\tdb.transaction(\n\t\tfunction(tx){\n\t\t\ttx.executeSql(\n\t\t\t\tquery, \n\t\t\t\t[], \n\t\t\t\tfunction (tx, resultado){\n\t\t\t\t\tvar CantFilas = resultado.rows.length;\t\t\t\t\t\n\t\t\t\t\tif (CantFilas > 0){\n\t\t\t\t\t\tIdUsuario = resultado.rows.item(0).ID;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tNomUsuario = resultado.rows.item(0).Nombre;\n\t\t\t\t\t\tPassword = resultado.rows.item(0).Password;\n\t\t\t\t\t\tIsAdmin = resultado.rows.item(0).IsAdmin;\n\t\t\t\t\t\tlogin();\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}, \n\t\t\t\terrorBD\n\t\t\t);\n\t\t},\n\t\terrorBD\n\t);\n}", "function AlumnoCrear() {\n window.location = `./AlumnoCrear.html?usu_id=${params.get('usu_id')}`;\n}", "function asignarUsuario(){\n usuarioActual = localStorage.getItem('nombre');\n document.getElementById(\"nombreUsuario\").value = usuarioActual;\n}", "function mostrarBienvenidaUsuario() {\n $(\"#pHome\").html(`Hola, ${usuarioLogueado.nombre}!`);\n}", "function contrata(){\n url = '..\\\\negocio\\\\registrar-contrato.php';\n adjunto = {'id_usuario': id_usuario,\n 'tipo_usuario': tipo_usuario,\n 'nombre_servicio': document.getElementById('salida_nombre').innerHTML};\n $.post(url, adjunto)\n .done(function(respuesta){\n if(respuesta > 0){//debe ser el id del contrato----------------OJO!!\n alert('ENHORABUENA! ya has contratado el servicio.');\n }else {\n alert('LO SENTIMOS NO has podido contratar el servicio.');\n }\n desactivar_contratar(respuesta);\n mostrar_contratos_en_vigor();//OJO esta debe ser la última sentencia\n });\n}", "function enviarComentario() {\n\tif (ValidarDatosObligatorios()) {\n\t\tvar token = ObtenerToken();\n\n\t\tvar dataJSON = {\n\t\t\tSolicitudId: $(\"#txtSolicitudId\").val(),\n\t\t\tRespuesta: $(\"#txtComentarioNuevo\").val(),\n\t\t}\n\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: urlPQRS + \"Solicitudes/Respuesta\",\n\t\t\tbeforeSend: function (request) {\n\t\t\t\trequest.setRequestHeader(\"Authorization\", token);\n\t\t\t},\n\t\t\tdata: JSON.stringify(dataJSON),\n\t\t\tcrossDomain: true,\n\t\t\tcontentType: 'application/json',\n\t\t\tdataType: 'json',\n\t\t\tasync: false,\n\t\t\tsuccess: function (data) {\n\t\t\t\tif (data != null) {\n\t\t\t\t\tdocument.getElementById(\"mensajeResultados\").innerHTML = data.Mensaje;\n\t\t\t\t\t$(\"#mensajeResultadosContainer\").removeClass('hidden');\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\n\t\t\t\t$(\"#txtComentario\").val('');\n\n\t\t\t},\n\t\t\terror: function (data) {\n\t\t\t\tdocument.getElementById(\"mensajeResultados\").innerHTML = 'Se presentó un error';\n\t\t\t\t$(\"#mensajeResultadosContainer\").removeClass('hidden');\n\t\t\t},\n\t\t});\n\t}\n}", "function getDatos() {\n\tvar comando= {\n\t\t\tid : sessionStorage.getItem(\"idUsuario\")\n\t};\n\t\n\tvar request = new XMLHttpRequest();\t\n\trequest.open(\"post\", \"GetDatosUsuario.action\");\n\trequest.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\trequest.onreadystatechange=function() {\n\t\tif (request.readyState==4 && request.status==200) {\n\t\t\tvar respuesta=JSON.parse(request.responseText);\n\t\t\trespuesta=JSON.parse(respuesta.resultado);\n\t\t\tif (respuesta.tipo==\"error\") {\n\t\t\t\talert(\"Ocurrió un error al recuperar los datos: \" + respuesta.mensaje);\n\t\t\t} else {\n\t\t\t\tvar email=document.getElementById(\"email\")\n\t\t\t\tvar nombre=document.getElementById(\"nombre\");\n\t\t\t\tvar apellido1=document.getElementById(\"apellido1\");\n\t\t\t\tvar apellido2=document.getElementById(\"apellido2\");\n\t\t\t\tvar fechaDeAlta=document.getElementById(\"fechaDeAlta\");\n\t\t\t\tvar telefono=document.getElementById(\"telefono\");\n\t\t\t\tvar idUbicacion=document.getElementById(\"idUbicacion\");\n\t\t\t\tif (email!=null) email.value=respuesta.email;\n\t\t\t\tif (nombre!=null) nombre.value=respuesta.nombre;\n\t\t\t\tif (apellido1!=null) apellido1.value=respuesta.apellido1;\n\t\t\t\tif (apellido2!=null) apellido2.value=respuesta.apellido2;\n\t\t\t\tif (fechaDeAlta!=null) fechaDeAlta.value=respuesta.fechaDeAlta;\n\t\t\t\tif (telefono!=null) telefono.value=respuesta.telefono;\n\t\t\t\tif (idUbicacion!=null) idUbicacion.value=respuesta.idUbicacion;\n\t\t\t}\n\t\t}\n\t};\n\tvar pars=\"command=\" + JSON.stringify(comando);\n\trequest.send(pars);\n}", "function ocultarLoginRegistro() {\n /* Oculta uno de los Divs: Login o Registro, según cuál link se haya clickeado */\n var clickeado = $(this).attr(\"alt\");\n var itemClickeado = $(\"#\" + \"div\" + clickeado);\n itemClickeado.removeClass(\"hidden\").siblings(\"div\").addClass(\"hidden\");\n $(\"#txt\" + clickeado + \"Nombre\").focus();\n $(\"#div\" + clickeado + \"Mensaje\").html(\"\");\n }", "function mostrarUsuario(idsuscriptor){\n $(\"#idsuscriptor_usuario\").val(idsuscriptor);\n\n $.post(\"views/ajax/admin_panel.php?op=mostrarAdmin\", {\n idsuscriptor: idsuscriptor\n }, function(data, status) {\n data = JSON.parse(data);\n\n mostrarformUsuario(true);\n //Como estan definidos los campos en la base de datos\n $(\"#idusuario_suscriptor\").val(data.idusuario_suscriptor);\n $(\"#nombre_completo\").val(data.nombre_completo);\n $(\"#email\").val(data.email);\n\n });\n\n\n}", "function crearDatosInspector(){\n\tprobar_conexion_red();\n\tvar codigo=$('#txt_codigo').val();\n\tvar nombre_usuario=$('#txt_nombre_usuario').val();\n\tvar cedula=$('#txt_cedula').val();\n\tvar nombre=$('#txt_nombre').val();\n\tvar apellido=$('#txt_apellido').val();\n\tvar correo=$('#txt_correo').val();\n\tvar rol=$('#txt_rol').val();\n\t\n\tif (cedula!=\"\" && nombre!=\"\" && apellido!=\"\" && correo!=\"\" && rol!=\"\"){\n\t\tif (codigo != \"Procesando, espere por favor...\") {\n\t\t\t$.post('http://www.montajesyprocesos.com/inspeccion/servidor/php/crear_inspector.php',{\n\t\t\t\tCaso:'Crear',\n\t\t\t\tId: codigo,\n\t\t\t\tUsuario: nombre_usuario,\n\t\t\t\tCedula: cedula,\n\t\t\t\tNombre: nombre,\n\t\t\t\tApellido: apellido,\n\t\t\t\tCorreo: correo,\n\t\t\t\tRol: rol\n\t\t\t},function(e){\t\t\t\t\t\t\n window.localStorage.setItem('codigo_inspector', codigo); //se crea la variable persistente del codigo del inspector\n crearTablaUsuario(codigo,nombre_usuario,cedula,nombre,apellido,correo,rol);\n addItemUsuario(codigo,nombre_usuario,cedula,nombre,apellido,correo,rol); //agregamos el usario a la BD\n crearTablaConsecutivoAscensores();\n addItemConsecutivoAscensores(codigo, 0);\n crearTablaConsecutivoEscalerasAndenes();\n addItemConsecutivoEscalerasAndenes(codigo, 0);\n crearTablaConsecutivoPuertas();\n addItemConsecutivoPuertas(codigo, 0);\n\t\t\t});\t\n\t\t} else {\n if (numeroUsuarios > 0) {\n if(navigator.notification && navigator.notification.alert){\n navigator.notification.alert(\"Error = No tiene conexión a la base de datos. Contacte al administrador del sistema!\", null, \"Montajes & Procesos M.P SAS\", \"Ok :)\");\n location.href='../websites/crear_inspector.html';\n }else{\n alert(\"Error = No tiene conexión a la base de datos. Contacte al administrador del sistema! :)\");\n location.href='../websites/crear_inspector.html';\n } \n }\n\t\t}\t\n\t}\n}", "function validaLogin(){\n \n if(document.getElementById(\"usuario\").value == \"dueño\"){\n /*window.open(\"DuenioPrincipal.html\", \"_self\"); /*Con resergol no funciona*/\n window.open(\"DuenioPrincipal.html\", \"\"); \n }\n else{\n \n }\n }", "function login () {\n \n var value_email_login = document.getElementById('login_email').value;\n var value_num_afiliacion_login = document.getElementById('login_num_afiliacion').value;\n\n if (value_email_login && value_num_afiliacion_login) {\n\n var objUsuario = Usuario(value_email_login, value_num_afiliacion_login);\n\n var objUsuario_json = JSON.stringify(objUsuario);\n \n objAjax = AJAXCrearObj();\n objAjax.open('GET', './php/login_usuario.php?objUsuario_json='+objUsuario_json, true); // llamamos al php\n objAjax.send();\n objAjax.onreadystatechange=responder_login;\n\n } else {\n\n alert(\"Rellene todos los campos\");\n }\n}", "function IdCuenta() {\n\n if (usuario.user.id) {\n console.log('entro')\n axios.get(`http://${URL}/api/account/?userId=${usuario.user.id}`)\n .then((resp) => {\n // console.log('LO QUE SERIA LA CUENTA', resp.data.data.id)\n setIdCuenta(resp.data.data.id)\n })\n .catch(error => {\n console.log(error.response)\n })\n\n }\n\n }", "function enviarSolicitud(datos){\n socket.emit(\"nuevaSolicitud\", datos, function(data){\n if(data['estado']){\n idSolicitud = data['idSolicitud'];\n buscarFleteros();//Buscamos choferes de la bd\n }else{\n alert(\"Lo sentimos, nuestro sistema no esta disponible.\")\n } \n });\n }", "function persona(usr,contra,ip,puert) {\n this.usuario=usr;\n this.contraseña=contra;\n this.IP =ip;\n this.puerto=puert;\n}", "function preenche(){\n if(comentario.comentario==\"\"){\n c.email.innerText = \"user: \" + comentario.usuario.email;\n c.textoComentario.innerHTML = 'comentario apagado';\n c.botaoEnviarComentario = c.botoes.children[0];\n }else{\n c.email.innerText = \"user: \" + comentario.usuario.email;\n c.textoComentario.innerHTML = comentario.comentario;\n c.botaoEnviarComentario = c.botoes.children[0];\n }\n }", "function crearUsuario(req, res){\n // Instanciar el objeto Usuario \n var usuario = new Usuario();\n\n // Guardar el cuerpo de la petición para mejor acceso de los datos que el usuario esta enviando\n // parametros = {\"nombre\": \"\", \"apellido\": \"\", \"correo\": \"\", \"contraseña\": \"\"}\n\n var parametros = req.body;\n\n //\n \n usuario.nombre = parametros.nombre;\n usuario.apellido = parametros.apellido;\n usuario.correo = parametros.correo;\n usuario.contrasena = parametros.contrasena;\n usuario.rol = \"usuario\";\n usuario.imagen = null;\n\n // Guardar y validar los datos\n // db.coleccion.insert()\n usuario.save((err, usuarioNuevo)=>{\n if(err){\n // El primner error a validar sera a nivel de servidor e infraestructura\n // para esto existen states o estados.\n res.status(500).send({ message: \"Error en el servidor\"});\n } else {\n if(!usuarioNuevo){\n // 404 -> Pagina no encontrada\n // 200 -> Ok pero con una alerta indicando que los datos invalidos\n res.status(200).send({message: \"No fue posible realizar el registro\"});\n } else {\n res.status(200).send({usuario: usuarioNuevo});\n }\n }\n });\n\n}", "function selUsuario(datosUsuario){\n datos = datosUsuario.split(\"-\");\n idPersona = datos[0];\n loginUsuario = datos[1];\n idSistema=$('idSistema').value;//idSistema de la ventana de buscador de personas\n var url = '../../ccontrol/control/control.php';\n var data = 'p1=listaDetallePermiso&p2=' + idSistema + '&p3=' + idPersona;\n new Ajax.Request (url,\n {method : 'get',\n parameters : data,\n onLoading : function(transport){est_cargador(1);},\n onComplete : function(transport){est_cargador(0);\n Windows.close(\"Div_buscador3\");\n $('contenido_detalle').innerHTML=transport.responseText;\n $('login_usuario').value=loginUsuario;\n $('idpersona').value=idPersona;\n $('nombre_formulario_permiso').value='';\n $('nombre_formulario_permiso').focus();\n }\n }\n )\n}", "function comprobar_casillas (){\n //obtenemos los valores de las casillas\n var usuario = document.getElementById(\"user\").value;\n var contrasena = document.getElementById(\"password\").value;\n\n if(usuario == \"\" || contrasena == \"\"){\n cuadro.style.display = 'block';\n aviso.innerHTML = \"Falta introducir datos\";\n console.log('dentro de aviso')\n return false\n }\n return true;\n}", "async function buscarUsuario(email){\n \n //insere os relatorios \n var resposta = await usarApi(\"GET\", \"http://localhost:8080/usuarios/cosnultaremail/\"+email); \n var usuario = JSON.parse(resposta);\n\n var idDestinatario = usuario.idUsuario;\n now = new Date();\n\n var relatorio = {\n titulo: $(\"#idTitulo\").val(),\n destinatario: idDestinatario,\n texto: $(\"#texto-area\").val(),\n dataRelatorio: now,\n fk_usuario: idUsuario\n }\n cadastrar(relatorio);\n}", "function anonima(){\r\n \r\n var http=new XMLHttpRequest();\r\n http.onreadystatechange=function(){\r\n console.log(\"llegó respuesta\", http.readyState, http.status);\r\n if(http.readyState==4){\r\n if(http.status===200){\r\n console.log(\"tenemos respuesta\",http.responseText);\r\n \r\n }\r\n /* funcion anonima. **/\r\n }\r\n }\r\n var pass=document.getElementById(\"pass\").value;\r\n var name=document.getElementById(\"txtUser\").value;\r\n console.log(pass);\r\n console.log(name);\r\n http.open(\"GET\",\" http://localhost:1337/login?usr=\"+pass+\"&pass=\"+name);\r\n http.send();\r\n}", "function AgregarUsuario(admin)\n{ \n var form;\n form='<div class=\"EntraDatos\">';\n form+='<table>';\n form+='<thead>';\n form+='<tr><th colspan=\"2\">'; \n form+='Nuevo Usuario'; \n form+='</th></tr>'; \n form+='</thead>'; \n form+='<tbody>';\n form+='<tr>';\n form+='<td width=\"50%\">'; \n form+='<label>Cédula de Identidad:</label>';\n form+='<input type=\"text\" id=\"CI\" class=\"Editable\" tabindex=\"1000\" title=\"Introduzca el Número de Cédula\"/>';\n form+='<input type=\"button\" onclick=\"javascript:BuscarUsuario()\" tabindex=\"1001\" title=\"Buscar\" value=\"Buscar\"/>';\n form+='</td>';\n form+='<td>';\n form+='<label>Correo Electrónico:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Correo\" title=\"Correo Electrónico\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='</tr>';\n form+='<tr>';\n form+='<td>';\n form+='<label>Nombre:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Nombre\" title=\"Nombre\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='<td>';\n form+='<label>Apellido:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Apellido\" title=\"Apellido\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='</tr>'; \n form+='<tr>';\n form+='<td colspan=\"2\">';\n form+='<input type=\"hidden\" id=\"id_unidad\" />'; \n form+='<label>Unidad Administrativa:</label>';\n form+='<center><input type=\"text\" class=\"Campos Editable\" id=\"Unidad\" title=\"Unidad Administrativa\" tabindex=\"1002\"/></center>';\n form+='</td>'; \n form+='</tr>';\n form+='<tr>';\n form+='<td>';\n form+='<label>Nivel de Usuario:</label>';\n form+='<select class=\"Campos Editable\" id=\"Nivel\" title=\"Seleccione el Nivel del Usuario\" tabindex=\"1003\">';\n form+='<option selected=\"selected\" value=\"0\">[Seleccione]</option>';\n form+='</select>';\n form+='</td>';\n form+='<td>';\n if (admin==1)\n {\n form+='<label>Rol de Usuario:</label>';\n form+='<div class=\"ToggleBoton\" onclick=\"javascript:ToggleBotonAdmin()\" title=\"Haga clic para cambiar\">';\n form+='<img id=\"imgAdmin\" src=\"imagenes/user16.png\"/>';\n form+='</div>';\n form+='<span id=\"spanAdmin\">&nbsp;Usuario Normal</span>'; \n }\n form+='<input type=\"hidden\" id=\"hideAdmin\" value=\"f\" />'; \n form+='</td>';\n form+='</tr>'; \n form+='</tbody>';\n \n form+='<tfoot>';\n form+='<tr><td colspan=\"2\">';\n form+='<div class=\"BotonIco\" onclick=\"javascript:GuardarUsuario()\" title=\"Guardar Usuario\">';\n form+='<img src=\"imagenes/guardar32.png\"/>&nbsp;'; \n form+='Guardar';\n form+= '</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';\n form+='<div class=\"BotonIco\" onclick=\"javascript:CancelarModal()\" title=\"Cancelar\">';\n form+='<img src=\"imagenes/cancel.png\"/>&nbsp;';\n form+='Cancelar';\n form+= '</div>';\n form+='</td></tr>';\n form+='</tfoot>';\n form+='</table>'; \n form+='</div>';\n $('#VentanaModal').html(form);\n $('#VentanaModal').show(); \n $('#CI').focus();\n \n selector_autocompletar(); \n}", "function Usuario(nomb, apell, edad = 1) {\n this.nombre = nomb;\n this.apellido = apell;\n this.edad = edad;\n}", "function buscarClienteOnClick(){\n if ( get('formulario.accion') != 'clienteSeleccionado' ) {\n // var oid;\n // var obj = new Object();\n var whnd = mostrarModalSICC('LPBusquedaRapidaCliente','',new Object());//[1] obj);\n if(whnd!=null){\n \n //[1] }else{\n /* posicion N°\n 0 : oid del cliente\n 1 : codigo del cliente\n 2 : Nombre1 del cliente\n 3 : Nombre2 del cliente\n 4 : apellido1 del cliente\n 5 : apellido2 del cliente */\n \n var oid = whnd[0];\n var cod = whnd[1];\n //[1] var nombre1 = whnd[2];\n //[1] var nombre2 = whnd[3];\n //[1] var apellido1 = whnd[4]; \n //[1] var apellido2 = whnd[5]; \n \n // asigno los valores a las variables y campos corresp.\n set(\"frmFormulario.hOidCliente\", oid);\n set(\"frmFormulario.txtCodigoCliente\", cod);\n \n } \n }\n }", "function crear_usuario()\n{\n\t// se va al metodo de validacion\n\tvalidacion();\n\t//debugger;\n\t// si validar es igual a nulo\n\tif(validar === null){\n\t\t// se va a crear un nuevo usuario\n\t\tusuario = [];\n\t\t// se obtiene la contraseña\n\t\tvar contrasenna = document.getElementById(\"password\").value;\n\t\t// se optiene la repeticion de la contraseña\n\t\tvar contrasenna_repeat = document.getElementById(\"password_repeat\").value;\n\t\t// si la contraseña es vacia o nula\n\t\tif(contrasenna == \"\" || contrasenna == null){\n\t\t\t// muestra un mensaje de error\n\t\t\talert(\"No puede dejar el campo de contraseña vacio\");\n\t\t\t// si la repeticion de la contraseña es vacio o nula\n\t\t}else if(contrasenna_repeat == \"\" || contrasenna_repeat == null){\n\t\t\t// muestra un mensaje de error\n\t\t\talert(\"No puede dejar el campo de repetir contraseña vacio\");\n\t\t}else{\n\t\t\t// si la contraseña es igual a la repeticion de la contraseña\n\t\t\tif(contrasenna === contrasenna_repeat){\n\t\t\t\t// obtiene el nombre de usuario\n\t\t\t\tvar nombreU = document.getElementById(\"user\").value;\n\t\t\t\t// obtiene el nombre completo\n\t\t\t\tvar nombreFull = document.getElementById(\"fullName\").value;\n\t\t\t\t// pregunta que si el nombre de usuario es vacio o nulo\n\t\t\t\tif(nombreU == \"\" || nombreU == null){\n\t\t\t\t\t// si es asi muestra un mensaje de error\n\t\t\t\t\talert(\"No puede dejar el campo de nombre de usuario vacio\");\n\t\t\t\t\t// pregunta que si el nombre completo es vacio o nulo\n\t\t\t\t}else if(nombreFull == \"\" || nombreFull == null){\n\t\t\t\t\t// muestra un mensaje de error\n\t\t\t\t\talert(\"No puede dejar el campo de nombre completo vacio\");\n\t\t\t\t\t// si no fuera asi\n\t\t\t\t}else{\n\n\t\t\t\t\t// crea el usuario\n\t\t\t\t\tusuario.push(document.getElementById(\"numero\").value, document.getElementById(\"fullName\").value, document.getElementById(\"user\").value,\n\t\t\t\t\t\tdocument.getElementById(\"password\").value, document.getElementById(\"password_repeat\").value);\n\t\t\t\t\t// lo agrega al arreglo de usuarios\n\t\t\t\t\tUser.push(usuario);\n\t\t\t\t\t// agrega el arreglo de arreglos al localstorage con el usuario nuevo\n\t\t\t\t\tlocalStorage['usuarios'] = JSON.stringify(User);\n\t\t\t\t\t// muestra un mensaje que ya puede iniciar sesion\n\t\t\t\t\talert(\"Usuario creado ya puedes iniciar sesion\");\n\t\t\t\t\t// se va a la pagina principal\n\t\t\t\t\tlocation.href=\"tablero-de-instrucciones.html\"\n\t\t\t\t}\n\t\t\t\t// si no fuera asi\n\t\t\t}else{\n\t\t\t\t// muestra un mensaje de error donde muestra que las contraseñas son diferentes\n\t\t\t\talert(\"No puedes crear el usuario porque las contraseñas son diferentes, asegurese que sea las mismas\");\n\t\t\t}\n\t\t}\n\t\t// si no es asi pregunta que si es administrador\n\t}else if(validar === \"Entra como administracion\"){\n\t\t// si es asi no lo puede crear porque ya exite\n\t\talert(\"No puedes crear con ese nombre de usuario porque ya existe\");\n\t\t// si no es asi pregunta que si es particular\n\t}else if(validar === \"Entra como particular\"){\n\t\t// si es asi no lo puede crear porque ya exite\n\t\talert(\"No puedes crear con ese nombre de usuario porque ya existe\");\n\t\t// si no es asi pregunta si no se pudo crear\n\t}else if(validar === \"No_se_pudo_crear\"){\n\t\t// si es asi no lo puede crear\n\t\talert(\"No se pudo crear el usuario\");\n\t\t// se le asigna a validar el valor de nulo\n\t\tvalidar = null;\n\t}\n}", "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 }", "function connect() {\n console.log(sock);\n\n var user = document.getElementById(\"pseudo\").value.trim();\n if (! user) return;\n document.getElementById(\"radio2\").check = true;\n id = user;\n sock.emit(\"login\", user);\n }", "'ofertas.insert'(oferta) {\n \n // Seguridad para la acción.\n if (! this.userId) {\n throw new Meteor.Error('[Ofertas] Usuario No Autorizado');\n }\n\n let o_id = new Meteor.Collection.ObjectID();\n oferta[\"_id\"] = o_id;\n\n //Ejecutar la accion en la base de datos sobre la colleccion.\n Ofertas.insert(oferta);\n }", "function connect() {\n pseudo = pseudoInput.value.trim();\n if (pseudo.length === 0) {\n alert(\"Votre pseudo ne doit pas être vide ! \");\n return;\n }\n if (!/^\\S+$/.test(pseudo)) {\n alert(\"Votre pseudo ne doit pas contenir d'espaces ! \");\n return;\n }\n sock.emit(\"login\", pseudo);\n }", "function enviar() {\n if (!validar()) {\n mostrarMensaje(\"alert alert-danger\", \"Debe digitar los campos del formulario\", \"Error!\");\n } else if (!validarTamCampos()) {\n mostrarMensaje(\"alert alert-danger\", \"Tamaño de los campos marcados Excedido\", \"Error!\");\n } else {\n //Se envia la información por ajax\n $.ajax({\n url: 'UsuarioServlet',\n data: {\n accion: $(\"#usuariosAction\").val(),\n idUsuario: $(\"#idUsuario\").val(),\n password: $(\"#password\").val(),\n nombre: $(\"#nombre\").val(),\n apellido1: $(\"#primerApellido\").val(),\n apellido2: $(\"#segundoApellido\").val(),\n correo: $(\"#correo\").val(),\n fechaNacimiento: $(\"#fechaNacimiento\").data('date'),\n direccion: $(\"#direccion\").val(),\n telefono1: $(\"#telefono1\").val(),\n telefono2: $(\"#telefono2\").val(),\n tipo: \"normal\"\n },\n error: function () { //si existe un error en la respuesta del ajax\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador (Error del ajax)\", \"Error!\");\n },\n success: function (data) { //si todo esta correcto en la respuesta del ajax, la respuesta queda en el data\n var respuestaTxt = data.substring(2);\n var tipoRespuesta = data.substring(0, 2);\n if (tipoRespuesta === \"C~\") {\n mostrarModal(\"myModal\", \"Exito\", \"Usuario agregado Correctamente!\", \"true\");\n limpiarForm();\n } else {\n if (tipoRespuesta === \"E~\") {\n mostrarMensaje(\"alert alert-danger\", respuestaTxt, \"Error!\");\n } else {\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador\", \"Error!\");\n }\n }\n },\n type: 'POST'\n });\n }\n}", "function iniciar() {\n\tcrearEscena();\n\tcrearCamara();\n\tcrearLuces();\n\tcrearMundo();\n\tcrearCohete();\n\n\tmensaje = document.getElementById('mensaje');\t\n\tciclo();\n}", "function obtenerUsuario(idUsuario, username){\n\t//console.log(\"OBTENER DATOS\");\n\t//console.log(idUsuario);\n\t//console.log(username);\n\t$.ajax({\n\t\tsync:true,\n\t\tdata: {\n\t\t\t\"id\" : idUsuario,\n\t\t\t\"username\" : username,\n\t},\n\tdataType:'json',\n\turl: '../../mvc/usuario/obtenerusuarioconrolesbyid',\n\ttype: 'post',\t\t\n\tbeforeSend: function () {\t\n\t},\n\tsuccess: function (response) {\n\t\t//console.log(\"RESPONSE\")\n\t\t//console.log(response)\n\t\tmuestraDatosUsuario(response);\t\n\t\t},\t\n\terror: function (response) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t$(\"#resultadoGuardar\").html(\"Error\");\n\t\t//console.log(\"RESPONSE ERROR\")\n\t\t//console.log(response)\n\t\t}\t\t\n\t});\t\t\n}", "function controller_by_user(){\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t} catch(e){\n\t\t\tconsole.log(\"%cerror: %cPage: `recuperar_contrasea` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\");\n\t\t\tconsole.dir(e);\n\t\t}\n\t}", "function seleccionarUsuarioParaPW(usuario){\n document.querySelector('#idUsuarioContrasena').value = usuario[0];\n document.querySelector('#nombreUsuarioContrasena').innerHTML = usuario[1];\n document.querySelector('#emailUsuarioContrasena').innerHTML = usuario[2];\n $('#modalFormUsuarioContrasena').modal('show');\n}", "procesarControles(){\n\n }", "function asignarNombre(nombreUsuario){\n\tvar nombreU = nombreUsuario;\n\tvar elemento = document.getElementById(\"Hi_user\");\n\telemento.innerHTML = nombreU;\n}", "function abrirHorario() {\n\t\t$.ajax({\n\t\t\turl : '/acmuniandes_hor/_php/hor_core.php',\n\t\t\tdataType : 'json',\n\t\t\tdata : {\n\t\t\t\t'tipsol' : '7',\n\t\t\t},\n\t\t\ttype : 'POST',\n\t\t\tsuccess : function(response) {\n\t\t\t\tif(response) {\n\t\t\t\t\tif(response.redirect) {\n\t\t\t\t\t\t// data.redirect contains the string URL to redirect to\n\t\t\t\t\t\tdocument.location = response.redirect;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\thorarioActual = new Horario(response);\n\t\t\t\t\t\tfor(var key in horarioActual.cursos){\n\t\t\t\t\t\t\tsel = \"p\"+key;\n\t\t\t\t\t\t\thorarioActual.cursos[key].id = \"p\"+key;\n\t\t\t\t\t\t\thorarioActual.cursos[key].persistido = true;\n\t\t\t\t\t\t\tagregarCursoCalendar(horarioActual.cursos[key], false, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thorarioActual = new Horario();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function loginauthor () {\n var xhr = httpIo.httpGet(\"/api/guest\", function (data, object) {\n console.log(\"game connect suLayaess!!\");\n // console.log(data);\n Laya.beimi.user.id = JSON.parse(data).token.userid;\n connectService();\n }, function () {\n console.log(\"game connect fail !!\");\n });\n\n}", "function loginSiteMudancas() {\n imagensPaginaInicio();\n let saberAverdade = sessionStorage.getItem('Usuario');\n if (saberAverdade == \"Usuario\") {\n return \"Usuario\";\n } else if (saberAverdade == \"Empresa\") {\n return \"Empresa\";\n } else {\n return \"nao\";\n }\n}", "function altaUsuario() {\n if (validarCampos()) { //Primero comprobamos que los campos no estan vacios\n $(this).toggleClass('active'); //Activamos el spinner \n \n //Obtenemos los valores de los campos que queremos enviar\n var usuario = document.getElementById('usuario').value;\n var password = document.getElementById('password').value;\n\n //Creamos una variable con formato JSON\n var usuarioJSON = {\"usuario\": usuario, \"password\": password};\n //Creamos un objeto para almacenar los valores\n var operacion = new FormData();\n operacion.append('operacion', 'altaUsuario');\n operacion.append('usuario', JSON.stringify(usuarioJSON));\n\n //Creamos la solicitud AJAX\n //Especificamos la action a ejecutar\n var url = \"OperacionesUsuario\";\n var solicitud = new XMLHttpRequest();\n solicitud.addEventListener('load', mostrar);\n solicitud.open('POST', url, true);\n solicitud.send(operacion); \n }\n}", "function jsdomEndpointAccedi(req, res, urlFile, mail, password) {\r\n database.selectUtente(mail, password, function(giocatoreTemp) {\r\n if (giocatoreTemp != null) {\r\n giocatore = giocatoreTemp;\r\n database.terminaConnessione();\r\n let data = fs.readFileSync(\"./html/\" + urlFile);\r\n let mioJsdom = new JSDOM(data);\r\n let tagAccedi = mioJsdom.window.document.getElementById(\"Accedi\");\r\n tagAccedi.innerHTML = \"Benvenuto \" + giocatore.getUsername();\r\n let tagHumburger = mioJsdom.window.document.getElementById(\"AccediHumburger\");\r\n tagHumburger.innerHTML = \"Benvenuto \" + giocatore.getUsername();\r\n res.send(mioJsdom.window.document.documentElement.outerHTML);\r\n } else {\r\n let ritorno = fs.readFileSync(\"./html/accedi.html\");\r\n res.send(ritorno.toString());\r\n }\r\n });\r\n}", "function mostrarRegistrarseComoOrganizacion(){\n mostrarComo('organizacion')\n}", "function inicializaInterfaz(){\n $.ajax({\n url:'tipoUsuario.php',//SE CONULSTA EL TIPO DE USUARIO DEL USUARIO QUE INICIÓ SESIÓN\n data:{},\n method:'POST',\n dataType:'json',\n async:false,\n success:function(data){\n tipo_usuario=data;\n if(data=='Inhabilitado'){//SE DESPLIEGA CONTENIDO PARA USUARIO \"INHABILITADO\"\n $('#mensaje-superior').text(\"Su cuenta está inhabilitada\");\n $('#espere').text(\"No tiene acceso a ninguna funcionalidad del sitema\");\n $('#loading-contenedor').show();\n $('#map').css({'z-index':'-1'});\n $('.boton').not('.btn-7').remove();\n $('.btn-7').css({'margin-top':'400px'}).show();\n \n }if(data=='Operador'){//SE DESPLIEGA CONTENIDO PARA USUARIO \"OPERADOR\"\n $('.btn-2').remove();\n $('.btn-4').remove(); \n $('.btn-5').remove();\n $('.controles').css({'margin-top':'60vh'}); \n }\n }\n \n \n });\n \n \n}", "function controller_by_user(){\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t} catch(e){\n\t\t\tconsole.log(\"%cerror: %cPage: `formlarios_para_publicar` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\");\n\t\t\tconsole.dir(e);\n\t\t}\n\t}", "function loginMe() {\n alert(\"Chào mừng bạn tới trang web !!!\");\n var person = $('#myName').html().trim(); // take account's email => person = [email protected]\n console.log(\"Person: \" + person);\n \n socket.emit('newUser', person);\n \n}", "function obtenerPermisosUsuario(){\n\n\t\tvar user = $('select#usuario').val();\n\t\tvar table = $('select#tabla').val();\n\n\t\t$.ajax({\n\n\t\t\tdata: { user: usuario, \n\t\t\t\t\tpass: pasword,\n\t\t\t\t\tagencia: agencia,\n\t\t\t\t\tusuario: user,\n\t\t\t\t\ttabla: table},\n\t\t\t\t\turl: 'http://apirest/permisos/tabla/',\n\t\t\t\t\ttype: 'POST',\n\n\t\t\tsuccess: function(data, status, jqXHR) {\n\t\t\t\tconsole.log(data);\n\n\t\t\t\tif(data.message == 'Autentication Failure'){\n\t\t\t\t\tmostrarMensaje(\"No estas autorizado para la gestión de permisos\",\"../../index.php\");\n\t\t\t\t}else if(data.message == 'OK'){\n\t\t\t\t\tmostrarPermisos(data);\n\t\t\t\t}else{\n\t\t\t\t\tmostrarMensajePermisos(\"No estas autorizado para añadir/eliminar permisos a ese usuario\");\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\terror: function (jqXHR, status) { \n\t\t\t\tmostrarMensaje(\"Fallo en la petición al Servicio Web\",\"../../index.php\");\n\t\t\t}\n\t\t\t\n\t\t});\n\n\t}", "function usuarios(){\n window.location = config['url']+\"Administrador/modulo?vista=usuarios\"\n}", "function iniciarTablaUsuario(tx) {\n\ttx.executeSql('CREATE TABLE IF NOT EXISTS Usuario (ID unique, Nombre, Password, IsAdmin)');\t\n}" ]
[ "0.6406209", "0.6242268", "0.6239344", "0.62221223", "0.6219718", "0.6177213", "0.6155958", "0.61553663", "0.61300033", "0.611397", "0.61103666", "0.60612863", "0.6054931", "0.6033202", "0.60165095", "0.60002303", "0.5997748", "0.59918493", "0.59654176", "0.5947931", "0.5934002", "0.59246635", "0.59220505", "0.5920879", "0.5906728", "0.58766437", "0.58663523", "0.58633715", "0.5849335", "0.5842858", "0.58286434", "0.582671", "0.5826245", "0.58144015", "0.5814036", "0.5811526", "0.58014506", "0.5791083", "0.57827574", "0.5778054", "0.5775392", "0.57723385", "0.5767268", "0.5764369", "0.5760442", "0.5739397", "0.5735955", "0.5735653", "0.57338035", "0.5716237", "0.5714481", "0.57118475", "0.57088596", "0.5706808", "0.57010555", "0.57001406", "0.57001257", "0.56913924", "0.5674305", "0.56714606", "0.5670152", "0.5657111", "0.5647329", "0.5646006", "0.5639147", "0.56340057", "0.563193", "0.56282836", "0.56193155", "0.5618737", "0.5612865", "0.5612658", "0.56073326", "0.5602619", "0.5597722", "0.5594417", "0.5592853", "0.55907005", "0.55872005", "0.55721945", "0.5571485", "0.5563674", "0.55636644", "0.5561202", "0.5557206", "0.5556653", "0.55514383", "0.55451477", "0.554137", "0.55409527", "0.55391127", "0.5531612", "0.55172217", "0.5516332", "0.5513777", "0.55136305", "0.5512263", "0.550062", "0.55001765", "0.5500111", "0.5499605" ]
0.0
-1
CRIA UM MODAL COM A ANIMACAO DE ESPERA
function esperaconectar(){ var load = "\ <div id='modalLogin' class='modal' style='color:rgba(84, 150, 252, 0.97); background: transparent; box-shadow: 0 0 0 0 rgba(0, 0, 0, 0), 0 0 0 0 rgba(0, 0, 0, 0); height: 30%;'>\ <div class='modal-content'>\ <div class='preloader-wrapper big active' style='margin-left: 40%;'>\ <div class='spinner-layer spinner-blue-only'>\ <div class='circle-clipper left'>\ <div class='circle'></div>\ </div><div class='gap-patch'>\ <div class='circle'></div>\ </div><div class='circle-clipper right'>\ <div class='circle'></div>\ </div>\ </div>\ </div>\ </div>\ </div>\ "; $("main").append(load); $('#modalLogin').openModal({ dismissible: false, opacity: .5, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ClickGerarPersonagem(modo) {\n GeraPersonagem(modo);\n}", "function ClickGerarPontosDeVida(modo) {\n GeraPontosDeVida(modo);\n AtualizaGeral();\n}", "function ClickVisualizacaoModoMestre() {\n gEntradas.modo_mestre = Dom('input-modo-mestre').checked;\n AtualizaGeralSemLerEntradas();\n}", "function ini() {\n\n // --- Select empresa Mae ---- //\n $('#empresaMaeSelect') //select data from EmpresaMae\n\n $('#btnAddEmpresaMae') // add functions to btnEmpresaMae\n\n $('#nomeRefood') // inherit Data from Refood module DB\n\n\n //TODO $('#contactinput') --> a fazer pelo Ricardo Castro\n // Tudo neste grupo é feito com o plugIn Contacts.js do RCastro\n\n // $('contact')//\n\n\n\n\n // ---- Plugin HORÁRIO ---- // Insert PickUp Schedule\n\n $('#horarioInicio').clockpicker({\n placement: 'top',\n align: 'left',\n autoclose: true\n });\n }", "function IndicadorRangoEdad () {}", "function alterarAgendamento() {\n //fecha modal visualizar\n $uibModalInstance.close();\n\n //abre modal alterar evento\n vm.alterarEvento(vm.agendamento.idAgendamento);\n }", "function ouvrir() {\n creationModal();\n }", "function addAgenmento() {\n var pop = $('#md-editar-agendamento');\n\n if (pop) {\n loadClientes().then(() => {\n onNovoAgendamento();\n setPopAgendamentoTitle(\"Criar Agendamento\");\n pop.draggable();\n pop.modal();\n });\n }\n }", "function editarFormulario(){\n //Trae la grid para poder actualizar al editar\n listadoCamposFormulario = Ext.getCmp('listadoCamposFormulario');\n if (listadoCamposFormulario.getSelectionModel().hasSelection()) {\n var row = listadoCamposFormulario.getSelectionModel().getSelection()[0];\n \n\n encontrado=1;\n if(ventana==null) \n ventana = Ext.create ('App.miVentanaBanco');\n\n // Precarga el nombre e id seleccionados\n Ext.getCmp('nombreBanco').setValue(row.get('nombre'));\n Ext.getCmp('idBanco').setValue(row.get('id'));\n\n\n ventana.show();\n \n }\n }", "function btnAnularTarea_onClick() {\n\n //bcambios = false;\n\n //validaciones de campos obligatorios\n if (!view.requiredValidation()) return;\n\n view.initModal_AnularTarea();\n }", "function TargetaFormulario() {\n this.$boton_test = $('#btn_test')\n this.$empresa_id = $('#empresa_pk')\n\n this.init()\n}", "function abrirModalAlta(){\r\n cargaSelectAlta();\r\n $(\"#formularioAlta\").css(\"visibility\",\"visible\");\r\n $(\"#doc\").addClass(\"contenedorDesactivado\");\r\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}", "function editar() {\n\n\t$('#mdlAgendamento').modal('toggle');\n\t$('#mdlVerAgendamento').modal('hide');\n\n}", "function ClickGastarFeitico() {\n AtualizaGeral();\n}", "function mostrarFormulario(){\n var acum; \n //variable que permite saber que es un registrar\n encontrado=0; \n if(ventana==null) \n ventana = Ext.create ('App.miVentanaBanco')\n limpiar();\n ventana.show();\n }", "function verMangaAdm(id) {\n console.log(id);\n manga = biblioteca[id];\n document.querySelector(\"#TituloModal\").innerText = manga.titulo;\n document.querySelector(\"#tomo_Manga\").src = manga.imagen;\n document.querySelector(\"#text_autor\").innerText = manga.autor;\n document.querySelector(\"#text_categoti\").innerText = manga.categoria;\n document.querySelector(\"#text_Año\").innerText = manga.año;\n document.querySelector(\"#text_Editorial\").innerText = manga.editorial;\n document.querySelector(\"#text_Sinopsis\").innerText = manga.descripcion;\n document.querySelector('#urlDeTomo').href=manga.tomo\n document.querySelector(\"#urlDeTomo\").innerText = manga.tomo;\n document.querySelector(\"#demogText\").innerText = manga.demografia;\n \n $(\"#verManga\").modal(\"show\");\n}", "function ver_paciente(id_paciente) {\n\t var modal_pacientes_name = document.getElementById('modal_pacientes_name');\n\t var actionAddEdit = document.getElementById('actionAddEdit');\n\n\t $.ajax({\n\t type: 'post',\n\t url: base_url + '../Usuario/ver_paciente',\n\t data: {\n\t id_paciente: id_paciente\n\t },\n\t beforeSend: function() {\n\n\t },\n\t success: function(response) {\n\t actionAddEdit.setAttribute('onclick', 'paciente_formulario_editar(\\'' + id_paciente + '\\')');\n\t actionAddEdit.innerHTML = '<i class=\"fa fa-pencil\" aria-hidden=\"true\"></i> Editar';\n\t modal_pacientes_name.innerHTML = 'Visualizar paciente';\n\t document.getElementById('load_action_paciente').innerHTML = response;\n\n\t function cuantosAnios(dia, mes, anio) {\n\t var hoy = new Date();\n\t var nacido = new Date(anio, mes - 1, dia);\n\t var tiempo = hoy - nacido;\n\t var unanio = 1000 * 60 * 60 * 24 * 365;\n\t var tienes = parseInt(tiempo / unanio);\n\t return tienes;\n\t }\n\t }\n\t });\n\n\t}", "function gestioneModale(allegato, buttonSelector, modalSelector, extractorType, warnings, ev) {\n var pulsante = $(buttonSelector);\n var modale = $(modalSelector);\n var labelledby = modale.attr('aria-labelledby');\n var span = $('#' + labelledby).find('span');\n var str = spanExtractors[extractorType || 'extractorBase'](allegato);\n var alertMessaggiModale = modale.find('.alert-warning');\n \n alertMessaggiModale && warnings && impostaDatiNegliAlert(warnings, alertMessaggiModale)\n // Blocco l'evento\n ev && ev.preventDefault();\n // Popolo lo span\n span.html(str);\n pulsante.substituteHandler('click', function() {\n var href = pulsante.data('href');\n $('#hiddenUidAllegatoAtto').val(allegato.uid);\n $('#formRisultatiRicercaAllegatoAtto').attr('action', href).submit();\n pulsante.attr('disabled', 'disabled');\n });\n modale.modal('show');\n }", "function modalCaja(){\n var options = {\n 'dismissible' : false\n };\n var elems = document.querySelectorAll('#modalAperturaCaja');\n var instances = M.Modal.init(elems, options);\n $('#modalAperturaCaja').modal('open');\n}", "function manageFloors() {\n\n status = 'editting floor';\n\n // opções da janela Modal\n var title = 'Gerir andares';\n var modalClass = 'modal-md modal-cable';\n var footer = '<button type=\"button\" class=\"btn btn-sm btn-default\" data-dismiss=\"modal\">Fechar</button>';\n var body = updateFloorsInterface();\n\n buildModal(title, body, footer, modalClass);\n}", "function setFullPosit(titulo, cuerpo) {\n var textoTitulo = document.getElementById(\"texto-titulo\");\n var textoCuerpo = document.getElementById(\"texto-cuerpo\");\n textoTitulo.innerText = titulo;\n textoCuerpo.innerText = cuerpo;\n //Mostramos el modal\n document.getElementById(\"modal-postit\").style.display = \"block\";\n}", "function apriModaleSoggetto(e) {\n e.preventDefault();\n $(\"#codiceSoggetto_modale\").val($(\"#codiceSoggetto\").val());\n $(\"#modaleGuidaSoggetto\").modal(\"show\");\n }", "function apriModaleRicercaFattura() {\n var modale = $(\"#modaleRicercaFattura\");\n // Chiudo l'alert di errore\n alertErroriModale.slideUp();\n // Cancello tutti i campi\n modale.find(\":input\").val(\"\");\n // Apro il modale\n modale.modal(\"show\");\n }", "function btnQuitarPublicacion(div) {\n controlesEdit(true, div, \".quitarPublicacionMode\")\n }//-------------------------------", "function adminModif(id){\n console.log(id)\n biblio = biblioteca[id]\n document.querySelector(\"#titleModal\").innerText = biblio.titulo\n document.querySelector(\"#authorModal\").value = biblio.autor\n document.querySelector(\"#demogModal\").value = biblio.demografia\n document.querySelector(\"#categModal\").value = biblio.categoria\n document.querySelector(\"#añoModal\").value = biblio.año\n document.querySelector(\"#ediModal\").value = biblio.editorial\n document.querySelector(\"#tomoModal\").value = biblio.tomo\n document.querySelector(\"#imgModal\").value = biblio.imagen\n document.querySelector(\"#descripModal\").value = biblio.descripcion\n \n $('#adminModif').modal('show')\n \n}", "atualizaNome() //controler\r\n {\r\n this._elemento.textContent = `[${this._idade}] ${this._nome}`;\r\n }", "function TargetaFormulario() {\n\n this.$id = $('#id_panel')\n this.$operacion = $('#operacion')\n\n this.$cabecera = $('#id_cabecera')\n this.$estado = $('#id_estado')\n this.$descripcion = $('#id_descripcion')\n this.$comentarios = $('#id_comentarios')\n this.$solicitante = $('#id_solicitante')\n this.$boton_guardar = $('#boton_guardar')\n this.init()\n}", "function abreModalRelatorios(btnRelatorios) {\n $(btnRelatorios).click(function(event) {\n $('#modal-relatorio-oferta').modal('show');\n abreRelatorio($('#exibir-relatorio'));\n });\n}", "function mostrarJogada (e){\n\n escolha.style.display = \"none\"\n containerPlay.style.display = \"none\"\n containerJogada.style.display = \"flex\"\n containerRegras.style.display = \"flex\"\n\n nivelDificuldade = e.target.id\n\n return geracaoTorreHanoi(nivelDificuldade)\n\n}", "function mostraPanelFoto()\n{\n\t$('#panelFoto').modal('show');\n}", "function abreCaixa() {\n let mdCx = $(\"#md-caixa\");\n\n mdCx.on(\"hidden.bs.modal\", function () {\n onCaixaClosed();\n });\n\n caixa();\n }", "function PopupAcciones() {\n\n this.$id_boton_checklist = $('#id_boton_checklist')\n this.$id_boton_plan_auditoria = $('#id_boton_plan_auditoria')\n this.init_Events()\n}", "function visualiserAuteurControls(){\n var vControles = [\"lbledNomAuteur\",\"txtedNomAuteur\",\n \"lbledPreAuteur\",\"txtedPreAuteur\",\"lbledSaveAute\",\"btnedSaveAute\"];\n visualiserControls(\"btnedaddAute\" ,vControles,\"cboxedAute\");\n} // end visualiser", "function inicializarBotaoFlutuante() {\n $('#btnHelpInfotic').floatingActionButton();\n $('#btnMenuCursos').floatingActionButton({\n direction: 'left',\n });\n $('#btnMenuEventos').floatingActionButton({\n direction: 'left',\n })\n}", "function addGestorActa(codigo) { \t\r\n\topen('addGestor.do?codEntidad='+codigo,'','top=100,left=300,width=600,height=300') ; \r\n}", "function agfunAgregarMod(formulario,accion)\n\t{\n\t\t myMask = new Ext.LoadMask(Ext.getCmp('panelDatos').getEl(), {msg:'Cargando...',removeMask: true});\n\t\t myMask.show();\n\t\t setTimeout('myMask.hide()',500);\n\t\t titulo = 'Nuevo modulo';\n\t\t Ext.getCmp('panelDatos').setTitle(titulo);\n\t\t formularioModulo.getForm().reset();\n\t\t \n\t\t Ext.getCmp('btGuardarMod').setText('Crear');\n\t}", "function zoto_album_menu_box_edit(){\n\tthis.$uber({label_text:_('edit'), open_event:'onclick'});\n//\tthis.zoto_menu_box({label_text:_('edit'), open_event:'onclick'});\n}", "function mostrarPrimPantalla(){\n\n \t\t$('#cuadro-preguntas').addClass(\"hidden\");//ocultar\n\t\t$('#segunda-pantalla').removeClass(\"hidden\");//mostrar\n \t}", "function visualiserEditeurControls(){\n //\"lbledPays\",\"cboxedPays\",\n var vControles = [\n \"lbledNomEditeur\", \"txtedNomEditeur\",\n \"lbledVille\", \"btnedaddVill\", \"cboxedVill\",\n \"lbledSaveEdit\",\"btnedSaveEdit\"//,\n //\"lbledaddVille\" , \"txtedaddVille\"\n ];\n visualiserControls(\"btnedaddEdit\",vControles,\"cboxedEdit\");\n} // end visualiser", "function ocultarAviso() {\n aviso.classList.add('ocultar');\n }", "function DetailMenuMakanan(IdMenuMakanan)\n{\n Messi.load(\"module/content.php?m=menumakanan&a=DetailMenuMakanan&IdMenuMakanan=\"+IdMenuMakanan, \n {title: 'Detail Menu Makanan', titleClass: 'info', modal: true, width: '500px', buttons: [{id: 0, label: 'Close', val: 'X', btnClass: 'btn-success'}]});\n}", "function ClickAbrir() {\n var nome = ValorSelecionado(Dom('select-personagens'));\n if (nome == '--') {\n Mensagem('Nome \"--\" não é válido.');\n return;\n }\n var eh_local = false;\n if (nome.indexOf('local_') == 0) {\n eh_local = true;\n nome = nome.substr(6);\n } else {\n nome = nome.substr(5);\n }\n var handler = {\n nome: nome,\n f: function(dado) {\n if (nome in dado) {\n gEntradas = JSON.parse(dado[nome]);\n CorrigePericias();\n AtualizaGeralSemLerEntradas();\n SelecionaValor('--', Dom('select-personagens'));\n Mensagem(Traduz('Personagem') + ' \"' + nome + '\" ' + Traduz('carregado com sucesso.'));\n } else {\n Mensagem(Traduz('Não encontrei personagem com nome') + ' \"' + nome + '\"');\n }\n DesabilitaOverlay();\n },\n };\n HabilitaOverlay();\n AbreDoArmazem(nome, eh_local, handler.f);\n}", "function aviso_CEP(campo, escolha){\r\r\n\r\r\n //TEXTO SIMPLES\r\r\n var label = document.createElement(\"label\")\r\r\n\r\r\n //ESCOLHENDO O TIPO DE AVISO\r\r\n if (escolha == 1 ){ \r\r\n\r\r\n //TEXTO DE AVISO DE OBRIGATORIO\r\r\n var text = document.createTextNode(\"Preenchimento Obrigatório\")\r\r\n\r\r\n //COLOCANDO O ID NA LABEL E BR CRIADAS\r\r\n label.id = \"aviso_cep\"\r\r\n\r\r\n //INSERINDO O TEXTO DE AVISO NO CAMPO QUE SERA COLOCADO\r\r\n label.appendChild(text)\r\r\n }\r\r\n else if (escolha == 2){ \r\r\n\r\r\n //COLOCANDO O ID NA LABEL E BR CRIADAS\r\r\n label.id = \"aviso_cep1\"\r\r\n\r\r\n //TEXTO DE AVISO DE INVÁLIDO\r\r\n var text = document.createTextNode(\"CEP inválido!\")\r\r\n\r\r\n //INSERINDO O TEXTO DE AVISO NO CAMPO QUE SERA COLOCADO\r\r\n label.appendChild(text)\r\r\n }\r\r\n\r\r\n //REFERENCIA DE ONDE SERA COLOCADO O ITEM\r\r\n var lista = document.getElementsByTagName(\"p\")[5]\r\r\n var itens = document.getElementsByTagName(\"/p\") \r\r\n\r\r\n //INSERINDO O AVISO EM VERMELHO\r\r\n lista.insertBefore( label, itens[0]);\r\r\n label.style.color = \"red\";\r\r\n\r\r\n //MUDANDO O BACKGROUND\r\r\n erro(campo)\r\r\n}", "function PopupEditar(){\n this.$formulario = $('#formulario')\n this.$modal = $('#modal_editar')\n this.$id = ''\n this.$status = $('#id_status_editar')\n this.$observaciones = $('#id_observaciones')\n this.$updated_by = $('#id_updated_by')\n this.$archivo = $('#id_archivo')\n this.$asunto_informacion = $('#id_asunto_informacion')\n this.$descripcion_informacion = $('#id_descripcion_informacion')\n this.$datos = ''\n this.$id= ''\n\n this.$boton_editar = $('#boton_editar')\n this.$boton_cancelar = $('#boton_cancelar')\n\n this.init_Components()\n this.init_Events()\n}", "function mostrarPlantearEje(){ // Cuando toque el boton \"plantear ejercicios\" voy a ver la seccion (plantear tarea a alumnos)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#divDevoluciones\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; //Habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"block\"; // muestro plantear tarea\r\n document.querySelector(\"#divEntregas\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"none\"; // oculto visualizar estadisticas\r\n}", "function abrirModalModi(){\r\n $(\"#formularioModi\").css(\"visibility\",\"visible\");\r\n //IMPORTANTISIMO\r\n var i = this.document.activeElement.getAttribute(\"class\");\r\n savedValue = i;\r\n completarFichaModi(i);\r\n $(\"#doc\").addClass(\"contenedorDesactivado\");\r\n}", "function mostrarEjElegido(){\r\n let idFila = this.getAttribute(\"id\");\r\n document.querySelector(\"#divEjElegido\").innerHTML = `\r\n <p style=\"font-weight: bold\">${ejerciciosAMostrar[idFila].titulo}</p>\r\n <p>${ejerciciosAMostrar[idFila].descripcion}</p>\r\n <img height=\"300px\" width=\"500px\" src=\"${ejerciciosAMostrar[idFila].imgPath}\"/><br/>\r\n <input type=\"file\" id=\"archivoConId${idFila}\">\r\n <input type=\"button\" id=\"${idFila}\" class=\"entrega\" value=\"Realizar entrega\"><span id=\"errorEntrega${idFila}\" class=\"error\"/></span>\r\n <hr/>`;\r\n addEventsEntrega(); \r\n}", "function ocu_form()\n\t{\n\t$('alta_modi').style.display='none';\n\tif($('mod_buscador') != undefined)\n\t\t{\n\t\t$('mod_buscador').style.display='none';\n\t\t}\n\t$('mod_listado').style.display='block';\n\t}", "function abreModalRelatorios(btnRelatorios) {\n $(btnRelatorios).click(function(event) {\n $('#modal-relatorio-cliente').modal('show');\n abreRelatorio($('#exibir-relatorio'));\n });\n}", "function getOrdenes() {\n\tvar tabla = $(\"#ordenes_trabajo\").anexGrid({\n\t class: 'table-striped table-bordered table-hover',\n\t columnas: [\n\t \t{ leyenda: 'Acciones', style: 'width:100px;', columna: 'Sueldo' },\n\t \t{ leyenda: 'ID', style:'width:20px;', columna: 'id', ordenable:true},\n\t { leyenda: 'Clave de orden de trabajo', style: 'width:200px;', columna: 'o.clave', filtro:true},\n\t { leyenda: 'Tipo de orden', style: 'width:100px;', columna: 'o.t_orden', filtro:function(){\n\t \treturn anexGrid_select({\n\t data: [\n\t { valor: '', contenido: 'Todos' },\n\t { valor: '1', contenido: 'INSPECCIÓN' },\n\t { valor: '2', contenido: 'VERIFICACIÓN' },\n\t { valor: '3', contenido: 'SUPERVISIÓN' },\n\t { valor: '4', contenido: 'INVESTIGACIÓN' },\n\t ]\n\t });\n\t }},\n\t { leyenda: 'Número de oficio', style: 'width:200px;', columna: 'of.no_oficio',filtro:true},\n\t { leyenda: 'Fecha', columna: 'o.f_creacion', filtro: function(){\n \t\treturn anexGrid_input({\n \t\t\ttype: 'date',\n \t\t\tattr:[\n \t\t\t\t'name=\"f_ot\"'\n \t\t\t]\n \t });\n\t } },\n\t //{ leyenda: 'Participantes', style: 'width:300px;', columna: 'Correo' },\n\t { leyenda: 'Estado', style: 'width:120px;', columna: 'o.estatus', filtro:function(){\n\t \treturn anexGrid_select({\n\t data: [\n\t { valor: '', contenido: 'Todos' },\n\t { valor: '1', contenido: 'Cumplida' },\n\t { valor: '2', contenido: 'Parcial sin resultado' },\n\t { valor: '3', contenido: 'Parcial con resultado' },\n\t { valor: '4', contenido: 'Cumplida sin resultado' },\n\t { valor: '5', contenido: 'Cancelada' },\n\t ]\n\t });\n\t }},\n\t \n\t ],\n\t modelo: [\n\t \t\n\t \t{ class:'',formato: function(tr, obj, valor){\n\t \t\tvar acciones = [];\n\t \t\tif (obj.estatus == 'Cancelada') {\n\t \t\t\tacciones = [\n { href: \"javascript:open_modal('modal_ot_upload',\"+obj.id+\");\", contenido: '<i class=\"glyphicon glyphicon-cloud\"></i> Adjuntar documento' },\n { href: \"javascript:open_modal('modal_add_obs');\", contenido: '<i class=\"glyphicon glyphicon-comment\"></i>Agregar observaciones' },\n { href: 'index.php?menu=detalle&ot='+obj.id, contenido: '<i class=\"glyphicon glyphicon-eye-open\"></i>Ver detalle' },\n ];\n\t \t\t}else{\n\t \t\t\tacciones = [\n { href: \"javascript:open_modal('modal_ot_upload',\"+obj.id+\");\", contenido: '<i class=\"glyphicon glyphicon-cloud\"></i> Adjuntar documento' },\n { href: \"javascript:open_modal('modal_add_obs');\", contenido: '<i class=\"glyphicon glyphicon-comment\"></i>Agregar observaciones' },\n { href: 'index.php?menu=detalle&ot='+obj.id, contenido: '<i class=\"glyphicon glyphicon-eye-open\"></i>Ver detalle' },\n { href: \"javascript:open_modal('modal_cancelar_ot',\"+obj.id+\");\", contenido: '<i class=\"fa fa-ban text-red\"></i><b class=\"text-red\">Cancelar</b> '},\n ];\n\t \t\t}\n\t return anexGrid_dropdown({\n contenido: '<i class=\"glyphicon glyphicon-cog\"></i>',\n class: 'btn btn-primary ',\n target: '_blank',\n id: 'editar',\n data: acciones\n });\n\t }},\n\t \t\n\t { class:'',formato: function(tr, obj, valor){\n\t \t\tvar acciones = [];\n\t \t\tif (obj.estatus == 'Cancelada') {\n\t \t\t\ttr.addClass('bg-red-active');\n\t \t\t}\n\t return obj.id;\n\t }},\n\t { propiedad: 'clave' },\n\t { propiedad: 't_orden' },\n\t { propiedad: 'oficio' },\n\t { propiedad: 'f_creacion' },\n\t //{ propiedad: 'id'},\n\t { propiedad: 'estatus'}\n\t \n\t \n\t ],\n\t url: 'controller/puente.php?option=8',\n\t filtrable: true,\n\t paginable: true,\n\t columna: 'id',\n\t columna_orden: 'DESC'\n\t});\n\treturn tabla;\n}", "function openModalRifiutoArgomento(btn) {\n idAppunto = parseInt($(btn).attr(\"id\").split('_')[$(btn).attr(\"id\").split('_').length - 1]);\n $(\"#contModaleRifiuto\").text(\"Sei sicuro di voler rifiutare questo appunto?\");\n $(\"#btnConfRifiutoAllegato\").removeAttr(\"disabled\");\n $(\"#modalRifiutoAllegato\").modal(\"show\");\n}", "function apriModaleConfermaCambioTab(anchor) {\n return modaleConfermaProsecuzione\n .find(\"#modaleConfermaPulsanteSi\")\n .substituteHandler(\"click\", function(e) {\n e.preventDefault();\n sovrascriviModificheERiprova(anchor);\n })\n .end()\n .find(\"#modaleConfermaPulsanteNo\")\n .substituteHandler(\"click\", function(e) {\n e.preventDefault();\n modaleConfermaProsecuzione.modal(\"hide\");\n })\n .end()\n .find(\".alert\")\n .slideDown()\n .end()\n .modal(\"show\");\n }", "editarPersonal() {\n this.activarPersonal = false;\n this.activarNotificaciones = true;\n this.activarContacto = true;\n this.activarAcordeon1();\n }", "cambiarEstado(tipo){\n if (tipo === \"editar\"){\n this.btnEnviar.textContent = \"Actualizar Publicación\";\n this.btnEnviar.classList =\"btn btn-block btn-warning\";\n \n const btnVolver = document.createElement(\"button\");\n btnVolver.className = \"btn btn-block btn-secondary mt-2 cancelar-Edicion\";\n btnVolver.setAttribute(\"id\", \"btnVolver\");\n btnVolver.textContent = \"Volver\";\n this.formTarjeta.appendChild(btnVolver);\n //si el estado que recibo por parametro es agregar, entonces quito los cambios hechos por el estado editar y limpio los campos\n }else{\n this.btnEnviar.textContent = \"Publicalo!\";\n this.btnEnviar.classList =\"btn btn-block btn-primary\";\n if (document.getElementById(\"btnVolver\")){\n document.getElementById(\"btnVolver\").remove();\n }\n this.limpiarCampos();\n \n }\n }", "function modalCheque()\n{\n $('#agregar_cheque').modal('show');\n}", "function showPopupElementFormular() {\r\n $(\"#\" + global.Element.PopupElementFormular).modal(\"show\");\r\n }", "function PratoDoDiaComponent() {\n }", "function clickInicio_(e){\n var app = UiApp.getActiveApplication();\n var panel = app.getElementById(\"panel\") ;\n panel.setVisible(false);\n frmInicio_(app, \"0\");\n //Actualizar APP\n return app;\n}", "function mostrarPalabra(){\n \n}", "efficacitePompes(){\n\n }", "function editannounement() {\n\n}", "function openModalApprovaAppunto(btn) {\n idAppunto = parseInt($(btn).attr(\"id\").split('_')[$(btn).attr(\"id\").split('_').length - 1]);\n idArgomento = parseInt($(btn).attr(\"id\").split('_')[$(btn).attr(\"id\").split('_').length - 2]);\n $(\"#contModale\").text(\"Sei sicuro di voler accettare questo allegato?\");\n $(\"#btnConfApprovAllegato\").removeAttr(\"disabled\");\n $(\"#modalApprovAllegato\").modal(\"show\");\n}", "function esconder(){\r\n\tdocument.all.mE2.style.display='none';\r\n\tdocument.all.mE1.style.display='';\r\n\tdocument.getElementById('preVM').innerHTML = '<a href=\"javascript:;\" onclick=\"mostrar()\" class=\"link_claro\">Mostrar miniatura</a>';\r\n}", "function ClickGerarAleatorioElite() {\n GeraAleatorioElite();\n AtualizaGeral();\n}", "function TipoServico_elementsExtraJS() {\n // screen (TipoServico) extra code\n\n }", "function reportarImagenOpenModal(){\n // Abre el modal a través de la variable modalReportarImagen\n // en el archivo modales.js de public\n window.modalReportarImagen()\n\n}", "function ClickAdicionarArma() {\n gEntradas.armas.push({ chave: 'desarmado', obra_prima: false, bonus: 0 });\n AtualizaGeralSemLerEntradas();\n}", "function calGuiasViewDetail(idRegistro){\n\t//Abrimos ventana modal en modo de detalle pasando como parametros el id del elemento seleccionado\n\t//y los parametros de acci?n, origen y previousAction para que la lp de startup pueda determinar el modo\n\tvar parametros = new Array();\n\tparametros[\"idSelection\"] = idRegistro;\n\tparametros[\"previousAction\"] = get('calGuiasFrm.accion');\n\tparametros[\"accion\"] = 'view'\n\tparametros[\"origen\"] = 'pagina';\n\t\n\t\n\tmostrarModalSICC('CalGuiasLPStartUp', 'view', parametros, null, null);\n}", "function cambiarVistaDia(fecha){\n\t$('#calendar').fullCalendar( 'gotoDate', fecha);\n\t$('#calendar').fullCalendar( 'changeView', 'agendaDay' );\n}", "set_operasi() {\n document.getElementById(\"operasi-hasil\").innerHTML = this.operasi_hasil;\n }", "function GridMediciones () {\n this.modal = new Modal()\n this.event_owner = null\n this.$odometro = null\n this.$fecha_exacta = null\n this.$celda_odometro = $('.odometro')\n this.$celda_equipo = $('.equipo')\n this.$equipos_lista = $('#equipos_lista')\n this.init()\n}", "function openModalApprovaModulo(btn) {\n idModulo = parseInt($(btn).attr(\"id\").split('_')[$(btn).attr(\"id\").split('_').length - 1]);\n idArgomento = parseInt($(btn).attr(\"id\").split('_')[$(btn).attr(\"id\").split('_').length - 2]);\n $(\"#contModaleApprovModulo\").text(\"Sei sicuro di voler accettare questo corso?\");\n $(\"#btnConfApprovModulo\").removeAttr(\"disabled\");\n $(\"#modalApprovModulo\").modal(\"show\");\n}", "function OcultarEtapa(etp) {\n var sComEta = $('#comEta' + etp);\n var sEta = $('#eta' + etp);\n var imgBotonEta = sEta.find('#imgBotonMostrarOcultarEtaX');\n imgBotonEta.attr('src', \"Images/support/botonMostrar.gif\");\n sComEta.html('');\n sComEta.hide();\n etapaMostrada = null;\n}", "function Buscar() {\n var nombreTipoHabitacion = get(\"txtNombreTipoHabitacion\")\n //alert(nombreTipoHabitacion);\n pintar({\n url: \"TipoHabitacion/filtrarTipoHabitacionPorNombre/?nombreHabitacion=\" + nombreTipoHabitacion,\n id: \"divTabla\",\n cabeceras: [\"Id\", \"Nombre\", \"Descripcion\"],\n propiedades: [\"id\", \"nombre\", \"descripcion\"],\n editar: true,\n eliminar: true,\n propiedadID: \"id\"\n\n })\n\n}", "function mostrar() {\n miLibro.mostrar();\n}", "function displayNei(){\n activaTab(\"boxdashboard-body-nei-generic\");\n }", "ClickOnAddScene(){\n // Load add Scene Config\n this._Scene.RenderAddModScene(this._DeviceConteneur, this._DeviceConfig.Electrovannes)\n }", "function TargetaResultados() {\n\n this.toolbar = new Toolbar()\n this.grid = new GridPrincipal()\n this.modal = new VentanaModal()\n}", "function addImagetoAssignment() {\r\n \r\n //Show success Modal and start confetti\r\n document.getElementById('modal3').style.display = 'block';\r\n\r\n\r\n }", "function fAppMeteo() {\n $(\"#bokm\").click(fAffMeteo);\n}", "render() {\n let button = this.el.querySelector('#more-peas');\n button.textContent = this.model.get('peas');\n }", "render() {\n let button = this.el.querySelector('#more-peas');\n button.textContent = this.model.get('peas');\n }", "function openModalRifiutoModulo(btn) {\n idModulo = parseInt($(btn).attr(\"id\").split('_')[$(btn).attr(\"id\").split('_').length - 1]);\n $(\"#contModaleRifiutoModulo\").text(\"Sei sicuro di voler rifiutare questo corso?\");\n $(\"#btnConfRifiutoModulo\").removeAttr(\"disabled\");\n $(\"#modalRifiutoModulo\").modal(\"show\");\n}", "function mostrarVentanaCajero(){\n\tnav = 20;\n\tvar nombre = datosUsuario[0][\"nombre\"];\n\tvar txt= forPantallaCajero('Cajero', nombre);\n\t$('#contenedor').html(txt);\n\t$('#contenedor').append(cargarModal());//Agrega HTML del formulario modal\n\tvar parametros ={\"opc\": nav};\n\tejecutarAjax(parametros, nav);\n}", "function onClickBtnModif(e) {\n e.preventDefault();\n\n //On recupere l'identifiant de l'equipe stocker en attribut\n let idEquipe = $(this).attr(\"idequipe\");\n\n //On execute la requete sur le serveur distant\n let request = constructRequest(\"index.php?page=equipemodifws&id=\" + idEquipe);\n\n //En cas de succe de la requete\n request.done(function( infos ) {\n //si les informations sur l'equipe sont definis\n if(infos.element_infos !== undefined) {\n //on modifie la valeur de tout les champ\n $(\"#modif-id\").val(infos.element_infos.id);\n $(\"#modif-libelle\").val(infos.element_infos.libelle);\n $(\"#modif-responsable\").val(infos.element_infos.idResponsable);\n\n //et on affiche le modal modif\n $(\"#modal-modif\").modal(\"show\");\n } else {\n //sinon on affiche un popup avec le message recu\n showPopup(infos.popup_message, infos.popup_type);\n }\n });\n}", "function pideLectura()\r\n{\r\n\t$(\"#aviso\").show();\r\n\t$(\"#formulario\").hide();\r\n\tgtimer = setTimeout(cerrar, 10000);\r\n\tPoneModoI('c', revisaLectura);\r\n}", "function createInspektor()\n{\n addCSS(); //nahraje do hlavicky css pro inspektor\n setEventBody(); //definovani obsluznych funkci pro udalosti nakter ma reagovat puvodni telo\n \n createInspektorElem(); // tvoreni tela inspektrou\n \n modalWindow(); //pomocny \"dialog\" pro meneni atributu class a id\n setEventDialog();\n}", "function abreAviso(texto, modo, cor){ \n modo = ((modo === undefined) || (modo === ''))? 'ok': modo;\n cor = ((cor === undefined) || (cor === ''))? 'ok': cor;\n \n $(\"#popFundo\").fadeIn();\n $(\"#avisoTexto\").html(texto);\n $(\"#aviso\").addClass(\"avisoEntrada\");\n \n\n}", "function mostrar_form(campo)\n\t{\n\t$('alta_modi').style.display='block';\n\tif($('mod_buscador') != undefined)\n\t\t{\n\t\t$('mod_buscador').style.display='none';\n\t\t}\n\t$('mod_listado').style.display='none';\n\tif($(campo))\n\t\t{\n\t\t$(campo).focus();\n\t\t}\n\tlimpiar_campos();\n\t}", "function frmInicio_(container, opc){\n \n //Crear Panel Vertical\n var vPanel = container.createVerticalPanel()\n .setWidth(\"810\")\n .setStyleAttribute(\"padding\",\"20px\")\n .setStyleAttribute(\"fontSize\", \"12pt\")\n .setId(\"panel\");\n \n // Mensaje Inicial\n var lblTitulo = container.createLabel()\n .setId(\"lblTitulo\")\n .setText(\"Registrar Movimientos de Activos\");\n \n // Mensaje Busqueda\n var lblBusqueda = container.createLabel()\n .setId(\"lblBusqueda\")\n .setText(\"Busqueda General:\");\n \n // Sub-Mensaje Busqueda\n var lblsBusqueda = container.createLabel()\n .setId(\"lblsBusqueda\")\n .setText(\"Introduzca Palabra a Buscar\");\n \n // Text Box Busqueda\n var txtBuscar = container.createTextBox()\n .setFocus(true)\n .setName(\"txtBuscar\")\n // Accion Boton Buscar\n \n //Style\n styleTitulo_(lblTitulo);\n styleLbl_(lblBusqueda);\n styleSublbl_(lblsBusqueda);\n styleTxt_(txtBuscar);\n \n //Imagen\n var imgFondo = container.createImage(URLIMAGEN)\n .setStyleAttribute(\"margin-top\",\"20px\");\n \n //Crear Panel Horizontal\n var hPanel = container.createHorizontalPanel();\n \n //Boton Buscar\n var btnBuscar = container.createButton()\n .setText(\"Buscar\");\n \n //Boton Nuevo \n var btnNuevo = container.createButton()\n .setText(\"Crear Registro\");\n \n //Style\n styleBtn_(btnBuscar);\n styleBtn_(btnNuevo); \n \n // Accion Boton Buscar\n var lnzBuscar = container.createServerHandler('clickBuscarGral_')\n .addCallbackElement(vPanel);\n btnBuscar.addClickHandler(lnzBuscar);\n \n // Accion Boton Nuevo\n var lnzNuevo = container.createServerHandler('clickNuevo_')\n .addCallbackElement(vPanel);\n btnNuevo.addClickHandler(lnzNuevo);\n \n //Agregar al Panel Horizontal\n hPanel.add(btnBuscar);\n hPanel.add(btnNuevo);\n \n // Agrega a Panel Vertical\n vPanel.add(lblTitulo);\n vPanel.add(lblBusqueda);\n vPanel.add(lblsBusqueda);\n vPanel.add(txtBuscar);\n vPanel.add(hPanel);\n vPanel.add(imgFondo);\n \n \n //Agregar a APP\n container.add(vPanel);\n}", "function ClickAdicionarEscudo() {\n gEntradas.escudos.push({ chave: 'nenhum', obra_prima: false, bonus: 0 });\n AtualizaGeralSemLerEntradas();\n}", "function accionTT(tipo) {\n $('#modalAddTipoTarea').data('kendoMobileModalView').open();\n kendo.fx($(\"#modalAddTipoTarea\")).zoom(\"in\").play(); //Sirve para eliminar el bug del click en la misma posición del btn cancelar, que hace que al seleccionar se cierre inmediatamente el modal\n $(\"#btnTT\").removeAttr(\"disabled\");\n switch (tipo) {\n case \"tipoUpdate\":\n $('#btnTT').val('tipoUpdate');\n $('#btnTT').html('<span class=\"glyphicon glyphicon-pencil\" aria-hidden=\"true\"></span> Editar');\n break;\n default:\n $('#btnTT').val('tipoInsert');\n $('#btnTT').html('<span class=\"glyphicon glyphicon-plus\" aria-hidden=\"true\"></span> Agregar');\n $('#txtnombre').val(\"\");\n $('#txtdescripcion').val(\"\");\n $('#txtidTT').val(\"\");\n }\n}", "openModal(){\n this.saveSelection()\n Nova.$emit(`ckeditor:media:${this.attribute}`)\n }", "function nuevo_producto(){\t\t\n\t\tllama_formulario('NUEVA CIUDAD','nuevo');\t \n\t\tVentana_modal.show();\t\t\t\n\t}", "_addActionEdit() {\n let btn = this._actions.getElementsByClassName('edit')[0];\n if (btn === undefined) {\n return;\n }\n\n btn.onclick = ((event) => {\n window.location.href = Service.editorUrl(this._api.getSlug());\n }).bind(this);\n\n this._btns.edit = btn;\n }", "function expedientealta()\n{\n\t$.post('includes/expediente_alta.php',{},function(data){ $(\"#contenedor\").html(data); });\n}", "function nuvoInscPreli(){ \n $(\".modal-title\").html(\"Nueva incripción\"); \n $('#formIncPreliminar').modal('show');\n}", "function mostrarMas(){\n\t\t\t\t//mostrar\n\t\t\t\t$(\"#boton1\").removeClass(\"no-active\").addClass(\"active\"); \t// mas\n\t\t\t\t//ocultar\n\t\t\t\t$(\"#boton0\").removeClass(\"active\").addClass(\"no-active\"); \t// ordenar\n\t\t\t\t$(\"#tamaño-desplegable\").css('height', '278px');\t\t\t// tamaño\n\t\t\t\t$(\"#conversaciones\").addClass(\"hidden\"); \t\t\t\t\t// conversaciones \n\t\t\t\t$(\"#actividad\").addClass(\"hidden\"); \t\t\t\t\t\t// actividad\n\t\t\t\t$(\"#user-popover\").addClass(\"hidden\"); \t\t\t\t\t\t// submenu barra\n\t\t\t\t$(\"#menuClickDerecho0\").addClass(\"hidden\"); \t\t\t\t// menu click derecho 0\n\t\t\t\t$(\"#menuClickDerecho1\").addClass(\"hidden\"); \t\t\t\t// menu click derecho 1\n\t\t\t\t$(\"#menuClickDerecho2\").addClass(\"hidden\"); \t\t\t\t// menu click derecho 2\n\t\t\t\t$(\"#menuClickDerecho3\").addClass(\"hidden\"); \t\t\t\t// menu click derecho 3\n\t\t\t\t$(\"#ejecutarMostrarAgregarTarea\").removeClass(\"focus\"); \t// destacado, asignar a y fecha\n\t\t\t\t$(\"#botonAgregarTarea1\").removeClass(\"hidden\"); \t\t\t// agregar lista icono del + \n\t\t\t\t$(\"#botonAgregarTarea2\").addClass(\"hidden\"); \t\t\t\t// agregar lista icono microfono\n\t\t\t\t$(\"#detail\").addClass(\"hidden\"); \t\t\t\t\t\t\t//ocultar menu derecho tarea\n\t\t\t}", "function abrirModalAdicionar() {\n $(\"#modalAdicionar\").modal();\n}", "function zoto_set_menu_box_edit(){\n\tthis.$uber({label_text:_('edit'), open_event:'onclick'});\n//\tthis.zoto_menu_box({label_text:_('edit'), open_event:'onclick'});\n}" ]
[ "0.63150495", "0.63056695", "0.6178775", "0.60582364", "0.605514", "0.60519964", "0.6022779", "0.6020148", "0.5992247", "0.5986929", "0.59642833", "0.5946956", "0.5946167", "0.5915311", "0.589851", "0.58791566", "0.587016", "0.5854482", "0.5838816", "0.5838363", "0.5785085", "0.57823366", "0.5779207", "0.57645124", "0.5758255", "0.57569635", "0.5744598", "0.5743301", "0.5743139", "0.5742807", "0.57409877", "0.5735085", "0.5724498", "0.5707721", "0.5696241", "0.56869644", "0.567141", "0.56703764", "0.5662957", "0.56590015", "0.56485236", "0.5635538", "0.5631639", "0.56267637", "0.5608152", "0.55977815", "0.558795", "0.5586802", "0.5577014", "0.5574019", "0.55679667", "0.55646455", "0.5559803", "0.5558593", "0.55581933", "0.55474603", "0.5547187", "0.55424875", "0.55406386", "0.5539122", "0.5530268", "0.55190086", "0.5515844", "0.551536", "0.5515141", "0.5511838", "0.5509134", "0.550641", "0.5504644", "0.5503018", "0.55009794", "0.5496754", "0.5493956", "0.54918635", "0.5490894", "0.5488073", "0.54879606", "0.54835737", "0.54788893", "0.5478303", "0.54736567", "0.5470343", "0.5470343", "0.54699665", "0.5469162", "0.5467117", "0.54618955", "0.546169", "0.5459546", "0.54581356", "0.5446174", "0.54399025", "0.543637", "0.5433932", "0.54327035", "0.54326904", "0.5431357", "0.5414394", "0.5411814", "0.541034", "0.54101366" ]
0.0
-1
workaround bug in FF 3.6
function token() { if (re.lastIndex >= text.length) return EOF; // special case: end of file if (eol) { eol = false; return EOL; } // special case: end of line // special case: quotes var j = re.lastIndex; if (text.charCodeAt(j) === 34) { var i = j; while (i++ < text.length) { if (text.charCodeAt(i) === 34) { if (text.charCodeAt(i + 1) !== 34) break; i++; } } re.lastIndex = i + 2; var c = text.charCodeAt(i + 1); if (c === 13) { eol = true; if (text.charCodeAt(i + 2) === 10) re.lastIndex++; } else if (c === 10) { eol = true; } return text.substring(j + 1, i).replace(/""/g, "\""); } // common case var m = re.exec(text); if (m) { eol = m[0].charCodeAt(0) !== 44; return text.substring(j, m.index); } re.lastIndex = text.length; return text.substring(j); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixIeBug(e){return browser.msie?e.length-e.replace(/\\r*/g,\"\").length:0}", "private internal function m248() {}", "function fixIESelect() {\n return false;\n }", "function StupidBug() {}", "protected internal function m252() {}", "function Ze(){if(ea)t.innerHTML=ha;else if(ia)t.innerHTML=ia;$e();eb&&hb.call(window,eb);nb();eb=-1;bb=[];cb={};ac=j;Zb=0;$b=[];w.Cc();Bb=0;Cb=[];document.documentElement.className=\"js no-treesaver\";document.documentElement.style.display=\"block\"}", "function noRange(){\n if (isFirefox === false){\n foo.appendChild(element);\n }\n }", "function Re(e){return!0===Ie(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", "function Pf(e,t,a,n){var r=e.display,f=!1,o=pn(e,function(t){xo&&(r.scroller.draggable=!1),e.state.draggingText=!1,ke(r.wrapper.ownerDocument,\"mouseup\",o),ke(r.wrapper.ownerDocument,\"mousemove\",i),ke(r.scroller,\"dragstart\",s),ke(r.scroller,\"drop\",o),f||(Ae(t),n.addNew||pr(e.doc,a,null,null,n.extend),\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n xo||vo&&9==wo?setTimeout(function(){r.wrapper.ownerDocument.body.focus(),r.input.focus()},20):r.input.focus())}),i=function(e){f=f||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},s=function(){return f=!0};\n // Let the drag handler handle this.\n xo&&(r.scroller.draggable=!0),e.state.draggingText=o,o.copy=!n.moveOnDrag,\n // IE's approach to draggable\n r.scroller.dragDrop&&r.scroller.dragDrop(),ni(r.wrapper.ownerDocument,\"mouseup\",o),ni(r.wrapper.ownerDocument,\"mousemove\",i),ni(r.scroller,\"dragstart\",s),ni(r.scroller,\"drop\",o),La(e),setTimeout(function(){return r.input.focus()},20)}", "function doDone() {\r\n // in FF this is empty.\r\n\r\n }", "function doDone() {\r\n // in FF this is empty.\r\n\r\n }", "function IEcompatibility() {\n\t// Only do anything if this is IE\n\tif(Browser.ie){\n\t\tvar __fix = $$(\"#kbbcode-size-options\", \"#kbbcode-size-options span\", \n\t\t\t\t\t\t\"#kbbcode-colortable\", \"#kbbcode-colortable td\");\n\t\tif (__fix) {\n\t\t\t__fix.setProperty('unselectable', 'on');\n\t\t}\n\t}\n}", "transient private protected internal function m182() {}", "function fixIE() {\n if (!Array.indexOf) {\n Array.prototype.indexOf = function(arg) {\n var index = -1;\n for (var i = 0; i < this.length; i++){\n var value = this[i];\n if (value == arg) {\n index = i;\n break;\n } \n }\n return index;\n };\n }\n\n if (!window.console) {\n window.console = {};\n window.console.log = window.console.debug = function(message) {\n return;\n var body = document.getElementsByTagName('body')[0];\n var messageDiv = document.createElement('div');\n messageDiv.innerHTML = message;\n body.insertBefore(messageDiv, body.lastChild);\n };\n } \n}", "function Da(a){// for issue 1168\nvoid 0===a.pageX&&(a.pageX=a.originalEvent.pageX,a.pageY=a.originalEvent.pageY)}", "function ElemToWindow(elem,dummy){\r\nif(!elem) return null;\r\nvar bod = document.body, doc = document.documentElement, rtl = 0;\r\n\r\nif(elem.getBoundingClientRect && !TGNoIEClientRect){\r\n if(!elem.parentNode) return [0,0]; \r\n var A = elem.getBoundingClientRect();\r\n var x = A.left, y = A.top;\r\n if(BIEStrict || (BMozilla||BOpera)&&BStrict){\r\n x += doc.scrollLeft;\r\n y += doc.scrollTop;\r\n if(!BIEA8) { x -= doc.clientLeft; y -= doc.clientTop; }\r\n \r\n }\r\n else {\r\n if(BChrome){\r\n var B = doc.getBoundingClientRect();\r\n x -= B.left-doc.offsetLeft; y -= B.top-doc.offsetTop;\r\n }\r\n \r\n else {\r\n x += bod.scrollLeft;\r\n y += bod.scrollTop;\r\n }\r\n \r\n if(BSafariMac&&!BSafariWin){\r\n x -= doc.offsetLeft;\r\n y -= doc.offsetTop;\r\n }\r\n else if(!BIE && !BChrome && !BSafariWin){\r\n x += bod.clientLeft;\r\n y += bod.clientTop;\r\n }\r\n }\r\n \r\n return [x/CZoom,y/CZoom];\r\n }\r\nvar x=elem.offsetLeft, y=elem.offsetTop,p,lp = elem;\r\ntry { p = elem.offsetParent; } catch(e){ return [x,y]; } \r\nif(!p) return AbsoluteToWindow(); \r\nif(BIEA){\r\n if(BIEStrict && CZoom!=1 && lp.style.position==\"absolute\"){\r\n x += Math.floor(lp.offsetLeft/CZoom-lp.offsetLeft);\r\n y += Math.floor(lp.offsetTop/CZoom-lp.offsetTop);\r\n }\r\n while(p && p!=doc){ \r\n if(p==bod){ \r\n x+=p.offsetLeft+p.clientLeft;\r\n y+=p.offsetTop+p.clientTop; \r\n break;\r\n }\r\n if((!BIEA8||!BStrict) && p.tagName.toLowerCase()==\"table\"){ \r\n x-=p.clientLeft;\r\n y-=p.clientTop;\r\n }\r\n x+=p.offsetLeft+p.clientLeft-p.scrollLeft;\r\n y+=p.offsetTop+p.clientTop-p.scrollTop; \r\n p = p.offsetParent;\r\n }\r\n if(BIEA8 && BStrict){ x-=bod.clientLeft; y-=bod.clientTop; }\r\n if(BIEStrict && CZoom!=1){\r\n x+=Math.floor(p.offsetLeft/CZoom-p.offsetLeft);\r\n y+=Math.floor(p.offsetTop/CZoom-p.offsetTop);\r\n } \r\n }\r\nelse { \r\n var po = elem;\r\n while(1){\r\n \r\n while(po!=p){\r\n po = po.parentNode;\r\n if(!po || po==bod) break; \r\n \r\n if(po!=bod&&!rtl){\r\n x-=po.scrollLeft;\r\n y-=po.scrollTop;\r\n }\r\n \r\n if((BOpera8 || BOpera&&BOperaVer<9.5)&&po.tagName){\r\n var tag = po.tagName.toLowerCase();\r\n if(tag=='tr'){ y+=po.offsetTop; x+=po.scrollLeft; } \r\n else if(tag=='tbody') x+=po.scrollLeft;\r\n else if(BOpera && tag=='table' && po.style.borderCollapse!='collapse') y+=Math.floor((po.offsetHeight-po.clientHeight)/2); \r\n }\r\n\r\n if(BFF3 && po.tagName){\r\n var tag = po.tagName.toLowerCase();\r\n if(tag==\"td\"){ x+=po.clientLeft; y+=po.clientTop; }\r\n } \r\n if((BIPAD||BSafariWin) && po.tagName){\r\n var tag = po.tagName.toLowerCase();\r\n if(tag==\"table\" || tag==\"td\"){ x+=po.clientLeft; y+=po.clientTop; }\r\n } \r\n }\r\n \r\n if(!p || p==bod) break;\r\n x+=p.offsetLeft;\r\n y+=p.offsetTop;\r\n lp = p; \r\n p = p.offsetParent;\r\n if(p==bod){\r\n var abs = lp.Absolute; if(abs==null){ var s = GetStyle(lp); abs = s.position==\"absolute\"; lp.Absolute = abs; }\r\n if(abs) {\r\n \r\n break;\r\n }\r\n }\r\n }\r\n \r\n if(BOpera8 || BMozilla || BSafariWin || BSafariMac){\r\n var abs = lp.Absolute; if(abs==null){ var s = GetStyle(lp); abs = s.position==\"absolute\"; lp.Absolute = abs; }\r\n if(abs){\r\n var A = AbsoluteToWindow();\r\n x += A[0]; y += A[1]; \r\n return [x,y];\r\n }\r\n if(BMozilla||BSafariWin){\r\n if(doc.marginLeft==null){\r\n var s = GetStyle(doc);\r\n var ml = parseInt(s.marginLeft), mt = parseInt(s.marginTop);\r\n doc.marginLeft = ml?ml:0; doc.marginTop = mt?mt:0;\r\n }\r\n x += doc.marginLeft; y += doc.marginTop;\r\n }\r\n \r\n if(BFF3&&!BStrict){ x -= bod.offsetLeft; y -= bod.offsetTop; }\r\n \r\n if(BSafariMac&&!abs){ x += bod.offsetLeft; y += bod.offsetTop; }\r\n if(BMozilla||BSafariWin){\r\n if(bod.clientLeft==null) {\r\n var s = GetStyle(bod);\r\n var bl = parseInt(s.borderLeftWidth), bt = parseInt(s.borderTopWidth);\r\n bod.clientLeft = bl?bl:0; bod.clientTop = bt?bt:0;\r\n }\r\n x += bod.clientLeft; y += bod.clientTop; \r\n }\r\n if(BOpera8){\r\n x += bod.offsetLeft+bod.clientLeft;\r\n y += bod.offsetTop+bod.clientTop;\r\n }\r\n \r\n } \r\n if(BKonqueror){ x += doc.offsetLeft; y += doc.offsetTop; }\r\n \r\n }\r\n\r\nreturn [x,y];\r\n}", "function fixTextSelection( dom_element )\n {\n //chrome, opera, and safari select PRE text correctly \n if ($.chili.selection.active && ($.browser.msie || $.browser.mozilla)) \n {\n var element = null;\n $(dom_element)\n .parents()\n .filter(\"pre\")\n .bind(\"mousedown\", resetSelectedTextElement)\n .bind(\"mouseup\", displaySelectedTextDialog)\n ;\n }\n }", "private public function m246() {}", "function yst_overrideElemFunction() {\n\treturn;\n}", "function fixIEMouseDown() {\n _ieSelectBack = doc.body.onselectstart;\n doc.body.onselectstart = fixIESelect;\n }", "function hackUserAgent(){\n if (navigator.userAgent.search('Firefox')!==-1)\n active='mouseup.webcrawler';\n}", "function ieCacheSelection(e){\n document.selection && (this.caretPos = document.selection.createRange());\n}", "transient protected internal function m189() {}", "function V(a){return fa.isWindow(a)?a:9===a.nodeType&&a.defaultView}", "function FF() {}", "function qTrace() {\n\n title = \"\" + document.getElementById(\"mbd\").contentDocument.title;\n java.elementTrace(title);\n}", "function P(a){return _.isWindow(a)?a:9===a.nodeType&&a.defaultView}", "function isFirefox(){\n\treturn navigator.userAgent.indexOf('Gecko/')>0;\n}", "function preIE10Check() {\n if (window.attachEvent && !window.navigator.msPointerEnabled) {\n return true;\n } else {\n return false;\n }\n }", "function vc_getElementAbsolutePos(elemID) { \n var element; \n if (typeof(elemID) == \"string\") { \n element = document.getElementById(elemID); \n } \n else { \n element = elemID; \n } \n \n var res = new Object(); \n res.x = 0; res.y = 0; \n if (element !== null) { \n res.x = element.offsetLeft; \n \n var offsetParent = element.offsetParent; \n var offsetParentTagName = offsetParent != null ? offsetParent.tagName.toLowerCase() : \"\"; \n \n if (__isIENew && offsetParentTagName == 'td') { \n res.y = element.scrollTop; \n } \n else { \n res.y = element.offsetTop; \n } \n \n var parentNode = element.parentNode; \n var borderWidth = null; \n \n while (offsetParent != null) { \n res.x += offsetParent.offsetLeft; \n res.y += offsetParent.offsetTop; \n \n var parentTagName = offsetParent.tagName.toLowerCase(); \n \n if ((__isIEOld && parentTagName != \"table\") || (__isFireFoxNew && parentTagName == \"td\") || __isChrome) { \n borderWidth = vc_getBorderWidth(offsetParent); \n res.x += borderWidth.left; \n res.y += borderWidth.top; \n } \n \n if (offsetParent != document.body && offsetParent != document.documentElement) { \n res.x -= offsetParent.scrollLeft; \n res.y -= offsetParent.scrollTop; \n } \n \n \n //next lines are necessary to fix the problem with offsetParent \n if (!__isIE && !__isOperaOld || __isIENew) { \n while (offsetParent != parentNode && parentNode !== null) { \n res.x -= parentNode.scrollLeft; \n res.y -= parentNode.scrollTop; \n if (__isFireFoxOld || __isWebKit) { \n borderWidth = vc_getBorderWidth(parentNode); \n res.x += borderWidth.left; \n res.y += borderWidth.top; \n } \n parentNode = parentNode.parentNode; \n } \n } \n \n parentNode = offsetParent.parentNode; \n offsetParent = offsetParent.offsetParent; \n } \n } \n return res; \n}", "function shiftForIE7() {\r\n\tif (jQuery.browser.msie && jQuery.browser.version == '7.0') {\r\n\t\tvar tabDiv = document.getElementById('tabsetDiv');\r\n\t\ttabDiv.scrollLeft = tabDiv.scrollLeft + 100;\r\n\t}\r\n}", "function lpPatch_IE8(){\n\tif (typeof Array.prototype.indexOf !== 'function') {\n\t\tArray.prototype.indexOf = function(obj, start) {\n\t\t for (var i = (start || 0), j = this.length; i < j; i++) {\n\t\t if (this[i] === obj) { return i; }\n\t\t }\n\t\t return -1;\n\t\t} \n\t}\n\t\n\tif(typeof String.prototype.trim !== 'function') {\n\t\tString.prototype.trim = function() {\n\t \treturn this.replace(/^\\s+|\\s+$/g, ''); \n\t\t}\n\t}\t\n}", "if (hWin.frames.frTransfer) {\r\t\t\r\t\t\tthis.hTransferObject\t= hWin.frames.frTransfer\r\t\t\tthis.isSrc\t\t\t= false\r\t\t\t\r\t\t}", "transient final protected internal function m174() {}", "transient private internal function m185() {}", "function gestoreClickPulsTop() {\r\n try {\r\n document.body.scrollTop = 0; // chrome safari opera\r\n document.documentElement.scrollTop = 0; // IE Firefox\r\n } catch (e) {\r\n alert(\"gestoreClickPulsTop \" + e);\r\n }\r\n}", "function iao_iframefix()\r\n{\r\n\tif(ulm_ie && !ulm_mac && !ulm_oldie && !ulm_ie7)\r\n\t\t{\r\n\t\t\tfor(var i=0;i<(x31=uld.getElementsByTagName(\"iframe\")).length;i++)\r\n\t\t\t{ \r\n\t\t\t\tif((a=x31[i]).getAttribute(\"x30\"))\r\n\t\t\t\t{\r\n\t\t\t\t\ta.style.height=(x32=a.parentNode.getElementsByTagName(\"UL\")[0]).offsetHeight;a.style.width=x32.offsetWidth;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n}", "transient final private protected internal function m167() {}", "function Zoom_Register_FireFox(theObject, cssZoom)\n{\n\t//returns null (firefox doesnt like this)\n\treturn null;\n}", "function __firefox() {\n HTMLElement.prototype.__defineGetter__(\"runtimeStyle\", __element_style);\n window.constructor.prototype.__defineGetter__(\"event\", __window_event);\n Event.prototype.__defineGetter__(\"srcElement\", __event_srcElement);\n}", "function clickIE4(){\nif (event.button==2){\nreturn false;\n}\n}", "transient private protected public internal function m181() {}", "function ie03Back(){ \r\n\t\tz_ie03_change_display = false;\r\n\t\tset(\"V[z_ie03_*]\",\"\");\r\n}", "function browserFixes() {\n // no text select on drag\n document.body.style.webkitUserSelect = 'none';\n // non right clickery\n //document.body.oncontextmenu = function() { return false; };\n // FIXME IEBUG CHROMEBUG\n // very ugly hack until they fixes some of their\n // audio bugs we disable audio completely\n if (navigator.userAgent.indexOf('Chrome') > -1 || navigator.userAgent.indexOf('MSIE') > -1 ||\n navigator.userAgent.indexOf('Safari') > -1) {\n gamejs.mixer.Sound = function() {\n return {\n play: function() {}\n };\n };\n }\n}", "function lstn(o, t, f)\r\n{\r\n if (o.addEventListener) {\r\n // Because MSIE only has a bubbling phase, capture will always be false.\r\n o.addEventListener(t, f, false);\r\n return true;\r\n } else if (o.attachEvent){\r\n return o.attachEvent(\"on\" + t, f);\r\n }\r\n return false;\r\n}", "function _overflowFixAdd() { ($.browser.msie) ? $(\"body, html\").css({ overflowX: 'visible' }) : $(\"body\").css({ overflowX: 'visible' }); }", "function getElementAbsolutePos(element) {\n var res = new Object();\n res.x = 0;\n res.y = 0;\n if (element !== null) {\n if (element.getBoundingClientRect) {\n var viewportElement = document.documentElement;\n var box = element.getBoundingClientRect();\n var scrollLeft = viewportElement.scrollLeft;\n var scrollTop = viewportElement.scrollTop;\n\n res.x = box.left + scrollLeft;\n res.y = box.top + scrollTop;\n\n }\n else { //for old browsers\n res.x = element.offsetLeft;\n res.y = element.offsetTop;\n\n var parentNode = element.parentNode;\n var borderWidth = null;\n\n while (offsetParent != null) {\n res.x += offsetParent.offsetLeft;\n res.y += offsetParent.offsetTop;\n\n var parentTagName =\n offsetParent.tagName.toLowerCase();\n\n if ((__isIEOld && parentTagName != \"table\") ||\n ((__isFireFoxNew || __isChrome) &&\n parentTagName == \"td\")) {\n borderWidth = kGetBorderWidth\n (offsetParent);\n res.x += borderWidth.left;\n res.y += borderWidth.top;\n }\n\n if (offsetParent != document.body &&\n offsetParent != document.documentElement) {\n res.x -= offsetParent.scrollLeft;\n res.y -= offsetParent.scrollTop;\n }\n\n\n //next lines are necessary to fix the problem\n //with offsetParent\n if (!__isIE && !__isOperaOld || __isIENew) {\n while (offsetParent != parentNode &&\n parentNode !== null) {\n res.x -= parentNode.scrollLeft;\n res.y -= parentNode.scrollTop;\n if (__isFireFoxOld || __isWebKit) {\n borderWidth =\n kGetBorderWidth(parentNode);\n res.x += borderWidth.left;\n res.y += borderWidth.top;\n }\n parentNode = parentNode.parentNode;\n }\n }\n\n parentNode = offsetParent.parentNode;\n offsetParent = offsetParent.offsetParent;\n }\n }\n }\n return res;\n}", "function fixActiveElement() {\n // IE9 throws an \"Unspecified error\" accessing document.activeElement from an <iframe>\n try {\n if (!document.activeElement && typeof (document.body.setActive) === \"function\") {\n document.body.setActive();\n }\n } catch ( error ) {}\n }", "function ie(e,n){var r=a(e),o=void 0===x[0];n=void 0===n||!!n,t.animate&&!o&&i(w,t.cssClasses.tap,t.animationDuration),S.forEach((function(e){ne(e,function(e,n){return null===e||!1===e||void 0===e?x[n]:(\"number\"==typeof e&&(e=String(e)),e=t.format.from(e),!1===(e=k.toStepping(e))||isNaN(e)?x[n]:e)}(r[e],e),!0,!1)})),S.forEach((function(e){ne(e,x[e],!0,!0)})),te(),S.forEach((function(e){$(\"update\",e),null!==r[e]&&n&&$(\"set\",e)}))}", "function iao_iframefix() {\n if (ulm_ie && !ulm_mac && !ulm_oldie && !ulm_ie7) {\n for (var i = 0; i < (x31 = uld.getElementsByTagName(\"iframe\")).length; i++) {\n if ((a = x31[i]).getAttribute(\"x30\")) {\n a.style.height = (x32 = a.parentNode.getElementsByTagName(\"UL\")[0]).offsetHeight; \n a.style.width = x32.offsetWidth;\n } \n } \n } \n}", "function __releaseSelects($dom) {\r\n if (_floatGFrame!=null) {\r\n _floatGFrame.style.display = \"none\";\r\n }\r\n}", "function thisBrowserIsBad() {\n track('streaming', 'not supported');\n alert(facetogif.str.nope);\n }", "static final private internal function m106() {}", "function k(){setTimeout(function(){// IE7 needs this so dimensions are calculated correctly\n!la.start&&p()&&// !currentView.start makes sure this never happens more than once\ns()},0)}", "function ie(e,r){var n=o(e),a=void 0===w[0]\nr=void 0===r||!!r,t.animate&&!a&&i(_,t.cssClasses.tap,t.animationDuration),E.forEach((function(e){re(e,function(e,r){return null===e||!1===e||void 0===e?w[r]:(\"number\"==typeof e&&(e=String(e)),e=t.format.from(e),!1===(e=D.toStepping(e))||isNaN(e)?w[r]:e)}(n[e],e),!0,!1)})),E.forEach((function(e){re(e,w[e],!0,!0)})),te(),E.forEach((function(e){$(\"update\",e),null!==n[e]&&r&&$(\"set\",e)}))}", "function f() {\n A && (A.detachEvent(\"onpropertychange\", h), A = null, P = null);\n }", "function tryWebkitApproach() {\n // document.location = custom;\n document.location = \"epicollectplus://project?plus.epicollect.net/bestpint.xml\";\n timer = setTimeout(function () {\n document.location = alt;\n }, 2000);\n }", "function redraw() { // IE6/7 position:relative elements not moving fix\n\tif($.browser.msie) {\n\t\t$('#columnPicker').css('display','none');\n\t\t$('#columnPicker').css('display','block');\n\t}\n}", "function fewLittleThings(){\r\n\t\r\n\t//document.getElementById('col-dx').childNodes[2].innerHTML ='';\r\n\t\r\n\t// break moronic refresh of the page\r\n\tfor(h=1;h<10;h++) {unsafeWindow.clearTimeout(h);}\r\n\tdocument.body.appendChild(document.createElement('script')).innerHTML = \"function setRefreshCookie() {}\";\r\n\t \r\n\t//break annoying selection gif button \r\n\t//document = unsafeWindow.document;\r\n\t//document.onmouseup = null;\r\n\tdocument.body.appendChild(document.createElement('script')).innerHTML = \"function mostraPulsante() {}\";\r\n\t\r\n\t\r\n\t}", "function i(e){return null==e}", "function change_focus(f, o, event) {\n var ret1 = \"\";\n var j = 0;\n var i = 0;\n var b = 0;\n first_object_id = -1;\n //try{\n var keyCode;\n //var keyCode = (document.layers) ? keyStroke.which : event.keyCode;\n if (typeof (event) == \"undefined\") {\n keyCode = window.event.keyCode;\n }\n else {\n keyCode = (window.event) ? event.keyCode : event.which;\n }\n if (keyCode == '13') {\n event.preventDefault();\n }\n // Neu la phim Enter, Down, Up\n if ((keyCode == '9' && o.type == 'select-one') || (o.type != 'select-one' && (keyCode == '40' || keyCode == '38' || keyCode == '13'))) {\n b = 0;\n while (i >= 0 && (i < f.length) && (j < 2)) {\n var e = f.elements[i];\n // Xac dinh ID cua field dau tien co kieu khong phai la hidden\n if (e.type != 'hidden' && first_object_id == -1) first_object_id = i;\n // Tim de vi tri cua doi tuong hien tai\n if ((b == 0) && (e.name == o.name) && (e.type != 'hidden')) {\n o.blur();\n b = 1;\n if (keyCode != '38') {\n i = i + 1;\n if (i == f.length) i = first_object_id;\n } else {\n if (i == first_object_id) i = f.length - 1; else i = i - 1;\n }\n var e = f.elements[i];\n }\n if (b == 1) {\n if ((e.type != 'hidden') && (!e.readOnly) && (!e.disabled) && (e.hide != 'true')) {\n e.focus();\n return true;\n }\n }\n if (keyCode != '38') {\n i = i + 1;\n if (i == f.length) { i = 0; j = j + 1; }\n } else {\n i = i - 1;\n if (i == first_object_id) { i = f.length - 1; j = j + 1; }\n }\n }\n }\n return true;\n //}catch(e){}\n}", "function fixOperaBug(e){return browser.opera?e.length-e.replace(/\\n*/g,\"\").length:0}", "function rf(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(\n // Might be a text scaling operation, clear size caches.\n t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}", "function fix_mouse(e,a)\n{\n\tif ( e && e.preventDefault )\n\te.preventDefault();\n\telse \n\twindow.event.returnValue=false;\n\ta.focus();\n\n}", "function fixIeBug(string) {\r\n\t\t\t\tif ($.browser.msie) {\r\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\r\n\t\t\t\t}\r\n\t\t\t\treturn 0;\r\n\t\t\t}", "function en(e,t,a,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(a?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,Ga(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}", "function ie03Clr(){ \r\n\tz_ie03_nav_details_flag = false;\r\n}", "function e(a){var q=(a||u).toLowerCase();var B1=/(webkit)[ \\/]([\\w.]+)/;var C1=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var D1=/(msie) ([\\w.]+)/;var E1=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var F1=/(edge)[ \\/]([\\w.]+)/;var G1=/(mozilla)(?:.*? rv:([\\w.]+))?/;var H1=F1.exec(q)||E1.exec(q)||B1.exec(q)||C1.exec(q)||D1.exec(q)||q.indexOf(\"compatible\")<0&&G1.exec(q)||[];var I1={browser:H1[1]||\"\",version:H1[2]||\"0\"};I1[I1.browser]=true;return I1;}", "function bringSelectedIframeToTop(val) {\r\n\tDIF_raiseSelectedIframe = val;\r\n}", "function Le(){!function t(e){Ie[De++]^=255&e,Ie[De++]^=e>>8&255,Ie[De++]^=e>>16&255,Ie[De++]^=e>>24&255,De>=Ue&&(De-=Ue)}((new Date).getTime())}", "function ie(){this.i=0,this.j=0,this.S=new Array}", "function Xj(a,b){this.Oc=D(\"div\",\"blocklyToolboxDiv\");this.Oc.setAttribute(\"dir\",q?\"RTL\":\"LTR\");b.appendChild(this.Oc);this.V=new Sh;a.appendChild(this.V.H());v(this.Oc,\"mousedown\",this,function(a){$b(a)||a.target==this.Oc?gg(!1):gg(!0)})}", "function dontPosSelect() {\n return false;\n }", "function fixIeBug(string) {\n\t\t\t\tif (browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "function fixIeBug(string) {\n\t\t\t\tif (browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "function isOldWebKit() {\n\t\t\t\tvar webKitChunks = navigator.userAgent.match(/WebKit\\/(\\d*)/);\n\t\t\t\treturn !!(webKitChunks && webKitChunks[1] < 536);\n\t\t\t}", "function isOldWebKit() {\n\t\t\t\tvar webKitChunks = navigator.userAgent.match(/WebKit\\/(\\d*)/);\n\t\t\t\treturn !!(webKitChunks && webKitChunks[1] < 536);\n\t\t\t}", "function isOldWebKit() {\n\t\t\t\tvar webKitChunks = navigator.userAgent.match(/WebKit\\/(\\d*)/);\n\t\t\t\treturn !!(webKitChunks && webKitChunks[1] < 536);\n\t\t\t}", "function Oe(){!function t(e){Ie[De++]^=255&e,Ie[De++]^=e>>8&255,Ie[De++]^=e>>16&255,Ie[De++]^=e>>24&255,De>=Le&&(De-=Le)}((new Date).getTime())}", "function s(e){\n// Support: real iOS 8.2 only (not reproducible in simulator)\n// `in` check used to prevent JIT error (gh-2145)\n// hasOwn isn't used here due to false negatives\n// regarding Nodelist length in IE\nvar t=!!e&&\"length\"in e&&e.length,n=me.type(e);return\"function\"!==n&&!me.isWindow(e)&&(\"array\"===n||0===t||\"number\"==typeof t&&0<t&&t-1 in e)}", "function janPrin(t,e) {\n\t\tif (!e) {\n\t\t\t//plugin wordpress\n\t\t\tgravador = jsCSSEditor_gravador;\n\t\t\te = t;\n\t\t}\n\t\t//debJ('e.ctrlKey='+e.ctrlKey+'e.shiftKey='+e.shiftKey);\n\t\tif (!e.ctrlKey && !e.shiftKey) {\n\t\t\treturn;\n\t\t}\n\t\tif (!browse.ie) {\n\t\t\ttry {\n\t\t\t\te.stopPropagation();\n\t\t\t} catch (e) {\n\t\t\t}\n\t\t}\n\t\t//objNav(e);\n\t\t//lert('e='+e);\n\t\t//return;\n\t\tjsCSSEditorD[0] = targetEvent(e);\n\t\t//objNav(jsCSSEditorD[0]);\n\t\t//lert(1);\n\t\ttry {\n\t\t\tdoc = e.target.ownerDocument;\n\t\t} catch (e) {\n\t\t\t//ie\n\t\t\t//lert('ie='+erro(e));\n\t\t\tdoc = jsCSSEditorD[0].document;\n\t\t}\n\t\tjsCSSEditorD[1] = doc.styleSheets;\n\t\t//bjNav(top);\n\t\t//objNav(doc.styleSheets);\n\t\tvar fs = '';\n\t\tfor (var i=0;i<doc.styleSheets.length;i++) {\n\t\t\t//fs += ','+substrAt(substrAt(document.styleSheets[i].href,'//'),'/');\n\t\t\ttry {\n\t\t\t\t//ocorre ERRO com estilos criados pelo GMap...\n\t\t\t\t//ebJ(i+' css at '+doc.styleSheets[i].href+(doc.styleSheets[i].href?' sim':' nao'));\n\t\t\t\tif (doc.styleSheets[i].href) {// && right(doc.styleSheets[i].href,4).toLowerCase()=='.css') {\n\t\t\t\t\t//ebJ('xx='+escape(absoluteUrl(doc.styleSheets[i].href)));\n\t\t\t\t\tfs += ','+i+'~'+escape(absoluteUrl(doc.styleSheets[i].href));\n\t\t\t\t\t//lert(document.styleSheets[i].href);\n\t\t\t\t} else {\n\t\t\t\t\t//fs +=',~~'+i;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\talert(doc.styleSheets[i].href+' '+erro(e));\n\t\t\t}\n\t\t\t//objNav(document.styleSheets[i]);\n\t\t}\n\t\tif (fs.length==0) {\n\t\t\talert('no css style sheet');\n\t\t\treturn;\n\t\t} else {\n\t\t\tfs = fs.substring(1);\n\t\t}\n\t\tvar w = new winDep(top,gravador+'?_fls='+fs\n\t\t\t+'&_loc='+escape(window.location));\n\t\tw.tipo = 3;\n\t\t//w.frame = true;\n\t\t//w.debug = true;\n\t\tw.centrada = false;\n\t\tw.abre();\n\t}", "function PMA_saveFrameSizeReal()\n{\n if (parent.text_dir == 'ltr') {\n pma_navi_width = parseInt(parent.document.getElementById('mainFrameset').cols)\n } else {\n pma_navi_width = parent.document.getElementById('mainFrameset').cols.match(/\\d+$/) \n }\n if ((pma_navi_width > 0) && (pma_navi_width != PMA_getCookie('pma_navi_width'))) {\n PMA_setCookie('pma_navi_width', pma_navi_width, expires);\n }\n}", "function e(a){var q=(a||u).toLowerCase();var A1=/(webkit)[ \\/]([\\w.]+)/;var B1=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var C1=/(mozilla)(?:.*? rv:([\\w.]+))?/;var D1=A1.exec(q)||B1.exec(q)||q.indexOf(\"compatible\")<0&&C1.exec(q)||[];var E1={browser:D1[1]||\"\",version:D1[2]||\"0\"};E1[E1.browser]=true;return E1;}", "function Pj(a,b){this.Wd=u(\"div\",\"blocklyToolboxDiv\");this.Wd.setAttribute(\"dir\",q?\"RTL\":\"LTR\");b.appendChild(this.Wd);this.Sa=new Te;a.appendChild(this.Sa.Aa());C(this.Wd,\"mousedown\",this,function(a){ae(a)||a.target==this.Wd?ee(!1):ee(!0)})}", "function fixIeBug(string) {\n\t\t\t\tif ($.browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "function fixIeBug(string) {\n\t\t\t\tif ($.browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "function b(){g.style.cssText=\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute\",g.innerHTML=\"\",e.appendChild(f);var b=a.getComputedStyle(g,null);c=\"1%\"!==b.top,d=\"4px\"===b.width,e.removeChild(f)}", "static private protected internal function m118() {}", "function ieAjaxWorkaround(){\n return \"time='\"+new Date().getTime() + \"'\";\n}", "function adjustScroll()\r\n{\r\n\tif ((browserName == browserIE) || (browserName == browserFF) || (browserName == browserSafari))\r\n\t{\r\n\t\tAdjustScroll();\r\n\t}\r\n}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function compatibility() {\n /* Logon */\n $('#title_settings').parent()\n .css('display', 'block')\n .css('postion', 'relative');\n\n $('#title_settings').css('postion', 'absulute')\n .css('width', '65px')\n .css('height','20px')\n .css('margin', '8px auto auto auto');\n }", "function qa(e,t){if(!Ne(e,\"scrollCursorIntoView\")){var a=e.display,r=a.sizer.getBoundingClientRect(),f=null;if(t.top+r.top<0?f=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),null!=f&&!No){var o=n(\"div\",\"鈥�\",null,\"position: absolute;\\n top: \"+(t.top-a.viewOffset-Ft(e.display))+\"px;\\n height: \"+(t.bottom-t.top+Gt(e)+a.barHeight)+\"px;\\n left: \"+t.left+\"px; width: \"+Math.max(2,t.right-t.left)+\"px;\");e.display.lineSpace.appendChild(o),o.scrollIntoView(f),e.display.lineSpace.removeChild(o)}}}", "function ie(e,t){this.x=t,this.q=e}", "function GetElementAbsolutePos(element) {\r\n\tvar res = new Object();\r\n\tres.x = 0; res.y = 0;\r\n\tif (element !== null) {\r\n\t\tres.x = element.offsetLeft; \r\n\t\tres.y = element.offsetTop; \r\n \t\r\n\t\tvar offsetParent = element.offsetParent;\r\n\t\tvar parentNode = element.parentNode;\r\n\r\n\t\twhile (offsetParent !== null) {\r\n\t\t\tres.x += offsetParent.offsetLeft;\r\n\t\t\tres.y += offsetParent.offsetTop;\r\n\r\n\t\t\tif (offsetParent != document.body && offsetParent != document.documentElement) {\r\n\t\t\t\tres.x -= offsetParent.scrollLeft;\r\n\t\t\t\tres.y -= offsetParent.scrollTop;\r\n\t\t\t}\r\n\t\t\t//next lines are necessary to support FireFox problem with offsetParent\r\n\t\t\tif (__isFireFox) {\r\n\t\t\t\twhile (offsetParent != parentNode && parentNode !== null) {\r\n\t\t\t\t\tres.x -= parentNode.scrollLeft;\r\n\t\t\t\t\tres.y -= parentNode.scrollTop;\r\n\t\t\t\t\t\r\n\t\t\t\t\tparentNode = parentNode.parentNode;\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\tparentNode = offsetParent.parentNode;\r\n\t\t\toffsetParent = offsetParent.offsetParent;\r\n\t\t}\r\n\t}\r\n return res;\r\n}", "function DK_DoFrame(){ /*DKLog(\"DK_ClearEvents(): not available for \"+DK_GetBrowser()+\"\\n\", DKWARN);*/ }", "function ie(a){this.ra=a}", "function mj(a,b){this.Sc=ac(\"div\",\"blocklyToolboxDiv\");this.Sc.setAttribute(\"dir\",J?\"RTL\":\"LTR\");b.appendChild(this.Sc);this.Wa=new nj;a.appendChild(this.Wa.Ba());M(this.Sc,\"mousedown\",this,function(a){bd(a)||a.target==this.Sc?le(!1):le(!0)})}", "function tempFix() {\n for (var id = 0; id < window.parent.frames.length; id++) {\n addPasteHandler(window.parent.frames[id].document);\n }\n}" ]
[ "0.5764417", "0.57277346", "0.5568826", "0.5524992", "0.55239373", "0.55047923", "0.54650784", "0.5458367", "0.54365754", "0.53885704", "0.53885704", "0.5355408", "0.5353211", "0.53430164", "0.5336466", "0.5324651", "0.5320176", "0.5297509", "0.5296868", "0.5290672", "0.5263345", "0.5250611", "0.5147285", "0.5105038", "0.5102224", "0.5084664", "0.5084661", "0.5084378", "0.5080725", "0.50801134", "0.50772274", "0.5065524", "0.50571597", "0.5023695", "0.5022916", "0.5006006", "0.50020665", "0.49951637", "0.4990608", "0.4988322", "0.4960379", "0.49578238", "0.49457002", "0.49323896", "0.4930129", "0.4926401", "0.49248838", "0.4923034", "0.49150696", "0.49059287", "0.4903507", "0.48955405", "0.48938853", "0.48919204", "0.488994", "0.4886378", "0.48825037", "0.48769033", "0.48760104", "0.4873655", "0.487165", "0.48707232", "0.48676813", "0.4866831", "0.48647118", "0.48641098", "0.48428276", "0.4836278", "0.4834887", "0.48336178", "0.48217386", "0.4818118", "0.4815278", "0.48143312", "0.48143312", "0.4795519", "0.4795519", "0.4795519", "0.47936678", "0.47907346", "0.4790169", "0.47890264", "0.4786769", "0.4785575", "0.47842842", "0.47842842", "0.47827092", "0.47782958", "0.47741094", "0.47673175", "0.4764916", "0.4764916", "0.4764916", "0.47582215", "0.47562957", "0.47561046", "0.47527748", "0.47411028", "0.47302252", "0.4730143", "0.4729422" ]
0.0
-1
create start function with listerners
function start(){ //create listener for the mouse being down document.addEventListener("mousedown", beginDrag, false); //create listener for the mouse button release document.addEventListener("mouseup", stopDrag, false); aImage = document.getElementById("pic"); zIndex = 0; mouseX = 0; mouseY = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startPoint()\n{\n\n}", "function createIncremontor(start) {\n return function () { // 1\n start++;\n return start\n }\n}", "set start(value) {}", "function makeStartingList(){\n for(var i = 0; i<1; i++){\n addListItem( {task: \"Make the list\"});\n addListItem( {task: \"Test the list\"});\n addListItem( {task: \"Pretend to do the list\"});\n }\n}", "constructor(input, start){\n this.input = input\n this.start = start \n }", "constructor(input, start){\n this.input = input\n this.start = start \n }", "function startWith() {\n var array = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n array[_i] = arguments[_i];\n }\n var scheduler = array[array.length - 1];\n if ((0,isScheduler/* isScheduler */.K)(scheduler)) {\n array.pop();\n return function (source) { return (0,concat/* concat */.z)(array, source, scheduler); };\n }\n else {\n return function (source) { return (0,concat/* concat */.z)(array, source); };\n }\n}", "turn_starts(args) {\n\n }", "start() {// [3]\n }", "function inertStartNode() {\n let startNode = document.querySelector(\".start-node\").id;\n let splittedNode = startNode.split(\"-\")\n nodesList.push([parseInt(splittedNode[0]), parseInt(splittedNode[1])]);\n let newNode = new Node(startNode)\n newNode.setX()\n newNode.setY()\n newNode.updateType('start-node')\n newNode.setDistance(0)\n availableNodes.push(newNode)\n }", "makeStart() {\n this.type = Node.START;\n this.state = null;\n }", "function start(tab)\n{\n\t\n}", "function start(){\n\t\n}", "function start() {\n\n}", "function renderStart() {\n generateStart();\n }", "function the_start_callback(){\n\t\t\t\tif(typeof start_callback == 'function'){\n\t\t\t\t\tvar id = $container.attr('id');\n\t\t\t\t\tif(id==undefined || !id){\n\t\t\t\t\t\tid = '[no id]';\n\t\t\t\t\t}\n\t\t\t\t\tstart_callback(id);\n\t\t\t\t}\n\t\t\t}", "function startUp(_x,_x2,_x3){return _startUp.apply(this,arguments);}", "function onConstruct(thelist){\n\t\t\t\tif(!mixin._started && !options.noStart){\n\t\t\t\t\tdarray.forEach(thelist, function(instance){\n\t\t\t\t\t\tif(typeof instance.startup === \"function\" && !instance._started){\n\t\t\t\t\t\t\tinstance.startup();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn thelist;\n\t\t\t}", "function onConstruct(thelist){\n\t\t\t\tif(!mixin._started && !options.noStart){\n\t\t\t\t\tdarray.forEach(thelist, function(instance){\n\t\t\t\t\t\tif(typeof instance.startup === \"function\" && !instance._started){\n\t\t\t\t\t\t\tinstance.startup();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn thelist;\n\t\t\t}", "function onConstruct(thelist){\n\t\t\t\tif(!mixin._started && !options.noStart){\n\t\t\t\t\tdarray.forEach(thelist, function(instance){\n\t\t\t\t\t\tif(typeof instance.startup === \"function\" && !instance._started){\n\t\t\t\t\t\t\tinstance.startup();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn thelist;\n\t\t\t}", "set start(start) {\n\t\tthis._start = start;\n\t}", "get start() {}", "start() {\n this.addBefore(\"^\");\n return this;\n }", "function start(){\n console.log('start()');\n}", "function startFrom(value) { }", "function startFromALocation(startingLocation, locationsList) {\n return R.prepend(startingLocation, locationsList);\n}", "start(item) {\n const _super = Object.create(null, {\n start: { get: () => super.start }\n });\n return __awaiter(this, void 0, void 0, function* () {\n return _super.start.call(this, item);\n });\n }", "function Start () {}", "constructor(start = 0) {\n this.value = start;\n }", "function init() {\n spielstart();\n}", "function startOver() { }", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "function start() {\n​\n}", "enterListmaker(ctx) {\n\t}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "preStart() {\n }", "start(bound, space) { console.log('Start callback'); }", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "function rest(func, start) {\n\t return overRest$1(func, start, identity);\n\t}", "function createList(start, end, start1, end1, callback) {\n var ints = [];\n for (var i = start; i < end; i++) {\n //console.log(i);\n ints.push(i);\n }\n\n if (start1 != 0 && end1 !== 0) {\n\n for (var j = start1; j < end1; j++) {\n console.log(j);\n ints.push(j);\n }\n }\n callback(ints);\n}", "function onConstruct(thelist) {\n if (!JSProf.LGD(5634, mixin, '_started')._started && !JSProf.LGD(5635, options, 'noStart').noStart) {\n JSProf.LMC(5641, darray, 'forEach').forEach(JSProf.LRE(5636, thelist), JSProf.LNF(5640, function (instance) {\n if (typeof JSProf.LGD(5637, instance, 'startup').startup === \"function\" && !JSProf.LGD(5638, instance, '_started')._started) {\n JSProf.LMC(5639, instance, 'startup').startup();\n }\n }, 12));\n }\n return JSProf.LRE(5642, thelist);\n }", "constructor(start: number, stop: number) {\n this.start = start;\n this.stop = stop;\n }", "start(callback){\n \n }", "start () {}", "function start() {\r\n dadesInicialsJugador(j1);\r\n dadesInicialsFantasma(f1);\r\n dadesInicialsFantasma(f2);\r\n dadesInicialsFantasma(f3);\r\n pintar();\r\n iterar = setInterval(iteracio, 200);\n //restart();\n}", "started() {\r\n\r\n\t}", "start() {\n }", "function startListCount() {\n active = 0;\n previous = active - 1;\n next = active + 1;\n\n s_imageElements[active].classList.add(state.slideShow.active);\n s_imageElements[next].classList.add(state.slideShow.next);\n s_markerElements[active].classList.add(state.markers.active);\n\n lastIndex = s_imageElements.length - 1;\n }", "started() {\n\t}", "function startByLine(line){\n inputs = \"\";\n var text = line.split(\",\");\n lCmd = text[0];\n\n\n for(var j=1; j<text.length;j++){\n inputs += text[j];\n inputs += \" \";\n }\n start();\n}", "function doStart() {\r\n\t\r\n\tdocument.getElementById(\"non-visible\").style.display = \"none\";\r\n\tdocument.getElementById(\"start\").style.display = \"block\";\r\n\t\r\n\tdoNext();\r\n}", "function runitl(start) {\n vm.r.push(vm.i) ;\n vm.i = start ;\n if (vm.r.length===1) {\n while (vm.i !== undefined) {\n var r = vm.x[vm.i++] ;\n if (typeof r===\"function\")\n r = r() ;\n else\n [].push.apply(vm.s,[].reverse.call(r));\n// if (r && typeof r.then==='function')\n// return r.then(runitl,function(x){ throw x }) ;\n }\n }\n}", "start(range) {\n var [start] = Range.edges(range);\n return start;\n }", "start(range) {\n var [start] = Range.edges(range);\n return start;\n }", "function start() {\n iterateTimer = setInterval(iterate, ms());\n $('#start').attr('disabled', 'disabled');\n $('#stop').removeAttr('disabled');\n }", "started() {\n\n }", "started() {\n\n }", "started() {\n\n }", "function startCommandList(value) {\n var regs, listName, loopName, loopIndexName, loopHasNextName, rt = [];\n regs = /(.*?)\\s+as\\s+([$\\w]+)/.exec(value);\n if (regs && regs.length && regs.length === 3) {\n listName = _expression(regs[1]);\n loopName = regs[2];\n loopIndexName = loopName + '_index';\n loopHasNextName = loopName + '_has_next';\n\n rt.push('(function(){');\n if (!/^\\w+$/.test(listName)) {\n rt.push('var _list=' + listName + ';');\n listName = '_list';\n }\n rt.push(['var __i=0', '__count=' + listName + '.length', loopName, loopIndexName, loopHasNextName + ';'].join(','));\n rt.push('for(;__i<__count;__i++){');\n rt.push(loopName + '=' + listName + '[__i];');\n rt.push(loopIndexName + '=__i;');\n rt.push(loopHasNextName + '=(__i!==__count-1);');\n }\n return rt.join('');\n }", "function startNewCall() {\n\n}", "function startIntevall() {\r\n start = setInterval(function () {\r\n timer();\r\n }, 1000);\r\n }", "function createStartsWithFilter(startsWith) {\n // YOUR CODE BELOW HERE //\n \n //return function, that takes givenValue\n return function (givenValue){\n //this function should return true if given value matches startsWith\n return givenValue[0].toLowerCase() === startsWith[0].toLowerCase();\n \n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function startinit(){\n eel.initFun()(startmsg)\n}", "function start(startnode, resume_seconds){\n\t\t\t\tstart_time=+new Date();\n\t\t\t\t\n\t\t\t\t//alert('start_time '+start_time);\n\t\t\t\t//aggiungo la classe playNode alla slide che sto visualizzando\n\t\t\t\t$playBtnNav.each(function(){\n\t\t\t\t\tvar id=$(this).data('id');\n\t\t\t\t\tif((parseInt(id))==startnode){\n\t\t\t\t\t\t$(this).addClass('playNode');\n\t\t\t\t\t\t$(this).children('img').attr('src',path_+'/slider-pause.png');\n\t\t\t\t\t\t}\n\t\t\t\t\telse if($(this).hasClass('playNode')){\n\t\t\t\t\t\t$(this).removeClass('playNode');\n\t\t\t\t\t\t$(this).children('img').attr('src',path_+'/slider-play.png');\n\t\t\t\t\t\t}\t\n\t\t\t\t\t});\n\t\t\t\t//\tresume second è sempre 4, non va bene\n\t\t\t\t//alert('resume_seconds'+resume_seconds);\n\t\t\t\t// Presentation start callback function\n\t\t\t\tif(startnode<2 && !resume_seconds && !started){\n\t\t\t\t\tthe_start_callback();\n\t\t\t\t}\n\t\t\t\t// Start the timer\n\t\t\t\tif(!resume_seconds){\n\t\t\t\t\tseconds = nodesec[startnode];\n\t\t\t\t}\n\t\t\t\tif(o.showtimedisplay){\n\t\t\t\t\ttime_start(seconds);\n\t\t\t\t}\n\t\t\t\t// Reset positions\n\t\t\t\tif(!resume_seconds){\n\t\t\t\t\t$innertimeline.css({ width:nodepos[startnode] });\n\t\t\t\t\tif(o.showtimedisplay){\n\t\t\t\t\t\t$time.css({ left:nodepos[startnode]-halftimewidth });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Calculate animation time\n\t\t\t\tif(resume_seconds){\n\t\t\t\t\tanimationtime = (resume_seconds*1000);\n\t\t\t\t}else{\n\t\t\t\t\tanimationtime = (nodeinterval[startnode]*1000);\n\t\t\t\t}\n\t\t\t\t// Animate time display\n\t\t\t\tif(startnode<nodes){\n\t\t\t\t\t//alert(nodepos[(startnode+1)]);\n\t\t\t\t\ttargetpos = nodepos[(startnode+1)];\n\t\t\t\t}else{\n\t\t\t\t\ttargetpos = o.timelinewidth;\n\t\t\t\t}\n\t\t\t\tif(o.showtimedisplay){\n\t\t\t\t\t$time.animate({\n\t\t\t\t\t\tleft:(targetpos-halftimewidth)\n\t\t\t\t\t}, animationtime, 'linear');\n\t\t\t\t}\n\t\t\t\t// Animate timeline bar\n\t\t\t\t//targetpos è undefined se clicco sulla freccia\n\t\t\t\t\n\t\t\t\t//alert(targetpos);\n\t\t\t\t$innertimeline.animate({\n\t\t\t\t\twidth:targetpos\n\t\t\t\t}, animationtime, 'linear', function(){\n\t\t\t\t\t// Slide end callback\n\t\t\t\t\tif(o.showtimedisplay){\n\t\t\t\t\t\ttime_stop();\n\t\t\t\t\t}\n\t\t\t\t\tif(startnode<nodes){\n\t\t\t\t\t\tstart((startnode+1));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t// Presentation end callback function\n\t\t\t\t\t\tthe_end_callback();\n\t\t\t\t\t\tstarted = false;\n\t\t\t\t\t\t// Repeat presentation\n\t\t\t\t\t\tif(o.repeat){\n\t\t\t\t\t\t\tstart(1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// Slide transition\n\t\t\t\tif(startnode != activenode){\n\t\t\t\t\tdifferenceTot=0;\n\t\t\t\t\t$container.find('.slide:not(.slide'+startnode+'):not(.slide'+activenode+')').stop().animate({ opacity:0 },0).css({ 'z-index':0 });\n\t\t\t\t\tif(o.transition=='fade'){\n\t\t\t\t\t\tvar bgCol = $container.find('.slide'+startnode).find('.description').css('background-color');\n\t\t\t\t\t\t$('#bg-slider')\n\t\t\t\t\t\t\t.stop()\n\t\t\t\t\t\t\t.animate({ opacity:0 },300);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$container.find('.slide'+activenode)\n\t\t\t\t\t\t\t.stop()\n\t\t\t\t\t\t\t.animate({ opacity:0 },300,function(){\n\t\t\t\t\t\t\t\t$(this).css({ 'z-index':0 });\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t$container.find('.slide'+startnode)\n\t\t\t\t\t\t\t.stop()\n\t\t\t\t\t\t\t.animate({ opacity:1 },300,function(){\n\t\t\t\t\t\t\t\t$(this).css({ 'z-index':1 });\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t$('#bg-slider')\n\t\t\t\t\t\t\t.stop()\n\t\t\t\t\t\t\t.animate({ opacity:1 },150,function(){\n\t\t\t\t\t\t\t\t$(this).css({ 'background-color': bgCol });\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif(o.transition=='slide' || o.transition=='reveal'){\n\t\t\t\t\t\t$container.find('.slide'+activenode)\n\t\t\t\t\t\t\t.css({ 'z-index':1 })\n\t\t\t\t\t\t\t.stop(true,true)\n\t\t\t\t\t\t\t.animate({ left:-o.containerwidth },600,function(){\n\t\t\t\t\t\t\t\t$(this)\n\t\t\t\t\t\t\t\t\t.css({ 'z-index':0, left:0 })\n\t\t\t\t\t\t\t\t\t.animate({ opacity:0 },0);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif(o.transition=='reveal'){\n\t\t\t\t\t\t$container.find('.slide'+startnode)\n\t\t\t\t\t\t\t.css({ 'z-index':0 })\n\t\t\t\t\t\t\t.stop(true,true)\n\t\t\t\t\t\t\t.animate({ opacity:1 },0);\n\t\t\t\t\t}\n\t\t\t\t\tif(o.transition=='slide'){\n\t\t\t\t\t\t$container.find('.slide'+startnode)\n\t\t\t\t\t\t\t.css({ 'z-index':1, left:o.containerwidth })\n\t\t\t\t\t\t\t.stop(true,true)\n\t\t\t\t\t\t\t.animate({ opacity:1 },0)\n\t\t\t\t\t\t\t.animate({ left:0 },600);\n\t\t\t\t\t}\n\t\t\t\t\tif(o.transition=='instant'){\n\t\t\t\t\t\t$container.find('.slide'+activenode).animate({ opacity:0 },0);\n\t\t\t\t\t\t$container.find('.slide'+startnode).animate({ opacity:1 },0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Activate node\n\t\t\t\t$container.find('.node'+activenode).removeClass('node_active');\n\t\t\t\t$container.find('.node'+startnode).addClass('node_active');\n\n\t\t\t\tactivenode = startnode;\n\t\t\t\tplaying = true;\n\t\t\t\tif(o.showpauseplay){\n\t\t\t\t\t$pauseplay.attr('class','pause');\n\t\t\t\t}\n\t\t\t\t// Pause if this is the last node and repeat is off\n\t\t\t\tif(o.showpauseplay && (startnode==nodes && !o.repeat)){\n\t\t\t\t\tstop();\n\t\t\t\t}\n\t\t\t\t// New slide callback function\n\t\t\t\tif(!resume_seconds && started){\n\t\t\t\t\tthe_newslide_callback();\n\t\t\t\t}\n\t\t\t\tif(!started){\n\t\t\t\t\tstarted = true;\n\t\t\t\t}\n\t\t\t}", "enterList_for(ctx) {\n\t}", "function start(elem) {\n return new Point(magic).moveToStart(elem);\n}", "function Start(){//We start with no items\n\titems[0]=0;\n\titems[1]=0;\n}", "function iteratorFromIncrementing(start) {\n let i = start;\n return iteratorFromFunction(() => ({ value: i++, done: false }));\n}", "function start(){\n\t\tfor(i=0;i<foes.length;i++)\n\t\t\tfoes[i].march;\n\t\t}", "function addRange(start, finish, scope) {\r\n var i = 0;\r\n for (i = start; i <= finish; i++) {\r\n var item = {\r\n value: i.toString(),\r\n liClass: scope.page == i ? scope.activeClass : 'waves-effect',\r\n action: function() {\r\n internalAction(scope, this.value);\r\n }\r\n };\r\n\r\n scope.List.push(item);\r\n }\r\n }", "startSpindle(clockwise = true) {\n\n // Add the code to the stack to start the spindle in a specified direction\n this.add(this.opCode(`M`, ((clockwise) ? `03` : `04`)));\n }", "function start() {\r\n\tgenerateLastStep();\r\n\ttimeout = setTimeout(showSteps, 2000);\r\n}", "started() { }", "function setStart( start )\n{\n script.api.manualStart = true;\n script.api.start = start;\n}", "function chooseStart(){\n\tthis.x = event.clientX;\n\tthis.y = event.clientY;\n\tfor (i = 0; i < nodeArray.length; i++) {\n\t\tif (Math.abs(this.x-20-nodeArray[i].x) <= 17 && Math.abs(this.y-20-nodeArray[i].y) <= 17) {\n\t\t\tif(nodeArray[i] == start || nodeArray[i] == end){ break;}\n\t\t\tnodeArray[i].makeStart();\n\t\t\tif(start != null){\n\t\t\t\tstart.removeStart();\n\t\t\t}\n\t\t\tstart = nodeArray[i];\n\t\t\tbreak;\n\t\t};\n\t}\n}", "function launch() {\n\tcont=1;\n\tt1=setInterval(\"beginp()\",iter);\n}", "function klapp_timeline_startpoint() {\n\n\t$('.timecapsule').each(function() {\n\t if( $('ol', this).children().length != 0 && $('ol', this).children().is(':visible') ) {\n\t\t\tvar container_margin = $(this).position();\n\t\t\t$('.maintain').animate({\n\t\t\t\t'margin-top': '-' + container_margin.top + 'px'\n\t\t\t}, 500);\n\t\t\treturn false;\n\t }\n\t});\n\n}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}" ]
[ "0.6626864", "0.65649986", "0.6478278", "0.635719", "0.6303357", "0.6303357", "0.6161959", "0.6160001", "0.6154346", "0.5970895", "0.5966612", "0.5965385", "0.59398353", "0.5855967", "0.57817835", "0.5769968", "0.57034665", "0.567525", "0.567525", "0.567525", "0.56513834", "0.56143004", "0.560336", "0.5571094", "0.5548216", "0.553495", "0.5515956", "0.55059475", "0.55043715", "0.5503551", "0.54916316", "0.54915714", "0.54915714", "0.54915714", "0.54915714", "0.54915714", "0.54915714", "0.547865", "0.54598194", "0.54552215", "0.54552215", "0.54552215", "0.54552215", "0.54552215", "0.54552215", "0.54552215", "0.54552215", "0.54551524", "0.5450536", "0.5424963", "0.5424963", "0.5424963", "0.5424963", "0.5424963", "0.5424963", "0.5424963", "0.5424963", "0.54145586", "0.5402634", "0.5396202", "0.5389588", "0.5384668", "0.5376521", "0.536978", "0.536725", "0.5366226", "0.5357097", "0.53553724", "0.53378844", "0.5329592", "0.5320162", "0.5317955", "0.5317955", "0.5314618", "0.5292104", "0.5292104", "0.5292104", "0.5289543", "0.5283738", "0.5278961", "0.527734", "0.52682054", "0.5261989", "0.5259732", "0.5249226", "0.5246717", "0.52419496", "0.52363867", "0.5226181", "0.5223844", "0.52186817", "0.5216488", "0.52136815", "0.5212087", "0.5209016", "0.52076405", "0.5195325", "0.5195325", "0.5195325", "0.5195325", "0.5195325" ]
0.0
-1
uzdavinio esme kad vienu metu reikia sumuoti dvi reiksmes t.y. asmenu/vaiku counta/kieki ir amziaus counta
function averageAge(asmuo) { let childCount = 1; // vaiku kiekis = 1 , nes pedro jau yra 1 let childAgeSum = asmuo.age; // vaiku amziaus suma if (asmuo.children) { // jeigu vaiku yra, suskaiciuoti kiek for (let i = 0; i < asmuo.children.length; i++){ const child = asmuo.children[i]; // kiekvienas vaikas const childInfo = averageAge(child); childCount += childInfo.childCount; childAgeSum += childInfo.ageSum; } } return { childCount: childCount, ageSum: childAgeSum } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contadoresArgentina() {\n $('#provPymes').html('Argentina');\n var pymesCountUp = new CountUp(\"totalPymes\", totalPymes_var, totalPymes_ARG, 0, 0.5, options);\n pymesCountUp.start();\n\n var pymes_porCountUp = new CountUp(\"porcPymes\", porcPymes_var*100, porcPymes_ARG*100, 0, 0.5, options);\n pymes_porCountUp.start();\n $('#porcBar').css('width', porcPymes_ARG*100+'%');\n\n totalPymes_var = totalPymes_ARG;\n porcPymes_var = porcPymes_ARG;\n\n}", "function hitung_total(){\n\t\t\tvar b_kirim = $(\"#biaya_kirim\").val();\n\t\t\tvar b_packing = $(\"#biaya_packing\").val();\n\t\t\tvar b_asuransi = $(\"#biaya_asuransi\").val();\n\t\t\tvar dibayar = $(\"#dibayar\").val();\n\n\t\t\tvar totalnya = parseInt(b_kirim) + parseInt(b_packing) + parseInt(b_asuransi);\n\t\t\t$(\"#subtotal\").html(rupiah(totalnya));\n\t\t\t\n\t\t\tif(dibayar >= totalnya){\n\t\t\t\tvar totalakhir = parseInt(dibayar) - totalnya;\n\t\t\t\t$('#status_bayar').val('lunas');\n\t\t\t\t$('#ketuang').html('Kembalian');\n\t\t\t}else{\n\t\t\t\tvar totalakhir = totalnya - parseInt(dibayar);\n\t\t\t\t$('#status_bayar').val('belum_lunas');\n\t\t\t\t$('#ketuang').html('Kekurangan');\n\t\t\t}\n\t\t\t$(\"#total\").html(rupiah(totalakhir));\n\t\t}", "function kaufen(_event) {\n anzahl += 1;\n console.log(anzahl);\n //Name\n cartCounter.innerHTML = \"\" + anzahl;\n //zusammenrechnen der presie \n let test = _event.currentTarget.parentElement.getAttribute(\"id\");\n let test2 = test.split(\"Artikel\");\n // Summe der Preise \n summe += artikel[parseInt(test2[1])].preis;\n console.log(summe + \"€\");\n }", "function IndicadorTotal () {}", "function uitvoeren(){\n//aantal kliks\nuitvoerCount.innerHTML = countClik;\n// gemidelde rating\nuitvoerHart.innerHTML = Math.ceil(10*totalCount/countClik)/10;\n//in gelkeurde harten met gemidelde rating als %\nkleurDeHarten(Math.ceil(10*totalCount/countClik)/10);\n}", "function faltaVisitar(paisesVisitados){\n var totalPaises = 193;\n return `Faltam visitar ${totalPaises - paisesVisitados} paises`;\n\n\n}", "function calcNiveau(){\r\n var ancienNiveau = perso.niveau\r\n while (perso.exp > perso.levelLimit){\r\n perso.exp = perso.exp - perso.levelLimit\r\n perso.levelLimit = Math.round(perso.levelLimit * 1.5)\r\n perso.niveau++\r\n niveauPlus = true\r\n gainDeNiveau()\r\n }\r\n\r\n if (niveauPlus){\r\n var message = \"Aurora a gagné \" + (perso.niveau - ancienNiveau) + \" niveau !!!\"\r\n niveauPlus = false\r\n }else {\r\n var message = \"aurora a gagné \" + perso.exp + \" pts d'experience\"\r\n }\r\n return message\r\n}", "function mostrarCantidadCarrito() {\n if (coleccionProductos.length !== 0) {\n let cantidadProductoCarrito = 0;\n for (let producto of coleccionProductos) {\n cantidadProductoCarrito += parseInt(producto.cantidad);\n }\n $(\"#carrito .badge\").text(cantidadProductoCarrito);\n $(\"#carrito .badge\").show();\n } else {\n $(\"#carrito .badge\").hide();\n }\n}", "totalContenu() {\n console.log(`Il y a ${this.contenu.length} personne(s) dans le/la ${this.nom}`);\n }", "niveauSuivant()\r\n\t{\r\n\t\tthis._termine = false;\r\n\t\tthis._gagne = false;\r\n\t\tthis._niveau++;\r\n\t\tthis.demarrerNiveau();\r\n\t}", "function goukei_4_10() {\n var total_c1 = 0;\n var total_c2 = 0;\n var total_c3 = 0;\n var total_c4 = 0;\n if (vm.property.men4_10_5 && vm.property.men4_10_5.length > 0) {\n vm.property.men4_10_5.forEach(function (item) {\n total_c1 += item.c1;\n total_c2 += item.c2;\n total_c3 += item.c3;\n var c4 = item.c2 + item.c3;\n item.c4 = c4;\n total_c4 += c4;\n });\n }\n\n vm.property.men4_10_1 = total_c1;\n vm.property.men4_10_2 = total_c2;\n vm.property.men4_10_3 = total_c3;\n vm.property.men4_10_4 = total_c4;\n }", "function subirNivel() {\n\tniv++;\n\tatrapados = 0;\n\tcant = 2 + niv;\n\tpy++;\n}", "function falso(){\n\tif(cont==2||cont==3||cont==5||cont==6||cont==7||cont==8||cont==10||cont==11||cont==13||cont==17||cont==19){\n\t\talert(\"ESA ES MI CHICA! CORRECTO\");\n\t\tpuntos = puntos + 1;\n\t}else{\n\t\talert(\"MALA NOVIA!!! ERROR\");\n\t}\n\tconsole.log(puntos);\n\tcambiarPagina();\n}", "function achatItem3Lvl1() {\n affichagePrixItem3Lvl1.innerHTML = \"OBTENU\";\n boutonItem3Lvl1.disabled = true;\n boutonItem3Lvl1.style.border = \"inherit\";\n clickRessource3 = 2;\n ressource1.innerHTML = ressource1.innerHTML - prixItem3Lvl1;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl1Vide\").src= \"assets/img/pioche1Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils1(); \n }", "function uspjesnost() {\n let brojRijesenih = 0;\n let procenat = 0;\n\n zadaci.forEach(zadatak => {\n if (zadatak.zavrsen === true) {\n brojRijesenih++;\n }\n })\n procenat = ((brojRijesenih / zadaci.length) * 100).toFixed(2);\n\n if (procenat < 50) {\n document.getElementById(\"uspesnost\").style.color = \"#DC143C\";\n } else {\n document.getElementById(\"uspesnost\").style.color = \"#00AD56\";\n }\n if (zadaci.length == 0) {\n document.getElementById('uspesnost').innerHTML = '';\n } else {\n document.getElementById('uspesnost').innerHTML = '<h6>Uspjesnost: ' + procenat + '%</h6>';\n }\n}", "function calcTotalDayAgain() {\n var eventCount = $this.find('.this-month .event-single').length;\n $this.find('.total-bar b').text(eventCount);\n $this.find('.events h3 span b').text($this.find('.events .event-single').length)\n }", "function pekeltiKlase(mokinys){\n mokinys.kelintokas++;\n if (Mokinys.kelintokas >= 13){\n console.log(Mokinys.vardas + \"baige mokykla\");\n } else if (Mokinys.kelintokas == 5){\n console.log(Mokinys.vardas + \"baige pradine mokykla\");\n }\n}", "function hitungLuasSegiEmpat(sisi){\n //tidak ada nilai balik\n var luas = sisi * sisi\n return luas\n}", "function restaurarReloj() {\n $horasDom.text('00');\n $minutosDom.text('00');\n $segundosDom.text('00');\n }", "function hitung(harga,tujuan){\n\t\t\tvar berat = $(\"#berat\").val();\n\t\t\tvar volume = $(\"#volume\").val();\n\t\t\tif(berat!='' && volume!=''){\n\t\t\t\tif(parseInt(berat) > parseInt(volume)){\n\t\t\t\t\tvar jumlah = harga*berat;\t\t\n\t\t\t\t}else{\n\t\t\t\t\tvar jumlah = harga*volume;\n\t\t\t\t}\n\t\t\t\n\t\t\t$(\"#biaya_kirim\").val(jumlah);\n\t\t\t$(\"#b_kirim\").html(rupiah(jumlah));\n\t\t\thitung_total();\t\t\n\t\t}}", "function amelioration(){\n return nbMultiplicateurAmelioAutoclick +9;\n}", "function count_result() {\n\tvar result;\n\tif((img_hits == 0 && img_miss == 0) || (miss == 0 && hits == 0)) // kdyby delal jenom jednu cast zaraz\n\t\tresult = 0;\n\telse\n\t\tresult = 2 * img_hits + hits - 2 * img_miss - miss;\n\tif(result < 0)\n\t\tresult = 0;\n\t\t\n $(\"#errcount\").val(result); // zvaliduj kolik udelal chyb\n $(\"#dialogform3\").submit(); // odesli formular a ukonci testovani\n}", "function kiekReiketuTapetuRulonuKambariui(ilgis, plotis, aukstis) {\n const vienasRulonas = 10;\n \n // debugger\n // gauti visus sienu ir lubu plota\n let sienos = kambarioSienuPlotas(ilgis, plotis, aukstis);\n let grindysLubos = kabarioLubosGrindys(ilgis, plotis);\n // pagal gauta plota paskaiciuoti kiek rulonu reikes \n let kiekRulonu = (sienos + grindysLubos) / vienasRulonas;\n\n return kiekRulonu;\n}", "function doeClick(){\n \n countClik ++;\n var number= this.getAttribute('data-role');\n totalCount += parseInt(number);\n uitvoeren();\n}", "function getpanierItemsCount(){\n\n\ttotal=calculertotal();\n\t(document.querySelector(\"#total\")).innerHTML=(\"Total a payer \"+total+\" DH\");\n}", "niveauSuivant()\n\t{\n\t \n\t\tthis._termine = false;\n\t\tthis._gagne = false;\n\t\tthis._niveau++;\n\t\tthis._score++;\n\t\tif (localStorage.getItem(\"high-score\") == null)\n\t\t localStorage.setItem(\"high-score\", \"0\");\n\t\tif (parseInt(localStorage.getItem(\"high-score\"), 10) < this._score) {\n\t\t localStorage.removeItem(\"high-score\");\n\t\t localStorage.setItem(\"high-score\", this._score.toString());\n\t\t}\n\t\tif ((this._niveau + 1) % 10 === 0)\n\t\t this._nbPDV++;\n\n\t\tthis.demarrerNiveau();\n\t}", "function aumentarCantidad2() {\n etiquetaCantidad2.innerHTML++;\n}", "function hitungVolumedanLuasPermukaanBalok(panjang, lebar, tinggi) {\n luasPermukaanBalok = 2 * ( (panjang * lebar) + (panjang * tinggi) + (lebar * tinggi) );\n volumeBalok = panjang * lebar * tinggi;\n document.write(\"Panjang : \" + panjang + \"<br/>\");\n document.write(\"Lebar : \" + lebar + \"<br/>\");\n document.write(\"Tinggi : \" + tinggi + \"<br/>\" + \"<br/>\");\n document.write(\"Volume Balok : \" + volumeBalok + \"<br/>\");\n document.write(\"Luas Permukaan Balok : \" + luasPermukaanBalok + \"<br/>\");\n}", "function ecarCount(){\r\r\r\r\r\r\n $.post('/officium/web/ecar/countEcar',\r\r\r\r\r\r\n {},function(result){\r\r\r\r\r\r\n ////actualizamos la cantidad de productos en el flag\r\r\r\r\r\r\n $(\"#ecounter\").html(result);\r\r\r\r\r\r\n\r\r\r\r\r\r\n });\r\r\r\r\r\r\n\r\r\r\r\r\r\n\r\r\r\r\r\r\n}", "function hitungLuasPersegiPanjang (panjang,lebar){\n //tidak ada nilai balik\n var luas = panjang * lebar\n return luas\n}", "function calcularTotalBoleta(){\n var aPagar = parseInt($('#res-total-mercaderia').data('total')) - parseInt($('#res-total-creditos').data('total'));\n\n $('#res-total-a-pagar').text(NumberHelper.aMoneda(aPagar));\n }", "function renderPorSucursal() {\n var ventasPorSucursal = [];\n for (i = 0; i < local.sucursales.length; i++) {\n ventasPorSucursal.push('Total de ' + local.sucursales[0] + ': ' + ventasSucursal(local.sucursales[0]));\n ventasPorSucursal.push(' Total de ' + local.sucursales[1] + ': ' + ventasSucursal(local.sucursales[1]));\n //intenté mil veces con ventasPorSucursal.push('Total de ' + local.sucursales[i] + ': ' + ventasSucursal(local.sucursales[i])) pero no funciona\n } return 'Ventas por sucursal: ' + ventasPorSucursal;\n}", "function updateTotaal(){\n var totaal = 0\n for (var pizza in pizzas){\n totaal += pizzas[pizza].aantal * pizzas[pizza].price;\n }\t\n $(\"#winkelmandje #totaal\").html(totaal);\n }", "function kiekDienuIkiKaledu() {\n console.log(\"266\");\n // siandienos data\n let today = new Date();\n // kaledu data\n let christmas = new Date(\"2021-12-24\");\n console.log(\"today\", today.toDateString(), \"christmas\", christmas.toDateString());\n\n // skirtumo tarp datu\n let diffMs = christmas - today;\n console.log(\"diffMs\", diffMs);\n // paversti ta skirtuma dienom\n let msToDays = diffMs / 1000 / 3600 / 24;\n // gaunam kiek pilnu dienu\n let wholeDays = Math.floor(msToDays);\n\n // panaudojom pagalbine funkcija\n //let wholeDays = daysDiff(today, christmas);\n\n // atspausdinti\n console.log(\"iki kaledu liko\", wholeDays, \"dienu\");\n}", "function IndicadorRangoEdad () {}", "function calculaTotalAjusteInv() {\n\tlet totalAjuste = 0;\n\tlet totalRenglon = 0;\n\t$(\".cuantos\").each(\n\t\tfunction(index, value) {\n totalAjuste = totalAjuste + eval($(this).val());\n if(parseFloat(totalAjuste)>0){\n totalRenglon=(parseInt(index)+1);\n }\n\t\t}\n\t);\n\t$(\"#renglon\").html(totalRenglon);\n\t$(\"#total\").html(totalAjuste );\n\tif(totalAjuste>0){\n\t $(\"#btnGuardarAjusteInv\").show();\n\t $(\"#rowAjusteInv\").show();\n }else{\n\t\t//$(\"#btnGuardar\").hide();\n\t}\n}", "function actualizarCantidad() {\n\n var total = 0;\n var cantidadFumigacion = 0;\n var contador = 0;\n\n // Se recorren todos los despegues\n while (contador < elDiaDeHoy.despeguesDeAvionetas.length) {\n\n // Se toma la avioneta y se evalua si es de fumigacion\n if (elDiaDeHoy.despeguesDeAvionetas[contador].Avioneta.esDeFumigacion) {\n\n // si la avioneta es de fumigacion se incrementa el contador de fumigacion en uno;\n cantidadFumigacion++;\n }\n\n // se incrementa el total en uno.\n total++;\n\n // se avanza en uno el contador\n contador++;\n }\n\n // Se actualizan los totales del dia. \n elDiaDeHoy.cantidadTotal = total;\n elDiaDeHoy.cantidadDeFumigacion = cantidadFumigacion;\n}", "function hitungKembalian(bayar, harga) {\n //your code here\n var result = {}\n var pecahan = [100000,50000,20000,10000,5000]\n var kembailan = bayar - harga\n var totalPecahan = 0\n var pembatas = 5\n\n if (kembailan < 0) {\n return 'Uang tidak cukup'\n }\n\n for (var i = 0; i < pecahan.length; i++) {\n \n if (kembailan - pecahan[i] >= 0) {\n kembailan -= pecahan[i]\n totalPecahan += 1\n result[pecahan[i]] = totalPecahan\n i -= 1\n if (totalPecahan === pembatas) {\n totalPecahan = 0\n i += 1\n }\n } else {\n totalPecahan = 0\n }\n\n if (result[pecahan[pecahan.length - 1]] === pembatas) {\n pembatas += 5\n i = -1\n }\n }\n return result\n}", "function totalAndInactives(sede,turma){\n var nameTotal = \"Alunas presentes e desistentes\"\n var inactives = 0;\n var actives = 0;\n\tvar totalStudents = data[sede][turma]['students'].length;\n\tfor (i in data[sede][turma]['students']){\n\t\tif (data[sede][turma]['students'][i]['active'] === false){\n\t\t\tinactives += 1;\n\t\t}\n }\n actives = totalStudents - inactives; \n var total = [actives,inactives]\n var legendGraph = [];\n legendGraph[0] = \"Ativas\";\n legendGraph[1] = \"Inativas\";\n pieGraph(total, nameTotal, legendGraph);\n}", "function CountTotal(val,from){\n\t\tswitch(from){\n\t case \"cw\": cw_total = val; break;\n\t case \"sk\": sk_total = val; break;\n\t case \"co\": co_total = val; break;\n\t case \"am\": am_total = val; break;\n\t case \"em\": em_total = val; break;\n\t\t}\n\t\tif (droits.catamaran_fleet) {\n\t\t\tif(droits.affich_coskipper){\n\t\t\t\tsum_total = cw_total+em_total+sk_total+co_total;\n\t\t\t\tsum_count = sum_total/4;\n\t\t\t}else{\n\t\t\t\tsum_total = cw_total+em_total+sk_total;\n\t\t\t\tsum_count = sum_total/3;\n\t\t\t}\n\t\t} else {\n\t\t\tif(droits.affich_coskipper){\n\t\t\t\tsum_total = cw_total+am_total+em_total+sk_total+co_total;\n\t\t\t\tsum_count = sum_total/5;\n\t\t\t}else{\n\t\t\t\tsum_total = cw_total+am_total+em_total+sk_total;\n\t\t\t\tsum_count = sum_total/4;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(sum_count > 50 || 1==1){\n\t\t\t$('#exp_pdf').removeClass(\"disabled\").attr(\"data-original-title\",row.lg_exportpdf_off);\n\t\t\twindow.clickstt = true;\n\t\t}else{\n\t\t\t$('#exp_pdf').addClass(\"disabled\").attr(\"data-original-title\",row.lg_exportpdf_on);\n\t\t\twindow.clickstt = false;\n\t\t}\n\t}", "function _AtualizaPontosVida() {\n // O valor dos ferimentos deve ser <= 0.\n var pontos_vida_corrente =\n gPersonagem.pontos_vida.total_dados + gPersonagem.pontos_vida.bonus.Total() + gPersonagem.pontos_vida.temporarios\n - gPersonagem.pontos_vida.ferimentos - gPersonagem.pontos_vida.ferimentos_nao_letais;\n ImprimeNaoSinalizado(\n pontos_vida_corrente, Dom('pontos-vida-corrente'));\n Dom('pontos-vida-dados').value = gPersonagem.pontos_vida.total_dados ?\n gPersonagem.pontos_vida.total_dados : '';\n ImprimeSinalizado(\n gPersonagem.pontos_vida.bonus.Total(), Dom('pontos-vida-bonus'), false);\n ImprimeSinalizado(\n gPersonagem.pontos_vida.temporarios, Dom('pontos-vida-temporarios'), false);\n ImprimeSinalizado(\n -gPersonagem.pontos_vida.ferimentos, Dom('ferimentos'), false);\n ImprimeSinalizado(\n -gPersonagem.pontos_vida.ferimentos_nao_letais, Dom('ferimentos-nao-letais'), false);\n\n // Companheiro animal.\n if (gPersonagem.canimal != null) {\n Dom('pontos-vida-base-canimal').value = gPersonagem.canimal.pontos_vida.base;\n Dom('pontos-vida-temporarios-canimal').value = gPersonagem.canimal.pontos_vida.temporarios;\n var pontos_vida_canimal = gPersonagem.canimal.pontos_vida;\n ImprimeSinalizado(-pontos_vida_canimal.ferimentos, Dom('ferimentos-canimal'), false);\n ImprimeSinalizado(-pontos_vida_canimal.ferimentos_nao_letais, Dom('ferimentos-nao-letais-canimal'), false);\n var pontos_vida_corrente_canimal =\n pontos_vida_canimal.base + pontos_vida_canimal.bonus.Total() + pontos_vida_canimal.temporarios\n - pontos_vida_canimal.ferimentos - pontos_vida_canimal.ferimentos_nao_letais;\n Dom('pontos-vida-corrente-canimal').textContent = pontos_vida_corrente_canimal;\n Dom('notas-canimal').textContent = gPersonagem.canimal.notas;\n Dom('canimal-raca').value = gPersonagem.canimal.raca;\n }\n\n // Familiar.\n if (gPersonagem.familiar == null ||\n !(gPersonagem.familiar.chave in tabelas_familiares) ||\n !gPersonagem.familiar.em_uso) {\n return;\n }\n Dom('pontos-vida-base-familiar').textContent = gPersonagem.familiar.pontos_vida.base;\n Dom('pontos-vida-temporarios-familiar').value = gPersonagem.familiar.pontos_vida.temporarios;\n var pontos_vida_familiar = gPersonagem.familiar.pontos_vida;\n ImprimeSinalizado(-pontos_vida_familiar.ferimentos, Dom('ferimentos-familiar'), false);\n ImprimeSinalizado(-pontos_vida_familiar.ferimentos_nao_letais, Dom('ferimentos-nao-letais-familiar'), false);\n var pontos_vida_corrente_familiar =\n pontos_vida_familiar.base + pontos_vida_familiar.bonus.Total() + pontos_vida_familiar.temporarios\n - pontos_vida_familiar.ferimentos - pontos_vida_familiar.ferimentos_nao_letais;\n Dom('pontos-vida-corrente-familiar').textContent = pontos_vida_corrente_familiar;\n}", "function achatItem2Lvl1() {\n affichagePrixItem2Lvl1.innerHTML = \"OBTENU\";\n boutonItem2Lvl1.disabled = true;\n boutonItem2Lvl1.style.border = \"inherit\";\n clickRessource2 = 2;\n ressource1.innerHTML = ressource1.innerHTML - prixItem2Lvl1;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem2lvl1Vide\").src= \"assets/img/hache1Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils1();\n }", "function obrisi_sekvencu(kliknuta_kartica) {\r\n\t// koji igrac zeli ponovo da popuni kombinaciju\r\n\tvar br_igraca = nadji_igraca(kliknuta_kartica);\r\n\tif (br_igraca == 1) {\r\n\t\tlocalStorage.setItem(\"sekvenca_zemalja1\", \"\");\r\n\t\t//sekvenca_zemalja1 = [];\r\n\t}\r\n\r\n\tif (br_igraca == 2) {\r\n\t\tlocalStorage.setItem(\"sekvenca_zemalja2\", \"\");\r\n\t\t//sekvenca_zemalja2 = [];\r\n\t}\r\n\r\n\t//dohvati sve kartice kako bi ih sve obrisao\r\n\tvar _niz = document.querySelectorAll(\"div.kartica\");\r\n\r\n\r\n\tvar vracen_fokus_na_prvu_karticu = 0;\r\n\t// 4 za po svakog igraca posto smo dohvatili sve kartice, a zelimo da brisemo samo za jednog\r\n\tfor (let i = 0; i < 8; i++) {\r\n\t\tlet vlasnik__niz = nadji_igraca(_niz[i]);\r\n\t\tif (vlasnik__niz != br_igraca) continue;\r\n\t\telse {\r\n\t\t\t// kada obrise sekvencu da se ispise ? na kartici\r\n\t\t\t_niz[i].innerHTML = \"<img class='icon' src='skocko-dodatno/upitnik2.png' alt='?'>\";\r\n\t\t\t_niz[i].classList.remove(mesto_fokusa[br_igraca]);\r\n\r\n\t\t\t// prva na koju naidjemo je zapravo prva kartica od tog igraca i na nju treba da se vratimo kada sve obrisemo\r\n\t\t\tif (vracen_fokus_na_prvu_karticu == 0) {\r\n\t\t\t\t_niz[i].classList.add(mesto_fokusa[br_igraca]);\r\n\t\t\t\tvracen_fokus_na_prvu_karticu = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function reglaAumPrecioFullCobertura(){\n if(producto.f_cobertura.sellIn -1){\n precio_FullCobertura + 1;\n }else{\n\n }\n}", "function calculaVazaoAtual(){\n var vazaoAtual = 10/(1000/this.state.graficos.rpmAtual);\n if(vazaoAtual<84){\n return alert(\"Produção em nível crítico com RPM atual!!\")\n }\n }", "function Puntaje(combos,de_donde){\r\n if(combos==\"reset\"){\r\n $(de_donde).text(\"0\")\r\n }\r\n else{\r\n var Puntaje_actual = $(de_donde).text()\r\n var Total = Number(Puntaje_actual)+combos;\r\n $(de_donde).text(Total.toString())\r\n }\r\n}", "function achatItem1Lvl3() {\n affichagePrixItem1Lvl3.innerHTML = \"OBTENU\";\n boutonItem1Lvl3.disabled = true;\n boutonItem1Lvl3.style.border = \"inherit\";\n clickRessource1 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item1Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item1Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem1lvl3Vide\").src= \"assets/img/lance3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "function viagem(limiteTanque, valorGasolina, kmPercorrido, destino){\n\n document.write(\"fizemos uma viagem para \" + destino +'<br>')\n document.write(\"A viagem foi de \" + kmPercorrido + 'km <br>')\n\n //Quantos km faz o tanque\n var kmTotalTanque = limiteTanque * 2\n document.write('O tanque do carro faz ' + kmTotalTanque + 'km <br>')\n\n console.log(kmTotalTanque)\n //Quantas vezes abastecer\n var qtsVzsAbastecer = Math.ceil(kmPercorrido / kmTotalTanque)\n document.write('Precisamos abastecer ' + qtsVzsAbastecer +'vez(es) <br>')\n console.log(qtsVzsAbastecer)\n //Quantos litros abastecer\n var qtsLitrosAbastecer = (kmPercorrido / 2) - limiteTanque\n document.write('Precisamos abastecer ' + qtsLitrosAbastecer +'litros <br>')\n console.log(qtsLitrosAbastecer)\n //valor gasto com a gasolina\n var gastoGasolina = qtsLitrosAbastecer * valorGasolina\n document.write('Gastamos R$' + gastoGasolina + ' com gasolina <br>')\n console.log(gastoGasolina)\n //quanto tempo durou a viagem\n var tempoViagem = Math.ceil(kmPercorrido / 60)\n document.write(\"A viagem demorou aproximadamente \" + tempoViagem + ' horas')\n console.log(tempoViagem)\n}", "function updateGesamtPreis() {\n \"use strict\";\n gesamtPreis = 0.0;\n warenkorb.forEach(WarenkorbRechner);\n /*Für jede option im Wk, werden in der Methode \"WarenkorbRechner\"\n die Preise Addiert*/\n var summeSite = document.getElementById(\"gesamtPreis\");\n //aktualisiere innerText mit neuem Preis\n summeSite.innerText = \"Gesamtpreis: \" + gesamtPreis.toFixed(2) + \"€\";\n}", "function upisNajaFunc()\n{\n\t/* ako je br bacanja veci od 1, nije najavljeno nedozvoljen upis */\n\tif (brojBacanja > 1 && indNajave < 1)\n\t{\n\t\talert(\"Niste najavili!\");\n\t\treturn;\n\t}\n\t/* u suprotnom u prvom smo bacanju i zelimo da najavimo */\n\telse if (brojBacanja == 1 && indNajave < 1)\n\t{\n\t\tindNajave = Number(this.id.slice(1, ));\n\n\t\t/* manipulate css for different background color */\n\t\tvar elm = document.getElementById(this.id);\n\t\telm.className = (elm.className == \"najaKlik\") ? \"polje naja\" : \"najaKlik\";\n\t\treturn;\n\t}\n\telse if (brojBacanja === 0)\n\t\treturn;\n\n\t/* get the value of the field clicked */\n\tvar vred = Number(this.id.slice(1, ));\n\n\t/* if not equal, user did not announce that field */\n\tif (vred != indNajave)\n\t{\n\t\talert(\"Niste TO najavili!\");\n\t\treturn; \n\t}\n\t\n\n\t///* see if the previous field is not -1 */\n\t///* else disable writting to preserve order */\n\t//if(vred < 12 && kNaja[vred] < 0)\n\t//{\n\t//\talert(\"Nedozvoljen upis!\");\n\t//\treturn;\n\t//}\n\t\n\t/* did we already write into this field */\n\tif(kNaja[vred-1] >= 0)\n\t{\n\t\talert(\"Vec ste upisali u ovo polje!\");\n\t\treturn;\n\t}\n\n\tvar tmp = 0;\n\tvar tmpNiz = [];\n\n\t/* splice izabraneKockice and baceneKockice */\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(izabraneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(izabraneKockice[i].innerText));\n\t}\n\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(baceneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(baceneKockice[i].innerText));\n\t}\n\n\tif(tmpNiz.length != 5)\n\t\talert(\"Niz nije 5! vec: \" + tmpNiz.length);\n\n\t/* decide which field was clicked: broj, maxmin ili igra */\n\tswitch(vred)\n\t{\n\t\tcase 1:\n\t\tcase 2:\n\t\tcase 3:\n\t\tcase 4:\n\t\tcase 5:\n\t\tcase 6:\n\t\t\tfor(var i=0; i<5; ++i)\n\t\t\t{\n\t\t\t\tif(tmpNiz[i] == vred)\n\t\t\t\t\ttmp += tmpNiz[i]\n\t\t\t}\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaKolFunc(kNaja, \"suma4\");\n\t\t\tsumaRazFunc(kNaja, \"suma8\")\n\t\t\tbreak;\n\t\tcase 7:\n\t\tcase 8:\n\t\t\ttmp = zbir(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\t/* suma8 */\n\t\t\tsumaRazFunc(kNaja, \"suma8\")\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\ttmp = jelFul(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\ttmp = jelPoker(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\ttmp = jelKenta(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\ttmp = jelYamb(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\t/* write number of vred thrown */\n\tdocument.getElementById(this.id).innerText=Number(tmp);\n\n\t/* manipulate css for different background color */\n\tvar elm = document.getElementById(this.id);\n\telm.className = (elm.className == \"najaKlik\") ? \"polje naja\" : \"najaKlik\";\n\tindNajave = 0;\n\tresetuj(izabraneKockice, baceneKockice);\n\n}", "function renumera_opcao_grade_linha(key){\n $('div#div_pergunta_'+key).find('div#div_op_grade_linha').find('label#label_op_grade_linha').each(function(i, label){\n $(this).find('span').html('Marcador da Linha '+(i+1)+'&nbsp;');\n });\n }", "function mesAnt() {\r\n if (mesActu === 0) {\r\n //si el mes actual es enero, se decrementa en 1 el año y se coloca como mes actual diciembre\r\n anioActu--;\r\n mesActu = 11;\r\n llenarMes();\r\n } else {\r\n mesActu--;\r\n llenarMes();\r\n }\r\n}", "function hitungLuasPersegi(sisi) {\n var luas = sisi * sisi;\n return luas;\n}", "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "function aplicarDescuento(){\n if (numeroDeClases >= 12) {\n console.log(\"El total a abonar con su descuento es de \" + (totalClase - montoDescontar));\n } else if (numeroDeClases <= 11) {\n console.log(\"Aún NO aplica el descuento, el valor total a abonar es de \" + totalClase);\n }\n }", "function achatItem3Lvl3() {\n affichagePrixItem3Lvl3.innerHTML = \"OBTENU\";\n boutonItem3Lvl3.disabled = true;\n boutonItem3Lvl3.style.border = \"inherit\";\n clickRessource3 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item3Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item3Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl3Vide\").src= \"assets/img/pioche3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "function aumentarCantidad1() {\n etiquetaCantidad1.innerHTML++;\n}", "function jelYamb(niz)\n{\n\tvar skup = napraviSet(niz);\n\n\t/* ako je velicina skupa 1 imamo yamb */\n\tif(skup.size === 1)\n\t\treturn 5*niz[0] + 80;\n\telse\n\t\treturn 0;\n\t\n}", "function achatItem2Lvl3() {\n affichagePrixItem2Lvl3.innerHTML = \"OBTENU\";\n boutonItem2Lvl3.disabled = true;\n boutonItem2Lvl3.style.border = \"inherit\";\n clickRessource2 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item2Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item2Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem2lvl3Vide\").src= \"assets/img/hache3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "function totalListItems() {\n currentliItems = jQuery(\"#first-ul li\").length;\n jQuery(\"#unsolve-badge\").text(currentliItems);\n }", "function jelKenta(niz)\n{\n\t/* make a set from an array */\n\tvar skup = napraviSet(niz);\n\tvar tmpn = Array.from(skup);\n\ttmpn.sort();\n\n\tif(skup.size === 5)\n\t{\n\t\tconsole.log(tmpn[4]);\n\t\t/* kandidat za kentu */\n\t\tif((tmpn[4] - tmpn[0]) === 4)\n\t\t{\n\t\t\t/* velika ili mala kenta? */\n\t\t\tif(tmpn[0] === 1)\n\t\t\t\treturn 75;\n\t\t\telse\n\t\t\t\treturn 80;\n\t\t}\n\t\telse\n\t\t\treturn 0;\n\t}\n\telse\n\t\treturn 0;\n\n}", "setQtd(){\n let contador = 0;\n\n sorteio.selecionaJogadores().filter(function(e){\n if(e.confirmado){\n contador++;\n }\n });\n\n document.getElementById(\"qtd\").innerHTML = contador;\n \n }", "function printMetinisPajamuDydis() {\n var metinesPajamos = atlyginimas * 12;\n console.log(\"per metus uzdirbu:\", metinesPajamos);\n\n}", "function achatItem3Lvl2() {\n affichagePrixItem3Lvl2.innerHTML = \"OBTENU\";\n boutonItem3Lvl2.disabled = true;\n boutonItem3Lvl2.style.border = \"inherit\";\n clickRessource3 = 4;\n ressource1.innerHTML = ressource1.innerHTML - prix1Item3Lvl2;\n ressource2.innerHTML = ressource2.innerHTML - prix2Item3Lvl2;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl2Vide\").src= \"assets/img/pioche2Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils2();\n }", "function completitud(oa, es){\n var titulo=0; var keyword=0; var descripcion=0; var autor=0;\n var tipoRE=0; var formato=0; var contexto=0; var idioma=0;\n var tipointer=0; var rangoedad=0; var nivelagregacion=0;\n var ubicacion=0; var costo=0; var estado=0; var copyright=0;\n\n // verifica que la variable tenga un valor y asigna el peso a las variables\n if (oa.title!=\"\") {\n titulo=0.15;\n }\n if (oa.keyword!=\"\") {\n keyword=0.14;\n }\n if (oa.description!=\"\") {\n descripcion=0.12;\n }\n if (oa.entity!=\"\") {\n autor=0.11;\n }\n if (oa.learningresourcetype!=\"\") {\n tipoRE=0.09;\n }\n if (oa.format!=\"\") {\n formato=0.08;\n }\n\n \n // hace la comprobacion cuantos contextos existe en el objeto\n var context=oa.context;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=context.length;\n // asigna el nuevo peso que tendra cada contexto\n var pesocontexto=0.06/can;\n // comprueba que los contextos sean diferentes a vacio o a espacio \n for (var w=0; w <can ; w++) { \n if (context[w]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n contexto=contexto+pesocontexto;\n }\n }\n\n\n\n\n\n if (oa.language!=\"\") {\n idioma=0.05;\n }\n if (oa.interactivitytype!=\"\") {\n tipointer=0.04;\n }\n if (oa.typicalagerange!=\"\") {\n rangoedad=0.03;\n }\n if (oa.aggregationlevel!=\"\") {\n nivelagregacion=0.03;\n }\n // hace la comprobacion cuantas ubicaciones existe en el objeto\n var location=oa.location;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=location.length;\n // asigna el nuevo peso que tendra cada ubicacion\n var peso=0.03/can;\n // comprueba que las ubicaciones sean diferentes a vacio o a espacio \n for (var i=0; i <can ; i++) { \n if (location[i]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n ubicacion=ubicacion+peso;\n }\n }\n \n\n if (oa.cost!=\"\") {\n costo=0.03;\n }\n if (oa.status!=\"\") {\n estado=0.02;\n }\n if (oa.copyrightandotherrestrictions!=\"\") {\n copyright=0.02;\n }\n\n \n \n // hace la sumatoria de los pesos \n var m_completitud=titulo + keyword + descripcion + autor + tipoRE + formato + contexto + idioma +\n tipointer + rangoedad + nivelagregacion + ubicacion + costo + estado + copyright;\n\n \n //alert(mensaje);\n return m_completitud;\n \n //echo \"* Completitud de: \".m_completitud.\"; \".evaluacion.\"<br>\";\n }", "function proximo_mes(){\n if(mes_actual!=10){\n mes_actual++;\n }else{\n mes_actual=0;\n año_actual++;\n }\n dibujar_fecha();\n escribir_mes();\n escogerdia1();\n escogerdia2();\n}", "function conta(){\n //setto delle variabili a 0, che mi serviranno poi per tener conto della somma dei macro\n var a = document.getElementsByName(\"bot\");\n var tmp_prot = 0;\n var tmp_cal = 0;\n var tmp_carb = 0;\n var tmp_gra = 0;\n //prendo la lista e la svuoto (poichè la ricompongo ogni volta in modo da mantenere gli oggetti in ordine)\n $(\"#alimenti_lista\").empty();\n for(var i=0; i<a.length; i++){\n if(a[i].value==\"\") a[i].value=0;\n //sommo alle variabili di prima il valore dei macro di ogni oggetto (moltiplicati per il nuemro di oggetti)\n tmp_prot = parseInt(tmp_prot)+parseFloat(a[i].value)*parseInt(le[i].p);\n tmp_cal = parseInt(tmp_cal)+parseFloat(a[i].value)*parseInt(le[i].c);\n tmp_carb = parseInt(tmp_carb)+parseFloat(a[i].value)*parseInt(le[i].cb);\n tmp_gra = parseInt(tmp_gra)+parseFloat(a[i].value)*parseInt(le[i].g);\n //se un alimento è presente almeno una votla lo aggiungo alla lista.\n if(a[i].value>0){\n var aux = 0;\n aux = parseFloat(a[i].value)*100\n if(a[i].value>0) $(\"#alimenti_lista\").append($(\"<li class='list-group-item' id='li_item'>\").html(le[i].nome));\n }\n }\n //modifico la scritta dentro i bottoni\n sum_prot.innerHTML=\"PROTEINE: \"+tmp_prot;\n sum_cal.innerHTML=\"CALORIE: \"+tmp_cal;\n sum_carb.innerHTML=\"CARBOIDRATI: \"+tmp_carb;\n sum_gra.innerHTML=\"GRASSI: \"+tmp_gra;\n\n\n}", "function getPelnas22(pajamos, islaidos){\n var pelnas = pajamos - islaidos;\n document.querySelector(\"body\").innerHTML += \"pelnas \" + pelnas + \"<br>\";\n return pelnas;\n}", "function Asigna() {\r\n //var a = SinDuplicadosIdTrains.length;\r\n var SinSalir = 0;\r\n var Catrasado = 0;\r\n var Crelenti = 0;\r\n var Caldia = 0;\r\n \r\n for (var i = 0; i < statusA.length; i++) {\r\n if (statusA[i] === \"0\") {\r\n SinSalir++;\r\n } else if (statusA[i] === \"5\") {\r\n Catrasado++;\r\n } else if (statusA[i] === \"4\") {\r\n Crelenti++;\r\n } else if (statusA[i] === \"3\") {\r\n Caldia++;\r\n }\r\n \r\n }\r\n\r\n document.getElementById(\"cst\").textContent = Caldia;\r\n document.getElementById(\"csr\").textContent = Crelenti;\r\n document.getElementById(\"csa\").textContent = Catrasado;\r\n}", "function TinhTheoLoaiXe(sokm, tgcho, giaLoai1, giaLoai2, giaLoai3, tgChoTheoLoai) {\n var tien = 0;\n if (sokm <= 1) {\n tien = sokm * giaLoai1 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm > 1 && sokm < 21) {\n tien = giaLoai1 + (sokm - 1) * giaLoai2 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm >= 21) {\n tien = giaLoai1 + 19 * giaLoai2 + (sokm - 20) * giaLoai3 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n }\n return document.getElementById('xuatTien').innerHTML = tien + ' vnđ';\n}", "function refreshButtonPanier(){\n var nbArticle = 0;\n panier.forEach(p => {\n nbArticle += p.nombre;\n });\n $(\"#panierBadge\").text(nbArticle);\n}", "function posarBoleta(e) {\r\n// console.log(\"has clicat el \"+ e.target.getAttribute('id'));\r\n if (numDeClics==0) {\r\n //si guanya\r\n if (e.target.getAttribute('id')==aleatorio) {\r\n resultat(\"guany\", \"Felicitats :)\");\r\n // resultat(\"Felicitats :)\");\r\n //si perd\r\n }else{\r\n // resultat(\"Torna a provar! :S\");\r\n resultat(\"perd\", \"Torna a provar! :S\");\r\n\r\n }\r\n numDeClics=numDeClics+1;\r\n }\r\n}", "function resultado(){\n\n var acertadas = 0;\n var falladas = 0;\n var porResponder = 0;\n\n if(geografia[1]==true && geografia[2]==1){\n acertadas++;\n } else if(geografia[1]==false && geografia[2]==2){\n falladas++;\n } else if (geografia[2]==0){\n porResponder++;\n }\n\n if(arte[1]==true && arte[2]==1){\n acertadas++;\n } else if(arte[1]==false && arte[2]==2){\n falladas++;\n } else if (arte[2]==0){\n porResponder++;\n }\n\n if(espectaculo[1]==true && espectaculo[2]==1){\n acertadas++;\n } else if(espectaculo[1]==false && espectaculo[2]==2){\n falladas++;\n } else if (espectaculo[2]==0){\n porResponder++;\n }\n\n if(historia[1]==true && historia[2]==1){\n acertadas++;\n } else if(historia[1]==false && historia[2]==2){\n falladas++;\n } else if (historia[2]==0){\n porResponder++;\n }\n\n if(deporte[1]==true && deporte[2]==1){\n acertadas++;\n } else if(deporte[1]==false && deporte[2]==2){\n falladas++;\n } else if (deporte[2]==0){\n porResponder++;\n }\n\n if(ciencia[1]==true && ciencia[2]==1){\n acertadas++;\n } else if(ciencia[1]==false && ciencia[2]==2){\n falladas++;\n } else if (ciencia[2]==0){\n porResponder++;\n }\n\n alert(\"Acertadas: \" + acertadas +\n \" - Falladas: \" + falladas +\n \" - Por Responder: \" + porResponder);\n}", "getTotalMenuPrice() {\n return this.menu.reduce((a,b) => a+b.pricePerServing, \" \") * this.getNumberOfGuests();\n }", "getTotalUsers(counts) {\n return Object.keys(counts).reduce(\n (a, b) => a + (this.foci[b] && !this.foci[b].showTotal ? 0 : counts[b]),\n 0\n );\n }", "function puntosCultura(){\r\n\t\tvar a = find(\"//div[@id='lmid2']//b\", XPList);\r\n\t\tif (a.snapshotLength != 5) return;\r\n\r\n\t\t// Produccion de puntos de cultura de todas las aldeas\r\n\t\tvar pc_prod_total = parseInt(a.snapshotItem(2).innerHTML);\r\n\t\t// Cantidad de puntos de cultura actuales\r\n\t\tvar pc_actual = parseInt(a.snapshotItem(3).innerHTML);\r\n\t\t// Puntos de cultura necesarios para fundar la siguiente aldea\r\n\t\tvar pc_aldea_prox = parseInt(a.snapshotItem(4).innerHTML);\r\n\r\n\t\t// 下一个的村庄数\r\n\t\tvar aldeas_actuales = (check3X() )? pc2aldeas3X(pc_aldea_prox) : pc2aldeas(pc_aldea_prox) ;\r\n\t\t// 目前村庄数\r\n\t\tvar aldeas_posibles = (check3X() )? pc2aldeas3X(pc_actual) : pc2aldeas(pc_actual) ;\r\n\r\n\t\tvar texto = '<table class=\"tbg\" align=\"center\" cellspacing=\"1\" cellpadding=\"2\"><tr class=\"rbg\"><td>' + T('ALDEA') + '</td><td>' + T('PC') + \"</td></tr>\";\r\n\t\tvar j = pc_f = 0;\r\n\t\tfor (var i = 0; i < 3; i++){\r\n\t\t\tvar idx = i + j;\r\n\r\n\t\t\ttexto += '<tr><td>' + (aldeas_actuales + idx + 1) + '</td><td>';\r\n\r\n\t\t\t// 下一级需要的文明\r\n\t\t\tvar pc_necesarios = (check3X() )? aldeas2pc3X(aldeas_actuales + idx) : aldeas2pc(aldeas_actuales + idx) ;\r\n\r\n\t\t\t// Si hay PC de sobra\r\n\t\t\tif (pc_necesarios < pc_actual) {\r\n\t\t\t\ttexto += T('FUNDAR');\r\n\t\t\t\tpc_f = 1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t// Tiempo en segundos hasta conseguir los puntos de cultura necesarios\r\n\t\t\t\tvar tiempo = ((pc_necesarios - pc_actual) / pc_prod_total) * 86400;\r\n\r\n\t\t\t\tvar fecha = new Date();\r\n\t\t\t\tfecha.setTime(fecha.getTime() + (tiempo * 1000));\r\n\t\t\t\tvar texto_tiempo = calcularTextoTiempo(fecha);\r\n\r\n\t\t\t\ttexto += T('FALTA') + ' <b>' + (pc_necesarios - pc_actual) + '</b> ' + T('PC') +'<br/>';\r\n\t\t\t\ttexto += T('LISTO') + \" \" + texto_tiempo;\r\n\t\t\t}\r\n\t\t\ttexto += '</td></tr>';\r\n\r\n\t\t\tif (pc_f && pc_necesarios >= pc_actual) {\r\n\t\t\t\tj = idx + 1;\r\n\t\t\t\tpc_f = i = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\ttexto += '</table>';\r\n\r\n\t\ta.snapshotItem(4).parentNode.innerHTML += \"<p>\" + texto + \"</p>\";\r\n\t}", "function hitungLuasSegitiga(alas,tinggi) {\n var luas = 1/2 * alas * tinggi;\n\n return luas;\n\n}", "function skaiciuotiVidurki(mas) {\n var suma = 0;\n for (var i = 0; i < mas.length; i++) {\n suma += mas[i];\n }\n // return Math.round(suma / mas.length);\n var ats = suma / mas.length;\n ats = Math.round(ats);\n return ats;\n}", "function llogarit()\n{\n\n\tmerr();\n\n\tvar piket = 0;\n\n\tvar shumaKrediteve = 0;\n\n\tfor( var i = 0; i < fushatAktive.length; i++ )\n\t{\t\n\n\t\tvar kredit = LENDET[ fushatAktive[ i ].pozicioni ].kreditet;\n\n\t\tpiket += kredit * fushatAktive[ i ].vlera;\n\n\t\tshumaKrediteve += kredit;\n\n\t}\n\n\tif( gabim == true )\n\t{\n\n\t\tdocument.getElementById( \"pergjigja\" ).innerHTML = mesazhGabimi;\n\t}\n\telse\n\t{\t\n\t\tvar mesatarja = piket / shumaKrediteve;\n\n\t\tvar string = \"<br>Piket: \" + piket + \"<br>Kreditet: \" + shumaKrediteve + \"<br><b>Mesatarja: \" + mesatarja.toFixed( 2 ) + \"</b>\";\n\n\t\tdocument.getElementById( \"pergjigja\" ).innerHTML = string;\n\t}\n\n\t/// ngrirja e butonave\n\tdocument.querySelector( \"button\" ).disabled = true ;\n\n\tgabim = false;\n\n\tfushatAktive = [];\n}///FUND llogarit", "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 reportBatalla(){ \n\t\tvar t = find(\"//table//table//table[@class='tbg']\", XPList); \n\t\tif (t.snapshotLength < 2) return;\n\n\t\t// Encuentra y suma todas las cantidades del botin\n\t\tvar botin = null;\n\t\tvar a = find(\"//tr[@class='cbg1']\", XPList);\n\t\tif (a.snapshotLength >= 3){\n\t\t\t// FIXME: Apaño para Firefox. FF mete nodos de tipo texto vacios\n\t\t\tif (a.snapshotItem(1).childNodes.length == 4){\n\t\t\t\tvar b = a.snapshotItem(1).childNodes[3];\n\t\t\t}else{\n\t\t\t\tvar b = a.snapshotItem(1).childNodes[1];\n\t\t\t}\n\t\t\tif (b.childNodes.length == 8){ \n\t\t\t\tvar cantidades_botin = new Array();\n\t\t\t\tcantidades_botin[0] = parseInt(b.childNodes[1].nodeValue);\n\t\t\t\tcantidades_botin[1] = parseInt(b.childNodes[3].nodeValue);\n\t\t\t\tcantidades_botin[2] = parseInt(b.childNodes[5].nodeValue);\n\t\t\t\tcantidades_botin[3] = parseInt(b.childNodes[7].nodeValue);\n\t\t\t\tbotin = arrayToInt(cantidades_botin);\n\t\t\t\tvar info_botin = '';\n\t\t\t\tfor (var i = 0; i < 4; i++){\n\t\t\t\t\tinfo_botin += '<img src=\"' + img('r/' + (i + 1) + '.gif') + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + (i+1)) + '\">';\n\t\t\t\t\tinfo_botin += cantidades_botin[i];\n\t\t\t\t\tif (i < 3) info_botin += ' + '; else info_botin += ' = ';\n\t\t\t\t}\n\t\t\t\tinfo_botin += botin;\n\t\t\t\tb.innerHTML = info_botin;\n\t\t\t}\n\t\t}\n\n\t\tvar perds = new Array();\n\t\tvar carry = new Array();\n\t\t// Por cada participante en la batalla (atacante, defensor y posibles apoyos)\n\t\tfor(var g = 0; g < t.snapshotLength; g++){ \n\t\t\tcarry[g] = 0;\t\n\t\t\tvar tt = t.snapshotItem(g); \n\t\t\tvar num_elementos = tt.rows[1].cells.length - 1;\n\t\t\tfor(var j = 1; j < 11; j++){ \n\t\t\t\t// Recupera la cantidades de tropa de cada tipo que han intervenido\n\t\t\t\tvar u = uc[tt.rows[1].cells[j].getElementsByTagName('img')[0].src.replace(/.*\\/.*\\//,'').replace(/\\..*/,'')]; \n\t\t\t\t\tvar p = tt.rows[3] ? tt.rows[3].cells[j].innerHTML : 0; \n\t\t\t\t// Basandose en el coste por unidad y su capacidad, se calculan las perdidas y la capacidad de carga total\n\t\t\t\tvar ptu = arrayByN(u, p);\n\t\t\t\tperds[g] = arrayAdd(perds[g], ptu.slice(0, 4)); \n\t\t\t\tcarry[g] += (tt.rows[2] ? tt.rows[2].cells[j].innerHTML - p : 0) * u[4];\n\t\t\t}\n\n\t\t\t// Anyade la nueva informacion como una fila adicional en cada tabla\n\t\t\tvar informe = document.createElement(\"TD\");\n\t\t\tfor (var i = 0; i < 4; i++){\n\t\t\t\tinforme.innerHTML += '<img src=\"' + img('r/' + (i + 1) + '.gif') + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + (i+1)) + '\">';\n\t\t\t\tinforme.innerHTML += perds[g][i];\n\t\t\t\tif (i < 3) informe.innerHTML += ' + '; else informe.innerHTML += ' = ';\n\t\t\t}\t\t\n\t\t\tvar perdidas = arrayToInt(perds[g]);\n\t\t\tinforme.innerHTML += perdidas;\n\t\t\tinforme.colSpan = num_elementos;\n\t\t\tinforme.className = \"s7\";\n\t\t\tvar fila = document.createElement(\"TR\");\n\t\t\tfila.className = \"cbg1\";\n\t\t\tfila.appendChild(elem(\"TD\", T('PERDIDAS')));\n\t\t\tfila.appendChild(informe);\n\t\t\ttt.appendChild(fila);\n\n\t\t\t// Solo para el atacante se calcula y muestra la rentabilidad y eficiencia del ataque\n\t\t\tif (g == 0 && botin != null){\n\t\t\t\tvar datos = document.createElement(\"TD\");\n\t\t\t\tvar fila_datos = document.createElement(\"TR\");\n\t\t\t\tdatos.colSpan = num_elementos;\n\n\t\t\t\t// La rentabilidad muestra el botin en comparacion con las perdidas\n\t\t\t\tvar rentabilidad = Math.round((botin - perdidas) * 100 / botin);\n\t\t\t\tif (botin == 0)\tif (perdidas == 0) rentabilidad = 0; else rentabilidad = -100;\t\n\t\t\t\tdatos.innerHTML = rentabilidad + \"%\";\n\t\t\t\tdatos.className = \"s7\";\n\t\t\t\tfila_datos.className = \"cbg1\";\n\t\t\t\tfila_datos.appendChild(elem(\"TD\", T('RENT')));\n\t\t\t\tfila_datos.appendChild(datos);\n\t\t\t\ttt.appendChild(fila_datos);\n\n\t\t\t\tvar datos = document.createElement(\"TD\");\n\t\t\t\tvar fila_datos = document.createElement(\"TR\");\n\t\t\t\tdatos.colSpan = num_elementos;\n\n\t\t\t\t// La eficiencia muestra el botin en comparacion con la cantidad de tropas utilizadas\n\t\t\t\tvar eficiencia = 100 - Math.round((carry[g] - botin) * 100 / carry[g]);\t\t\t\n\t\t\t\tif (carry[g] == 0) eficiencia = 0;\n\t\t\t\tdatos.innerHTML = eficiencia + \"%\";\n\t\t\t\tdatos.className = \"s7\";\n\t\t\t\tfila_datos.className = \"cbg1\";\n\t\t\t\tfila_datos.appendChild(elem(\"TD\", T('EFICIENCIA')));\n\t\t\t\tfila_datos.appendChild(datos);\n\t\t\t\ttt.appendChild(fila_datos);\n\t\t\t}\n\t\t}\n\t}", "getResultatCodificat(){ // SI EL MÈTODE NO PASSA ALGUN VALOR, SE LI POSSA this. MÉS EL ATRIBUT CORRESPONENT.\n this.eliminarEspaisBlanc();\n this.senseAccent();\n for (var i = 0; i < this._entrada.length; i++){\n\n // IGUALEM LA LLARGADA DE LA CLAU A LA DE L'ENTRADA\n var y = 0;\n var max_lenght = this._entrada.length;\n while (this._entrada.length != this._clau.length){\n\n this._clau = this._clau + this._clau[y];\n\n if(y >= max_lenght){\n\n y = 0;\n }\n else{\n\n y++;\n }\n }\n\n // BUSQUEM ON ESTAN SITUATS TANT LA LLETRA DE L'ENTRADA COM DE LA CLAU\n var posicio_lletra_entrada = this._alfabet.indexOf(this._entrada[i]);\n var posicio_lletra_clau = this._alfabet.indexOf(this._clau[i]);\n\n // SUMEM LES DUES POSICIONS\n var suma_posicions = posicio_lletra_entrada + posicio_lletra_clau;\n\n // ANEM RESTANT MENTRE QUE EL MOD SIGUI MÉS GRAN QUE EL LENGTH DEL ABECEDARI\n while (suma_posicions >= this._alfabet.length){\n\n suma_posicions = suma_posicions - this._alfabet.length;\n }\n \n // ARA BUSQUEM LA LLETRA AMB LA QUAL SUBSTITUIREM L'ENTRADA\n this._resultat = this._resultat + this._alfabet[suma_posicions];\n }\n\n // RETORNEM EL RESULTAT\n return (document.form.sortida.value = this._resultat);\n }", "function hitungLuasSegiTiga(alas,tinggi){\n var luas = 0.5 * alas * tinggi\n return luas\n}", "bouger()\r\n {\r\n this.gauche += Math.cos(this.angle) * this.vitesseX;\r\n this.haut += Math.sin(this.angle) * this.vitesseY;\r\n\r\n //Fonctions annexes\r\n this.limite();\r\n this.majHTML();\r\n }", "resumen_estado_nave(){\n this.ajuste_potencia();\n if (typeof this._potencia_disponible !== \"undefined\"){\n if (this._potencia_disponible){\n let estado_plasma = \"\";\n for (let i = 0; i < this._injectores.length; i++) {\n estado_plasma += \"Plasma \"+i.toString()+\": \";\n let total = this._injectores[i].get_plasma+this._injectores[i].get_extra_plasma;\n estado_plasma += total+\"mg/s \";\n }\n console.log(estado_plasma);\n\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i].get_danio_por<100){\n if (this._injectores[i].get_extra_plasma>0){\n console.log(\"Tiempo de vida: \"+this._injectores[i].tiempo_vuelo().toString()+\" minutos.\");\n } else {\n console.log(\"Tiempo de vida infinito!\");\n break;\n }\n }\n }\n } else {\n console.log(\"Unable to comply.\")\n console.log(\"Tiempo de vida 0 minutos.\")\n }\n } else {\n throw \"_potencia_disponible: NO DEFINIDA\";\n }\n }", "function GetCount() {\n\n dateNow = new Date(); //grab current date\n amount = dateFuture.getTime() - dateNow.getTime(); //calc milliseconds between dates\n delete dateNow;\n\n // time is already past\n if(amount < 0) {\n $(\".count-days .value\").html(0);\n $(\".count-days .title\").html(\"дней\");\n\n $(\".count-hours .value\").html(0);\n $(\".count-hours .title\").html(\"часов\");\n\n $(\".count-mins .value\").html(0);\n $(\".count-mins .title\").html(\"минут\");\n\n $(\".count-seconds .value\").html(0);\n $(\".count-seconds .title\").html(\"секунд\");\n }\n // date is still good\n else{\n var days=0,hours=0,mins=0,secs=0;\n\n amount = Math.floor(amount/1000);//kill the \"milliseconds\" so just secs\n\n days=Math.floor(amount/86400);//days\n amount=amount%86400;\n\n hours=Math.floor(amount/3600);//hours\n amount=amount%3600;\n\n mins=Math.floor(amount/60);//minutes\n amount=amount%60;\n\n secs=Math.floor(amount);//seconds\n\n $(\".count-days .value\").html(days);\n if (days%10 == 1) {\n $(\".count-days .title\").html(\"день\");\n } else if (days%10 == 0 || days%10 >= 5) {\n $(\".count-days .title\").html(\"дней\");\n } else if (days%10 == 2 || days%10 == 3 || days%10 == 4) {\n $(\".count-days .title\").html(\"дня\");\n }\n\n $(\".count-hours .value\").html(hours);\n if (hours%10 == 1) {\n $(\".count-hours .title\").html(\"час\");\n } else if (hours%10 == 0 || hours%10 >= 5) {\n $(\".count-hours .title\").html(\"часов\");\n } else if (hours%10 == 2 || hours%10 == 3 || hours%10 == 4) {\n $(\".count-hours .title\").html(\"часа\");\n }\n\n $(\".count-mins .value\").html(mins);\n if (mins%10 == 1) {\n $(\".count-mins .title\").html(\"минута\");\n } else if (mins%10 == 0 || mins%10 >= 5) {\n $(\".count-mins .title\").html(\"минут\");\n } else if (mins%10 == 2 || mins%10 == 3 || mins%10 == 4) {\n $(\".count-mins .title\").html(\"минуты\");\n }\n\n $(\".count-seconds .value\").html(secs);\n if (secs%10 == 1) {\n $(\".count-seconds .title\").html(\"секунда\");\n } else if (secs%10 == 0 || secs%10 >= 5) {\n $(\".count-seconds .title\").html(\"секунд\");\n } else if (secs%10 == 2 || secs%10 == 3 || secs%10 == 4) {\n $(\".count-seconds .title\").html(\"секунды\");\n }\n\n setTimeout(\"GetCount()\", 1000);\n }\n}", "function mostrarCantEjResueltos(){\r\n let cantidadEntregas = cantEntregasDocente();\r\n document.querySelector(\"#divMostrarResueltos\").innerHTML = `Usted tiene en total ${cantidadEntregas} entregas de sus alumnos`;\r\n}", "function fordel() {\n let antall = medlemsListe.length;\n if (antall > 2) {\n // kan ikke fordele ellers\n // antar bredde = 10*16 ~ 180px pr medlemm\n // antar høyde ~ 20px\n let total = Math.floor(800 / 180) * Math.floor(600 / 20);\n if (antall > total) {\n alert(\"for mange\");\n return;\n }\n // fordeler med 4 i bredden.\n let rader = Math.floor(antall / 4);\n let radrom = 600 / rader;\n \n }\n }", "function conteoFilasArticulos(valor){\r\n\tvar total=0;\r\n\t\r\n\tif(valor == '1'){\r\n\t $(\".tablaVentaArticulos tbody tr\").each(function () {\r\n\t\t \r\n\t\tvar articuloId = $(this).find('td').eq(1).find(\".articuloId\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t$(this).find('td').eq(1).find(\".articuloId\").attr('name',articuloId);\r\n\t\t \r\n\t\tvar z = $(this).find('td').eq(3).find(\".descripcion\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t$(this).find('td').eq(3).find(\".descripcion\").attr('name',z);\r\n\t\t\r\n\t\tvar cantidad = $(this).find('td').eq(2).find(\".cantidad\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t$(this).find('td').eq(2).find(\".cantidad\").attr('name',cantidad);\r\n\t\t\r\n\t\tvar precio = $(this).find('td').eq(4).find(\".precio\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t$(this).find('td').eq(4).find(\".precio\").attr('name',precio);\r\n\r\n\t\t$(this).find(\"td\").eq(0).find(\".consecutivo\").text(++total);\r\n\t });\r\n\t \r\n\t \r\n\t $('#totalArticulos').text(total);\r\n\t\r\n\t\r\n\t}else{\r\n\t\t$(\".tablaUpdateVentaArticulos tbody tr\").each(function () {\r\n\t\t\t// esta parte es para reoirganizar la numeracion del arreglo y evitar conflictos en el server\r\n\t\t\t\r\n\t\t\tvar articuloId = $(this).find('td').eq(1).find(\".articuloId\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t\t$(this).find('td').eq(1).find(\".articuloId\").attr('name',articuloId);\r\n\t\t\t\r\n\t\t\tvar z = $(this).find('td').eq(3).find(\".descripcion\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t\t$(this).find('td').eq(3).find(\".descripcion\").attr('name',z);\r\n\t\t\t\r\n\t\t\tvar cantidad = $(this).find('td').eq(2).find(\".cantidad\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t\t$(this).find('td').eq(2).find(\".cantidad\").attr('name',cantidad);\r\n\t\t\t\r\n\t\t\tvar precio = $(this).find('td').eq(4).find(\".precio\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t\t$(this).find('td').eq(4).find(\".precio\").attr('name',precio);\r\n\r\n\t\t\t$(this).find(\"td\").eq(0).find(\".consecutivo\").text(++total);\r\n\t\t});\r\n\t $('#totalArticulosUpdate').text(total);\r\n\t}\r\n \r\n\t \r\n}", "function sedePromo(sede, promo) {\n // respondiendo primera pregunta. Hallando la cantidad de alumnas y el porcentaje recorriendo un array se puede contar cuantas alumnas hay\n var arr = data[sede][promo]['students'];\n var cant = 0;\n var nocant = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i].active === true) {\n cant++;\n } else {\n nocant++;\n }\n }\n var calculandoPorcentaje = parseInt((nocant / arr.length) * 100);\n total.textContent = cant;\n porcentaje.textContent = calculandoPorcentaje + '%';\n /* ***************************************************Cantida de alumnas que superan el objetivo*****************************************************/\n var sumaScore = 0;\n for (var i = 0; i < arr.length; i++) {\n debugger;\n var sumaHse = 0;\n var sumaTech = 0;\n for (var j = 0; j < data[sede][promo]['students'][i]['sprints'].length; j++) {\n var tech = data[sede][promo]['students'][i]['sprints'][j]['score']['tech'];\n var hse = data[sede][promo]['students'][i]['sprints'][j]['score']['hse'];\n sumaHse = sumaHse + hse;\n sumaTech = sumaTech + tech;\n }\n if (sumaHse > 3360 && sumaTech > 5040) {\n sumaScore++;\n }\n }\n meta.innerHTML = sumaScore;\n /* ***************************************************************cantida de nps*********************************************************************/\n var arrNps = data[sede][promo]['ratings'];\n var sum = 0;\n var npsTotal = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var npsPromoters = data[sede][promo]['ratings'][i]['nps']['promoters'];\n var npsDetractors = data[sede][promo]['ratings'][i]['nps']['detractors'];\n var npsPassive = data[sede][promo]['ratings'][i]['nps']['passive'];\n var npsResta = npsPromoters - npsDetractors;\n sum = sum + npsResta;\n var npsSuma = npsPromoters + npsDetractors + npsPassive;\n npsTotal = npsTotal + npsSuma;\n }\n var promoterPorcentaje = parseInt((npsPromoters / npsTotal) * 100);\n var detractorsPorcentaje = parseInt((npsDetractors / npsTotal) * 100);\n var passivePorcentaje = parseInt((npsPassive / npsTotal) * 100);\n var totalNps = sum / arrNps.length;\n nps.textContent = totalNps.toFixed(2);\n npsPorciento.innerHTML = promoterPorcentaje + '% Promoters' + '<br>' + detractorsPorcentaje + '% Passive' + '<br>' + passivePorcentaje + '% Detractors';\n /* *********************************************calculando los puntos obtenidos en tech********************************************************************/\n var cantidadTech = 0;\n for (var i = 0; i < arr.length; i++) {\n var arrSprint = data[sede][promo]['students'][i]['sprints'];\n var sumTech = 0;\n for (var j = 0; j < arrSprint.length; j++) {\n var tech2 = data[sede][promo]['students'][i]['sprints'][j]['score']['tech'];\n sumTech = sumTech + tech2;\n if (sumTech > (1260 * 4)) {\n cantidadTech++;\n }\n }\n }\n pointTech.textContent = cantidadTech;\n /* ********************************************************calculando los puntos en hse*******************************************************************/\n var cantidadHse = 0;\n for (var i = 0; i < arr.length; i++) {\n var arrSprint = data[sede][promo]['students'][i]['sprints'];\n var sumHse = 0;\n for (var j = 0; j < arrSprint.length; j++) {\n var hse2 = data[sede][promo]['students'][i]['sprints'][j]['score']['hse'];\n sumHse = sumHse + hse2;\n if (sumHse > (840 * 4)) {\n cantidadHse++;\n }\n }\n }\n pointHse.textContent = cantidadHse;\n /* **************************************porcentaje de la expectativa de las alumnas respecto a laboratoria**************************************************/\n var sumaExpectativa = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var studentNoCumple = data[sede][promo]['ratings'][i]['student']['no-cumple'];\n var studentCumple = data[sede][promo]['ratings'][i]['student']['cumple'];\n var studentSupera = data[sede][promo]['ratings'][i]['student']['supera'];\n var Expectativa = ((studentSupera + studentCumple) / (studentNoCumple + studentCumple + studentSupera)) * 100;\n sumaExpectativa = sumaExpectativa + Expectativa;\n }\n var porcentajeExpectativa = parseInt(sumaExpectativa / arrNps.length);\n boxExpectativa.textContent = porcentajeExpectativa + '%';\n /* *********************************************promedio de los profesores********************************************************************/\n var promedioTeacher = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var teacher = data[sede][promo]['ratings'][i]['teacher'];\n promedioTeacher = (promedioTeacher + teacher) / arrNps.length;\n }\n boxTeacher.textContent = promedioTeacher.toFixed(2);\n /* *************************************************promedio jedi*****************************************************************/\n var promedioJedi = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var jedi = data[sede][promo]['ratings'][i]['jedi'];\n promedioJedi = (promedioJedi + jedi) / arrNps.length;\n }\n boxJedi.textContent = promedioJedi.toFixed(2);\n }", "function etapa7() {\n \n msgTratamentoEtapa6.innerHTML = \"\";\n \n //recebe a qtd de despesa em uma variavel\n var qtdDespesa = document.getElementById('qtdDespesa').value; //habilita a etapa 7\n \n //verifica se adicionou pelo menos 1 despesa\n if(qtdDespesa == 0){\n \n //COMEÇO DEFINIÇÃO DO TEXTO DE CONFIRMAÇÃO DA ULTIMA ETAPA\n //recebe o elemento html que está as inf das despesas e apaga tudo, pois vai ser montado novamente\n var confirmacaoInfDespesas = document.querySelector(\"#despesasInf\");\n confirmacaoInfDespesas.innerHTML = \"\"; \n\n //variaveis utilizadas para montagem do texto\n var textoParagrafoDespesa = \"\";\n\n //cria um elento inpunt <h6>\n var paragrafoDespesa = document.createElement(\"h5\");\n\n //define os atributos desse elemento\n paragrafoDespesa.id = \"h6Despesa\";\n paragrafoDespesa.class = \"card-title\";\n\n //define o texto dentro do paragrafo\n paragrafoDespesa.textContent = \"Evento não possui despesas.\";\n\n //adicona o <p> criado na informação das despesas na ultima etapa\n confirmacaoInfDespesas.appendChild(paragrafoDespesa); \n \n //COMEÇO DO CALCULO DOS VALORES\n //VALOR TOTAL FESTA \n //calcula o valor total dos pacotes adicionais\n var valorPacotesAdd = 0;\n listaPacoteAddValores.forEach((valorAtual) => {\n valorPacotesAdd = parseFloat(valorPacotesAdd) + parseFloat(valorAtual);\n });\n \n //calcula o valor total dos valores adicionais\n var valorValoresAdicionais = 0;\n listaValoresAddValores.forEach((valorAtual) => {\n valorValoresAdicionais = parseFloat(valorValoresAdicionais) + parseFloat(valorAtual);\n }); \n \n //resultado = pacotes adicionais + valores adicionais + pacote\n valorTotalFesta = (parseFloat(valorPacotesAdd) + parseFloat(valorValoresAdicionais) + parseFloat(valorPacote)) - parseFloat(descontoTotalFesta);\n\n //VALOR TOTAL DESPESA \n //calcula o valor de despesa de funcionario\n var valorTotalPagamentoFunc = 0;\n listaFuncionarioValores.forEach((valorAtual) => {\n valorTotalPagamentoFunc = parseFloat(valorTotalPagamentoFunc) + parseFloat(valorAtual);\n });\n \n //resultado = funcionario\n var valorTotalDespesa = 0;\n valorTotalDespesa = parseFloat(valorTotalPagamentoFunc);\n \n //LUCRO\n //resultado = valor total - valor total despesa\n valorLucro = parseFloat(valorTotalFesta) - parseFloat(valorTotalDespesa);\n \n //arredonda os valores para 2 casas depois da virgula\n valorTotalFesta = parseFloat(valorTotalFesta.toFixed(2));\n valorTotalDespesa = parseFloat(valorTotalDespesa.toFixed(2));\n valorLucro = parseFloat(valorLucro.toFixed(2));\n \n //salva o valorTotalFesta em uma variavel auxiliar utilizada na próxima etapa\n if(countPrimeiraVezAdd == 0){\n valorTotalFestaLocal = valorTotalFesta; \n valorTotalFestaLocalAnterior = valorTotalFesta; \n }else{\n //subtrai do valor total anterior oque sobrou do valor total festa\n valorTotalFestaLocalAnterior = valorTotalFestaLocalAnterior - valorTotalFestaLocal;\n \n //define o novo valor total local, subtraindo o valor total festa - valor anterior\n valorTotalFestaLocal = valorTotalFesta - valorTotalFestaLocalAnterior;\n \n valorTotalFestaLocalAnterior = valorTotalFesta;\n }\n //FIM DO CALCULO DOS VALORES \n \n //DEFINIÇÃO DO TEXTO DA PRÓXIMA ETAPA\n //valor total\n var valorTotalProximaEtapa = document.querySelector(\"#valorTotal\");\n valorTotalProximaEtapa.textContent = \"Valor Total: R$\"+valorTotalFesta; \n \n //desconto\n var valorDescontoProximaEtapa = document.querySelector(\"#totalDesconto\");\n valorDescontoProximaEtapa.textContent = \"Desconto: R$\" + descontoTotalFesta;\n \n //valor total despesa\n var valorTotalDespesaProximaEtapa = document.querySelector(\"#totalDespesas\");\n valorTotalDespesaProximaEtapa.textContent = \"Total de despesas: R$\"+valorTotalDespesa; \n \n //valor lucro\n var valorLucroProximaEtapa = document.querySelector(\"#lucro\");\n valorLucroProximaEtapa.textContent = \"Lucro do Evento: R$\"+valorLucro; \n //FIM DA DEFINIÇÃO DO TEXTO DA PRÓXIMA ETAPA\n \n //DEFINIÇÃO DO TEXTO PARA A ULTIMA ETAPA (CONFIRMAÇÃO)\n //recebe o elemento html da ultima etapa (confirmação) e salva em uma variavel \n var confirmacaoInfValoresFinais = document.querySelector(\"#valoresFinalInf\");\n confirmacaoInfValoresFinais.innerHTML = \"\"; //limpa seu conteudo\n \n //zera a varivel porque vai apagar o h6\n criouPegarContratante = 0;\n \n //cria os elementos <h6> para todos os valores\n var paragrafoValorTotal = document.createElement(\"h5\");\n var paragrafoDesconto = document.createElement(\"h5\");\n var paragrafoValorTotalDespesa = document.createElement(\"h5\");\n var paragrafoValorLucro = document.createElement(\"h5\");\n\n //define o atributo\n paragrafoValorTotal.class = \"card-title\";\n paragrafoDesconto.class = \"card-title\";\n paragrafoValorTotalDespesa.class = \"card-title\"; \n paragrafoValorLucro.class = \"card-title\"; \n \n //define o texto\n paragrafoValorTotal.textContent = \"Valor Total: R$\"+valorTotalFesta; \n paragrafoDesconto.textContent = \"Desconto: R$\"+descontoTotalFesta; \n paragrafoValorTotalDespesa.textContent = \"Total de despesas: R$\"+valorTotalDespesa; \n paragrafoValorLucro.textContent = \"Lucro do Evento: R$\"+valorLucro; \n \n //coloca os <p> criados dentro do elemento html da etapa de confirmação\n confirmacaoInfValoresFinais.appendChild(paragrafoValorTotal);\n confirmacaoInfValoresFinais.appendChild(paragrafoDesconto);\n confirmacaoInfValoresFinais.appendChild(paragrafoValorTotalDespesa);\n confirmacaoInfValoresFinais.appendChild(paragrafoValorLucro);\n //FIM DEFINIÇÃO DO TEXTO PARA A ULTIMA ETAPA (CONFIRMAÇÃO)\n \n //DEFINIÇÃO DOS VALORES DO INPUTS DO CADASTRO DE FESTA\n document.getElementById('valorTotalFesta').value = valorTotalFesta;\n document.getElementById('descontoEvento').value = descontoTotalFesta;\n document.getElementById('valorTotalDespesa').value = valorTotalDespesa;\n document.getElementById('valorTotalLucro').value = valorLucro;\n //FIM DEFINIÇÃO DOS VALORES DO INPUTS DO CADASTRO DE FESTA\n \n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"7º Etapa - Valores & Formas de Pagamento\";\n \n document.getElementById('valoresEformaPagamento').style.display = ''; //habilita a etapa 7\n document.getElementById('inserirDespesas').style.display = 'none'; //desabilita a etapa 6\n \n }else{ \n\n //COMEÇO DO CALCULO DOS VALORES\n //VALOR TOTAL FESTA \n //calcula o valor total dos pacotes adicionais\n var valorPacotesAdd = 0;\n listaPacoteAddValores.forEach((valorAtual) => {\n valorPacotesAdd = parseFloat(valorPacotesAdd) + parseFloat(valorAtual);\n });\n \n //calcula o valor total dos valores adicionais\n var valorValoresAdicionais = 0;\n listaValoresAddValores.forEach((valorAtual) => {\n valorValoresAdicionais = parseFloat(valorValoresAdicionais) + parseFloat(valorAtual);\n }); \n \n //resultado = pacotes adicionais + valores adicionais + pacote\n valorTotalFesta = (parseFloat(valorPacotesAdd) + parseFloat(valorValoresAdicionais) + parseFloat(valorPacote)) - parseFloat(descontoTotalFesta);\n\n //VALOR TOTAL DESPESA \n //calcula o valor de despesa de funcionario\n var valorTotalPagamentoFunc = 0;\n listaFuncionarioValores.forEach((valorAtual) => {\n valorTotalPagamentoFunc = parseFloat(valorTotalPagamentoFunc) + parseFloat(valorAtual);\n }); \n \n //calcula o valor de despesa das despesas\n var valorTotalDespesa = 0;\n listaValoresDespesa.forEach((valorAtual) => {\n valorTotalDespesa = parseFloat(valorTotalDespesa) + parseFloat(valorAtual);\n }); \n \n //resultado = funcionario + despesas\n valorTotalDespesa = parseFloat(valorTotalPagamentoFunc) + parseFloat(valorTotalDespesa);\n \n //LUCRO\n //resultado = valor total - valor total despesa\n valorLucro = parseFloat(valorTotalFesta) - parseFloat(valorTotalDespesa);\n \n //arredonda os valores para 2 casas depois da virgula\n valorTotalFesta = parseFloat(valorTotalFesta.toFixed(2));\n valorTotalDespesa = parseFloat(valorTotalDespesa.toFixed(2));\n valorLucro = parseFloat(valorLucro.toFixed(2));\n \n //salva o valorTotalFesta em uma variavel auxiliar utilizada na próxima etapa\n if(countPrimeiraVezAdd == 0){\n valorTotalFestaLocal = valorTotalFesta; \n valorTotalFestaLocalAnterior = valorTotalFesta; \n }else{\n //subtrai do valor total anterior oque sobrou do valor total festa\n valorTotalFestaLocalAnterior = valorTotalFestaLocalAnterior - valorTotalFestaLocal;\n \n //define o novo valor total local, subtraindo o valor total festa - valor anterior\n valorTotalFestaLocal = valorTotalFesta - valorTotalFestaLocalAnterior;\n \n valorTotalFestaLocalAnterior = valorTotalFesta;\n }\n //FIM DO CALCULO DOS VALORES \n \n //DEFINIÇÃO DO TEXTO DA PRÓXIMA ETAPA\n //valor total\n var valorTotalProximaEtapa = document.querySelector(\"#valorTotal\");\n valorTotalProximaEtapa.textContent = \"Valor Total: R$\"+valorTotalFesta; \n \n //desconto\n var valorDescontoProximaEtapa = document.querySelector(\"#totalDesconto\");\n valorDescontoProximaEtapa.textContent = \"Desconto: R$\" + descontoTotalFesta;\n \n //valor total despesa\n var valorTotalDespesaProximaEtapa = document.querySelector(\"#totalDespesas\");\n valorTotalDespesaProximaEtapa.textContent = \"Total de despesas: R$\"+valorTotalDespesa; \n \n //valor lucro\n var valorLucroProximaEtapa = document.querySelector(\"#lucro\");\n valorLucroProximaEtapa.textContent = \"Lucro do Evento: R$\"+valorLucro; \n //FIM DA DEFINIÇÃO DO TEXTO DA PRÓXIMA ETAPA\n \n //DEFINIÇÃO DO TEXTO PARA A ULTIMA ETAPA (CONFIRMAÇÃO)\n //recebe o elemento html da ultima etapa (confirmação) e salva em uma variavel \n var confirmacaoInfValoresFinais = document.querySelector(\"#valoresFinalInf\");\n confirmacaoInfValoresFinais.innerHTML = \"\"; //limpa seu conteudo\n \n //zera a varivel porque vai apagar o h6\n criouPegarContratante = 0;\n \n //cria os elementos <h6> para todos os valores\n var paragrafoValorTotal = document.createElement(\"h5\");\n var paragrafoDesconto = document.createElement(\"h5\");\n var paragrafoValorTotalDespesa = document.createElement(\"h5\");\n var paragrafoValorLucro = document.createElement(\"h5\");\n\n //define o atributo\n paragrafoValorTotal.class = \"card-title\"; \n paragrafoDesconto.class = \"card-title\";\n paragrafoValorTotalDespesa.class = \"card-title\"; \n paragrafoValorLucro.class = \"card-title\"; \n \n //define o texto\n paragrafoValorTotal.textContent = \"Valor Total: R$\"+valorTotalFesta; \n paragrafoDesconto.textContent = \"Desconto: R$\"+descontoTotalFesta;\n paragrafoValorTotalDespesa.textContent = \"Total de despesas: R$\"+valorTotalDespesa; \n paragrafoValorLucro.textContent = \"Lucro do Evento: R$\"+valorLucro; \n \n //coloca os <p> criados dentro do elemento html da etapa de confirmação\n confirmacaoInfValoresFinais.appendChild(paragrafoValorTotal);\n confirmacaoInfValoresFinais.appendChild(paragrafoDesconto);\n confirmacaoInfValoresFinais.appendChild(paragrafoValorTotalDespesa);\n confirmacaoInfValoresFinais.appendChild(paragrafoValorLucro);\n //FIM DEFINIÇÃO DO TEXTO PARA A ULTIMA ETAPA (CONFIRMAÇÃO)\n \n //DEFINIÇÃO DOS VALORES DO INPUTS DO CADASTRO DE FESTA\n document.getElementById('valorTotalFesta').value = valorTotalFesta;\n document.getElementById('descontoEvento').value = descontoTotalFesta;\n document.getElementById('valorTotalDespesa').value = valorTotalDespesa;\n document.getElementById('valorTotalLucro').value = valorLucro;\n //FIM DEFINIÇÃO DOS VALORES DO INPUTS DO CADASTRO DE FESTA\n \n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"7º Etapa - Valores & Formas de Pagamento\";\n \n document.getElementById('valoresEformaPagamento').style.display = ''; //habilita a etapa 7\n document.getElementById('inserirDespesas').style.display = 'none'; //desabilita a etapa 6\n }\n \n }", "function calcHtotal() {\n\t//* G00 (PRODUTO B)\n\t$('#matGPF' + pad(0))\n\t\t\t.html(mESQ[0][0]+'<br>'+mESQ[0][1]+'<br>'+mESQ[0][2]+'<br>'+mESQ[0][3])\n\t$('#matCUT' + pad(0))\n\t\t\t.html(mCOD1[0][0]+'<br>'+mCOD1[0][1]+'<br>'+mCOD1[0][2]+'<br>'+mCOD1[0][3])\n\n\t//* PRIMEIRA À PENÚLTIMA\n\tfor (let index = 1; index < nGavs; index++) {\n\t\tlet nGPF = pad(index)\n\t\tlet source = document.getElementById('rngG' + nGPF)\n\t\tlet j = 1 * index\n\t\ttry {\n\t\t\tmESQ[j][0][0] = parseInt(source.value, 10)\n\t\t\t$('#codGPF' + pad(index)).html(calcCOD(index))\n\t\t\t$('#matGPF' + pad(index))\n\t\t\t.html(mESQ[index][0]+'<br>'+mESQ[index][1]+'<br>'+mESQ[index][2]+'<br>'+mESQ[index][3])\n\t\t\t$('#matCUT' + pad(index))\n\t\t\t.html(mCOD1[index][0]+'<br>'+mCOD1[index][1]+'<br>'+mCOD1[index][2]+'<br>'+mCOD1[index][3])\n\t\t\t\n\t\t\t//> Código incompleto\n\t\t\tif (mESQ[index][1][0] == 0 || (mESQ[index][2][0] == 0 && mESQ[index][3][0] == 0)\n\t\t\t\t|| ((mESQ[index][2][1] == index && mESQ[index][2][2] == 0) &&\n\t\t\t\t\t(mESQ[index][3][1] == index && mESQ[index][3][2] == 0))) {\n\t\t\t\t$('#codGPF' + pad(index)).css('opacity', 0.1)\n\t\t\t} else {\n\t\t\t\t$('#codGPF' + pad(index)).css('opacity', 1)\n\t\t\t}\n\t\t} catch (error) { }\n\t}\n\t//* ÚLTIMA GAVETA\n\t\t//_ console.log('nGavs='+nGavs)\n\t\tmESQ[nGavs][0][0] = 32\n\t\t$('#codGPF' + pad(nGavs)).html(calcCOD(nGavs))\n\t\t$('#matGPF' + pad(nGavs))\n\t\t.html(mESQ[nGavs][0] + '<br>' + mESQ[nGavs][1] + '<br>' + mESQ[nGavs][2] + '<br>' + mESQ[nGavs][3])\n\t\t$('#matCUT' + pad(nGavs))\n\t\t.html(mCOD1[nGavs][0] + '<br>' + mCOD1[nGavs][1] + '<br>' + mCOD1[nGavs][2] + '<br>' + mCOD1[nGavs][3])\n\t\t//> Código incompleto\n\t\tif (mESQ[nGavs][1][0]==0 || (mESQ[nGavs][2][0]==0 && mESQ[nGavs][3][0]==0)) {\n\t\t\t$('#codGPF' + pad(nGavs)).css('opacity', 0.1)\n\t\t} else {\n\t\t\t$('#codGPF' + pad(nGavs)).css('opacity', 1)\n\t\t}\n\n\thTotal = 0\n\tfor (let index = 1; index <= nGavs; index++) {\n\t\thTotal = hTotal + 1 * parseInt(mESQ[index][0][0])\n\t\tif (mESQ[index][0][0]=== NaN) { $('#z-flow-clog').html(index) } \n\t}\n\t//_ let target = document.getElementById('hTotal')\n\t//_ target.innerHTML = '&nbsp' + hTotal + 'mm'\n\t$('#hTotal').html('&nbsp' + hTotal + 'mm');\n\n\t$('#divESQ').css({ 'height': 220 + yOff * nGavs + \"px\" })\n}", "function condiçaoVitoria(){}", "function achatItem1Lvl2() {\n affichagePrixItem1Lvl2.innerHTML = \"OBTENU\";\n boutonItem1Lvl2.disabled = true;\n boutonItem1Lvl2.style.border = \"inherit\";\n clickRessource1 = 4;\n ressource1.innerHTML = ressource1.innerHTML - prix1Item1Lvl2;\n ressource2.innerHTML = ressource2.innerHTML - prix2Item1Lvl2;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem1lvl2Vide\").src= \"assets/img/lance2Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils2();\n }", "liikuta(nimi, suunta){\n for (var i = 0; i < this.hahmot.length; i++){\n var h = this.hahmot[i];\n if (h.nimi == nimi) {\n if (suunta == suunnat.OIKEA) {\n if (this.onkoEtanoita(h.x + 1,h.y)) return;\n if (++h.x >= this.leveys) {\n h.x = 0;\n }\n }\n if (suunta == suunnat.VASEN) {\n if (this.onkoEtanoita(h.x - 1,h.y)) return;\n if (--h.x < 0) {\n h.x = this.leveys - 1;\n }\n }\n if (suunta == suunnat.YLOS) {\n if (this.onkoEtanoita(h.x,h.y - 1)) return;\n if (--h.y < 0) {\n h.y = 0;\n }\n }\n if (suunta == suunnat.ALAS) {\n if (this.onkoEtanoita(h.x, h.y + 1)) return;\n if (++h.y >= this.korkeus) {\n h.y = this.korkeus - 1;\n }\n }\n }\n } \n if (typeof this.pelihahmo == 'undefined') return;\n var h = this.pelihahmo;\n if (h.nimi == nimi) {\n if (suunta == suunnat.OIKEA) {\n if (++h.x >= this.leveys) {\n h.x = 0;\n }\n pisteet++;\n }\n if (suunta == suunnat.VASEN) {\n if (--h.x < 0) {\n h.x = this.leveys - 1;\n }\n pisteet--;\n }\n if (suunta == suunnat.YLOS) {\n if (--h.y < 0) {\n h.y = 0;\n }\n }\n if (suunta == suunnat.ALAS) {\n if (++h.y >= this.korkeus) {\n h.y = this.korkeus - 1;\n }\n }\n }\n }", "function calculate_jumlah_bruto(frm) {\n let jumlah_bruto = (\n frm.doc.gaji_pensiunan + frm.doc.tunjangan_pph \n + frm.doc.tunjangan_lainnya + frm.doc.honorarium + frm.doc.premi_asuransi \n + frm.doc.penerimaan_natura + frm.doc.bonus\n );\n frm.set_value(\"jumlah_bruto\", jumlah_bruto);\n calculate_spt(frm);\n}", "function valorTotalDesconto(descontoreal) {\n\t\tvar valorTotal = 0,\n\t\tvalor;\n\t\t\n\t\t$('.grid tbody tr').each(function(i){\n\t\t\tvalor = $(this).find('.itemTotal').text();\n\t\t\tvalor = valor.replace('R$ ', '').replace('.', '').replace(',', '.');\n\t\t\tvalorTotal += parseFloat(valor);\n\t\t});\n\t\t$('.valorTotal').text('R$ '+ number_format(valorTotal - descontoreal, 2, ',', '.'));\n\t}", "total(){\n return this.contador1 + this.contador2 + this.contador3;\n }", "function tamagoOverTo(){\n\t\t\tif (tivoniClickStatus == true && tzimhoniClickStatus == true && kasherClickStatus == true && heraionClickStatus == true && ingridiantClick==true){\n\t\t\tthis.gari.alpha=0.2;\n\t\t\tthis.tobiko.alpha=0.2;\n\t\t\tthis.tuna.alpha=0.2;\n\t\t\tthis.unagi.alpha=0.2;\n\t\t\tthis.surimi.alpha=0.2;\n\t\t\tthis.palamida.alpha=0.2;\n\t\t\tthis.salmon.alpha=0.2;\n\t\t\tthis.skin.alpha=0.2;\n\t\t\tthis.ekora.alpha=0.2;\n\t\t\tthis.panko.alpha=0.2;\n\t\t\tthis.wasabi.alpha=0.2;\n\t\t\tthis.daikon.alpha=0.2;\n\t\t\tthis.shitaki.alpha=0.2;\n\t\t\tthis.nuri.alpha=0.2;\n\t\t\tthis.nato.alpha=0.2;\n\t\t\tthis.tograshi.alpha=0.2;\n\t\t\tthis.canfio.alpha=0.2;\n\t\t\tthis.tzimhoni_fade.visible=0;\n\t\t\tthis.tivoni_fade.visible=1;\n\t\t\tthis.heraion_fade.visible=0;\n\t\t\tthis.kasher_fade.visible=0;\n\t\t\tthis.instruction_txt.text=\"לחץ כדי ללמוד עוד על הרכיב\";\n\t\t}\n\t\tif((tzimhoniClickStatus == false || kasherClickStatus == false || heraionClickStatus == false) && ingridiantClick==true){\n\t\t\tthis.instruction_txt.text=\"לחץ כדי ללמוד עוד על הרכיב\";\n\t\t}\n\t\t}", "function count(){\n \n \n /* wszystko co jest na wyswietlaczu zostaje 'pociete' na numer1 i numer 2 */\n\n var screen = document.getElementById('screen');\n var length = screen.length;\n \n number2 = screen.value.substring(howManyDigits, length);\n number2 = Number(number2);\n \n // w zaleznosci od flagi opertion wykonuja sie inne dzialania\n \n switch (operation)\n {\n case 301: ans = number1 + number2; break;\n case 302: ans = number1 - number2; break;\n case 303: ans = number1 * number2; break;\n case 304: if(number2 != 0) {\n ans = number1 / number2; \n ans = ans.toFixed(8); break;\n } else {\n ans = 'Div 0'; // nie dziel przez zero\n } \n default: \n var screen = document.getElementById('screen');\n ans = screen.value;\n ans = Number(ans);\n screen.value = ''; // defaultowo wyswietla zmienna \n } \n \n var screenMin = document.getElementById('screenMin'); \n screenMin.value = 'Ans = '+ans; //przeniesienie wyniku na miniscreen\n ans=0;\n \n//ustawienie flag\n operation=300; \n operator = false;\n clearOnClick = true; // ta flaga pozwala wyczyscic ekran po obliczeniu\n dotInUse = false;\n insertAns = true;\n number1=number2=0;\n howManyDigits=0;\n \n }", "function afficherResultats(verifTableau) {\r\n // Méthode filter() va créer un nouveau tableau avec les el triés\r\n // el = élément (couramment utilisé)\r\n // fonction callback type array qui filtre chaque el différents de la valeur true\r\n // .length pour avoir la longueur du tableau ET l'affichage du nbre de fautes\r\n const nbDeFautes = verifTableau.filter((el) => el !== true).length;\r\n // console.log(nbDeFautes);\r\n titreResultat.textContent = \"\";\r\n\r\n switch (nbDeFautes) {\r\n case 0:\r\n titreResultat.textContent = `${emojis[0]} Bravo, c\"est un sans faute ! ${emojis[0]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `5/5`;\r\n break;\r\n case 1:\r\n titreResultat.textContent = `${emojis[1]} Vous y êtes presque ! ${emojis[1]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `4/5`;\r\n break;\r\n case 2:\r\n titreResultat.textContent = `${emojis[1]} Encore un effort ... ${emojis[2]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `3/5`;\r\n break;\r\n case 3:\r\n titreResultat.textContent = `${emojis[2]} Il reste quelques erreurs. ${emojis[3]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `2/5`;\r\n break;\r\n case 4:\r\n titreResultat.textContent = `${emojis[3]} Peux mieux faire. ${emojis[3]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `1/5`;\r\n break;\r\n case 5:\r\n titreResultat.textContent = `${emojis[4]} Peux mieux faire. ${emojis[4]}`;\r\n texteResultat.textContent = `0/5`;\r\n break;\r\n }\r\n}" ]
[ "0.63130164", "0.62169874", "0.61833024", "0.61737436", "0.6134403", "0.6064927", "0.60555124", "0.60259974", "0.59764886", "0.59751385", "0.5957782", "0.5929572", "0.59239525", "0.5910305", "0.59076947", "0.5887431", "0.58761317", "0.58727163", "0.5870127", "0.5848806", "0.58406776", "0.5837249", "0.583068", "0.58260375", "0.58179057", "0.58095914", "0.57994074", "0.57974523", "0.57658064", "0.5760847", "0.5760753", "0.57520556", "0.57471263", "0.57434213", "0.5741692", "0.5734455", "0.57252455", "0.5719254", "0.57073104", "0.570497", "0.56971574", "0.56956595", "0.5690589", "0.5682873", "0.56801933", "0.5671594", "0.56659627", "0.56648487", "0.56625694", "0.5648398", "0.5644747", "0.56441814", "0.5643233", "0.56353045", "0.5632912", "0.5631979", "0.5628739", "0.56231636", "0.56210124", "0.5618775", "0.5611013", "0.5607658", "0.5604472", "0.55901456", "0.5584571", "0.55832136", "0.55818695", "0.5581054", "0.5580986", "0.5577219", "0.5576213", "0.55754614", "0.5570148", "0.5567857", "0.55654866", "0.5563791", "0.556217", "0.55620533", "0.55499923", "0.55468965", "0.5537428", "0.5535409", "0.5533093", "0.55283517", "0.5526348", "0.55250996", "0.55237705", "0.5523115", "0.55213565", "0.55198324", "0.5516186", "0.5504437", "0.5503622", "0.5503619", "0.55025005", "0.55006814", "0.5500195", "0.5499197", "0.54964364", "0.5494053", "0.5488891" ]
0.0
-1
Check if the given character code, or the character code at the first character, is a whitespace character.
function whitespace(character) { return re.test( typeof character === 'number' ? fromCode(character) : character.charAt(0) ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_whitespace(char) {\n return \" \\t\\n\".indexOf(char) >= 0;\n }", "function isWhiteSpace(code) {\n return isNewline(code) || code === 0x0020 || code === 0x0009;\n}", "function isWhitespace(char) {\n\treturn /\\s/.test(char);\n}", "function sc_isCharWhitespace(c) {\n var tmp = c.val;\n return tmp === \" \" || tmp === \"\\r\" || tmp === \"\\n\" || tmp === \"\\t\" || tmp === \"\\f\";\n}", "function whitespace(char) {\n return char != \"\" ? true : false \n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}", "function isWhiteSpace(code) {\n if (code >= 8192 && code <= 8202) {\n return true;\n }\n switch (code) {\n case 9:\n // \\t\n case 10:\n // \\n\n case 11:\n // \\v\n case 12:\n // \\f\n case 13:\n // \\r\n case 32:\n case 160:\n case 5760:\n case 8239:\n case 8287:\n case 12288:\n return true;\n }\n return false;\n }", "function isWhitespace(code) {\n // Based on https://www.w3.org/TR/css-syntax-3/#whitespace\n switch (code) {\n case 0x0009: // tab\n case 0x0020: // space\n case 0x000a: // line feed\n case 0x000c: // form feed\n case 0x000d: // carriage return\n return true;\n default:\n return false;\n }\n}", "function isWhiteSpace(code) {\n\t if (code >= 0x2000 && code <= 0x200A) { return true; }\n\t switch (code) {\n\t case 0x09: // \\t\n\t case 0x0A: // \\n\n\t case 0x0B: // \\v\n\t case 0x0C: // \\f\n\t case 0x0D: // \\r\n\t case 0x20:\n\t case 0xA0:\n\t case 0x1680:\n\t case 0x202F:\n\t case 0x205F:\n\t case 0x3000:\n\t return true;\n\t }\n\t return false;\n\t}", "function isWhitespace$1(c) {\n return c === CHAR_SPACE$1 || c === CHAR_TAB$1;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "function isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}", "isWhitespace(char) {\n return /\\s/.test(char ? char : this.char) // || this.isNewline() // [\\r\\n\\t\\f\\v ]\n }", "function isWhitespace(ch) {\n return /\\s/.test(ch);\n }", "function isWhitespace(c) {\n\t return c === CHAR_SPACE || c === CHAR_TAB;\n\t}", "function isWhitespace(c) {\n\t return c === CHAR_SPACE || c === CHAR_TAB;\n\t}", "function isWhitespace(c) {\n\t return c === CHAR_SPACE || c === CHAR_TAB;\n\t}", "function isSpace(c) {\n\treturn c.trim() === \"\";\n}", "function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }", "function isWhiteSpace(ch) {\n\t return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n\t (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n\t }", "function isWhitespace(c) {\n\t\treturn WHITESPACE_PATTERN.test(c);\n\t}", "function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }", "function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }", "function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }", "static isWhitespace(ch) {\n return ch === 0x20 || ch === 0x09;\n }", "function IsSpace(ch) {\n return (\" \\t\\r\\n\".indexOf(ch) >= 0);\n}", "function iswhitespace(s) {\n switch(s.charAt(0)) {\n case '\\t': case '\\n': case '\\r': case ' ':\n return true\n case '/':\n switch(s.charAt(1)) {\n case '*': case '/':\n return true\n default:\n return false\n }\n default:\n return false\n }\n}", "function isWhiteSpace(ch) {\n // The messy regexp is because IE's regexp matcher is of the\n // opinion that non-breaking spaces are no whitespace.\n return ch != \"\\n\" && /^[\\s\\u00a0]*$/.test(ch);\n}", "function isWhitespace(cp) {\r\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\r\n}", "function isWhitespace(cp) {\r\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\r\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function hasWhiteSpace(string) {\r\n\tfor (char of string) {\r\n\t\tif (char === \" \") {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}", "function isWhitespace(s)\n\n{\t var i;\n\n\t\t// Is s empty?\n\t\tif (isEmpty(s)) return true;\n\n\t\tfor (i = 0; i < s.length; i++)\n\t\t{\t \n\t\t// Check that current character isn't whitespace.\n\t\tvar c = s.charAt(i);\n\n\t\tif (whitespace.indexOf(c) == -1) return false;\n\t\t}\n\n\t\t// All characters are whitespace.\n\t\treturn true;\n}", "function hasWhiteSpace(string) {\n return string.indexOf(\" \") >= 0;\n}", "function isSpace(c) {\n return c === \"\\u0020\" || // space\n c === \"\\u0009\" || // horizontal tab\n c === \"\\u000A\" || // new line\n c === \"\\u000C\" || // form feed\n c === \"\\u000D\"; // carriage return\n }", "function hasSpaces(cadena) {\n\n return ((-1)!= cadena.indexOf(\" \"));\n\n }", "function isWhitespace(c) {\n if ((c == ' ') || (c == '\\r') || (c == '\\n'))\n return true;\n return false;\n }", "function isWhitespace(str) { \r\n\tvar re = /[\\S]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isSpace(str) {\n return str.match(/\\s/) !== null;\n}", "function satisyWhitespace(ch, pos) {\n switch (ch) {\n case 0x09:\n case 0x0A:\n case 0x0D:\n case 0x20:\n return true;\n default:\n return false;\n }\n }", "function isS(c) {\n return c === SPACE || c === NL || c === CR || c === TAB;\n}", "function isS(c) {\n return c === SPACE || c === NL || c === CR || c === TAB;\n}", "function isSpace(ltr) {\n return (ltr == \" \");\n }", "function isSpace(c) {\n\treturn c === 0x20 || c >= 0x0009 && c <= 0x000d || c === 0x00a0 || c === 0x1680 || c === 0x180e || c >= 0x2000 && c <= 0x200a || c === 0x2028 || c === 0x2029 || c === 0x202f || c === 0x205f || c === 0x3000 || c === 0xfeff;\n}", "function isSpace(c) {\n return (c === \"\\u0020\" || // space\n c === \"\\u0009\" || // horizontal tab\n c === \"\\u000A\" || // new line\n c === \"\\u000C\" || // form feed\n c === \"\\u000D\"); // carriage return\n }", "function isWhitespace(cp) {\n return cp === $$5.SPACE || cp === $$5.LINE_FEED || cp === $$5.TABULATION || cp === $$5.FORM_FEED;\n}", "function isWhitespace (s)\r\n\r\n{ var i;\r\n\r\n // Is s empty?\r\n if (isEmpty(s)) return true;\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-whitespace character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character isn't whitespace.\r\n var c = s.charAt(i);\r\n\r\n if (whitespace.indexOf(c) == -1) return false;\r\n }\r\n\r\n // All characters are whitespace.\r\n return true;\r\n}" ]
[ "0.7842182", "0.7834264", "0.7832752", "0.78228", "0.77745175", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7682491", "0.76666844", "0.7659627", "0.76204914", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7570898", "0.7534774", "0.7407433", "0.7399154", "0.7399154", "0.7399154", "0.73413897", "0.7301224", "0.7244097", "0.7210971", "0.720715", "0.720715", "0.720715", "0.719943", "0.7151194", "0.71169263", "0.70465326", "0.6993038", "0.6993038", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.69897974", "0.6979824", "0.6977775", "0.69372404", "0.6912462", "0.6898158", "0.68820524", "0.68773174", "0.6863435", "0.68628407", "0.6847895", "0.68454725", "0.68454725", "0.6839906", "0.68365514", "0.68252915", "0.68245345", "0.68155324" ]
0.77966636
8
Check if the given character code, or the character code at the first character, is decimal.
function decimal(character) { var code = typeof character === 'string' ? character.charCodeAt(0) : character return code >= 48 && code <= 57 /* 0-9 */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 48 && code <= 57; /* 0-9 */\n}", "function _isDecimalDigit(ch) {\n return ch >= 48 && ch <= 57; // 0...9\n }", "function isdecimal(num) {\n return (/^\\d+(\\.\\d+)?$/.test(num + \"\"));\n}", "function isNumberChar(char) {\n\treturn char.charCodeAt(0) >= 48 && char.charCodeAt(0) <= 57;\n}", "function isValidNumberChar(ch) {\n return isNumeral(ch) || ch === '.';\n }", "function containsDecimal (string) {\n return string.includes(\".\");\n}", "function isIntDecimal(value)\r\n{\r\n //var res = value.match(/^\\d+(\\.\\d+)?$/);\r\n if(!value.match(/^\\d+(\\.\\d+)?$/))\r\n\t\treturn false;\r\n else\t\r\n\t\treturn true;\r\n}", "function isDigit(code) {\n return code >= 0x0030 && code <= 0x0039;\n}", "function isNumeric(val) {\r\n var dp = false;\r\n for (var i=0; i < val.length; i++) {\r\n if (!isDigit(val.charAt(i))) {\r\n if (val.charAt(i) == '.') {\r\n if (dp == true) { return false; } // already saw a decimal point\r\n else { dp = true; }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "function checkDecimal(stringValue) {\n\t\tstringValue = stringValue.trim();\n\t\t/*\tRegExp explanation:\n\t\t\t# [^ - Start of negated character class\t\t\t\t\t\t\t# , The literal character ,\t\t\t\t\t\t\t\t\n\t\t\t# ] - End of negated character class\t\t\t\t\t\t\t\t# \\. Matches the character . literally\n\t\t\t# 0-9 A single character in the range between 0 and 9\t\t\t\t# \\d Match a digit [0-9]\n\t\t\t# g Modifier: global. All matches (don't return on first match)\t# {2} Quantifier: {2} Exactly 2 times\n\t\t\t# [,\\.] Match a single character present in the list below\t\t\t# $ Assert position at end of the string\n\t\t*/\n\t\tvar result = stringValue.replace(/[^-0-9]/g, '');\n\t\tif (/[,\\.]\\d{2}$/.test(stringValue)) {\n\t\t\tresult = result.replace(/(\\d{2})$/, '.$1');\n\t\t}\n\t\treturn parseFloat(result);\n\t}", "function checkDecimal(stringValue) {\n\t\tstringValue = stringValue.trim();\n\t\t/*\tRegExp explanation:\n\t\t\t# [^ - Start of negated character class\t\t\t\t\t\t\t# , The literal character ,\t\t\t\t\t\t\t\t\n\t\t\t# ] - End of negated character class\t\t\t\t\t\t\t\t# \\. Matches the character . literally\n\t\t\t# 0-9 A single character in the range between 0 and 9\t\t\t\t# \\d Match a digit [0-9]\n\t\t\t# g Modifier: global. All matches (don't return on first match)\t# {2} Quantifier: {2} Exactly 2 times\n\t\t\t# [,\\.] Match a single character present in the list below\t\t\t# $ Assert position at end of the string\n\t\t*/\n\t\tvar result = stringValue.replace(/[^-0-9]/g, '');\n\t\tif (/[,\\.]\\d{2}$/.test(stringValue)) {\n\t\t\tresult = result.replace(/(\\d{2})$/, '.$1');\n\t\t}\n\t\treturn parseFloat(result);\n\t}", "function decimalCurrency(txt) {\n\tregExp = /^[0-9]+(\\.[0-9]+)*$/;\n\treturn regExp.test(txt.value);\n}", "function isWholeOrDecimal(num){\n if (parseInt(num) === num){\n return \"whole num\";\n }else {\n return \"decimal num\";\n }\n}", "function isDigit (c)\r\n{ return ((c >= \"0\") && (c <= \"9\"))\r\n}", "function isDigit (c)\r\n{ return ((c >= \"0\") && (c <= \"9\"))\r\n}", "function isDecimal(theInputField)\r\n{\r\n\r\n theInput = theInputField.value;\r\n theLength = theInput.length ;\r\n var dec_count = 0 ;\r\n\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n if(theInput.charAt(i) == '.')\r\n // the text field has decimal point entry\r\n {\r\n dec_count = dec_count + 1;\r\n }\r\n }\r\n //check if number field contains more than one decimal points '.'\r\n if(dec_count > 1)\r\n {\r\n\talert('The field cannot contain two decimal points');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n return(false);\r\n }\r\n //check if decimal field contains just a '.'\r\n if (dec_count == 1 && dec_count == theLength)\r\n {\r\n\talert('The field cannot contain just a decimal');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n \treturn false;\r\n }\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n\t//check if decimal field contains laphabets or spaces\r\n if (theInput.charAt(i) < '0' || theInput.charAt(i) > '9')\r\n {\r\n\t if(theInput.charAt(i) == '-'){\r\n\t\t continue;\r\n\t }\r\n if(theInput.charAt(i) != '.')\r\n {\r\n alert(\"This field cannot contain alphabets or spaces\");\r\n theInputField.focus();\r\n\t theInputField.select();\r\n return(false);\r\n }\r\n }\r\n }// for ends\r\n return (true);\r\n}", "function isChar (code) {\n\t// http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes\n\treturn code === 32 || (code > 46 && !(code >= 91 && code <= 123) && code !== 144 && code !== 145);\n}", "function isDigit (c)\n{ return ((c >= \"0\") && (c <= \"9\"))\n}", "function isAsciiDigit(cp) {\n return cp >= CODE_POINTS.DIGIT_0 && cp <= CODE_POINTS.DIGIT_9;\n}", "function decimal(campo)\n\t{\n\tvar charpos = campo.value.search(\"[^0-9. ]\");\n\tif(campo.value.length > 0 && charpos >= 0)\n\t\t{\n\t\tcampo.value = campo.value.slice(0, -1)\n\t\tcampo.focus();\n\t\treturn false;\n\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\treturn true;\n\t\t\t\t}\n\t}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDecimal(element)\n{\nreturn (/^\\d+(\\.\\d)?$/.test(element.value) || /^\\d+(\\.\\d\\d)?$/.test(element.value)\n\t\t || /^(\\.\\d\\d)?$/.test(element.value) || /^\\d+(\\.)?$/.test(element.value));\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isFullDigital(char)\n{\n\t//if (char < '0' || char > '9')\n\tif (char == '0' || char == '1' || char == '2' || char == '3' || char == '4'\n\t || char == '5' || char == '6' || char == '7' || char == '8' || char == '9')\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function isDigit(c)\n{\n return !isNaN(parseFloat(c)) && isFinite(c);\n}", "function isDigit(character)\n{\n return (1 == character.length) && (!isNaN(parseInt(character), 10));\n}", "function isDigit_(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit_(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(c) {\n return c >= '0' && c <= '9';\n}", "function onlyDecimalCP(e){ \n// note: backspace = 8, enter = 13, '0' = 48, '9' = 57 \n\tif(!e) e = window.event;\n\tvar key; key = !e.keyCode ? e.which : e.keyCode;\n\tvar punto = 0;\n\tvar decimals = 0;\n\tvar _this;\n\tif (e.target) _this = e.target;\n\telse if (e.srcElement) _this = e.srcElement;\n\tif (_this.nodeType == 3) // defeat Safari bug\n\t _this = targ.parentNode;\n\n\tif ((key >= 48 && key <= 57) || key == 45 || key == 46 || keySpecial(key)) {\n\t __hiddenInfo(e);\n\t if (key == 46) {\n cadena = _this.value\n\t if (cadena.indexOf(\".\") != -1) {\n\t punto = 1;\n\t }\n\t punto++;\n\t if (punto > 1) { stopEvent(e); cancelEvent(e); __showInfo(e, 3); }\n\t } else {\n try{\n //cadena = _this.value.substring(0, _this.selectionStart);\n cadena = _this.value.substring(0, getCaret(_this));\n }catch(e){\n cadena = _this.value;\n }\n if (cadena.indexOf(\".\") != -1) {\n //decimals = cadena.substring(cadena.indexOf(\".\")).length;\n decimals = _this.value.substring(_this.value.indexOf(\".\")).length;\n }\n if (decimals > 2) { stopEvent(e); cancelEvent(e); __showInfo(e, 3); }\n\t\t}\n\t}\n\telse { stopEvent(e); cancelEvent(e); __showInfo(e, 3); }\n}", "function isNumeric (c) {\n // FIXME: is this correct? Seems to work\n return (c >= '0') && (c <= '9')\n}", "function isNumeric (c) {\n // FIXME: is this correct? Seems to work\n return (c >= '0') && (c <= '9')\n}", "function isNumeric (c) {\n // FIXME: is this correct? Seems to work\n return (c >= '0') && (c <= '9')\n}", "function isHalfDigital(char)\n{\n\tif (char < '0' || char > '9')\n\t{\n\t\treturn false;\n\t}\n\treturn true;\n}", "function sc_isCharNumeric(c)\n { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); }", "function is_digit(char) {\n return /[0-9]/i.test(char);\n }", "function charIsDigit(charCode)\n{\n return (charCode >= 48 && charCode <= 57);\n}", "function isNumeric (c) {\n\t // FIXME: is this correct? Seems to work\n\t return (c >= '0') && (c <= '9')\n\t}", "function isNumeral(ch) {\n const Ascii_0 = 48;\n const Ascii_9 = 57;\n let code = ch.charCodeAt(0);\n return Ascii_0 <= code && code <= Ascii_9;\n }", "function isNumber(character) {\n return Number.isInteger(parseInt(character))\n}", "function isDecimalNumber(evt) {\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n if (charCode !== 46 && charCode > 31\n && (charCode < 48 || charCode > 57))\n return false;\n\n return true;\n}", "function isDigit(charVal)\r\n{\r\n\treturn (charVal >= '0' && charVal <= '9');\r\n}", "static isDigit(ch) {\n return ch >= 0x30 && ch < 0x3A;\n }", "function isNumeric(c) \n\t{\n\t\tif (c >= '0' && c <= '9') \n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function isNumber(codepoint) {\n return codepoint >= Character._0 && codepoint <= Character._9;\n}", "function __is_comm_chars(char_code)\n{\n\tif (char_code == 0) return true;\t\t\t\t\t\t/* some control key. */\n\tif (char_code == 8) return true;\t\t\t\t\t\t/* TAB */\n\tif (char_code >= 48 && char_code <= 57) return true;\t/* 0~9 */\n\tif (char_code >= 65 && char_code <= 90) return true;\t/* A~Z */\n\tif (char_code >= 97 && char_code <= 122) return true;\t/* a~z */\n\n\treturn false;\n}", "function isNumber(character){\n return !isNaN(character);\n}", "function isLetterOrDigit (c)\r\n{ return (isLetter(c) || isDigit(c))\r\n}", "function isLetterOrDigit (c)\r\n{ return (isLetter(c) || isDigit(c))\r\n}", "function isValidPositiveNumber(val){\r\n if(val==null){return false;}\r\n if (val.length==0){return false;}\r\n var DecimalFound = false;\r\n for (var i = 0; i < val.length; i++) {\r\n var ch = val.charAt(i)\r\n if (ch == \".\" && !DecimalFound) {\r\n DecimalFound = true;\r\n continue;\r\n }\r\n if (ch < \"0\" || ch > \"9\") {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function isEmptyDecimal(value) {\n return value === \"\" || value === \"-\" || value === \".\" || value === \"-.\";\n}", "static isDecimalOrBlank(string) {\n return string.match(/^\\d+(\\.\\d{0,2})?$|^$/)\n }", "function esNumeroDecimalValido(strNumeroDecimal) {\n\treturn (/^[\\-]*[0-9]+\\.[0-9][0-9]$/.test(strDecimal));\n}", "function esNumeroDecimalValido(strNumeroDecimal) {\n\treturn (/^[\\-]*[0-9]+\\.[0-9][0-9]$/.test(strDecimal));\n}", "function input_decimal(){\n console.log(\"Handling decimal\");\n let dot = \".\";\n const {curr_num} = calculator;\n // case 1: what if i already have a decimal in the current number? do nothing. Check only for when there is\n if(!curr_num.includes(dot)){\n calculator.curr_display += dot;\n calculator.curr_num += dot;\n }\n}", "function num_d(event){\n var char = event.which;\n if (char > 31 && (char < 48 || char > 57) && char != 68) {\n return false;\n }\n}", "function charIsSymbol(charCode)\n{\n switch (charCode)\n {\n case 36: // $\n case 95: // _\n return true;\n\n default:\n return (\n (charCode >= 48 && charCode <= 57) || // 0-9\n (charCode >= 97 && charCode <= 122) || // a-z\n (charCode >= 64 && charCode <= 90) // A-Z\n );\n }\n}", "function isCmplSep(achar) {\n if (achar == 44 || achar == 188 || achar == 10 || achar == 13) {\n return 1;\n } else { \n return 0;\n }\n}", "function Digitos(e, field) {\n var teclaPulsada = window.event ? window.event.keyCode : e.which;\n var valor = field.value;\n\n if (teclaPulsada == 08 || (teclaPulsada == 46 && valor.indexOf(\".\") == -1)) return true;\n\n return /\\d/.test(String.fromCharCode(teclaPulsada));\n}", "function isLetterOrNumber(codepoint) {\n return isLetter(codepoint) || isNumber(codepoint);\n}", "function isnotValidDecimal(str){\n\tif((str.indexOf(\".\"))!=-1){\n\t\tfr1=str.indexOf('.');\n\t\tmm = (str.substring(fr1,str.length));\n\t\tstrnum=(Number(mm.length));\n\t\tif(strnum>3){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function containsDecimalPlaces (string) {\n return (containsDecimal(string) && string.indexOf(\".\") < string.length - 1);\n}", "function numCheck(num) {\n let charPresent = false;\n for (let i = 0; i < num.length; i++) {\n if (isNaN(num[i])) {\n charPresent = true;\n return charPresent;\n }\n }\n}", "function checkDecimalWithPrecesion (field, totalDecimal, allowedPrecision)\r\n{\r\n\r\n\t//alert('inside checkDecimalWithPrecision');\r\n var value = field.value;\r\n if (value.length == 0) {\r\n //value is empty / field is blank\r\n\treturn flagIsBlank;\r\n } \r\n \r\n if (isDecimal(field)) \r\n {\r\n dindex = value.indexOf(\".\", 0);\r\n\tvar s1 = value;\r\n var adj = 0;\r\n\t\r\n\tif (dindex > 0) {\r\n\t s1 = value.substring (0, dindex);\r\n\t var adj = (dindex > 0)?1:0;\r\n\r\n\t var s2 = value.substring (dindex + 1, value.length);\r\n\r\n\t if (s2.length > allowedPrecision) {\r\n\t return flagExceedNumericLimit;\r\n\t }\r\n\t} \r\n\t\r\n\tif (s1.length > (totalDecimal - allowedPrecision + adj)) {\r\n\t //alert (\"Exceeds allowed numerical length\");\t\r\n\t return flagExceedPecisionLimit;\r\n\t}\r\n }\r\n else\r\n\t{\r\n\t return flagIsBlank;\r\n\t}\r\n return flagIsValid; \r\n}", "function isValidCharToStartNumber(ch) {\n return isNumeral(ch) || ch == '-';\n }", "function isDigitalOrLetter(str)\n{\n\tvar result = true;\n \tif(str == null || str.trim() == \"\") return false;\n\t\n\tstr = str.trim();\n\n for(var i=0; i<str.length; i++)\n {\n var strSub = str.substring(i,i+1); \n if( !((strSub<=\"9\"&&strSub>=\"0\") || \n\t\t (strSub<=\"Z\"&&strSub>=\"A\") || \n\t\t\t(strSub<=\"z\"&&strSub>=\"a\")) )\n {\n\t\t\tresult = false;\n\t\t\tbreak;\n }\n }\n return result ;\t\n}", "function isNumberKeyDecimal(evt){\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n if (charCode > 31 && (charCode !== 46 &&(charCode < 48 || charCode > 57)))\n return false;\n return true;\n}", "function priceFormatCheck(input) {\r\n var i = 0;\r\n do {\r\n if (i === input.length) {\r\n return false;\r\n }\r\n i++;\r\n } while (input.charAt(i) != '.');\r\n return 2 === input.length - (i + 1);\r\n}", "function decimal(){\n if (foo.inputMode === false) {\n foo.key = '0.';\n } else if (foo.register.includes('.')){\n return;\n } else {\n foo.key = '.';\n }\n foo.numPad();\n return;\n }", "function isNumberCheck(el, evt) {\n var charCode = (evt.which) ? evt.which : event.keyCode;\n var num=el.value;\n var number = el.value.split('.');\n if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {\n return false;\n }\n //just one dot\n if((number.length > 1 && charCode == 46) || ( el.value=='' && charCode == 46)) {\n return false;\n }\n //get the carat position\n var caratPos = getSelectionStart(el);\n var dotPos = el.value.indexOf(\".\");\n if( caratPos > dotPos && dotPos>-1 && (number[1].length > 1)){\n return false;\n }\n return true;\n}", "function numbersCurrency(myfield, e, dec)\n{\n\tvar key;\n\tvar keychar;\n\t\n\tif (window.event)\n\t key = window.event.keyCode;\n\telse if (e)\n\t key = e.which;\n\telse\n\t return true;\n\tkeychar = String.fromCharCode(key);\n\t\n\t// control keys\n\tif ((key==null) || (key==0) || (key==8) || \n\t (key==9) || (key==13) || (key==27) )\n\t return true;\n\t\n\t// numbers\n\telse if (((\"0123456789.\").indexOf(keychar) > -1))\n\t return true;\n\t\n\t// decimal point jump\n\telse if (dec && (keychar == \".\"))\n\t {\n\t myfield.form.elements[dec].focus();\n\t return false;\n\t }\n\telse\n\t return false;\n}", "function IsCharCodeNumeric(charCode)\n{\n return ((charCode > 47) && (charCode < 58));\n}", "static get decimal() {\n return /^[\\+\\-]?\\d*\\.\\d+$/;\n }", "function intOnly(myfield, e, dec)\r\n{\r\n\tvar key;\r\n\tvar keychar;\r\n\t \r\n\tif (window.event)\r\n\t key = window.event.keyCode;\r\n\telse if (e)\r\n\t key = e.which;\r\n\telse\r\n\t return true;\r\n\tkeychar = String.fromCharCode(key);\r\n\t \r\n\t// control keys\r\n\tif ((key==null) || (key==0) || (key==8) || \r\n\t\t(key==9) || (key==13) || (key==27) )\r\n\t return true;\r\n\t \r\n\t// numbers\r\n\telse if (((\"0123456789\").indexOf(keychar) > -1))\r\n\t return true;\r\n\telse if (((\".\").indexOf(keychar) > -1)){\r\n\t if (myfield.value.indexOf(\".\") >-1){\r\n\t\t return false;\r\n\t }else \r\n\t return true;\r\n\t }\r\n\t \r\n\telse\r\n\t return false;\r\n}", "function isDigit(ch) {\n return /^[0-9]$/.test(ch);\n }", "function isDecimal(possibleNumber)\n\t{\n//\t\t//trace(\"in is decimal\");\n//\t\t//trace(possibleNumber);\n\n\t\tif (isNaN(possibleNumber))\n\t\t\treturn false;\n\n\t\treturn !(possibleNumber === Math.floor(possibleNumber))\n\t}", "function decimals(evt,id)\n{\n\ttry{\n var charCode = (evt.which) ? evt.which : event.keyCode;\n \n if(charCode==46){\n var txt=document.getElementById(id).value;\n if(!(txt.indexOf(\".\") > -1)){\n\t\n return true;\n }\n }\n if (charCode > 31 && (charCode < 48 || charCode > 57) )\n return false;\n\n return true;\n\t}catch(w){\n\t\talert(w);\n\t}\n}", "function likeNumber(value) {\n\t var code = value.charCodeAt(0);\n\t var nextCode;\n\n\t if (code === plus || code === minus) {\n\t nextCode = value.charCodeAt(1);\n\n\t if (nextCode >= 48 && nextCode <= 57) {\n\t return true;\n\t }\n\n\t var nextNextCode = value.charCodeAt(2);\n\n\t if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {\n\t return true;\n\t }\n\n\t return false;\n\t }\n\n\t if (code === dot) {\n\t nextCode = value.charCodeAt(1);\n\n\t if (nextCode >= 48 && nextCode <= 57) {\n\t return true;\n\t }\n\n\t return false;\n\t }\n\n\t if (code >= 48 && code <= 57) {\n\t return true;\n\t }\n\n\t return false;\n\t}", "num_decimals(num) {\n if (!this.is_numeric(num)) return false;\n let text = num.toString()\n if (text.indexOf('e-') > -1) {\n let [base, trail] = text.split('e-')\n let elen = parseInt(trail, 10)\n let idx = base.indexOf(\".\")\n return idx == -1 ? 0 + elen : (base.length - idx - 1) + elen\n }\n let index = text.indexOf(\".\")\n return index == -1 ? 0 : (text.length - index - 1)\n }", "function isDigitOrAlphabetChar(c) {\nreturn ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z'));\n}", "function isHexDigit(code) {\n return (\n isDigit(code) || // 0 .. 9\n (code >= 0x0041 && code <= 0x0046) || // A .. F\n (code >= 0x0061 && code <= 0x0066) // a .. f\n );\n}", "function decimals(evt,id)\n{\t\n\ttry{\n var charCode = (evt.which) ? evt.which : event.keyCode; \n if(charCode==46){\n var txt=document.getElementById(id).value;\n if(!(txt.indexOf(\".\") > -1)){\n\t\n return true;\n }\n }\n if (charCode > 31 && (charCode < 48 || charCode > 57) )\n return false;\n\n return true;\n\t}catch(w){\n\t\t//alert(w);\n\t}\n}", "startsWith(c){ return this.isSign(c) || Character.isDigit(c) }", "function checkDecimalMisc(op) {\r\n\tfor (element of splitBySymbol(op)) {\r\n\t\tif (!element.match(/[-+*/%]/) && element % 1 != 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t} \r\n\treturn false;\r\n}", "function isDigit(s) { return Number.isInteger(parseInt(s)); }", "function isChar(c) {\n return (c >= 0x0001 && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function checkDecimalAndPrecision(theInputField, val)\r\n{\r\n\r\n theInput = theInputField.value;\r\n theLength = theInput.length ;\r\n var dec_count = 0 ;\r\n\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n if(theInput.charAt(i) == '.')\r\n // the text field has decimal point entry\r\n {\r\n dec_count = dec_count + 1;\r\n }\r\n }\r\n\r\n //check if number field contains more than one decimal points '.'\r\n if(dec_count > 1)\r\n {\r\n\t//alert('The field cannot contain two decimal points');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n return flagExtraDecimal;\r\n }\r\n //check if decimal field contains just a '.'\r\n if (dec_count == 1 && dec_count == theLength)\r\n {\r\n\t//alert('The field cannot contain just a decimal');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n \treturn flagOnlyDecimal;\r\n }\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n\t//check if decimal field contains laphabets or spaces\r\n if (theInput.charAt(i) < '0' || theInput.charAt(i) > '9')\r\n {\r\n if(theInput.charAt(i) != '.' && theInput.charAt(i) != ',')\r\n {\r\n // alert(\"This field cannot contain alphabets or spaces\");\r\n theInputField.focus();\r\n\t theInputField.select();\r\n return flagNonNumeric;\r\n }\r\n }\r\n }// for ends\r\n\tif(theInputField.value >= val)\r\n\t{\r\n // alert(\"This field cannot be greater than or equal to\" + val);\r\n\t\ttheInputField.focus();\r\n\t\ttheInputField.select();\r\n\t\treturn flagMaxLimit;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn flagFieldValid;\r\n\t}\r\n}" ]
[ "0.79072535", "0.7269267", "0.67055756", "0.6648749", "0.6647464", "0.6595899", "0.65650105", "0.6528613", "0.6525254", "0.6490702", "0.6490702", "0.6467799", "0.6428777", "0.6407652", "0.6407652", "0.639504", "0.63804865", "0.6337335", "0.6335508", "0.6280799", "0.62789047", "0.62789047", "0.62789047", "0.62789047", "0.62789047", "0.62789047", "0.62789047", "0.62789047", "0.62765914", "0.6276259", "0.6249478", "0.6241283", "0.6236676", "0.6233047", "0.6232657", "0.622366", "0.62046677", "0.619347", "0.619347", "0.619347", "0.6117236", "0.6104083", "0.6087748", "0.60853344", "0.6067501", "0.6042812", "0.60284585", "0.6014922", "0.60129774", "0.6004983", "0.59937274", "0.59757733", "0.59721506", "0.5966875", "0.5960449", "0.5960449", "0.5937855", "0.5932052", "0.58838224", "0.5873984", "0.5873984", "0.58515084", "0.58456224", "0.58404386", "0.5826893", "0.58210295", "0.5820967", "0.5800808", "0.5800759", "0.57813734", "0.5768312", "0.5766554", "0.57634693", "0.5748703", "0.57386625", "0.57311326", "0.5729757", "0.5727685", "0.57238084", "0.571357", "0.57014525", "0.56879723", "0.56877995", "0.5682046", "0.56780094", "0.5670713", "0.5667188", "0.56522876", "0.56425524", "0.56400317", "0.56386244", "0.56310296", "0.56228405", "0.5621779" ]
0.7950802
5
Wrap to ensure clean parameters are given to `parse`.
function parseEntities(value, options) { var settings = {} var option var key if (!options) { options = {} } for (key in defaults) { option = options[key] settings[key] = option === null || option === undefined ? defaults[key] : option } if (settings.position.indent || settings.position.start) { settings.indent = settings.position.indent || [] settings.position = settings.position.start } return parse(value, settings) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitize( params, cb ){\n\n var clean = {};\n\n // ensure the input params are a valid object\n if( Object.prototype.toString.call( params ) !== '[object Object]' ){\n params = {};\n }\n\n // input text\n if('string' !== typeof params.input || !params.input.length){\n return cb( 'invalid param \\'input\\': text length, must be >0' );\n }\n clean.input = params.input;\n\n // total results\n var size = parseInt( params.size, 10 );\n if( !isNaN( size ) ){\n clean.size = Math.min( size, 40 ); // max\n } else {\n clean.size = 10; // default\n }\n\n // which layers to query\n if('string' === typeof params.layers && params.layers.length){\n var layers = params.layers.split(',').map( function( layer ){\n return layer.toLowerCase(); // lowercase inputs\n });\n for( var x=0; x<layers.length; x++ ){\n if( -1 === indeces.indexOf( layers[x] ) ){\n return cb( 'invalid param \\'layer\\': must be one or more of ' + layers.join(',') );\n }\n }\n clean.layers = layers;\n }\n else {\n clean.layers = indeces; // default (all layers)\n }\n\n // lat\n var lat = parseFloat( params.lat, 10 );\n if( isNaN( lat ) || lat < 0 || lat > 90 ){\n return cb( 'invalid param \\'lat\\': must be >0 and <90' );\n }\n clean.lat = lat;\n\n // lon\n var lon = parseFloat( params.lon, 10 );\n if( isNaN( lon ) || lon < -180 || lon > 180 ){\n return cb( 'invalid param \\'lon\\': must be >-180 and <180' );\n }\n clean.lon = lon;\n\n // zoom level\n var zoom = parseInt( params.zoom, 10 );\n if( !isNaN( zoom ) ){\n clean.zoom = Math.min( zoom, 18 ); // max\n } else {\n clean.zoom = 10; // default\n }\n\n return cb( undefined, clean );\n\n}", "_cleanParams(params) {\n for (const k in params) {\n const v = params[k];\n if (/^[0-9]*$/.test(v)) {\n params[k] = +v;\n }\n }\n return params;\n }", "function parseParams(owner, params) {\n\tparams = (isArray(params) ? params : params.split(';'));\n\towner._simple = true;\n\tfor (var i = 0; i < params.length; i++) {\n\t\tvar nameValue = params[i].split('=');\n\t\towner[nameValue[0].toLowerCase()] = checkDate(nameValue[1] || '');\n\t\towner._simple = false;\n\t}\n}", "cleanParser() {\n this.bnodes = {}\n this.why = null\n }", "function sanitize( raw, clean ){\n\n // error & warning messages\n var messages = { errors: [], warnings: [] };\n\n if( !check.undefined( raw.details ) ){\n clean.details = isTruthy( raw.details );\n } else {\n clean.details = DEFAULT_DETAILS_BOOL;\n }\n\n return messages;\n}", "function parseArguments( url, data, success, dataType ) {\n if ( $.isFunction( data ) ) dataType = success, success = data, data = undefined\n if ( !$.isFunction( success ) ) dataType = success, success = undefined\n return {\n url : url,\n data : data,\n success : success,\n dataType: dataType\n }\n }", "function _checkParams() {\n var params = _current[\"(params)\"];\n\n if (!params) {\n return;\n }\n\n var param = params.pop();\n var unused_opt;\n\n while (param) {\n var label = _current[\"(labels)\"][param];\n\n unused_opt = _getUnusedOption(state.funct[\"(unusedOption)\"]);\n\n // 'undefined' is a special case for (function(window, undefined) { ... })();\n // patterns.\n if (param === \"undefined\")\n return;\n\n if (label[\"(unused)\"]) {\n _warnUnused(param, label[\"(token)\"], \"param\", state.funct[\"(unusedOption)\"]);\n } else if (unused_opt === \"last-param\") {\n return;\n }\n\n param = params.pop();\n }\n }", "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url,\n data: data,\n success: success,\n dataType: dataType\n }\n }", "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined;\n if (!$.isFunction(success)) dataType = success, success = undefined;\n return {\n url: url,\n data: data,\n success: success,\n dataType: dataType\n };\n}", "parse(parseType) {}", "function parseArguments(url, data, success, dataType) {\r\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\r\n if (!$.isFunction(success)) dataType = success, success = undefined\r\n return {\r\n url: url\r\n , data: data\r\n , success: success\r\n , dataType: dataType\r\n }\r\n }", "function parseArguments(url,data,success,dataType){if($.isFunction(data))dataType=success,success=data,data=undefined;if(!$.isFunction(success))dataType=success,success=undefined;return{url:url,data:data,success:success,dataType:dataType};}", "trim() {\n let start = 0;\n let end = this.formatParts.length;\n const isNoArg = (i) => {\n const arg = this.formatParts[i];\n return arg !== undefined && NO_ARG_PLACEHOLDERS.includes(arg);\n };\n while (start < end && isNoArg(start)) {\n start++;\n }\n while (start < end && isNoArg(end)) {\n end--;\n }\n if (start > 0 || end < this.formatParts.length) {\n return this.copy({\n args: this.args,\n formatParts: this.formatParts.slice(start, end),\n referencedSymbols: this.referencedSymbols,\n });\n }\n else {\n return this;\n }\n }", "function parseArguments(url, data, success, dataType) {\r\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\r\n if (!$.isFunction(success)) dataType = success, success = undefined\r\n return {\r\n url: url\r\n , data: data\r\n , success: success\r\n , dataType: dataType\r\n }\r\n }", "function parseArguments(url, data, success, dataType) {\r\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\r\n if (!$.isFunction(success)) dataType = success, success = undefined\r\n return {\r\n url: url\r\n , data: data\r\n , success: success\r\n , dataType: dataType\r\n }\r\n }", "function validate_parameters(command_name, parameters){\n if(parameters == null) parameters = \"\"\n command_obj = get_command(command_name)['c']\n // If there are no defined parameters return an empty set.\n if(command_obj['parameters'].length == 0) return {}\n // If the \"whole_string\" send the whole parameters string.\n if(command_obj['param_types'].includes(\"whole_string\")){\n param_set = {}, param_set[command_obj['parameters'][0]] = parameters\n return param_set\n }\n given_params = parameters.split(\" \")\n // Make sure given parameters and required parameters are the same in length\n if(given_params.length == command_obj['parameters'].length){\n // Make sure each required parameter has a param_type defined.\n if(command_obj['parameters'].length != command_obj['param_types'].length){\n console.log(\"::ERROR: \" + command_name + \"'s parameter definitions and parameter types don't match!\")\n process.exit()\n }\n return process_parameters(command_obj, given_params)\n } else return null\n}", "function sanitizeInputs({\n keywords = [],\n filters = [],\n property = '',\n limit,\n relatedKinds = [],\n}) {\n const sanitizedKeywords = keywords.map((k) => sanitizeString(k));\n const sanitizedFilters = filters.map((f) => ({\n property: sanitizeString(f.property),\n values: f.values.map((v) => sanitizeString(v)),\n }));\n\n return {\n keywords: sanitizedKeywords,\n filters: sanitizedFilters,\n property: sanitizeString(property),\n limit: limit || config.get('defaultQueryLimit'),\n relatedKinds: relatedKinds.map((k) => sanitizeString(k)),\n };\n}", "function parseArg(v, de, fmt) {\n var errs = [];\n if (typeof fmt.default !== \"undefined\" && typeof v === \"undefined\") {\n v = fmt.default;\n }\n if (fmt.required && typeof v === \"undefined\") {\n errs.push({ field: fmt.name, type: \"required\" });\n }\n if (typeof v === \"undefined\") {\n return { arg: v, errs: errs };\n }\n var lengthOpt = {\n max: fmt.maxLength ? fmt.maxLength : undefined,\n min: fmt.minLength ? fmt.minLength : 0,\n };\n if (fmt.type === \"string\") {\n if (typeof v !== \"string\") {\n errs.push({ field: fmt.name, type: \"string\" });\n }\n else if (v !== fmt.default && fmt.format === \"uuid\" && !validator.isUUID(v)) {\n errs.push({ field: fmt.name, type: \"uuid\" });\n }\n else if (v !== fmt.default && fmt.format === \"email\" && !validator.isEmail(v)) {\n errs.push({ field: fmt.name, type: \"email\" });\n }\n else if (!validator.isLength(v, lengthOpt)) {\n errs.push({ field: fmt.name, type: \"strlen\" });\n }\n }\n if (numberTypes.indexOf(fmt.type) !== -1) {\n if (typeof v !== \"number\") {\n errs.push({ field: fmt.name, type: \"number\" });\n }\n else if (!isInt(v) && fmt.type === \"integer\") {\n errs.push({ field: fmt.name, type: \"integer\" });\n }\n else if (typeof fmt.maximum !== \"undefined\" && v > fmt.maximum) {\n errs.push({ field: fmt.name, type: \"maximum\" });\n }\n else if (typeof fmt.minimum !== \"undefined\" && v < fmt.minimum) {\n errs.push({ field: fmt.name, type: \"minimum\" });\n }\n }\n if (fmt.type === \"object\") {\n if (typeof v !== \"object\") {\n errs.push({ field: fmt.name, type: \"object\" });\n }\n else {\n var tmp = parseObjectSchema(v, fmt);\n v = tmp.arg;\n errs = errs.concat(tmp.errs);\n }\n }\n if (fmt.type === \"array\") {\n if (!Array.isArray(v)) {\n errs.push({ field: fmt.name, type: \"array\" });\n }\n else if (!fmt.items) {\n throw notSupportError;\n }\n else if (fmt.minItems && v.length < fmt.minItems) {\n errs.push({ field: fmt.name, type: \"minItems\" });\n }\n else if (fmt.maxItems && v.length > fmt.maxItems) {\n errs.push({ field: fmt.name, type: \"maxItems\" });\n }\n else {\n if (fmt.items.properties) {\n for (var prop in fmt.items.properties) {\n if (fmt.items.properties.hasOwnProperty(prop)) {\n for (var _i = 0, v_1 = v; _i < v_1.length; _i++) {\n var vv = v_1[_i];\n var tmp = parseArg(vv[prop], vv[prop], fmt.items.properties[prop]);\n errs = errs.concat(tmp.errs);\n }\n }\n }\n }\n else {\n for (var _a = 0, v_2 = v; _a < v_2.length; _a++) {\n var vv = v_2[_a];\n var tmp = parseArg(vv, vv, fmt.items);\n errs = errs.concat(tmp.errs);\n }\n }\n if (fmt.items.required && fmt.items.required.length) {\n var requires = fmt.items.required;\n for (var _b = 0, requires_1 = requires; _b < requires_1.length; _b++) {\n var ii = requires_1[_b];\n var require_1 = ii;\n for (var _c = 0, v_3 = v; _c < v_3.length; _c++) {\n var jj = v_3[_c];\n if (typeof jj[require_1] === \"undefined\") {\n errs.push({ field: fmt.name + \".\" + require_1, type: \"required\" });\n }\n }\n }\n }\n }\n }\n if (fmt.type === \"boolean\" && typeof v !== \"boolean\") {\n errs.push({ field: fmt.name, type: \"boolean\" });\n }\n return { arg: v, errs: errs };\n}", "function expandParseArguments(parseFn, self) {\n var arglist = self.parseParams;\n\n if (!arglist || arglist.length === 0) {\n parseFn = parseFn.replace(/, parseParams\\b/g, '');\n parseFn = parseFn.replace(/\\bparseParams\\b/g, '');\n parseFn = parseFn.replace(/,\\s*[\\r\\n]+\\s*parseParamsAsMembers:\\s+parseParamsAsMembers\\b/g, '');\n } else {\n parseFn = parseFn.replace(/, parseParams\\b/g, ', ' + arglist.join(', '));\n parseFn = parseFn.replace(/\\bparseParams\\b/g, arglist.join(', '));\n parseFn = parseFn.replace(/,\\s*[\\r\\n]+(\\s*)parseParamsAsMembers:\\s+parseParamsAsMembers\\b/g, function parseParamsReplF(m, ws) {\n var s = ',';\n\n // determine longest name of the bunch (for formatting the generated code)\n var max_k_len = 0;\n for (var i = 0, len = arglist.length; i < len; i++) {\n var k = arglist[i];\n max_k_len = Math.max(max_k_len, k.length);\n }\n var wsi2 = new Array(max_k_len + 1).join(' ');\n\n // generate the member assignment list for the `sharedState_yy` object which will store the `parseParams` for everyone to access\n for (var i = 0, len = arglist.length; i < len; i++) {\n var k = arglist[i];\n s += '\\n' + ws + k + ': ' + k + (i < len - 1 ? ',' + wsi2.substr(0, max_k_len - k.length - 1) : wsi2.substr(0, max_k_len - k.length)) + ' // parseParams::' + k;\n }\n return s;\n });\n }\n return parseFn;\n}", "function expandParseArguments(parseFn, self) {\n var arglist = self.parseParams;\n\n if (!arglist || arglist.length === 0) {\n parseFn = parseFn.replace(/, parseParams\\b/g, '');\n parseFn = parseFn.replace(/\\bparseParams\\b/g, '');\n parseFn = parseFn.replace(/,\\s*[\\r\\n]+\\s*parseParamsAsMembers:\\s+parseParamsAsMembers\\b/g, '');\n } else {\n parseFn = parseFn.replace(/, parseParams\\b/g, ', ' + arglist.join(', '));\n parseFn = parseFn.replace(/\\bparseParams\\b/g, arglist.join(', '));\n parseFn = parseFn.replace(/,\\s*[\\r\\n]+(\\s*)parseParamsAsMembers:\\s+parseParamsAsMembers\\b/g, function parseParamsReplF(m, ws) {\n var s = ',';\n\n // determine longest name of the bunch (for formatting the generated code)\n var max_k_len = 0;\n for (var i = 0, len = arglist.length; i < len; i++) {\n var k = arglist[i];\n max_k_len = Math.max(max_k_len, k.length);\n }\n var wsi2 = (new Array(max_k_len + 1)).join(' ');\n\n // generate the member assignment list for the `sharedState_yy` object which will store the `parseParams` for everyone to access\n for (var i = 0, len = arglist.length; i < len; i++) {\n var k = arglist[i];\n s += '\\n' + ws + k + ': ' + k + (i < len - 1 ? ',' + wsi2.substr(0, max_k_len - k.length - 1) : wsi2.substr(0, max_k_len - k.length)) + ' // parseParams::' + k;\n }\n return s;\n });\n }\n return parseFn;\n}", "function parseArguments(url, data, success, dataType) {\n\t if ($.isFunction(data)) dataType = success, success = data, data = undefined;\n\t if (!$.isFunction(success)) dataType = success, success = undefined;\n\t return {\n\t url: url,\n\t data: data,\n\t success: success,\n\t dataType: dataType\n\t };\n\t }", "function parseArguments(url, data, success, dataType) {\n var hasData = !$.isFunction(data)\n return {\n url: url,\n data: hasData ? data : undefined,\n success: !hasData ? data : $.isFunction(success) ? success : undefined,\n dataType: hasData ? dataType || success : success\n }\n }", "function check_param(par) { \n return (par != null && par.length > 0) ? par:'';\n}", "function parseValues({ title, text = null, url = null, files, params = {} } = {}) {\n\t\tif (('text' in params) && typeof text === 'string' && text.length !== 0 && (typeof url !== 'string' || url.length === 0)) {\n\t\t\tconst words = text.trim().split(' ');\n\t\t\tconst end = words.splice(-1)[0];\n\n\t\t\t/**\n\t\t\t * Check if `text` ends with a URL\n\t\t\t */\n\t\t\tif (end.startsWith('https://') || end.startsWith('http://')) {\n\t\t\t\turl = end;\n\t\t\t\ttext = words.join(' ');\n\t\t\t}\n\t\t} else if (('text' in params) && typeof text === 'string' && typeof url == 'string' && url.length === 0 && text.endsWith(url)) {\n\t\t\t/**\n\t\t\t * URL given alone and in text\n\t\t\t */\n\t\t\ttext = text.replace(url, '').trim();\n\t\t} else if (typeof text === 'string' && typeof url === 'string' && text.endsWith(url)) {\n\t\t\ttext = text.replace(url, '').trim();\n\t\t}\n\n\t\treturn { title, text, url, files, params };\n\t}", "async _validateAndSanitize() {\n const oThis = this;\n\n if (oThis.currentUserId !== oThis.userId) {\n return Promise.reject(\n responseHelper.paramValidationError({\n internal_error_identifier: 'a_s_u_rb_1',\n api_error_identifier: 'invalid_params',\n params_error_identifiers: ['invalid_user_id'],\n debug_options: { currentUserId: oThis.currentUserId }\n })\n );\n }\n }", "function parseParameters() {\n var searchParams = new URLSearchParams(location.search);\n\n if (searchParams.has(\"question\")) {\n state.question = searchParams.get(\"question\")\n }\n}", "function tryParse(callback) {\n return speculationHelper(callback, /*isLookAhead*/ false);\n }", "function _cleanUpEmptyParams(fp) {\n if (typeof fp === 'object') {\n // remove params namespaces if empty\n ['q', 'r'].forEach(function(ns) {\n if (typeof fp[ns] === 'object' && Object.keys(fp[ns]).length === 0) {\n delete fp[ns];\n }\n });\n }\n return fp;\n}", "resetParser(){\n\t\tsuper.resetParser();\n\t}", "function cleanUserRequestParameters( editor, trimEnd ){\r\n\t\tif( editor.config.autosaveRequestParams ) {\r\n\t\t\tvar helper = editor.config.autosaveRequestParams;\t\r\n\t\t\tvar x = '&';\r\n\t\t\t\r\n\t\t\t// Remove all leading '&'.\r\n\t\t\twhile( helper && helper.indexOf( x ) === 0 )\r\n\t\t\t\thelper = ( helper.length === 1 ? '' : helper.substring( 1 ) );\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tif(trimEnd){// true only during init.\t\t\t\t\r\n\t\t\t\t// Remove all trailing '&'.\t\t\t\t\r\n\t\t\t\twhile( helper && endsWith( helper, x ) )\r\n\t\t\t\t\thelper = helper.substring( 0, helper.length - 1 );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Later assume there is none or only one '&' at the end.\r\n\t\t\tif ( helper && !endsWith( helper, x ) )\r\n\t\t\t\thelper += '&';\r\n\t\t\t\r\n\t\t\teditor.config.autosaveRequestParams = helper;\r\n\t\t}\t\t\r\n\t}", "function parse() {\n if (params.rawMessage) {\n try {\n that.endpointId = params.rawMessage.header.from;\n that.originalRecipient = params.rawMessage.header.toOriginal;\n that.connectionId = params.rawMessage.header.fromConnection;\n that.timestamp = params.rawMessage.header.timestamp;\n } catch (e) {\n throw new Error(e);\n }\n that.message = params.rawMessage.message || params.rawMessage.body;\n if (params.rawMessage.header.channel) {\n that.recipient = params.rawMessage.header.channel;\n }\n } else {\n try {\n that.to = params.endpointId;\n that.ccSelf = params.ccSelf;\n that.toConnection = params.connectionId;\n that.requestConnectionReply = (params.requestConnectionReply === true);\n that.push = (params.push === true);\n that.persist = (params.persist === true);\n } catch (e) {\n throw new Error(e);\n }\n that.message = params.message;\n }\n }", "function parse(opts) {\n\t\tif (typeof(opts) != \"object\") opts = {};\n\t\tthis.options = opts;\n\t\tthis.build();\n\t}", "function parseOptions (opts) {\n return removeEmpty({\n plugins: convertFn.call(this, opts.plugins),\n locals: convertFn.call(this, opts.locals),\n filename: convertFn.call(this, opts.filename),\n parserOptions: convertFn.call(this, opts.parserOptions),\n generatorOptions: convertFn.call(this, opts.generatorOptions),\n runtime: convertFn.call(this, opts.runtime),\n parser: convertFnSpecial.call(this, opts.parser),\n generator: convertFnSpecial.call(this, opts.generator)\n })\n}", "constructor( parser ){ \n super()\n this.parser = parser \n }", "static parseArgs(args, kwargs, special) {\n const argDef = SPECIALS[special].args;\n const parsedArgs = Object.assign({ $args: [], $kwargs: {} }, ((argDef) ? argDef.defaults : {}));\n args.forEach((arg, index) => {\n if (argDef.argsPosition !== null && argDef.argsPosition <= index) {\n parsedArgs.$args.push(arg);\n }\n else if (argDef.lookup[index] !== undefined) {\n parsedArgs[argDef.lookup[index].name] = arg;\n }\n else {\n throw new UnexpectedPositionalArgument(index, special);\n }\n });\n Object.keys(kwargs).forEach(key => {\n if (argDef.lookup[key] !== undefined) {\n parsedArgs[key] = kwargs[key];\n }\n else if (argDef.kwargsPosition !== null) {\n parsedArgs.$kwargs[key] = kwargs[key];\n }\n else {\n throw new UnepectedKeywordArgument(key, special);\n }\n });\n return parsedArgs;\n }", "function prepareOptions(callback) {\n parseParams(params, function(err, pathfind_params) {\n if (err) {\n res.json(400, { success: false, message: err.message });\n } else {\n callback(null, pathfind_params);\n }\n });\n }", "function parseQuery() {\n var queryString = window.location.search.substr(1);\n // set all parameters to their default values\n param1 = default1;\n if (queryString.length > 0) {\n // if there's a query string, check for each param within it\n var val1 = queryString.match(/.*param1=([^&]+).*/i);\n if (val1) {\n param1 = val1[1];\n }\n }\n}", "set autoParse(val) { this._parse = typeof val === 'boolean' ? val : true }", "function ParseException() {\r\n}", "function cleanInput(input){\n let output = input;\n if (flags.trimInput) {\n output = output.trim()\n }\n if (!flags.caseSensitive) {\n output = output.toLowerCase()\n }\n return output;\n}", "function tidyParams(str) {\n str = str.replace(/\\+/g,' ');\n return str;\n }", "async _parse(raw) {\n\t\tlet vars = {};\n\t\tlet fill = async (commandtext)=> {\n\t\t\tdo {\n\t\t\t\tlet matches = commandtext.match(RE_VAR);\n\n\t\t\t\t// Repeat until no more pattern found.\n\t\t\t\tif (!matches) return commandtext;\n\n\t\t\t\tlet [ pattern, name, enums ] = matches;\n\n\t\t\t\tif (!vars[name]) {\n\t\t\t\t\t// Trim braces and spaces.\n\t\t\t\t\tenums = enums && enums.slice(1, -1).split(',').map(value => value.trim());\n\t\t\t\t\t\n\t\t\t\t\tlet options = {\n\t\t\t\t\t\tmessage: name,\n\t\t\t\t\t\tvalidate: value => /^\\s*$/.test(value) ? `${name} SHOULD NOT be empty.` : true,\n\t\t\t\t\t};\n\t\t\t\t\tif (raw) options.default = raw[name];\n\n\t\t\t\t\tif (!enums || enums.length == 0) {\n\t\t\t\t\t\tvars[name] = await myutil.prompt.input(options);\n\t\t\t\t\t}\n\t\t\t\t\telse if (enums.length == 1) {\n\t\t\t\t\t\tif (!raw) options.default = raw ? raw[name] : enums[0];\n\t\t\t\t\t\tvars[name] = await myutil.prompt.input(options);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (enums[ enums.length - 1 ] == '...') {\n\t\t\t\t\t\t\tenums.splice(-1, 1, { name: colors.dim('OTHERS ...'), value: '...' });\n\t\t\t\t\t\t}\n\t\t\t\t\t\toptions.choices = enums.map(value => value || { name: colors.dim('-- EMPTY --'), value: '' });\n\t\t\t\t\t\toptions.loop = false;\n\t\t\t\t\t\tvars[name] = await myutil.prompt.select(options);\n\t\t\t\t\t\tif (vars[name] == '...') {\n\t\t\t\t\t\t\tvars[name] = await myutil.prompt.input(options);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Replace the pattern.\n\t\t\t\tcommandtext = commandtext.replace(pattern, vars[name]);\n\t\t\t} while (true);\n\t\t};\n\n\t\tconst options = this._options;\n\n\t\tif (options.argv) {\n\t\t\tlet argv = options.argv.slice(0);\n\t\t\tfor (let i = 0; i < argv.length; i++) {\n\t\t\t\targv[i] = await fill(argv[i]);\n\t\t\t}\n\t\t\tthis._push2history({ argv, vars });\n\t\t\treturn { argv };\n\t\t}\n\n\t\tif (options.commandline) {\n\t\t\tlet commandline = await fill(options.commandline);\n\t\t\tthis._push2history({ commandline, vars });\n\t\t\treturn { commandline };\n\t\t}\n\t}", "static get sanitize() {\n return {}\n }", "function process_parameters(command_obj, given_params){\n var param_set = {}\n for(var i=0; i < command_obj['parameters'].length; i++){\n key = command_obj['parameters'][i]\n switch(command_obj['param_types'][i]){\n case \"username\":\n value = given_params[i].match(/^<@(\\d+)(?:>)$/)\n if(value) param_set[key] = value[1]\n else return null;\n break;\n case \"number\":\n value = given_params[i].match(/^\\d+$/g)\n if(value) param_set[key] = parseInt(value[0])\n else return null;\n break;\n case \"word\":\n value = given_params[i].match(/^\\S+$/g)\n if(value) param_set[key] = value[0]\n else return null;\n break;\n }\n }\n return param_set\n}", "AddParam(Name,Min,Max,CleanValue,TreatAsType)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tthis.AddParamUnsafe(...arguments);\r\n\t\t}\r\n\t\tcatch(e)\r\n\t\t{\r\n\t\t\tPop.Warning(e);\r\n\t\t}\r\n\t}", "static parse(str) {\n }", "function _checkParser() {\n eval(Processing(canvas, parserTest.body));\n _pass();\n}", "function valueParser(v) {\n\tvar p = function(x){ return _.isEqual(x,v); };\n\n\tif (_.isObject(v))\t\tp = isObject;\n\tif (_.isArray(v))\t\tp = isArray;\n\tif (_.isUndefined(v))\tp = isUndefined;\n\tif (_.isFunction(v))\tp = v;\n\n\treturn p;\n}", "parseParams(){\n\t\tthis.app.use(\n\t\t\t(req, res, next) => {\n\t\t\t\treq.parsedParams = {};\n\n\t\t\t\tconst records = req.body;\n\t\t\t\tthis.log.debug({records}, 'parseParams() getting records');\n\t\t\t\tif(records || records === '' || records === 0){\n\t\t\t\t\treq.parsedParams = {\n\t\t\t\t\t\t...req.parsedParms,\n\t\t\t\t\t\trecords\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst rangeMatch = ( req.get('Range') || '' ).match(/=(\\d*)[-–](\\d*)$/);\n\t\t\t\tif(Array.isArray(rangeMatch) && typeof rangeMatch[1] == 'string' && typeof rangeMatch[2] == 'string'){\n\t\t\t\t\tlet end = parseInt(rangeMatch[2], 10);\n\t\t\t\t\tend = isNaN(end) ? undefined : end;\n\t\t\t\t\treq.parsedParams = {\n\t\t\t\t\t\t...req.parsedParams,\n\t\t\t\t\t\tstart: parseInt(rangeMatch[1], 10),\n\t\t\t\t\t\tend\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst idMatch = req.originalUrl.match(/\\/(?<id>\\d+)\\/*$/);\n\t\t\t\tif(Array.isArray(idMatch) && typeof idMatch[1] == 'string'){\n\t\t\t\t\treq.parsedParams = {\n\t\t\t\t\t\t...req.parsedParams,\n\t\t\t\t\t\tstart: parseInt(idMatch[1], 10), // yes, let this start override the range start above\n\t\t\t\t\t\tid: parseInt(idMatch[1], 10)\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tnext();\n\t\t\t}\n\t\t);\n\t}", "constructor() {\n if (arguments.length === 1) {\n let arg1 = arguments[0];\n if (typeof arg1 === 'string') this.parseString(arg1);\n else {\n this.r = arg1.r;\n this.g = arg1.g;\n this.b = arg1.b;\n this.a = arg1.a;\n }\n }\n }", "function main(args) {\n // propagate errors\n if (args.error) return args\n // unescape params: { action, state, foo, params: { bar } } becomes { action, state, params: { foo, bar } }\n const action = args.action\n const state = args.state\n const params = args.params\n delete args.action\n delete args.state\n delete args.params\n return { action, state, params: Object.assign(args, params) }\n}", "parse(xhttp){ return xhttp }", "assignParam (param, v) {\n if (param.isDateTime) {\n param.parse(v)\n } else {\n param.value = v\n }\n }", "function postParseChecks(pf,args){\r\n\tif (typeof postParse != 'undefined' && postParse.length) {\r\n\t\tfor (var k = 0; k < postParse.length; k++) {\r\n\t\t\tif (postParse[k](pf,args)) continue;\r\n\t\t\treturn false; // end now since have an error\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function argumentsValids(log, id, req, res) {\n var ok = true\n\n var missing_fields = []\n\n if ((req.body.input_data == undefined && req.body.filehash == undefined) || (req.body.input_data != undefined && req.body.filehash != undefined)) {\n missing_fields.push(\"input_data\")\n missing_fields.push(\"filehash\")\n ok = false\n }\n\n if (req.body.filehash != undefined && !system.isFilehashValid(req.body.filehash)) {\n missing_fields.push(\"filehash_format\")\n ok = false\n }\n\n if (req.body.logstash_version == undefined && !/^\\d\\.\\d\\.\\d$/.test(req.body.logstash_version)) {\n missing_fields.push(\"logstash_version\")\n ok = false\n }\n\n if (req.body.logstash_filter == undefined) {\n missing_fields.push(\"logstash_filter\")\n ok = false\n }\n\n if (req.body['custom_codec'] != undefined && req.body.custom_codec == \"\") {\n missing_fields.push(\"custom_codec\")\n ok = false\n }\n\n if (req.body['input_extra_fields'] == undefined) {\n ok = false\n } else {\n for (var i = 0; i < req.body.input_extra_fields.length; i++) {\n if (req.body.input_extra_fields[i].attribute == \"\" || req.body.input_extra_fields[i].value == \"\") {\n ok = false;\n missing_fields.push(\"input_extra_fields\")\n break;\n }\n }\n }\n\n if (!ok) {\n failBadParameters(log, id, res, missing_fields)\n }\n\n return ok\n}", "function Params() {\n if (currentToken() == \"(\") {\n nextToken();\n ArgList();\n if (currentToken() == \")\") {\n nextToken();\n return;\n } else {\n let errorMessage = \"Não foi encontrado o fechamento da lista de parâmetros da função\";\n handleError(errorMessage);\n nextToken();\n }\n } else {\n return;\n }\n }", "function parse(args) {\n return validateArgs(parseArgs(triageArgs(args)));\n}", "parseQuery(query) {\n\t\treturn qs.parse(query)\n\t}", "function parseOptions (options, callback, wrappedProtocol) {\n\t assert.equal(typeof callback, 'function', 'callback must be a function');\n\t if ('string' === typeof options) {\n\t options = url.parse(options);\n\t options.maxRedirects = publicApi.maxRedirects;\n\t } else {\n\t options = extend({\n\t maxRedirects: publicApi.maxRedirects,\n\t protocol: wrappedProtocol\n\t }, options);\n\t }\n\t assert.equal(options.protocol, wrappedProtocol, 'protocol mismatch');\n\t options.protocol = wrappedProtocol;\n\t options.userCallback = callback;\n\t\n\t debug('options', options);\n\t return options;\n\t }", "function parseParameter$2(spec, ctx, params) {\n if (!spec || !isObject(spec)) return spec;\n\n for (var i=0, n=PARSERS.length, p; i<n; ++i) {\n p = PARSERS[i];\n if (spec.hasOwnProperty(p.key)) {\n return p.parse(spec, ctx, params);\n }\n }\n return spec;\n }", "function clean(args) {\n\treturn Array.prototype.filter.call(args, v => v !== INVALIDATE);\n}", "function parseParameter(spec, ctx) {\n if (!spec || !(0,vega_util__WEBPACK_IMPORTED_MODULE_3__.isObject)(spec)) return spec;\n\n for (var i=0, n=PARSERS.length, p; i<n; ++i) {\n p = PARSERS[i];\n if (spec.hasOwnProperty(p.key)) {\n return p.parse(spec, ctx);\n }\n }\n return spec;\n}", "_validate() {\n\t}", "function Sanitize(){\n var i, e, options;\n options = arguments[0] || {};\n this.config = {};\n this.config.elements = options.elements ? options.elements : [];\n this.config.attributes = options.attributes ? options.attributes : {};\n this.config.attributes[Sanitize.ALL] = this.config.attributes[Sanitize.ALL] ? this.config.attributes[Sanitize.ALL] : [];\n this.config.allow_comments = options.allow_comments ? options.allow_comments : false;\n this.allowed_elements = {};\n this.config.protocols = options.protocols ? options.protocols : {};\n this.config.add_attributes = options.add_attributes ? options.add_attributes : {};\n this.dom = options.dom ? options.dom : document;\n for(i=0;i<this.config.elements.length;i++) {\n this.allowed_elements[this.config.elements[i]] = true;\n }\n this.config.remove_element_contents = {};\n this.config.remove_all_contents = false;\n if(options.remove_contents) {\n\n if(options.remove_contents instanceof Array) {\n for(i=0;i<options.remove_contents.length;i++) {\n this.config.remove_element_contents[options.remove_contents[i]] = true;\n }\n }\n else {\n this.config.remove_all_contents = true;\n }\n }\n this.transformers = options.transformers ? options.transformers : [];\n}", "function parseArg(tokenStream) {\n return parseKeyVal(tokenStream) || parseVal(tokenStream);\n}", "function ArgonParser(key) {\n this.key = key;\n}", "function parseInputParameters() {\n\tvar ret = null;\n\tif (start == null) {\n\t\tret = \"Należy ustawić punkt startowy\";\n\t} else if (stop == null) {\n\t\tret = \"Należy ustawić punkt docelowy\";\n\t} else if (startTime == null) {\n\t\tret = \"Należy ustawić date i czas\";\n\t}\n\n\treturn ret;\n}", "static processUserInput(input) {\n // Input is null, return null.\n if (input == null) {\n return null;\n }\n let sanitizedInput = this.replaceFancyQuotes(input);\n // Trim off trailing\n sanitizedInput = sanitizedInput.replace(this.removeDanglingQuotes1, \"\");\n sanitizedInput = sanitizedInput.replace(this.removeDanglingQuotes2, \"\");\n return sanitizedInput;\n }", "function parseURL(request, response){\n \tvar parseQuery = true; \n var badHost = true; \n var urlObj = url.parse(request.url, parseQuery , badHost );\n console.log('path:');\n console.log(urlObj.path);\n console.log('query:');\n console.log(urlObj.query);\n \treturn urlObj;\n }", "function parseParameter(spec, ctx, params) {\n if (!spec || !vegaUtil.isObject(spec)) return spec;\n\n for (var i=0, n=PARSERS.length, p; i<n; ++i) {\n p = PARSERS[i];\n if (vegaUtil.hasOwnProperty(spec, p.key)) {\n return p.parse(spec, ctx, params);\n }\n }\n return spec;\n }", "function parseParameter(spec, ctx) {\n if (!spec || !Object(__WEBPACK_IMPORTED_MODULE_3_vega_util__[\"y\" /* isObject */])(spec)) return spec;\n\n for (var i=0, n=PARSERS.length, p; i<n; ++i) {\n p = PARSERS[i];\n if (spec.hasOwnProperty(p.key)) {\n return p.parse(spec, ctx);\n }\n }\n return spec;\n}", "validate() {}", "function parseParams() {\n var md = view.getLocation().match(/^(.*?)#(.*)$/);\n var result = {};\n if(md) {\n var hash = md[2];\n hash.split('&').forEach(function(param) {\n var kv = param.split('=');\n if(kv[1]) {\n result[kv[0]] = decodeURIComponent(kv[1]);\n }\n });\n if(Object.keys(result).length > 0) {\n view.setLocation(md[1] + '#');\n }\n }\n return result; \n }", "function parseHelper(command) {\n var ret,\n nestedQuery = command.match(regexes.enclosing);\n\n if (nestedQuery) {\n // e.g. m:p[query]\n ret = retrieveQueryFromList(nestedQuery[1]);\n if (ret) {\n var embeddable = ret.match(regexes.placeholder);\n if (embeddable) {\n\n var override = nestedQuery[2];\n if(override){\n var params = retrieveQueryFromList(override);\n if(params)\n ret = ret.replace(regexes.placeholder, params);\n }\n\n // e.g. query\n var subQuery = parseSyntax(nestedQuery[3]);\n if (!subQuery) return;\n\n ret = ret.replace(regexes.placeholder, subQuery);\n }\n else {\n return;\n }\n }\n }\n else {\n // e.g. q , [size|sz]{10}\n var injectableOption = command.match(regexes.injectable);\n if (injectableOption) {\n\n ret = retrieveQueryFromList(injectableOption[1]);\n var matchKeyValue = ret.match(regexes.types);\n if (matchKeyValue) {\n\n var newValue = injectableOption[2];\n if (newValue) {\n ret = ret.replace(matchKeyValue[1],newValue);\n }\n }\n }\n else {\n ret = retrieveQueryFromList(command);\n }\n\n if (ret) {\n var embeddable = ret.match(regexes.placeholder);\n if (embeddable) {\n // replace with its default value or fill empty\n ret = ret.replace(regexes.placeholder, embeddable[1]);\n }\n }\n }\n return ret;\n }", "function passToParser (data) {\n parseMonster(data, _this);\n }", "function parseString(arg){\n // console.log(arguments[0]);\n // para = arguments[0];\n // para.split('');\n\n // console.log(para);\n // // para.replace(' ', ',')\n \n\n // console.log(typeof(para),'this is argument');\n}", "constructor() {\n this.data = {};\n this.args = process.argv;\n this.parser = new Parse(this.args[2]);\n this.calculate = new Calculate(this.data);\n this.checkArgs();\n }", "function BaseBodyParser() {\n\t}", "function tryParse(parseFn, value) {\n return value ? parseFn(value) : value;\n}", "function normalize$1(opts) {\n\t var options = opts || defaults;\n\t function get(key) {\n\t return hasOwn$6.call(options, key)\n\t ? options[key]\n\t : defaults[key];\n\t }\n\t return {\n\t tabWidth: +get(\"tabWidth\"),\n\t useTabs: !!get(\"useTabs\"),\n\t reuseWhitespace: !!get(\"reuseWhitespace\"),\n\t lineTerminator: get(\"lineTerminator\"),\n\t wrapColumn: Math.max(get(\"wrapColumn\"), 0),\n\t sourceFileName: get(\"sourceFileName\"),\n\t sourceMapName: get(\"sourceMapName\"),\n\t sourceRoot: get(\"sourceRoot\"),\n\t inputSourceMap: get(\"inputSourceMap\"),\n\t parser: get(\"esprima\") || get(\"parser\"),\n\t range: get(\"range\"),\n\t tolerant: get(\"tolerant\"),\n\t quote: get(\"quote\"),\n\t trailingComma: get(\"trailingComma\"),\n\t arrayBracketSpacing: get(\"arrayBracketSpacing\"),\n\t objectCurlySpacing: get(\"objectCurlySpacing\"),\n\t arrowParensAlways: get(\"arrowParensAlways\"),\n\t flowObjectCommas: get(\"flowObjectCommas\"),\n\t tokens: !!get(\"tokens\")\n\t };\n\t}", "setParam(param) {\n param = param.trim();\n const alphaRegex = /^[a-zA-Z ]+$/;\n\n if (!param.length || !param || (param.length > 100)) {\n throw new Error('Parameter name is not valid');\n }\n\n if (param.match(alphaRegex)) {\n return param;\n }\n throw new Error('Please include only valid symbols in the parameter name');\n }", "function cleanArgs (cmd) {\n const args = {}\n cmd.options.forEach(o => {\n const key = camelize(o.long.replace(/^--/, ''))\n console.log(key, 'key')\n if (typeof cmd[key] !== 'function' && typeof cmd[key] !== 'undefined') {\n args[key] = cmd[key]\n }\n })\n return args\n}", "function parseParameters(options) {\n var opt = {\n maximumAge: 0,\n enableHighAccuracy: false,\n timeout: Infinity\n };\n\n if (options) {\n if (options.maximumAge !== undefined && !isNaN(options.maximumAge) && options.maximumAge > 0) {\n opt.maximumAge = options.maximumAge;\n }\n if (options.enableHighAccuracy !== undefined) {\n opt.enableHighAccuracy = options.enableHighAccuracy;\n }\n if (options.timeout !== undefined && !isNaN(options.timeout)) {\n if (options.timeout < 0) {\n opt.timeout = 0;\n } else {\n opt.timeout = options.timeout;\n }\n }\n }\n\n return opt;\n}", "function sanitizeAddress(input) {\n input = input || \"\";\n input = input.trim();\n // etc\n return input;\n}", "parseSchema () {\n this.schema.split(',').forEach(char => {\n switch(char) {\n case 'l': {\n this.schemaMapping[char] = new ArgsBooleanParamter(this)\n break\n }\n case 's': {\n this.schemaMapping[char] = new ArgsStringParamter(this)\n break\n }\n case 'n': {\n this.schemaMapping[char] = new ArgsIntegerParamter(this) \n break\n }\n default: {\n throw new Error(`Unknow schema char: ${char}`)\n }\n }\n })\n }", "_parse(method, params) {\n if (!params) params = {};\n\n const queryParts = [];\n const pathParts = [];\n\n // ?Part\n const queryPart = method.url.split('?')[1];\n if (queryPart) {\n const queryParams = queryPart.split('&');\n for (let i in queryParams) {\n const name = queryParams[i].split('=')[0];\n (params[name] || params[name] === 0) && queryParts.push(`${name}=${encodeURIComponent(params[name])}`);\n }\n }\n\n // /part\n const pathPart = method.url.split('?')[0];\n const pathParams = pathPart.split('/');\n for (let k in pathParams) {\n if (pathParams[k][0] != ':') {\n pathParts.push(pathParams[k]);\n } else {\n const param = params[pathParams[k].substr(1)];\n if (param || param === 0) {\n pathParts.push(param);\n } else {\n // check for missing required params\n if (method.optional && method.optional.indexOf(pathParams[k].substr(1)) === -1) throw Error(`Missing mandatory parameter: ${pathParams[k].substr(1)}`);\n }\n }\n }\n\n // Filters\n const filters = ['query', 'years', 'genres', 'languages', 'countries', 'runtimes', 'ratings', 'certifications', 'networks', 'status'];\n for (let p in params) {\n filters.indexOf(p) !== -1 && queryParts.indexOf(`${p}=${encodeURIComponent(params[p])}`) === -1 && queryParts.push(`${p}=${encodeURIComponent(params[p])}`);\n }\n\n // Pagination\n if (method.opts['pagination']) {\n params['page'] && queryParts.push(`page=${params['page']}`);\n params['limit'] && queryParts.push(`limit=${params['limit']}`);\n }\n\n // Extended\n if (method.opts['extended'] && params['extended']) { \n queryParts.push(`extended=${params['extended']}`);\n }\n\n return [\n this._settings.endpoint,\n pathParts.join('/'),\n queryParts.length ? `?${queryParts.join('&')}` : ''\n ].join('');\n }", "function fixup({ min: maybeMin, max: maybeMax, value: unclampedValue, ...etc }) {\n const min = Math.min(maybeMin, maybeMax);\n const max = Math.max(maybeMin, maybeMax);\n const value = Math.min(max, Math.max(min, unclampedValue));\n\n return { min, max, value, ...etc };\n}", "parse(toParse, options) {\n var _a;\n let tokens;\n if (typeof toParse === 'string') {\n tokens = Lexer_1.Lexer.scan(toParse).tokens;\n }\n else {\n tokens = toParse;\n }\n this.logger = (_a = options === null || options === void 0 ? void 0 : options.logger) !== null && _a !== void 0 ? _a : new Logger_1.Logger();\n this.tokens = tokens;\n this.options = this.sanitizeParseOptions(options);\n this.allowedLocalIdentifiers = [\n ...TokenKind_1.AllowedLocalIdentifiers,\n //when in plain brightscript mode, the BrighterScript source literals can be used as regular variables\n ...(this.options.mode === ParseMode.BrightScript ? TokenKind_1.BrighterScriptSourceLiterals : [])\n ];\n this.current = 0;\n this.diagnostics = [];\n this.namespaceAndFunctionDepth = 0;\n this.pendingAnnotations = [];\n this.ast = this.body();\n //now that we've built the AST, link every node to its parent\n this.ast.link();\n return this;\n }", "prepare() {}", "function clean(urlObj) {\n\tvar scheme = urlObj.protocol;\n\n\tif (scheme) {\n\t\t// Remove \":\" suffix\n\t\tif (scheme.indexOf(\":\") === scheme.length - 1) {\n\t\t\tscheme = scheme.substr(0, scheme.length - 1);\n\t\t}\n\t}\n\n\turlObj.host = {\n\t\t// TODO :: unescape(encodeURIComponent(s)) ? ... http://ecmanaut.blogspot.ca/2006/07/encoding-decoding-utf8-in-javascript.html\n\t\tfull: urlObj.hostname,\n\t\tstripped: null\n\t};\n\n\turlObj.path = {\n\t\tabsolute: {\n\t\t\tarray: null,\n\t\t\tstring: urlObj.pathname\n\t\t},\n\t\trelative: {\n\t\t\tarray: null,\n\t\t\tstring: null\n\t\t}\n\t};\n\n\turlObj.query = {\n\t\tobject: urlObj.query,\n\t\tstring: {\n\t\t\tfull: null,\n\t\t\tstripped: null\n\t\t}\n\t};\n\n\turlObj.extra = {\n\t\threfInfo: {\n\t\t\tminimumPathOnly: null,\n\t\t\tminimumResourceOnly: null,\n\t\t\tminimumQueryOnly: null,\n\t\t\tminimumHashOnly: null,\n\t\t\tempty: null,\n\n\t\t\tseparatorOnlyQuery: urlObj.search === \"?\"\n\t\t},\n\t\tportIsDefault: null,\n\t\trelation: {\n\t\t\tmaximumScheme: null,\n\t\t\tmaximumAuth: null,\n\t\t\tmaximumHost: null,\n\t\t\tmaximumPort: null,\n\t\t\tmaximumPath: null,\n\t\t\tmaximumResource: null,\n\t\t\tmaximumQuery: null,\n\t\t\tmaximumHash: null,\n\n\t\t\tminimumScheme: null,\n\t\t\tminimumAuth: null,\n\t\t\tminimumHost: null,\n\t\t\tminimumPort: null,\n\t\t\tminimumPath: null,\n\t\t\tminimumResource: null,\n\t\t\tminimumQuery: null,\n\t\t\tminimumHash: null,\n\n\t\t\toverridesQuery: null\n\t\t},\n\t\tresourceIsIndex: null,\n\t\tslashes: urlObj.slashes\n\t};\n\n\turlObj.resource = null;\n\turlObj.scheme = scheme;\n\tdelete urlObj.hostname;\n\tdelete urlObj.pathname;\n\tdelete urlObj.protocol;\n\tdelete urlObj.search;\n\tdelete urlObj.slashes;\n\n\treturn urlObj;\n}", "function __parseParams($params) {\r\n var reg = /([^\\=\\;]*)\\=([^\\;]*)/gi;\r\n var rt = [];\r\n if ($params==null)\r\n return rt;\r\n var ar = $params.match(reg);\r\n var t = null;\r\n for (var i=0; i<ar.length; i++) {\r\n t = ar[i].split(\"=\");\r\n if (t[1].toUpperCase()==\"TRUE\") {\r\n rt[t[0]] = true;\r\n }else {\r\n rt[t[0]] = t[1];\r\n }\r\n }\r\n return rt;\r\n}", "function parseGraphQLParams(data={}) {\n\t// GraphQL Query string.\n\tlet query = data.query\n\tif (typeof query !== 'string') {\n\t\tquery = null\n\t}\n\n\t// Parse the variables if needed.\n\tlet variables = data.variables\n\tif (variables && typeof variables === 'string') {\n\t\ttry {\n\t\t\tvariables = JSON.parse(variables)\n\t\t} catch (error) {\n\t\t\tthrow httpError(400, 'Variables are invalid JSON.')\n\t\t}\n\t} else if (typeof variables !== 'object') {\n\t\tvariables = null\n\t}\n\t// Name of GraphQL operation to execute.\n\tlet operationName = data.operationName\n\tif (typeof operationName !== 'string') {\n\t\toperationName = null\n\t}\n\tconst raw = data.raw !== undefined\n\n\treturn { query, variables, operationName, raw }\n}" ]
[ "0.5849934", "0.5465816", "0.5398534", "0.5267196", "0.5057463", "0.50056684", "0.4993291", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49773252", "0.4934223", "0.49293447", "0.4920151", "0.49136737", "0.49090514", "0.48955607", "0.48955607", "0.48932505", "0.48830956", "0.4863923", "0.4860022", "0.48590672", "0.4846222", "0.48253843", "0.48243582", "0.47872198", "0.47614112", "0.47546583", "0.47471297", "0.47204518", "0.47138175", "0.4711249", "0.4709435", "0.46920085", "0.46789506", "0.4637821", "0.46121657", "0.46097308", "0.45969254", "0.4584752", "0.45547098", "0.4531139", "0.45271713", "0.45253074", "0.45242402", "0.45168275", "0.45109054", "0.45002085", "0.4491268", "0.44909093", "0.4480304", "0.44778758", "0.44762486", "0.44760114", "0.44757292", "0.44625077", "0.44622678", "0.44436863", "0.44323993", "0.44320548", "0.44299102", "0.44243228", "0.44144946", "0.4413988", "0.44122297", "0.4410376", "0.44062015", "0.4388539", "0.43864253", "0.43850267", "0.4380874", "0.43768507", "0.4374578", "0.43692002", "0.43651828", "0.43575063", "0.43554175", "0.4348163", "0.43444753", "0.4342435", "0.43368983", "0.43357718", "0.4333914", "0.433213", "0.43184224", "0.4303845", "0.43020752", "0.43008265", "0.42969245", "0.42940181", "0.42937478", "0.42885637", "0.42881975", "0.42690784" ]
0.0
-1
Get character at position.
function at(position) { return value.charAt(position) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function at(position) {\n return value.charAt(position);\n }", "function getchar(position){\n return $(position).text();\n}", "function getCharFromPosition(pos) {\n\t\tvar index = pos.row * 5;\n\t\tindex = index + pos.col;\n\t\treturn keyPhrase.charAt(index);\n\t}", "function charAt (str='', position) {\n // var strArray = str.split('')\n return str[position]\n}", "char () {\n\t\treturn this.code[ this.pos ];\n\t}", "function getCharFromPosition(pos) {\n var index = pos.row * 5;\n index = index + pos.col;\n return cipher.key.charAt(index);\n}", "function nextChar() {\n return text.charAt(offset);\n }", "function getChar() {\n index++;\n c = expr.charAt(index);\n }", "get(index) { return this.input.charAt(index) }", "function getCharAtPosInDiv(editableDiv, pos) {\r\n\treturn editableDiv.innerHTML.charAt(pos);\r\n}", "function getPosLetter(inpt,position)\r\n{\r\n\tvar len=inpt.length;\r\n\tif(position<=len)\r\n\t{\r\n\t\tfinalOutput=inpt.charAt(position-1);\r\n\t\treturn finalOutput;\r\n\t\t \r\n\t}\r\n\telse\r\n\t{\r\n\t\tdocument.write(\"Invalid Position!\");\r\n\t\treturn; \r\n\t}\r\n\t\r\n}", "charAt(index) {return this.code[index];}", "function getChar(c){\n return String.fromCodePoint(c);\n}", "function getChar(c){\n return String.fromCharCode(c)\n}", "function byChar(cm, pos, dir) {\n return cm.findPosH(pos, dir, \"char\", true);\n }", "function peek() {\n return input.charAt(pos);\n }", "function peek() {\n return input.charAt(pos);\n }", "function getChar(c) {\n let char = String.fromCharCode(c);\n // console.log(char);\n return char\n}", "function current ()\n {\n if (index < text.length)\n return text.charCodeAt(index);\n else\n return undefined;\n }", "function getLetterFromAlphabet(position) {\n if (position == 0) {\n return \"\";\n }\n return String.fromCharCode(64 + position);\n}", "function characterAPick(string, index){\n return string[index]\n}", "function characPosit(character){\n\t\t//your code is here\n\t\tvar code = character.toLowerCase().charCodeAt(0)\n\t\treturn \"Position of alphabet: \" + (code - 96);\n\t}", "function GiveACharacter(str, num) {\n if (num >=0) {\n return str[num];\n }\n}", "function next_char() {\n c = ++pos < str.length ? str[pos] : undefined;\n }", "function getLetter(index) {\n return String.fromCharCode(64 + index);\n}", "getChar() { \n return this._char; \n }", "function position(letter){\n return \"Position of alphabet: \" + ((letter.charCodeAt(0)-97) + 1);\n }", "getChar() {\n return this.#charValue;\n }", "function getCharacter(text, index, uppercase) {\n let character = text.charAt(index);\n if (uppercase === true) {\n character = character.toUpperCase();\n } else {\n character = character.toLowerCase();\n }\n \n return character;\n}", "function codePointAt(text, position) {\n if (position === void 0) { position = 0; }\n // Adapted from https://github.com/mathiasbynens/String.prototype.codePointAt\n if (text == null) {\n throw new TypeError('string.codePointAt requries a valid string.');\n }\n var length = text.length;\n if (position !== position) {\n position = 0;\n }\n if (position < 0 || position >= length) {\n return undefined;\n }\n // Get the first code unit\n var first = text.charCodeAt(position);\n if (first >= exports.HIGH_SURROGATE_MIN && first <= exports.HIGH_SURROGATE_MAX && length > position + 1) {\n // Start of a surrogate pair (high surrogate and there is a next code unit); check for low surrogate\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n var second = text.charCodeAt(position + 1);\n if (second >= exports.LOW_SURROGATE_MIN && second <= exports.LOW_SURROGATE_MAX) {\n return (first - exports.HIGH_SURROGATE_MIN) * 0x400 + second - exports.LOW_SURROGATE_MIN + 0x10000;\n }\n }\n return first;\n }", "function getChar(keyNum) {\r\n return String.fromCharCode(keyNum);\r\n}", "function characPosit(character){\n\t\tvar alphabet=\"abcdefghijklmnopqrstuvwxyz\"\n\t\tvar position =eval(alphabet.indexOf(character))+1;\n\t\treturn \"Position of alphabet: \" + position;\n\t}", "selectChar(){\n this.pFse = (this.pFse + 1) % this.frase.length;\n return this.frase[this.pFse];\n }", "function get_character(workspace, char) {\n const x = (char * font_width) % (font_width * spritesheet_columns);\n const y = font_height * Math.floor(char / spritesheet_columns);\n return workspace.spritesheet_ctx.getImageData(x, y, font_width, font_height);\n }", "function getWholeChar(str, i) {\n var code = str.charCodeAt(i);\n\n if (isNaN(code)) {\n return ''; // Position not found\n }\n if (code < 0xD800 || code > 0xDFFF) {\n return str.charAt(i);\n }\n\n // High surrogate (could change last hex to 0xDB7F to treat high private\n // surrogates as single characters)\n if (0xD800 <= code && code <= 0xDBFF) {\n if (str.length <= (i + 1)) {\n throw 'High surrogate without following low surrogate';\n }\n var next = str.charCodeAt(i + 1);\n if (0xDC00 > next || next > 0xDFFF) {\n throw 'High surrogate without following low surrogate';\n }\n return str.charAt(i) + str.charAt(i + 1);\n }\n // Low surrogate (0xDC00 <= code && code <= 0xDFFF)\n if (i === 0) {\n throw 'Low surrogate without preceding high surrogate';\n }\n var prev = str.charCodeAt(i - 1);\n\n // (could change last hex to 0xDB7F to treat high private\n // surrogates as single characters)\n if (0xD800 > prev || prev > 0xDBFF) {\n throw 'Low surrogate without preceding high surrogate';\n }\n // We can pass over low surrogates now as the second component\n // in a pair which we have already processed\n return false;\n }", "function getTheCharacterPosition(name, letter) {\n let characterPosition = name.indexOf(letter);\n return characterPosition;\n}", "function getPosition() {\n return _character.getPosition();\n }", "function indexToChar (i) {\n // 97 = a\n return String.fromCharCode(97 + i); \n }", "get ( ) { return ns.ui.panels[1]._character; }", "getUntilChar(char) {\n const currIndex = this.index;\n var finalIndex = currIndex;\n while (this.currentChar != char && this.index < this.length) {\n this.consume();\n finalIndex = this.index;\n }\n return this.string.substring(currIndex, finalIndex);\n }", "function chr(i) {\n\t\treturn String.fromCharCode(i);\n\t}", "coordsForChar(pos) {\n this.readMeasured();\n return this.docView.coordsForChar(pos);\n }", "function charCode(str, index) {\n return index < str.length ? str.charCodeAt(index) : 0;\n}", "function nextChar() {\n return source[index++];\n }", "function text_from(s, offset)\n{\n\treturn String.fromCharCode( s[offset], s[offset + 1], s[offset + 2], s[offset + 3] );\n}", "function getCharPosition(c) {\n var index = cipher.key.indexOf(c);\n var row = Math.floor(index / 5);\n var col = index % 5;\n return {\n row: row,\n col: col,\n };\n}", "function position(letter){\n let alphabet ='abcdefghijklmnopqrstuvwxyz';\nreturn `Position of alphabet: ${alphabet.indexOf(letter)+1}`;\n}", "function curr () { return jsString.charAt(i); }", "current() { return this.valid(this.pos)?this.input.charAt(this.pos):Source.EOI }", "findTypedLetterByPosition(position) {\n let result = this.typedLetters.find(typedLetter => {\n return typedLetter.position.x === position.x && typedLetter.position.y === position.y;\n });\n\n if (typeof result === 'undefined') {\n result = null;\n }\n\n return result;\n }", "function look(stream, c){\n return stream.string.charAt(stream.pos+(c||0));\n}", "function peekForward(i) {\n return input.charAt(pos + i)\n }", "peek() {\n return this.input.charAt(this.pos);\n }", "function getWholeChar(str, i) {\n let code;\n let next;\n let prev;\n code = str.charCodeAt(i);\n\n if (isNaN(code)) {\n return ''; // Position not found\n }\n if (code < 0xD800 || code > 0xDFFF) {\n return str.charAt(i);\n }\n if (code >= 0xD800 && code <= 0xDBFF) { // High surrogate (could change last hex to 0xDB7F to treat high private surrogates as single characters)\n if (str.length <= (i + 1)) {\n throw 'High surrogate without following low surrogate';\n }\n next = str.charCodeAt(i + 1);\n if (next < 0xDC00 || next > 0xDFFF) {\n throw 'High surrogate without following low surrogate';\n }\n return str.charAt(i) + str.charAt(i + 1);\n }\n\n // Low surrogate (0xDC00 <= code && code <= 0xDFFF)\n if (i === 0) {\n throw 'Low surrogate without preceding high surrogate';\n }\n prev = str.charCodeAt(i - 1);\n if (prev < 0xD800 || prev > 0xDBFF) { // (could change last hex to 0xDB7F to treat high private surrogates as single characters)\n throw 'Low surrogate without preceding high surrogate';\n }\n return false; // We can pass over low surrogates now as the second component in a pair which we have already processed\n }", "function getLetterAtIndex(string, i) {\n // check if argument i is a number\n if (typeof i === 'number') {\n // return the character at the index\n return string[i]\n } else {\n // returns undefined if string is a number or if i is a string\n return undefined\n }\n}", "c() {\n if (this._c === undefined) {\n this._c = (this.eof ? \"\" : this._chars[this._pointer]);\n }\n return this._c;\n }", "function characPosit(character){\n\t\tvar str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\treturn str.search(character)+1;\n\n}", "function readEscapedCharacter(lexer, position) {\n const body = lexer.source.body;\n const code = body.charCodeAt(position + 1);\n\n switch (code) {\n case 0x0022:\n // \"\n return {\n value: '\\u0022',\n size: 2,\n };\n\n case 0x005c:\n // \\\n return {\n value: '\\u005c',\n size: 2,\n };\n\n case 0x002f:\n // /\n return {\n value: '\\u002f',\n size: 2,\n };\n\n case 0x0062:\n // b\n return {\n value: '\\u0008',\n size: 2,\n };\n\n case 0x0066:\n // f\n return {\n value: '\\u000c',\n size: 2,\n };\n\n case 0x006e:\n // n\n return {\n value: '\\u000a',\n size: 2,\n };\n\n case 0x0072:\n // r\n return {\n value: '\\u000d',\n size: 2,\n };\n\n case 0x0074:\n // t\n return {\n value: '\\u0009',\n size: 2,\n };\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character escape sequence: \"${body.slice(\n position,\n position + 2,\n )}\".`,\n );\n}", "peek() { return this.string.charAt(this.pos) || undefined; }", "function charToIndex (c) {\n return parseInt(c.toLowerCase().charCodeAt(0) - 97);\n }", "read() {\n if (this.pos < this.size) {\n this.ch = this.input.charCodeAt(this.pos++);\n } else {\n this.ch = -1;\n }\n }", "function chr(n) {\n return String.fromCharCode(n);\n }", "function sc_readChar(port) {\n if (port === undefined) // we assume the port hasn't been given.\n\tport = SC_DEFAULT_IN; // THREAD: shared var...\n var t = port.readChar();\n return t === SC_EOF_OBJECT? t: new sc_Char(t);\n}", "function indexToChar(i) {\n return String.fromCharCode(i+97).toUpperCase(); //97 in ASCII is 'a', so i=0 returns 'a', i=1 returns 'b', etc\n}", "function getPosition(position) {\n\t\treturn board[position];\n\t}", "function codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}", "function codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}", "function codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}", "function codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}", "function codePointAt(str, posParam) {\n let code;\n let next;\n let pos = posParam;\n\n pos = isNaN(pos) ? 0 : pos;\n code = str.charCodeAt(pos);\n next = str.charCodeAt(pos + 1);\n\n // If a surrogate pair\n if (code >= 0xD800 && code <= 0xDBFF && next >= 0xDC00 && next <= 0xDFFF) {\n return ((code - 0xD800) * 0x400) + (next - 0xDC00) + 0x10000;\n }\n return code;\n }", "function text_from(s, offset)\n{\n\tvar fromCharCode = String.fromCharCode;\n\treturn fromCharCode(s[offset]) + fromCharCode(s[offset + 1]) + fromCharCode(s[offset + 2]) + fromCharCode(s[offset + 3]);\n}", "function extractChar (cmd, objects) {\n let char;\n if (cmd.forNpc) {\n char = objects[0][0];\n if (!char.npc) {\n failedmsg(not_npc(char));\n return world.FAILED\n }\n objects.shift();\n } else {\n char = game.player;\n }\n return char\n }", "function positionToChar(position) {\n var counter = 0;\n\n loop:\n for (var i = 1; i <= keyboardDimension[0]; i++) {\n for (var j = 1; j <= keyboardDimension[1]; j++) {\n if (!(i in invalidPositions) || !invalidPositions[i].some(xPosition => xPosition == j)) {\n counter++;\n }\n\n if (position[0] == i && position[1] == j) {\n //We are at the position that is given as the parameter, stop the N(2) loop\n // with the label\n break loop;\n }\n }\n }\n\n if (counter >= 10) {\n return String.fromCharCode(65 + (counter - 10));\n }\n\n return counter;\n}", "function letterPosition() {\n \"use strict\";\n var name, charName, position;\n name = window.prompt(\"Please type in your name.\");\n charName = name.length;\n position = window.prompt(\"Please choose a number between 1 and \" + charName + \".\");\n window.alert(name.charAt(position - 1) + \" is the letter in that position.\");\n}", "function codePointAt(str, pos) {\n let code0 = str.charCodeAt(pos);\n if (!surrogateHigh(code0) || pos + 1 == str.length)\n return code0;\n let code1 = str.charCodeAt(pos + 1);\n if (!surrogateLow(code1))\n return code0;\n return ((code0 - 0xd800) << 10) + (code1 - 0xdc00) + 0x10000;\n}", "function toChar(ch) {\n if (typeof ch === 'string') return ch;\n return isMeta(ch) ?\n '^'+ String.fromCharCode(parseInt(ch, 10) + 64) :\n String.fromCharCode(ch);\n}", "function setCharAt(str,index,chr) {\n\t\t\tif (typeof str !== 'undefined') {\n\t\t\t\tif(index > str.length-1) return str;\n\t\t\t\treturn str.substr(0,index) + chr + str.substr(index+1);\n\t\t\t}\n\t\t}", "codePoint() {\n if (this._codePoint === undefined) {\n if (this.eof) {\n this._codePoint = -1;\n }\n else {\n const cp = this._chars[this._pointer].codePointAt(0);\n /* istanbul ignore else */\n if (cp !== undefined) {\n this._codePoint = cp;\n }\n else {\n this._codePoint = -1;\n }\n }\n }\n return this._codePoint;\n }", "skipPastChar(char) {\n var text = this.getUntilChar(char);\n text += this.consume();\n return text;\n }", "function positionInAlphabet(myChar) {\n const DIFFERENCE_CHARCODE_AND_LETTERS = 96;\n // Convert the character into lowercase\n const myCharLowercase = myChar.toLowerCase();\n // Find the position of the char in the alphabet\n const position = myCharLowercase.charCodeAt() - DIFFERENCE_CHARCODE_AND_LETTERS;\n // Return the desired message with the position\n return `Position in Alphabet: ${position}`\n}", "function toChar(cp) {\r\n if (cp <= 0xFFFF)\r\n return String.fromCharCode(cp);\r\n\r\n cp -= 0x10000;\r\n return String.fromCharCode(cp >>> 10 & 0x3FF | 0xD800) + String.fromCharCode(0xDC00 | cp & 0x3FF);\r\n}", "function toChar(cp) {\r\n if (cp <= 0xFFFF)\r\n return String.fromCharCode(cp);\r\n\r\n cp -= 0x10000;\r\n return String.fromCharCode(cp >>> 10 & 0x3FF | 0xD800) + String.fromCharCode(0xDC00 | cp & 0x3FF);\r\n}", "function toChar(ascii){\n return String.fromCharCode(ascii);\n}", "charValue(character){\n if(BadBoggle.isAVowel(character)) return 3;\n if(character === 'y') return -10;\n return -2;\n }", "convertPointToCharacterPosition(text, point) {\n var position = 0;\n var w = 0;\n for (var i = 0, n = text.length; i < n; i++) {\n\n var charWidth = this.calculateCharacterSize(text.charAt(i))[0];\n var halfWidth = charWidth / 2;\n\n if (i > 0) {\n w = this.calculateSize(text.substr(0, i))[0];\n }\n\n // basic rounding calculation bast on character\n // width\n if (w + halfWidth > point) {\n break;\n }\n\n position++;\n }\n\n return position;\n }", "function setCharAt(str,index,chr) {\n if(index > str.length-1 || index < 0) return str;\n return str.substr(0,index) + chr + str.substr(index+1);\n}", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\t\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function get(r, c) {\n\t\t\n\t\tr=getR(r);\n\t\tc=getC(c);\n\t\t\n\t\treturn cipher[which][r].substring(c,c+1);\n\t}", "function get(r, c) {\n\t\t\n\t\tr=getR(r);\n\t\tc=getC(c);\n\t\t\n\t\treturn cipher[which][r].substring(c,c+1);\n\t}", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "next() {\n if (this.pos < this.string.length)\n return this.string.charAt(this.pos++);\n }", "function toChar(cp) {\n if (cp <= 0xFFFF)\n return String.fromCharCode(cp);\n\n cp -= 0x10000;\n return String.fromCharCode(cp >>> 10 & 0x3FF | 0xD800) + String.fromCharCode(0xDC00 | cp & 0x3FF);\n}", "function toChar(cp) {\n if (cp <= 0xFFFF)\n return String.fromCharCode(cp);\n\n cp -= 0x10000;\n return String.fromCharCode(cp >>> 10 & 0x3FF | 0xD800) + String.fromCharCode(0xDC00 | cp & 0x3FF);\n}" ]
[ "0.80307126", "0.7923145", "0.7504489", "0.7345628", "0.72849643", "0.7173458", "0.71678835", "0.7005721", "0.69420445", "0.69145226", "0.69129384", "0.6879252", "0.6852267", "0.6845846", "0.6806128", "0.6754075", "0.6754075", "0.66977465", "0.6695774", "0.6644064", "0.6619243", "0.644228", "0.6433002", "0.6422239", "0.63991237", "0.63553786", "0.6288172", "0.6284775", "0.6282976", "0.62810755", "0.62471783", "0.6238594", "0.6204005", "0.6176572", "0.6169998", "0.61476034", "0.6131726", "0.6103043", "0.6098686", "0.60911083", "0.6075488", "0.6068428", "0.6036842", "0.6023266", "0.600363", "0.5981548", "0.5970237", "0.5965237", "0.5929314", "0.59250385", "0.59237516", "0.5917935", "0.59073436", "0.5903095", "0.58656245", "0.5852062", "0.5848521", "0.58122826", "0.58085203", "0.580611", "0.5799472", "0.578219", "0.5776155", "0.57535374", "0.5740868", "0.5738022", "0.5738022", "0.5738022", "0.5738022", "0.57280153", "0.57270014", "0.57067275", "0.57045263", "0.56756663", "0.56633216", "0.566155", "0.5660584", "0.56376326", "0.5634387", "0.56287515", "0.56270075", "0.56270075", "0.5626872", "0.5619289", "0.56179416", "0.56157607", "0.56156707", "0.561214", "0.561214", "0.5609914", "0.5609914", "0.5604543", "0.5604543", "0.5604543", "0.5600907", "0.56008947", "0.56008947" ]
0.7991142
4
Flush `queue` (normal text). Macro invoked before each entity and at the end of `value`. Does nothing when `queue` is empty.
function flush() { if (queue) { result.push(queue) if (handleText) { handleText.call(textContext, queue, {start: prev, end: now()}) } queue = '' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flush () {\n flushing = true\n run(queue)\n run(userQueue)\n reset()\n}", "function flush () {\n flushing = true\n run(queue)\n run(userQueue)\n reset()\n}", "function flush () {\n flushing = true\n run(queue)\n run(userQueue)\n reset()\n}", "function flush() {\n if (queue) {\n result.push(queue);\n\n if (options.text) {\n options.text.call(options.textContext, queue, {\n start: previous,\n end: now()\n });\n }\n\n queue = '';\n }\n }", "function flush () {\n\t flushing = true\n\t run(queue)\n\t run(userQueue)\n\t reset()\n\t}", "function flush() {\n if (queue) {\n result.push(queue);\n if (handleText) {\n handleText.call(textContext, queue, {\n start: prev,\n end: now()\n });\n }\n queue = '';\n }\n }", "function flush() {\n if (queue) {\n result.push(queue);\n\n if (handleText) {\n handleText.call(textContext, queue, {\n start: prev,\n end: now()\n });\n }\n\n queue = EMPTY;\n }\n }", "function flush() {\n if (queue) {\n result.push(queue);\n\n if (handleText) {\n handleText.call(textContext, queue, {\n start: prev,\n end: now()\n });\n }\n\n queue = EMPTY;\n }\n }", "function flushQueue(context) {\n var buffer = context[8 /* HostInstructionsQueue */];\n if (buffer) {\n for (var i = 1 /* ValuesStartPosition */; i < buffer.length; i += 3 /* Size */) {\n var fn = buffer[i + 1 /* InstructionFnOffset */];\n var args = buffer[i + 2 /* ParamsOffset */];\n fn.apply(this, args);\n }\n buffer.length = 1 /* ValuesStartPosition */;\n }\n}", "function flush_queue() {\n $.each(action_queue, function () {\n // $ is a special case that means onload\n if (this.method === '$') {\n this.params.apply(this.node, []);\n }\n // otherwise call method on the jquery object with given params.\n else {\n if (!isTypeOf(this.params, 'Array')) {\n this.params = [this.params];\n }\n this.node[this.method].apply(this.node, this.params);\n }\n });\n action_queue = [];\n }", "function flushQueue() {\r\n var length = componentFlushQueue.length;\r\n if (length > 0) {\r\n for (var i = 0; i < length; i++) {\r\n var component = componentFlushQueue[i];\r\n applyState(component, false);\r\n var callbacks = component.__FCB;\r\n if (callbacks !== null) {\r\n for (var j = 0, len = callbacks.length; j < len; j++) {\r\n callbacks[i].call(component);\r\n }\r\n component.__FCB = null;\r\n }\r\n component.__FP = false; // Flush no longer pending for this component\r\n }\r\n componentFlushQueue = [];\r\n }\r\n }", "function flushBatcherQueue() {\n runBatcherQueue(queue);\n internalQueueDepleted = true;\n runBatcherQueue(userQueue);\n // dev tool hook\n /* istanbul ignore if */\n if (devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n}", "function flushBatcherQueue() {\n\t runBatcherQueue(queue);\n\t internalQueueDepleted = true;\n\t runBatcherQueue(userQueue);\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t}", "function flushBatcherQueue() {\n\t runBatcherQueue(queue);\n\t internalQueueDepleted = true;\n\t runBatcherQueue(userQueue);\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t}", "function flushBatcherQueue() {\n\t var _again = true;\n\t\n\t _function: while (_again) {\n\t _again = false;\n\t\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "function flushBatcherQueue() {\n\t var _again = true;\n\t\n\t _function: while (_again) {\n\t _again = false;\n\t\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "function flushBatcherQueue() {\n\t var _again = true;\n\t\n\t _function: while (_again) {\n\t _again = false;\n\t\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n }", "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n }", "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n }", "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n}", "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n}", "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n}", "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n}", "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n}", "function flushBatcherQueue () {\n runBatcherQueue(queue)\n resetBatcherState()\n}", "function flushBatcherQueue() {\n\t var _again = true;\n\n\t _function: while (_again) {\n\t _again = false;\n\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "function flushBatcherQueue () {\n\t\t runBatcherQueue(queue)\n\t\t internalQueueDepleted = true\n\t\t runBatcherQueue(userQueue)\n\t\t // dev tool hook\n\t\t /* istanbul ignore if */\n\t\t if (true) {\n\t\t if (_.inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__) {\n\t\t window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit('flush')\n\t\t }\n\t\t }\n\t\t resetBatcherState()\n\t\t}", "function flush() {\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\twhile (i < fnQueueLen) {\n\t\t\t\t\t\tfn(fnQueue[i], fnQueue[i + 1]);\n\t\t\t\t\t\tfnQueue[i++] = $undefined;\n\t\t\t\t\t\tfnQueue[i++] = $undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tfnQueueLen = 0;\n\t\t\t\t\tif (fnQueue.length > initQueueSize) fnQueue.length = initQueueSize;\n\t\t\t\t}", "function flushBatcherQueue() {\n\t runBatcherQueue(queue);\n\t internalQueueDepleted = true;\n\t runBatcherQueue(userQueue);\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (process.env.NODE_ENV !== 'production') {\n\t if (inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__) {\n\t window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit('flush');\n\t }\n\t }\n\t resetBatcherState();\n\t}", "function flushBatcherQueue() {\n runBatcherQueue(queue);\n internalQueueDepleted = true;\n runBatcherQueue(userQueue);\n // dev tool hook\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production') {\n if (inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__) {\n window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit('flush');\n }\n }\n resetBatcherState();\n}", "function clearQueue() {\n // get item at front of queue and call fn\n var fn = queue.shift();\n if (fn) fn();\n\n // run again on next tick\n clearQueueLater();\n}", "function redux_saga_core_esm_flush() {\n release();\n var task;\n\n while (!semaphore && (task = redux_saga_core_esm_queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "function flushBatcherQueue () {\n\t runBatcherQueue(queue)\n\t internalQueueDepleted = true\n\t runBatcherQueue(userQueue)\n\t resetBatcherState()\n\t}", "function flush() {\n\t release();\n\n\t var task = void 0;\n\t while (!semaphore && (task = queue.shift()) !== undefined) {\n\t exec(task);\n\t }\n\t}", "function flush(){release();var task;while(!semaphore&&(task=queue.shift())!==undefined){exec(task);}}", "function flush() {\n\t release();\n\t var task;\n\n\t while (!semaphore && (task = queue.shift()) !== undefined) {\n\t exec(task);\n\t }\n\t}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0; scan < index; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0; scan < index; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "denqueue() {\n debug(`\\nLOG: remove the queue`);\n this.queue.shift();\n }", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}" ]
[ "0.7087387", "0.7087387", "0.7087387", "0.6971163", "0.69597924", "0.6915335", "0.6880378", "0.6880378", "0.65975094", "0.653583", "0.63974905", "0.6274862", "0.6236151", "0.62098926", "0.6177881", "0.6177881", "0.6177881", "0.6148284", "0.6148284", "0.6148284", "0.613334", "0.613334", "0.613334", "0.613334", "0.613334", "0.61309975", "0.61279297", "0.61187506", "0.610593", "0.60849756", "0.6073106", "0.60404664", "0.60371435", "0.5981362", "0.5981362", "0.5981362", "0.5981362", "0.5981362", "0.5981362", "0.5981362", "0.5981362", "0.5981362", "0.5981362", "0.5981362", "0.5981362", "0.59616864", "0.5935922", "0.5922137", "0.5918999", "0.59150434", "0.59150434", "0.59150434", "0.59150434", "0.59150434", "0.59150434", "0.59150434", "0.59150434", "0.59150434", "0.59150434", "0.59150434", "0.5912751", "0.5912751", "0.5912751", "0.5912751", "0.59036154", "0.59036154", "0.58669174", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824", "0.585824" ]
0.69163615
12
Check if `character` is outside the permissible unicode range.
function prohibited(code) { return (code >= 0xd800 && code <= 0xdfff) || code > 0x10ffff }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isCharAndNotRestricted(c) {\n return (c === 0x9) ||\n (c === 0xA) ||\n (c === 0xD) ||\n (c > 0x1F && c < 0x7F) ||\n (c === 0x85) ||\n (c > 0x9F && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function isRestrictedChar(c) {\n return (c >= 0x1 && c <= 0x8) ||\n c === 0xB ||\n c === 0xC ||\n (c >= 0xE && c <= 0x1F) ||\n (c >= 0x7F && c <= 0x84) ||\n (c >= 0x86 && c <= 0x9F);\n}", "function isChar(c) {\n return (c >= 0x0001 && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function isUnicodeFraction(character) {\n\tvar unicode = character.charCodeAt(0);\n\treturn ((unicode >= 188 && unicode <= 190) || (unicode >= 8531 && unicode <= 8542));\n}", "function check_range(str) {\n for (var i = 0; i < shutdownFilePath.length; i++) {\n if (shutdownFilePath.charCodeAt(i) > 127) {\n return false;\n }\n }\n return true;\n }", "function needsHexEscape(character) {\n\t return !((0x00020 <= character && character <= 0x00007E) ||\n\t (character === 0x00085) ||\n\t (0x000A0 <= character && character <= 0x00D7FF) ||\n\t (0x0E000 <= character && character <= 0x00FFFD) ||\n\t (0x10000 <= character && character <= 0x10FFFF));\n\t}", "function in_ascii_range(str) {\n for (let i = 0; i < str.length; i++) {\n let c = str.charCodeAt(i);\n \n if ( !(c >= 32 && c <= 127) ) {\n return false;\n }\n }\n return true;\n}", "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "function isReservedCodePoint(cp) {\n return cp >= 0xD800 && cp <= 0xDFFF || cp > 0x10FFFF;\n}", "function isReservedCodePoint(cp) {\n return cp >= 0xD800 && cp <= 0xDFFF || cp > 0x10FFFF;\n}", "function css__UNICODE__RANGE_ques_(cssPrimitiveType) /* (cssPrimitiveType : cssPrimitiveType) -> bool */ {\n return (cssPrimitiveType === 27);\n}", "function isInvalidChar() {\n var validChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n if (validChar.indexOf(userGuess) === -1) {\n feedBackText.textContent = \"You entered an invalid character. Please make another selection.\";\n return true;\n }\n }", "function notUnicode(s) {\n if (/[\\ud800-\\udbff][^\\udc00-\\udfff]/.test(s)) {\n return true /* high-surrogate without low-surrogate */\n }\n\n if (/[^\\ud800-\\udbff][\\udc00-\\udfff]/.test(s)) {\n return true /* low-surrogate without high-surrogate */\n }\n\n return false\n}", "function outOfBoard(position) {\n charPart = String.fromCharCode(position.charCodeAt(0))\n intPart = parseInt(position.charAt(1))\n if (alpha.includes(charPart) && intPart > 0 && intPart < 9)\n return false\n else\n return true\n }", "validateInput(char) {\n if ((new RegExp(`^${'[\\x00-\\x5F\\xC8-\\xCF]'}+$`)).test(char)) {\n return undefined;\n }\n else {\n return 'Supports only ASCII characters 00 to 95 (0–9, A–Z and control codes) and special characters.';\n }\n }", "validateInput(char) {\n if ((new RegExp(`^${'[\\x20-\\x7F\\xC8-\\xCF]'}+$`)).test(char)) {\n return undefined;\n }\n else {\n return 'Supports only ASCII characters 32 to 127 (0–9, A–Z, a–z), and special characters.';\n }\n }", "validateInput(char) {\n //if (char.search('/[a-zA-Z0-9]*/') === -1) {\n if (char.search(/^[0-9A-Za-z\\-\\.\\ \\@\\$\\/\\+\\%\\!\\@\\#\\$\\%\\&\\*\\^\\(\\)\\_\\+\\=\\<\\>\\?\\{\\}\\[\\]\\~\\-\\Ê]+$/) === -1) {\n return 'Supports only 128 characters of ASCII.';\n }\n else {\n return undefined;\n }\n }", "function isValidChar(toCheck) {\n\n var ascii = toCheck.charCodeAt(0)\n\n //check for letters \n if( (ascii > 64 && ascii < 91) || (ascii > 96 && ascii < 123)) {\n return true\n }\n\n //Check for puncuation marks\n if(toCheck === '\\'' || toCheck === \"!\" || toCheck === \".\" || toCheck === \"?\") {\n return true\n } \n\n //Not valid\n return false\n}", "function checkInvalid (paragr, position, wordLength){\r\n\r\n\t//kiem tra ki tu truoc va sau cua tu co phai la chu cai hay chu so hay khong\r\n\tif (checkLetter(paragr.charAt(position - 1)) \r\n\t\t\t|| checkLetter(paragr.charAt(position + wordLength))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\r\n\treturn true;\r\n}", "function isNonAscii(code) {\n return code >= 0x0080;\n}", "function opihelp_codepoint(b){\n\treturn sink_isnum(b) && // must be a number\n\t\tMath.floor(b) == b && // must be an integer\n\t\tb >= 0 && b < 0x110000 && // must be within total range\n\t\t(b < 0xD800 || b >= 0xE000); // must not be a surrogate\n}", "function testTrailSurrogateOutOfbounds()\n{\n return (\"\\uD800\\uDBFF\".codePointAt(0) === 0xd800 && \"\\uD800\\uDBFF\".codePointAt(1) === 0xdbff && \"\\uD800\\uDBFF\".codePointAt(2) === undefined\n && \"\\uD800\\uE000\".codePointAt(0) === 0xd800 && \"\\uD800\\uE000\".codePointAt(1) === 0xe000 && \"\\uD800\\uE000\".codePointAt(2) === undefined)\n}", "function specialCheck(check){\n \n for(let a=0; a<check.length; a++){\n \n let char_num = check.charCodeAt(a);\n\n if(char_num >= 33 && char_num <= 47 || char_num >= 58 && char_num <= 64 || char_num >= 91 && <= 96 || char_num >= 123 && char_num <= 126){\n return true;\n }\n\n }\n return false;\n\n\n}", "validateInput(char) {\n let asciiCheck = this.checkText(char);\n if (asciiCheck) {\n return undefined;\n }\n else {\n return 'Supports 128 characters of ASCII.';\n }\n }", "function charCheck(string) {\n if (string.length > 10) {\n return true;\n } else if (string.length < 10){\n return false;\n } else {\n console.log(\"something went wrong\");\n }\n}", "invalidInput(value) {\n const test = /[^\\wÀ-û\\s]/;\n return test.test(value) || value.length < 5;\n }", "function isUnclosedURLCharacter(character) {\n return (\n character !== leftSquareBracket &&\n character !== rightSquareBracket &&\n !whitespace(character)\n )\n}", "function isEnclosedURLCharacter(character) {\n return (\n character !== greaterThan &&\n character !== leftSquareBracket &&\n character !== rightSquareBracket\n )\n}", "function validateChar(str) {\r\n for (var i = 0; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n i++;\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}", "function nCharOK(c) \n{\n let ch = (String.fromCharCode(c));\n ch = ch.toUpperCase();\n // if the current character is not found in the set of all numbers\n // set the flag variable to fail\n if (filterSet.indexOf(ch) !== -1)\n return true;\n else \n return false;\n}", "function nCharOK(c) {\n var ch = (String.fromCharCode(c));\n ch = ch.toUpperCase();\n\n if (nCharsAllowed.indexOf(ch) != -1)\n return true;\n else\n return false;\n}", "function isValidCharacter(char){\n return (char >= 'a' && char <= 'z') || char === '\\'';\n}", "function isAsciiOnly(str) {\n console.log(\"Story is: \", str, str.length)\n let retval = true;\n for (let i = 0; i<str.length; i++)\n if (str.charCodeAt(i) > 127)\n retval = false;\n return retval;\n}", "function illegalCharsFound(checkString)\n{\n //var specialCharacters = \"<>@!#$%^&*()_+[]{}?:;|'\\\"\\\\,./~`-=\";\n var specialCharacters = \"<>~`\";\n var result = false;\n if (checkString.indexOf('>')!=-1 || checkString.indexOf('<')!=-1 ) // dan is het gevonden\n {\n result = true; \n }\n\n return result;\n}", "function checkRange(num){\r\n if(num>=65 && num<=90){\r\n return true;\r\n }\r\n return false;\r\n}", "function isCorrectCharacter(char) {\r\n switch (char) {\r\n case 'a':\r\n case 'e':\r\n case 'i':\r\n case 'o':\r\n case 'u':\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUTF8NonAscii(tok) {\n // In JavaScript, we just deal directly with Unicode code points,\n // so we aren't checking individual bytes for UTF-8 encoding.\n // Just check that the character is non-ascii.\n return tok.charCodeAt(0) >= 128;\n }", "function isUTF8NonAscii(tok) {\n // In JavaScript, we just deal directly with Unicode code points,\n // so we aren't checking individual bytes for UTF-8 encoding.\n // Just check that the character is non-ascii.\n return tok.charCodeAt(0) >= 128;\n }", "function isUTF8NonAscii(tok) {\n // In JavaScript, we just deal directly with Unicode code points,\n // so we aren't checking individual bytes for UTF-8 encoding.\n // Just check that the character is non-ascii.\n return tok.charCodeAt(0) >= 128;\n }", "function isUTF8NonAscii(tok) {\n // In JavaScript, we just deal directly with Unicode code points,\n // so we aren't checking individual bytes for UTF-8 encoding.\n // Just check that the character is non-ascii.\n return tok.charCodeAt(0) >= 128;\n }", "function isUnicodeScalarValue(code) {\n return (\n (code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff)\n );\n}", "_validateInput(character, position) {\n const that = this,\n maskElement = that._mask[position],\n regEx = new RegExp(maskElement.regex);\n\n return regEx.test(character);\n }", "function checkLenInput(pLen){\n if(parseInt(pLen) > 7 && parseInt(pLen) <129){\n return false;\n }\n else{\n return true;\n }\n}", "function outsideRange(a, b, c) {\n var out;\n if (b < c) {\n out = a < b || a > c;\n } else if (b > c) {\n out = a > b || a < c;\n } else {\n out = a != b;\n }\n return out;\n }", "function checkIsOver(str, num) {\n return str.length > num;\n //this is going to be analyzed as true or false\n}", "function outOfRange(narrativeID, sentence){\n\tif(sentence < narrativeFrames[narrativeID]-250){\n\t\treturn true;\n\t}else if (sentence > narrativeFrames[narrativeID]+250){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function checkLengthStringInput(strInput, lengthIn){\n\tvar strLetter = StringUtilNVL(strInput);\n\tif(strLetter.length > lengthIn){\n\t\treturn false;\n\t}\n\treturn true;\n}", "function _isASCIIString(value)\n{\n for (var i = 0; i < value.length; ++i) {\n if (_getElementAt(value, i) >= 128)\n return false;\n }\n return true;\n}", "function isLtrChar(c) {\n return rangesOfLRgExp.test(c);\n}", "function strchk_unicode(str)\n{\n\tvar strlen=str.length;\n\tif(strlen>0)\n\t{\n\t\tvar c = '';\n\t\tfor(var i=0;i<strlen;i++)\n\t\t{\n\t\t\tc = escape(str.charAt(i));\n\t\t\tif(c.charAt(0) == '%' && c.charAt(1)=='u')\n\t\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function chinese_check_only(v)\n{\n var ck = /[^\\x00-\\xff]/;\n\n if (v==\"\" ||ck.test(v)) {\n return 1;\n }\n \n return 0;\n}", "function supportedCodepoint(codepoint) {\n for (var i = 0; i < allBlocks.length; i += 2) {\n if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) {\n return true;\n }\n }\n return false;\n}", "function supportedCodepoint(codepoint) {\n for (var i = 0; i < allBlocks.length; i += 2) {\n if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) {\n return true;\n }\n }\n\n return false;\n}", "function supportedCodepoint(codepoint) {\n for (var i = 0; i < allBlocks.length; i += 2) {\n if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) {\n return true;\n }\n }\n\n return false;\n}", "function supportedCodepoint(codepoint) {\n for (var i = 0; i < allBlocks.length; i += 2) {\n if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) {\n return true;\n }\n }\n\n return false;\n}", "validateInput(char) {\n if ((new RegExp(`^${'(\\xCF*[0-9]{2}\\xCF*)'}+$`)).test(char)) {\n return undefined;\n }\n else {\n return 'Supports even number of numeric characters (00-99).';\n }\n }", "function parseSafeChars() {\n var startPos = pos;\n do {\n if (curChar >= \"\\u007F\") {\n if (curChar <= \"\\u009F\")\n error(\"control character #x%1 not allowed\", formatCodePoint(curChar));\n if (curChar >= \"\\uD800\") {\n if (curChar <= \"\\uDFFF\") {\n if (curChar >= \"\\uDC00\")\n error(\"high surrogate code point #x%1 not following low surrogate\", formatCodePoint(curChar));\n if (pos + 1 === source.length)\n error(\"incomplete surrogate pair\");\n var code2 = source.charCodeAt(pos + 1);\n if (code2 < 0xDC00 || code2 > 0xDFFF)\n posError(pos + 1, pos + 2, \"expected high surrogate code point not #x%1\", formatCodePoint(curChar));\n if ((code2 & 0x3FE) === 0x3FE) {\n var code1 = curChar.charCodeAt(0);\n if ((code1 & 0x3F) === 0x3F)\n posError(pos, pos + 1, \"noncharacter code point\");\n }\n advance();\n }\n else if (curChar >= \"\\uFDD0\" && (curChar <= \"\\uFDEF\" || curChar >= \"\\uFFFE\"))\n error(\"noncharacter #x%1 not allowed\", formatCodePoint(curChar));\n }\n }\n advance();\n } while (curChar > \">\");\n return source.slice(startPos, pos);\n }", "function isLong(inputText) {\n return inputText.value.match(inputRange);\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "static outOfBounds (x, z) {\n return x < 0 || x >= 32 || z < 0 || z >= 32\n }", "function checkLength(text) {\n\tif (text.length < 8) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "function checkRangeTokens(inputString) {\n var finalString = inputString.replaceAll(',', '').replaceAll('-', '').replaceAll(/[0-9]/g, '').replaceAll(' ', '');\n\n if (finalString == '')\n return true;\n else\n return false;\n }", "function outOfBounds(row, col) {\n if ((row < 0) || (row > 7)) {\n return true;\n }\n else if ((col < 0) || (col > 7)) {\n return true;\n }\n return false;\n}", "function checkIntegrity(input) {\n\tvar okayChars = /[A-Za-z_0-9\\\\\\/<>\\-~()\\s\\&\\|\\=\\!\\u2227\\u2228\\u2192\\u2194\\u22A4\\u22A5\\u00AC]/;\n\tfor (var i = 0; i < input.length; i++) {\n\t\tif (!okayChars.test(input.charAt(i))) {\n\t\t\tscannerFail(\"Illegal character\", i, i + 1);\n\t\t}\n\t}\n}", "function isValidChar(evt)\n{ \n \n var charCode = evt.keyCode;\n \n /*--------EXCLUDE THE FOLLOWING CHAR CODES--------------\n ! \" # $ % & = 33 to 38\n ( ) * + = 40 to 43\n / = 47 \n 0 1 2 3 4 5 6 7 8 9 = 48 to 57\n : ; < = > ? @ = 58 to 64 \n [ \\ ] ^ _ ` = 91 to 96\n { | } ~ = 123 to 126\n -------------------------------------------------------*/ \n //alert(charCode);\n \n if ((charCode >= 33 && charCode <= 38) ||(charCode >= 40 && charCode <= 43) || (charCode == 47) || (charCode >= 48 && charCode <= 57) || (charCode >= 58 && charCode <= 64) || (charCode >= 91 && charCode <= 96) || (charCode >= 123 && charCode <= 126) )\n {\n \n return false;\n }\n return true;\n}", "function isChar(c) {\n return (c >= SPACE && c <= 0xD7FF) ||\n c === NL || c === CR || c === TAB ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function isUnicodeLetter(code) {\n for (var _i = 0; _i < unicodeLetterTable.length;) {\n if (code < unicodeLetterTable[_i++]) {\n return false;\n }\n\n if (code <= unicodeLetterTable[_i++]) {\n return true;\n }\n }\n\n return false;\n }", "function areValidChars(char){\n for(var i=0; i<char.length; i++){\n if(alphabet.indexOf(char[i]) == -1 && char[i] != '_' && char[i] != '\\\\'){\n return char[i];\n }\n }\n return true;\n}", "function onlyNumberKey(evt) {\n \n // Only ASCII character in that range allowed\n var ASCIICode = (evt.which) ? evt.which : evt.keyCode ;\n if (ASCIICode >=48 && ASCIICode <=57 ){\n return true ; \n }\n else{\n return false;\n }\n }", "function isCharacterALetter(character_start) {\n return /[a-zA-Z]/.test(character_start);\n}", "isValidTruncated(value) {\n return value <= this.upper && value >= this.lower;\n }", "function n(e){return e>=65&&e<=90||95===e||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}", "function isUpper(character) {\n if (!character)\n return false;\n return !/[a-z]/.test(character) && /[A-Z]/.test(character);\n}", "function charSuitableForTagName(char) {\n return /[.\\-_a-z0-9\\u00B7\\u00C0-\\uFFFD]/i.test(char);\n} // it flips all brackets backwards and puts characters in the opposite order", "function isAlpha(aChar)\n{\n myCharCode = aChar.charCodeAt(0);\n \n if(((myCharCode > 64) && (myCharCode < 91)) ||\n ((myCharCode > 96) && (myCharCode < 123)))\n {\n return true;\n }\n \n return false;\n}", "function checkLength(str, minLim, maxLim){\r\n length = str.length;\r\n if(length > minLim && length <= maxLim){\r\n return true;\r\n }\r\n return false;\r\n}", "validateInput(text) {\n let valueCheck = this.getValue(text);\n if (valueCheck) {\n return undefined;\n }\n else {\n return 'Supports 128 characters of ASCII.';\n }\n }", "function isCharUpper(char) {\n return char === char.toUpperCase() && !isNumberChar(char);\n}", "function restrictAlphabets(e){\n\t\tvar x=e.which||e.keycode;\n\t\tif((x>=48 && x<=57) || x==8 ||\n\t\t\t(x>=35 && x<=40)|| x==46)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n }", "function isASCIIDigit(c) {\n return c >= 0x30 && c <= 0x39;\n}", "function validated(password, character, min, max){\n\n let passwordArr = password.split(''); // split password into Array\n let onlyChar = ''; //the matching characters in password\n\n if(password.includes(character)){\n for(let i = 0; i < passwordArr.length; i++){\n if(passwordArr[i] === character){\n onlyChar = onlyChar + passwordArr[i];\n }\n }\n }\n //\n if(onlyChar.length >= min && onlyChar.length <= max ){\n return true;\n }else {\n return false;\n }\n }", "function isLetters(input){\n for(let i = 0; i < input.length; i++){\n if(input.charAt(i) < 10){\n return false;\n break;\n }\n }\n }", "function containsForbiddenCharacters(str) {\n const regex = new RegExp(\"[^(0-9\\\\s-\\\\(\\\\))]\");\n return regex.test(str);\n}", "function character(evt) {\n evt = (evt) ? evt : event;\n var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode :\n ((evt.which) ? evt.which : 0));\n if (charCode > 33 && (charCode < 65 || charCode > 90) &&\n (charCode < 97 || charCode > 122)) {\n alert(\"Enter only characters\");\n return false;\n }\n return true;\n}", "function eP(a){return 32>=a||8203===a}", "static checkInvalidUsernameChars(username) {\n if (!username || username.length === 0) {\n return false;\n }\n let c = username.charAt(0);\n if (c >= '0' && c <= '9') {\n return true;\n }\n return /[^a-zA-Z0-9_]/.test(username)\n }", "function isProhibited(code) {\n return (code >= 0xD800 && code <= 0xDFFF) || (code > 0x10FFFF);\n}", "function verifyWord(word) {\n return (word.length > 1 && word.length < 26)\n}", "function isNumber(codepoint) {\n return codepoint >= Character._0 && codepoint <= Character._9;\n}", "function blockSpecialChar(e) {\n var k = e.keyCode;\n return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8 || k == 16 || k == 95 || k == 32 || (k > 43 && k < 47) || (k >= 48 && k <= 57));\n}" ]
[ "0.67489797", "0.6671416", "0.6548199", "0.6439609", "0.6376556", "0.636672", "0.6355649", "0.6336511", "0.61371344", "0.61371344", "0.61335915", "0.6131919", "0.6103784", "0.6095146", "0.60744405", "0.60734296", "0.6037238", "0.6001221", "0.59768313", "0.596549", "0.596392", "0.59461623", "0.59438676", "0.58910733", "0.58776355", "0.58581823", "0.5837474", "0.58274657", "0.57954454", "0.57929367", "0.578933", "0.57853293", "0.5784441", "0.57843256", "0.5760287", "0.575679", "0.57447946", "0.57447946", "0.57447946", "0.57447946", "0.57447946", "0.57447946", "0.57361233", "0.57361233", "0.57361233", "0.57361233", "0.56932586", "0.56713915", "0.5668214", "0.56290144", "0.560999", "0.55934894", "0.559007", "0.55700636", "0.5558063", "0.5555141", "0.55442286", "0.55291766", "0.5527829", "0.5527829", "0.5527829", "0.5519928", "0.55153847", "0.5513832", "0.5500315", "0.5500315", "0.5500315", "0.5500315", "0.5500315", "0.5500315", "0.549418", "0.5491529", "0.5486237", "0.54842293", "0.5482286", "0.5481259", "0.5479212", "0.5477002", "0.54741293", "0.547389", "0.5473167", "0.5462892", "0.5450426", "0.5448684", "0.5445283", "0.54408514", "0.5436034", "0.54266727", "0.54129523", "0.54100233", "0.54005104", "0.5391798", "0.53871864", "0.538687", "0.5386237", "0.5370453", "0.53669107", "0.53658366", "0.5357403", "0.53537667", "0.5352439" ]
0.0
-1
Check if `character` is disallowed.
function disallowed(code) { return ( (code >= 0x0001 && code <= 0x0008) || code === 0x000b || (code >= 0x000d && code <= 0x001f) || (code >= 0x007f && code <= 0x009f) || (code >= 0xfdd0 && code <= 0xfdef) || (code & 0xffff) === 0xffff || (code & 0xffff) === 0xfffe ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isCharAndNotRestricted(c) {\n return (c === 0x9) ||\n (c === 0xA) ||\n (c === 0xD) ||\n (c > 0x1F && c < 0x7F) ||\n (c === 0x85) ||\n (c > 0x9F && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function isValidCharacter(character){\n if(character.getName() === undefined || \n character.getRealm() === undefined || \n character.getLevel() === undefined ||\n character.getRace() === undefined ||\n character.getClass() === undefined){\n console.log(character.getName() + \" : \" + character.getRealm() + \" is not a valid character\");\n return false;\n }\n else {\n return true;\n }\n}", "function isValidCharacter(char){\n return (char >= 'a' && char <= 'z') || char === '\\'';\n}", "function isInvalidChar() {\n var validChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n if (validChar.indexOf(userGuess) === -1) {\n feedBackText.textContent = \"You entered an invalid character. Please make another selection.\";\n return true;\n }\n }", "function simpleChar(character) {\n return CHAR_TAB !== character &&\n CHAR_LINE_FEED !== character &&\n CHAR_CARRIAGE_RETURN !== character &&\n CHAR_COMMA !== character &&\n CHAR_LEFT_SQUARE_BRACKET !== character &&\n CHAR_RIGHT_SQUARE_BRACKET !== character &&\n CHAR_LEFT_CURLY_BRACKET !== character &&\n CHAR_RIGHT_CURLY_BRACKET !== character &&\n CHAR_SHARP !== character &&\n CHAR_AMPERSAND !== character &&\n CHAR_ASTERISK !== character &&\n CHAR_EXCLAMATION !== character &&\n CHAR_VERTICAL_LINE !== character &&\n CHAR_GREATER_THAN !== character &&\n CHAR_SINGLE_QUOTE !== character &&\n CHAR_DOUBLE_QUOTE !== character &&\n CHAR_PERCENT !== character &&\n CHAR_COLON !== character &&\n !ESCAPE_SEQUENCES[character] &&\n !needsHexEscape(character);\n}", "function areValidChars(char){\n for(var i=0; i<char.length; i++){\n if(alphabet.indexOf(char[i]) == -1 && char[i] != '_' && char[i] != '\\\\'){\n return char[i];\n }\n }\n return true;\n}", "validateInput(char) {\n if ((new RegExp(`^${'[\\x20-\\x7F\\xC8-\\xCF]'}+$`)).test(char)) {\n return undefined;\n }\n else {\n return 'Supports only ASCII characters 32 to 127 (0–9, A–Z, a–z), and special characters.';\n }\n }", "function simpleChar(character) {\n\t return CHAR_TAB !== character &&\n\t CHAR_LINE_FEED !== character &&\n\t CHAR_CARRIAGE_RETURN !== character &&\n\t CHAR_COMMA !== character &&\n\t CHAR_LEFT_SQUARE_BRACKET !== character &&\n\t CHAR_RIGHT_SQUARE_BRACKET !== character &&\n\t CHAR_LEFT_CURLY_BRACKET !== character &&\n\t CHAR_RIGHT_CURLY_BRACKET !== character &&\n\t CHAR_SHARP !== character &&\n\t CHAR_AMPERSAND !== character &&\n\t CHAR_ASTERISK !== character &&\n\t CHAR_EXCLAMATION !== character &&\n\t CHAR_VERTICAL_LINE !== character &&\n\t CHAR_GREATER_THAN !== character &&\n\t CHAR_SINGLE_QUOTE !== character &&\n\t CHAR_DOUBLE_QUOTE !== character &&\n\t CHAR_PERCENT !== character &&\n\t CHAR_COLON !== character &&\n\t !ESCAPE_SEQUENCES[character] &&\n\t !needsHexEscape(character);\n\t}", "validateInput(char) {\n if ((new RegExp(`^${'[\\x00-\\x5F\\xC8-\\xCF]'}+$`)).test(char)) {\n return undefined;\n }\n else {\n return 'Supports only ASCII characters 00 to 95 (0–9, A–Z and control codes) and special characters.';\n }\n }", "function isRestrictedChar(c) {\n return (c >= 0x1 && c <= 0x8) ||\n c === 0xB ||\n c === 0xC ||\n (c >= 0xE && c <= 0x1F) ||\n (c >= 0x7F && c <= 0x84) ||\n (c >= 0x86 && c <= 0x9F);\n}", "function containsForbiddenCharacters(str) {\n const regex = new RegExp(\"[^(0-9\\\\s-\\\\(\\\\))]\");\n return regex.test(str);\n}", "function characterSuitableForNames(char) {\n return /[-_A-Za-z0-9]/.test(char); // notice, there's no dot or hash!\n }", "function nCharOK(c) {\n var ch = (String.fromCharCode(c));\n ch = ch.toUpperCase();\n\n if (nCharsAllowed.indexOf(ch) != -1)\n return true;\n else\n return false;\n}", "validateInput(char) {\n //if (char.search('/[a-zA-Z0-9]*/') === -1) {\n if (char.search(/^[0-9A-Za-z\\-\\.\\ \\@\\$\\/\\+\\%\\!\\@\\#\\$\\%\\&\\*\\^\\(\\)\\_\\+\\=\\<\\>\\?\\{\\}\\[\\]\\~\\-\\Ê]+$/) === -1) {\n return 'Supports only 128 characters of ASCII.';\n }\n else {\n return undefined;\n }\n }", "characterIsALetter(char) {\n return (/[a-zA-Z]/).test(char)\n }", "function isCorrectCharacter(char) {\r\n switch (char) {\r\n case 'a':\r\n case 'e':\r\n case 'i':\r\n case 'o':\r\n case 'u':\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "function check_allowed_char(input,type,config){\r\n\tvar filter = eval(config)[type].allowed;\r\n\t//console.log(filter.test(input))\r\n\treturn(!filter.test(input));\r\n}", "_validateInput(character, position) {\n const that = this,\n maskElement = that._mask[position],\n regEx = new RegExp(maskElement.regex);\n\n return regEx.test(character);\n }", "function isValidChar(evt)\n{ \n \n var charCode = evt.keyCode;\n \n /*--------EXCLUDE THE FOLLOWING CHAR CODES--------------\n ! \" # $ % & = 33 to 38\n ( ) * + = 40 to 43\n / = 47 \n 0 1 2 3 4 5 6 7 8 9 = 48 to 57\n : ; < = > ? @ = 58 to 64 \n [ \\ ] ^ _ ` = 91 to 96\n { | } ~ = 123 to 126\n -------------------------------------------------------*/ \n //alert(charCode);\n \n if ((charCode >= 33 && charCode <= 38) ||(charCode >= 40 && charCode <= 43) || (charCode == 47) || (charCode >= 48 && charCode <= 57) || (charCode >= 58 && charCode <= 64) || (charCode >= 91 && charCode <= 96) || (charCode >= 123 && charCode <= 126) )\n {\n \n return false;\n }\n return true;\n}", "function check_invalid_char(input, type, config){\r\n\tvar filter = eval(config)[type].not_allowed;\r\n\t//console.log(filter.test(input))\r\n\treturn(filter.test(input));\r\n}", "function isValidChar(toCheck) {\n\n var ascii = toCheck.charCodeAt(0)\n\n //check for letters \n if( (ascii > 64 && ascii < 91) || (ascii > 96 && ascii < 123)) {\n return true\n }\n\n //Check for puncuation marks\n if(toCheck === '\\'' || toCheck === \"!\" || toCheck === \".\" || toCheck === \"?\") {\n return true\n } \n\n //Not valid\n return false\n}", "function isCharacterALetter(char) {\n return (/[a-zA-Z]/).test(char)\n}", "function chars(input){\n return true; // default validation only\n }", "function checkSpecialChar(data){\n\tvar iChars = \"!@#$%^&*()+=-[]\\\\\\';,./{}|\\\":<>?~_\";\n\tisvalid=true;\n\tfor (var i = 0; i < data.length; i++) {\n\t\tif (iChars.indexOf(data.charAt(i)) != -1) {isvalid=false;}\n\t}return isvalid;\n}", "function isChar(c) {\n return (c >= 0x0001 && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function character(evt) {\n evt = (evt) ? evt : event;\n var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode :\n ((evt.which) ? evt.which : 0));\n if (charCode > 33 && (charCode < 65 || charCode > 90) &&\n (charCode < 97 || charCode > 122)) {\n alert(\"Enter only characters\");\n return false;\n }\n return true;\n}", "function alphanum_allowChar(validatedStringFragment, Char, settings) {\n\n\t\tif (settings.maxLength && validatedStringFragment.length >= settings.maxLength)\n\t\t\treturn false;\n\n\t\tif (settings.allow.indexOf(Char) >= 0)\n\t\t\treturn true;\n\n\t\tif (settings.allowSpace && (Char == \" \"))\n\t\t\treturn true;\n\n\t\tif (settings.blacklistSet.contains(Char))\n\t\t\treturn false;\n\n\t\tif (!settings.allowNumeric && DIGITS[Char])\n\t\t\treturn false;\n\n\t\tif (!settings.allowUpper && isUpper(Char))\n\t\t\treturn false;\n\n\t\tif (!settings.allowLower && isLower(Char))\n\t\t\treturn false;\n\n\t\tif (!settings.allowCaseless && isCaseless(Char))\n\t\t\treturn false;\n\n\t\tif (!settings.allowLatin && LATIN_CHARS.contains(Char))\n\t\t\treturn false;\n\n\t\tif (!settings.allowOtherCharSets) {\n\t\t\tif (DIGITS[Char] || LATIN_CHARS.contains(Char))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function validateCharacters(val) {\n if (/^[a-zA-Z()]+$/.test(val) && val != \"\") {\n return true;\n } else {\n return false;\n }\n}", "function isLetter( character ) {\n\treturn character.toLowerCase() != character.toUpperCase();\n}", "validateInput(char, characters) {\n return char;\n }", "validateInput(char) {\n let asciiCheck = this.checkText(char);\n if (asciiCheck) {\n return undefined;\n }\n else {\n return 'Supports 128 characters of ASCII.';\n }\n }", "function isCharUnsafe(compareChar) {\nvar unsafeString = \"\\\"<>%\\\\^[]`\\+\\$\\,='#&@.:\\t\";\n\tif ( unsafeString.indexOf(compareChar) == -1 && compareChar.charCodeAt(0) >= 32\n\t\t&& compareChar.charCodeAt(0) < 123 )\n\t\treturn false; // found no unsafe chars, return false\n\treturn true;\n}", "function validateSpecialCharacter(x) {\n var validateSpecialChar = /^[A-Za-z0-9\\_\\-]+$/;\n\n if (x.match(validateSpecialChar)) {\n return true;\n }\n else {\n return false;\n }\n}", "function checkIntegrity(input) {\n\tvar okayChars = /[A-Za-z_0-9\\\\\\/<>\\-~()\\s\\&\\|\\=\\!\\u2227\\u2228\\u2192\\u2194\\u22A4\\u22A5\\u00AC]/;\n\tfor (var i = 0; i < input.length; i++) {\n\t\tif (!okayChars.test(input.charAt(i))) {\n\t\t\tscannerFail(\"Illegal character\", i, i + 1);\n\t\t}\n\t}\n}", "valid(c) { return Character.isAlphabetic(c) || c=='+'||c=='/' }", "function isvalidchar(strInvalidChars,strInput)\r\n\t{\r\n\t\tvar rc = true;\r\n\r\n\t\ttry \r\n\t\t{\r\n\t\t\tvar exp = new RegExp(strInvalidChars);\r\n\t\t\tvar result = exp.test(strInput);\r\n\r\n\t\t\tif ( result == true )\r\n\t\t\t{\r\n\t\t\t\trc = false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\trc = true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tcatch(oException)\r\n\t\t{\r\n\t\t\tif ( SA_IsDebugEnabled() )\r\n\t\t\t{\r\n\t\t\t\talert(\"Unexpected exception encountered in function: isvalidchar\\n\\n\"\r\n\t\t\t\t\t\t+ \"Number: \" + oException.number + \"\\n\"\r\n\t\t\t\t\t\t+ \"Description: \" + oException.description);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rc;\r\n\t}", "validateInput(char) {\n if (char.search(/^[0-9A-Z\\-\\.\\ \\$\\/\\+\\%]+$/) === -1) {\n return 'Supports A-Z, 0-9, and symbols ( - . $ / + % SPACE).';\n }\n else {\n return undefined;\n }\n }", "static checkInvalidUsernameChars(username) {\n if (!username || username.length === 0) {\n return false;\n }\n let c = username.charAt(0);\n if (c >= '0' && c <= '9') {\n return true;\n }\n return /[^a-zA-Z0-9_]/.test(username)\n }", "function Check_char(ct){\n\tf=document.forms[0];\n\tel=f.elements;\n\n\tif (el[ct].value.length > 1){\n\t\tel[ct].value = trim(el[ct].value);\n\t\t\n\t\treg_ex = /^([a-zàèéìòù]+['\\s]?){1,}[a-zàèéìòù]$/ig\n\t\t\n\t\tstringa = el[ct].value;\n\t\t\n\t\tif( stringa.match(reg_ex))\n\t\t\treturn true;\n\t\telse {\n\t\t\talert(\"Attenzione!\\nCarattere non ammesso nel campo \"+ct+\"\\n\\nSono consentiti solo lettere, spazi e apostrofi. Non sono ammessi:\\n - numeri\\n - caratteri speciali (es ?,@,_,*,+,-,/)\\n - spazi prima e dopo gli apostrofi\\n - doppio spazio o doppio apostrofo\\n - apostrofo finale\\n - spazi iniziali e finali\");\n\t\t\tel[ct].focus();\n\t\t\treturn false;\n\t\t}\n\t}\n\n}", "function isInvalidChar(str) {\n var ch = toStr(str);\n return ch === '\\\\'\n || ch === '['\n || ch === ']'\n || ch === '^'\n || ch === '('\n || ch === ')'\n || ch === '`';\n}", "function isInvalidChar(str) {\n var ch = toStr(str);\n return ch === '\\\\'\n || ch === '['\n || ch === ']'\n || ch === '^'\n || ch === '('\n || ch === ')'\n || ch === '`';\n}", "function validCharacters(str) {\r\n var regex = /^[0-9-()\" \"]*$/;\r\n return regex.test(str);\r\n}", "function containsForbiddenChars(str) {\n var chars = ['<script>', '</script>', '<script', 'script>', '</script', '<audio>', '</audio>', '<audio', 'audio>', '</audio', '$', '{', '}', '%'];\n for (var i = 0; i < chars.length; i++) {\n if (str.includes(chars[i])) return true;\n }\n return false;\n}", "function illegalCharsFound(checkString)\n{\n //var specialCharacters = \"<>@!#$%^&*()_+[]{}?:;|'\\\"\\\\,./~`-=\";\n var specialCharacters = \"<>~`\";\n var result = false;\n if (checkString.indexOf('>')!=-1 || checkString.indexOf('<')!=-1 ) // dan is het gevonden\n {\n result = true; \n }\n\n return result;\n}", "validateInput(char) {\n if ((new RegExp(`^${'(\\xCF*[0-9]{2}\\xCF*)'}+$`)).test(char)) {\n return undefined;\n }\n else {\n return 'Supports even number of numeric characters (00-99).';\n }\n }", "function isInvalidChar(str) {\n var ch = toStr(str);\n return ch === '\\\\' || ch === '[' || ch === ']' || ch === '^' || ch === '(' || ch === ')' || ch === '`';\n}", "function isEscapeable(char){\n\tif(char == ','\n\t|| char == '(' || char == ')'\n\t|| char == '[' || char == ']'\n\t|| char == '{' || char == '}'){\n\t\treturn true;\n\t}\n\treturn false;\n}", "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "function blockSpecialChar(e) {\n var k = e.keyCode;\n return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8 || k == 16 || k == 95 || k == 32 || (k > 43 && k < 47) || (k >= 48 && k <= 57));\n}", "function needsHexEscape(character) {\n\t return !((0x00020 <= character && character <= 0x00007E) ||\n\t (character === 0x00085) ||\n\t (0x000A0 <= character && character <= 0x00D7FF) ||\n\t (0x0E000 <= character && character <= 0x00FFFD) ||\n\t (0x10000 <= character && character <= 0x10FFFF));\n\t}", "function isUnclosedURLCharacter(character) {\n return (\n character !== leftSquareBracket &&\n character !== rightSquareBracket &&\n !whitespace(character)\n )\n}", "function isCharacterALetter(character_start) {\n return /[a-zA-Z]/.test(character_start);\n}", "function onlyGoodCharacters() {\n //Get element id\n const idName = this.id;\n // Regex that checks if input has somethong that is not a digit\n const current_value = $(`#${idName}`).val();\n const re = new RegExp(/[\\{\\}\\*\\_\\$\\%\\<\\>\\#\\|\\&\\?\\!\\¡\\¿\\[\\]]+/gi);\n const match = re.exec(current_value);\n // Check match\n if (match != null) {\n // remove user input\n $(`#${idName}`).val(\"\");\n // Put error message\n $(`#${idName}_wi`).text(\"¡Ingresaste uno o más caracteres inválidos!\");\n $(`#${idName}_wi`).show();\n } else {\n // Hide error message\n $(`#${idName}_wi`).text(\"\");\n $(`#${idName}_wi`).hide();\n }\n}", "function __is_evt_in_allow_chars(evt, allow_comm_chars, allow_chars)\n{\n\tvar char_code;\n\tvar i;\n\n\tif (navigator.appName == 'Netscape'){char_code=evt.which;\t}\n\telse\t\t\t\t\t\t\t\t{char_code=evt.keyCode;\t}\n\n\tif (allow_comm_chars == \"1\" && __is_comm_chars(char_code)==true) return true;\n\tif (allow_chars.length > 0 && __is_char_in_string(char_code, allow_chars)==true) return true;\n\n\treturn false;\n}", "function checkIfNoIllegalCharacters ( name ) {\n return ( name.indexOf(\".\") === -1 ) &&\n ( name.indexOf(\"/\") === -1 ) &&\n ( name.indexOf(\":\") === -1) &&\n ( name.indexOf(\"*\") === -1 );\n }", "function isNumber(character){\n return !isNaN(character);\n}", "function valid() {\n\t\treturn !(this.string.search(/^[!-~ ]+$/) === -1);\n\t}", "function nochars(chars, e) {\n var kCode = e.keyCode ? e.keyCode : e.charCode;\n if (e && kCode != 0 && chars.indexOf(String.fromCharCode(kCode)) >= 0) {\n Event.stop(e);\n }\n return !(e && kCode != 0 && chars.indexOf(String.fromCharCode(kCode)) >= 0);\n}", "function specialValidation(){\n var specialCharacters = \"!@#$%^&*()+=\";\n if(specialCharactersChoice === 'yes'){\n return specialCharacters;\n }else{\n return;\n }\n }", "function sc_isChar(c) {\n return (c instanceof sc_Char);\n}", "function isChar(c) {\n return (c >= SPACE && c <= 0xD7FF) ||\n c === NL || c === CR || c === TAB ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function isGeneralLegalMailboxChar(charCode) {\n if(isAlphaNumeric(charCode)) {\n return true;\n }\n\n switch(charCode) {\n case 33: // !\n case 35: // #\n case 36: // $\n case 37: // %\n case 38: // &\n case 39: // '\n case 42: // *\n case 43: // +\n case 45: // -\n case 47: // /\n case 61: // =\n case 63: // ?\n case 94: // ^\n case 95: // _\n case 96: // `\n case 123: // {\n case 124: // |\n case 125: // }\n case 126: // ~\n return true;\n\n default:\n return false;\n }\n }", "function isLetterOrDigit(char) {\n return \"abcdefghijklmnopqrstuvwxyz0123456789\".indexOf(char) >= 0;\n }", "function validateChar(key) {\r\n var keycode = (key.which) ? key.which : key.keyCode\r\n var phn = document.getElementById(key);\r\n //comparing pressed keycodes\r\n if (!(keycode == 8 || keycode == 46) && (keycode < 64 || keycode > 92) && (keycode < 97 || keycode > 122)) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n}", "function isCharacterKeyPress(event) {\n\tif (typeof event.which == \"undefined\") {\n\t\t// This is IE, which only fires keypress events for printable keys\n\t\treturn true;\n\t} else if (typeof event.which == \"number\" && event.which > 0) {\n\t\t// In other browsers except old versions of WebKit, evt.which is\n\t\t// only greater than zero if the keypress is a printable key.\n\t\t// We need to filter out control keys\n\t\tvar control_keys = {\n\t\t\t\"17\": \"control\",\n\t\t\t\"91\": \"meta\",\n\t\t\t\"93\": \"meta\",\n\t\t\t\"18\": \"alt\",\n\t\t\t\"16\": \"shift\",\n\t\t\t\"9\": \"tab\",\n\t\t\t\"8\": \"backspace\",\n\t\t\t\"13\": \"enter\",\n\t\t\t\"27\": \"escape\",\n\t\t\t\"46\": \"delete\",\n\t\t\t\"37\": \"left\",\n\t\t\t\"39\": \"right\",\n\t\t\t\"40\": \"down\",\n\t\t\t\"38\": \"up\",\n\t\t\t\"33\": \"page_up\",\n\t\t\t\"34\": \"page_down\",\n\t\t\t\"36\": \"home\",\n\t\t\t\"35\": \"end\"\n\t\t};\n\t\treturn control_keys[event.which] == null;\n\t}\n\treturn false;\n}", "function specialValid(val){\n if( /[^a-zA-Z0-9\\-\\/]/.test(val)) {\n // alert('Input is not alphanumeric');\n return false;\n }\n return true;\n}", "function isLetter(character) {\n if (character.length > 1) {\n return false;\n }\n var regex = /[A-Za-z]/;\n //character.search returns -1 if not found\n return character.search(regex) > -1;\n}", "function isChar (code) {\n\t// http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes\n\treturn code === 32 || (code > 46 && !(code >= 91 && code <= 123) && code !== 144 && code !== 145);\n}", "function isValid(str){\n return !/[~`!#$%\\^&*+=\\\\[\\]\\\\';,/{}|\\\\\":<>\\?]/g.test(str);\n}", "function spacialchactercheck(element)\n{\n\tvar iChars = \"~`!#$%^&*+=-[]\\\\\\';,/{}|\\\":<>?\";\n\n\tfor (var i = 0; i < element.length; i++)\n\t{\n \t\tif (iChars.indexOf(element.charAt(i)) != -1)\n \t\t{\n \t\treturn false;\n \t\t}\n\t}\n\treturn true;\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function __is_str_in_allow_chars(str, allow_comm_chars, allow_chars)\n{\n\tvar char_code;\n\tvar i;\n\n\tfor (i=0; i<str.length; i++)\n\t{\n\t\tchar_code=str.charCodeAt(i);\n\t\tif (allow_comm_chars == \"1\" && __is_comm_chars(char_code) == true) continue;\n\t\tif (allow_chars.length > 0 && __is_char_in_string(char_code, allow_chars) == true) continue;\n\t\treturn false;\n\t}\n\treturn true;\n}", "function checkInput(id) {\n \n var str = document.getElementById(id).value;\n \n var pattern = new RegExp(/[~`!#$%\\^&*+=\\-\\[\\]\\\\';/{}|\\\\\":<>\\?]/);\n \n if (pattern.test(str)) {\n alert('Special chars are not allowed!')\n document.getElementById(id).value = \"\";\n }\n\n}", "function isLetter(char) {\n return char.toLowerCase() != char.toUpperCase();\n}", "function validateSpecialCharacters(sender, args)\n{\n args.IsValid = true;\n\n var iChars = \"!@$%^&*+=[]\\\\\\';.{}|\\\":<>\";\n for (var i = 0; i < args.Value.length; i++)\n {\n if (iChars.indexOf(args.Value.charAt(i)) != -1)\n {\n args.IsValid = false;\n\n return false;\n }\n }\n\n return args.IsValid;\n}", "function specialCharCheck(field) {\n\t\tif(/[\\\\\\^\\$\\.\\|\\?\\*\\+\\(\\)\\[\\{]/.test(field)){\n\t\t\terrorGenerator(field, \"No special characters\", headers);\n\t\t}\n\t}", "function isCharacterAVowel(char) {\n if (char == \"a\" || char == \"e\" || char == \"i\" || char == \"o\" || char == \"u\") {\n console.log(\"Character is a vowel.\")\n }\n else if (char == \"y\") {\n console.log(\"Character can sometimes be a vowel.\")\n }\n else if (char = \" \") {\n console.log(\"Please enter character.\")\n }\n else {\n console.log(\"Character is a consonant.\")\n }\n}", "function CharactersOnly(e) \r\n { \r\n var key = window.event ? e.keyCode:e.which; \r\n var keychar = String.fromCharCode(key); \r\n reg = /\\d/; \r\n\t\tif(reg.test(keychar)==false)\r\n\t\t{\r\n return true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\treturn false;\r\n\t\t}\r\n\t}", "function onlychars(regex, e) {\n var kCode = e.keyCode ? e.keyCode : e.charCode;\n if (e && kCode != 0 && !String.fromCharCode(kCode).match(regex)) {\n Event.stop(e);\n }\n return !(e && kCode != 0 && !String.fromCharCode(kCode).match(regex));\n}", "function isAlphaNumericCharacter(character) {\n var characterCode = character.charCodeAt(0);\n return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ ||\n (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ ||\n (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */);\n }", "function isLetter(char) {\n const alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n return alphabet.includes(char);\n }", "function isAlphaNumeric(char){\n let code = char.charCodeAt(0);\n if(!(code > 47 && code < 58) &&\n !(code > 64 && code < 91) &&\n !(code > 96 && code < 123)){\n return false;\n }\n return true;\n}", "function charSuitableForTagName(char) {\n return /[.\\-_a-z0-9\\u00B7\\u00C0-\\uFFFD]/i.test(char);\n} // it flips all brackets backwards and puts characters in the opposite order", "function validateChar(str) {\r\n for (var i = 0; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n i++;\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}" ]
[ "0.7253733", "0.72172964", "0.70964015", "0.7084406", "0.69946593", "0.6974858", "0.6965145", "0.69241107", "0.6893851", "0.6864202", "0.6696537", "0.6636918", "0.66188204", "0.6596767", "0.6581353", "0.6559648", "0.65311134", "0.65260786", "0.6522246", "0.65065336", "0.6478346", "0.64602005", "0.6449885", "0.64483714", "0.6420851", "0.63918936", "0.63918936", "0.63918936", "0.63918936", "0.63918936", "0.63918936", "0.63918936", "0.63918936", "0.63918936", "0.63918936", "0.63918936", "0.63918936", "0.6383984", "0.63741523", "0.6368322", "0.6344403", "0.63323975", "0.6331623", "0.6329758", "0.63239396", "0.6323596", "0.62955755", "0.62709314", "0.626237", "0.6225236", "0.62131935", "0.6205863", "0.6205863", "0.6197119", "0.6175527", "0.6164238", "0.6159311", "0.6158", "0.61433554", "0.61368895", "0.6134666", "0.6133932", "0.6094038", "0.60893565", "0.6082448", "0.6041757", "0.60348105", "0.602172", "0.601584", "0.6009323", "0.6004768", "0.59953153", "0.5992213", "0.5980196", "0.59784776", "0.59736544", "0.5970383", "0.59391063", "0.5929318", "0.59228003", "0.5915824", "0.5911617", "0.5899673", "0.5899673", "0.5899673", "0.5899673", "0.5899673", "0.5899673", "0.5894408", "0.5893688", "0.5892123", "0.58905846", "0.5882709", "0.58688116", "0.58572334", "0.5848738", "0.58452964", "0.5834299", "0.58320004", "0.5812649", "0.58078605" ]
0.0
-1
Remove final newline characters from `value`.
function trimTrailingLines(value) { var val = String(value) var index = val.length while (val.charAt(--index) === line) { /* Empty */ } return val.slice(0, index + 1) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trimTrailingLines(value) {\n return String(value).replace(/\\n+$/, '')\n}", "function trimTrailingLines(value) {\n var val = String(value);\n var index = val.length;\n\n while (val.charAt(--index) === line) { /* empty */ }\n\n return val.slice(0, index + 1);\n}", "function trimTrailingLines(value) {\n var val = String(value)\n var index = val.length\n\n while (val.charAt(--index) === line) {\n // Empty\n }\n\n return val.slice(0, index + 1)\n}", "function trimTrailingLines(value) {\n var val = String(value)\n var index = val.length\n\n while (val.charAt(--index) === line) {\n // Empty\n }\n\n return val.slice(0, index + 1)\n}", "function trimTrailingLines(value) {\n var val = String(value)\n var index = val.length\n\n while (val.charAt(--index) === line) {\n // Empty\n }\n\n return val.slice(0, index + 1)\n}", "function cleanup(value) {\n return value.trim();\n }", "valueReformattedForMultilines(value) {\n if (typeof(value)==\"string\") return(value.replace(/\\n/ig,\"<br/>\"));\n else return(value);\n }", "function remove_newline(string) {\n return string.replace(/\\n/g, \" \");\n}", "function righttrim(value)\n{\n\twhile( value.length != 0 )\n\t{\n\t\tmychar=value.substring(value.length-1);\n\t\tif( mychar == \"\\u0020\" )\n\t\t{\n\t\t\tvalue=value.substr(0,value.length-1);\n\t\t}\n\t\telse\n\t\t\tbreak;\n\t\t\n\t}\n\treturn value;\n}", "function String_StripLineFeed()\n{\n\t//remove targets\n\treturn this.replace(/\\r/g, \"\").replace(/\\n/g, \"\");\n}", "function trim( value )\n{\n\treturn lTrim(rTrim(value));\n}", "function rtrim()\n{\n return this.replace( /\\s+$/g,'');\n}", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\tvar rng, container, offset;\n\n\t\t\trng = selection.getRng(true);\n\t\t\tcontainer = rng.startContainer;\n\t\t\toffset = rng.startOffset;\n\n\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t}\n\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\tvar rng, container, offset;\n\n\t\t\trng = selection.getRng(true);\n\t\t\tcontainer = rng.startContainer;\n\t\t\toffset = rng.startOffset;\n\n\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t}\n\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function trim( value ) {\r\n\t\r\n return LTrim(RTrim(value));\r\n\t\r\n }", "function trim( value ) {\n return LTrim(RTrim(value));\n}", "function trim( value ) {\r\n\t\treturn LTrim(RTrim(value));\r\n\t}", "function trim( value ) {\r\n return LTrim(RTrim(value));\r\n}", "function trim( value ) {\n\n return LTrim(RTrim(value));\n\n}", "function dropEndingNewline(string) {\n\t return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n\t}", "function dropEndingNewline(string) {\n\t return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n\t}", "function dropEndingNewline(string) {\n\t return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n\t}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n}", "function trim(value) {\n return LTrim(RTrim(value));\n}", "function trim( value )\n{\n\n return LTrim(RTrim(value));\n\n}", "function trim( value ) {\r\n\treturn LTrim(RTrim(value));\r\n}", "function dropEndingNewline$1(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\t\t\tvar rng, container, offset;\n\n\t\t\t\t\trng = selection.getRng(true);\n\t\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\t\toffset = rng.startOffset;\n\n\t\t\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\t\t\tvalue = ' ' + value;\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}", "function RTrim( value ) {\r\n\r\n var re = /((\\s*\\S+)*)\\s*/;\r\n return value.replace(re, \"$1\");\r\n\r\n}", "function LTrim( value ) {\r\n\t\tvar re = /\\s*((\\S+\\s*)*)/;\r\n\t\treturn value.replace(re, \"$1\");\r\n\t}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}", "function trim(value) {\n\tif (value) {\n\t\treturn ltrim(rtrim(value));\n\t}\n\treturn '';\n}", "function trim( value )\r\n{\r\n return LTrim(RTrim(value));\r\n}", "function trim( value ) {\r\n\t\r\n\treturn LTrim(RTrim(value));\r\n\t\r\n}", "function trim( value )\r\n{\r\n\t\r\n\treturn LTrim(RTrim(value));\r\n\t\r\n}", "function trim(value) {\n return value.replace(/^\\s+|\\s+$/g, \"\");\n}", "normalizeLine (line) {\n return line.replace('\\r', '')\n }", "function stripAndCollapse( value ) {\n var tokens = value.match( rnothtmlwhite ) || [];\n return tokens.join( \" \" );\n }", "function nullf(){}", "function LTrim( value ) {\t\r\n var re = /\\s*((\\S+\\s*)*)/;\r\n return value.replace(re, \"$1\");\r\n\r\n}", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function stripAndCollapse( value ) {\n var tokens = value.match( rnothtmlwhite ) || [];\n return tokens.join( \" \" );\n }", "function normalize(s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function normalize(s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function normalize(s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function normalize(s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function normalize(s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function normalize(s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function normalize(s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function normalize(s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function normalize(s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function normalize(s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function LTrim( value ) {\n\tvar re = /\\s*((\\S+\\s*)*)/;\n\treturn value.replace(re, \"$1\");\n}", "function LTrim( value ) {\n\n var re = /\\s*((\\S+\\s*)*)/;\n return value.replace(re, \"$1\");\n\n}", "function normalize (s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function normalize (s) {\n return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n }", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}" ]
[ "0.79480493", "0.7229775", "0.7213269", "0.7213269", "0.7213269", "0.69982606", "0.6687853", "0.6399552", "0.63851583", "0.6329458", "0.6270205", "0.6220877", "0.6215881", "0.6215881", "0.62151474", "0.62026143", "0.6172999", "0.6161238", "0.61498433", "0.61375123", "0.61375123", "0.61375123", "0.61240065", "0.61059636", "0.61029947", "0.6101714", "0.60960656", "0.6089448", "0.6089448", "0.6089448", "0.6079108", "0.60708886", "0.60646635", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.60634214", "0.605627", "0.6043817", "0.60172826", "0.5983574", "0.5969321", "0.5962896", "0.5952801", "0.59456474", "0.5944363", "0.5941342", "0.5941342", "0.5941342", "0.5941342", "0.5941342", "0.5941342", "0.59387094", "0.5933322", "0.5933322", "0.5933322", "0.5933322", "0.5933322", "0.5933322", "0.5933322", "0.5933322", "0.5933322", "0.5933322", "0.59083605", "0.5906906", "0.5898475", "0.5898475", "0.5879138", "0.5879138", "0.5879138", "0.5879138", "0.5879138", "0.5879138", "0.5879138", "0.5879138", "0.5879138", "0.5879138", "0.5879138", "0.5879138" ]
0.7208231
6
Normalize an identifier. Collapses multiple white space characters into a single space, and removes casing.
function normalize(value) { return collapseWhiteSpace(value).toLowerCase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalize(name) {\n return name.replace(/[- _]+/g, '').toLowerCase();\n }", "function normalize(name) {\n return name.replace(/[- _]+/g, '').toLowerCase();\n }", "function normalizeName(name) {\n s = name;\n var pos = 0;\n while (true)\n {\n pos = s.search(' ');\n if (pos === -1) return s;\n else s = s.replace(' ','_');\n }\n}", "function directiveNormalize(name){return name.replace(PREFIX_REGEXP,'').replace(SPECIAL_CHARS_REGEXP,fnCamelCaseReplace);}", "function normalizeName(name) {\n return name\n .toUpperCase()\n .replace(/[^A-Z0-9]/g, \" \")\n .trim()\n .split(/\\s+/)\n .join(\"_\");\n}", "function directiveNormalize(name){return name.replace(PREFIX_REGEXP,'').replace(SPECIAL_CHARS_REGEXP,function(_,separator,letter,offset){return offset?letter.toUpperCase():letter;});}", "function normalize(word) {\n return word.toLowerCase().replace(/[.!,//]/g, \"\");\n}", "function normalize(val) {\n\treturn val; /* disable me for now */\n\n if(!val) return \"\"; \n\n var newVal = '';\n try {val = val.split(' ');} catch(E) {return val;}\n var reg = /\\w/;\n\n for( var c = 0; c < val.length; c++) {\n\n var string = val[c];\n var cap = false; \n for(var x = 0; x != string.length; x++) {\n\n if(!cap) {\n var ch = string.charAt(x);\n if(reg.exec(ch + \"\")) {\n newVal += string.charAt(x).toUpperCase();\n cap = true;\n continue;\n }\n }\n\n newVal += string.charAt(x).toLowerCase();\n }\n if(c < (val.length-1)) newVal += \" \";\n }\n\n newVal = newVal.replace(/\\s*\\.\\s*$/,'');\n newVal = newVal.replace(/\\s*\\/\\s*\\/\\s*$/,' / ');\n newVal = newVal.replace(/\\s*\\/\\s*$/,'');\n\n return newVal;\n}", "function normalize(value) {\n return collapseWhiteSpace(value).toLowerCase()\n}", "function directiveNormalize(name) { // 8950\n return camelCase(name.replace(PREFIX_REGEXP, '')); // 8951\n} // 8952", "function normalize(string) {\n\t return string.replace(/[\\s,]+/g, ' ').trim();\n\t}", "function normalize(word) {\n return stem(word.toLowerCase()).replace(/[^a-z]/g, '');\n}", "function normalize(word) {\n return stem(word.toLowerCase()).replace(/[^a-z]/g, '');\n}", "function directiveNormalize(name){return camelCase(name.replace(PREFIX_REGEXP,''));}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}", "function toIdentifier(str){return str.split(' ').map(function(token){return token.slice(0,1).toUpperCase()+token.slice(1);}).join('').replace(/[^ _0-9a-z]/gi,'');}", "function normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n }", "function directiveNormalize(name) {\n\t return name\n\t .replace(PREFIX_REGEXP, '')\n\t .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) {\n\t return offset ? letter.toUpperCase() : letter;\n\t });\n\t}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n }", "function normalizeString(s) {\n s = s.replace(whtSpMult, \" \"); // Collapse any multiple whites space.\n s = s.replace(whtSpEnds, \"\"); // Remove leading or trailing white space.\n return (s);\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, fnCamelCaseReplace);\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, fnCamelCaseReplace);\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, fnCamelCaseReplace);\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, fnCamelCaseReplace);\n}", "function normalizeIdentifier(identifier) {\n return identifier > 20 ? identifier % 20 : identifier;\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n }", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n }", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n }", "normalizeString(name) {\n return name.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n }", "function normalize(name) {\n return name.toLowerCase();\n}", "function toIdentifier (str) {\n\t return str.split(' ').map(function (token) {\n\t return token.slice(0, 1).toUpperCase() + token.slice(1)\n\t }).join('').replace(/[^ _0-9a-z]/gi, '')\n\t}", "function sanitize (word) {\n return word.toLowerCase().trim().split(' ').join('_');\n }", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n}", "function standardize(str) { \r\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '').toLowerCase();\r\n}", "function directiveNormalize(name) {\n\t return camelCase(name.replace(PREFIX_REGEXP, ''));\n\t}", "function denormalize(str) {\n return str.replace(/\\W+/g, '-')\n .replace(/([a-z\\d])([A-Z])/g, '$1-$2').toLowerCase();\n }", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n }", "function directiveNormalize(name) {\n\t\treturn camelCase(name.replace(PREFIX_REGEXP, ''));\n\t}", "function directiveNormalize(name) {\n\t\treturn camelCase(name.replace(PREFIX_REGEXP, ''));\n\t}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n }", "function idify ( text ) {\n return text.replace( /\\([^)]+\\)/, \"\" ).trim().toLowerCase().replace( /\\W+/g, '_' );\n}", "normalizeForIndex(word) {\n word = stripAnyAttributes(word);\n if (this.options.IgnoreWhiteSpaceDifferences && isWhiteSpace(word)) {\n return ' ';\n }\n\n return word;\n }", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "function normalizeTitle(title)\n {\n return title.replace(/^_+/, \"\").replace(/_+$/, \"\").replace(/[\\s_]+/g, \"_\")\n }", "function normalizeTitle(title)\n {\n return title.replace(/^_+/, \"\").replace(/_+$/, \"\").replace(/[\\s_]+/g, \"_\")\n }", "function normalizeAttributeName( attributeName ) {\n\t\tattributeName = attributeName.replace( rDataAttrPrefix, \"\" );\n\n\t\t//if subscription involve with more than one events, you can\n\t\t//concatenate them with \"_\", here we need to revert them back\n\t\t//such as \"$click_mouseover\" need to be changed to \"$click mouseover\"\n\t\tif (attributeName.startsWith( \"!\" ) || attributeName.startsWith( \"$\" )) {\n\n\t\t\tattributeName = attributeName.replace( reUnderscore, \" \" );\n\n\t\t}\n\t\treturn attributeName.replace( reAttrDash, replaceAttrDashWithCapitalCharacter );\n\t}", "function standardize(input)\n {\n \tinput = input.toLowerCase();\n\n \t//supposed to remove vowels and spaces\n \tinput = input.replace(/[\\s_]/g, '');\n \treturn input;\n }", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}" ]
[ "0.664014", "0.664014", "0.66295314", "0.65128195", "0.6494406", "0.6434182", "0.642196", "0.6413547", "0.63303286", "0.6327255", "0.63266134", "0.63184613", "0.63184613", "0.63148844", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.62675434", "0.62669253", "0.62584674", "0.62244993", "0.6223409", "0.62228405", "0.62228405", "0.62228405", "0.62228405", "0.62225145", "0.6197799", "0.6197799", "0.6197799", "0.61952996", "0.6163168", "0.6149809", "0.6147159", "0.6134513", "0.6134513", "0.6134513", "0.6134513", "0.6065008", "0.60637367", "0.6061975", "0.6054618", "0.6052813", "0.6052813", "0.6049893", "0.60471255", "0.6044059", "0.598831", "0.598831", "0.598831", "0.598831", "0.598831", "0.598831", "0.598831", "0.598831", "0.598831", "0.598831", "0.598831", "0.598831", "0.598831", "0.598726", "0.598726", "0.59872115", "0.5978893", "0.5917757", "0.5917757", "0.5917757", "0.5917757", "0.5917757", "0.5917757", "0.5917757", "0.5917757", "0.5917757", "0.5917757", "0.5917757", "0.5917757", "0.5917757", "0.5917757", "0.5917757" ]
0.631888
14
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n if (each.score >= 0.4) {\n objectDescription = objectDescription + \", \" + each.class\n }\n })\n tj.speak(\"The objects I see are: \" + objectDescription)\n });\n}", "function recommendNewPosts() {\n model.loadModel();\n getNewPosts(function (err, posts) {\n var label\n ;\n posts.forEach(function (post) {\n label = model.classifyPost(post);\n if (label == 'like') {\n console.log(post);\n }\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 like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "function LanguageUnderstandingModel() {\n }", "function guess() {\n classifier.predict(video.elt, 5, gotResult);\n}", "function theBigBang() {\n\t\tinitLibs();\n\t\tinitFuncs();\n\t\tObject.setPrototypeOf(Universe.prototype, universe.kjsclasses._primitive_prototype);\n\t\tObject.setPrototypeOf(Object.prototype, universe); // [0]\n\t}", "function readOwn(obj, name, pumpkin) {\n if (typeof obj !== 'object' || !obj) {\n if (typeOf(obj) !== 'object') {\n return pumpkin;\n }\n }\n if (typeof name === 'number' && name >= 0) {\n if (myOriginalHOP.call(obj, name)) { return obj[name]; }\n return pumpkin;\n }\n name = String(name);\n if (obj[name + '_canRead___'] === obj) { return obj[name]; }\n if (!myOriginalHOP.call(obj, name)) { return pumpkin; }\n // inline remaining relevant cases from canReadPub\n if (endsWith__.test(name)) { return pumpkin; }\n if (name === 'toString') { return pumpkin; }\n if (!isJSONContainer(obj)) { return pumpkin; }\n fastpathRead(obj, name);\n return obj[name];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach(function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)})}", "function NXObject() {}", "function isPrimative(val) { return (typeof val !== 'object') }", "function like (data, duck) {\n var name;\n\n assert.object(data);\n assert.object(duck);\n\n for (name in duck) {\n if (duck.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof duck[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], duck[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "static get observedAttributes() {\n return ['rainbow', 'lang'];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach((function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)}))}", "function testSimpleHole_prototype() {\n var theHole = Object.create({ x: \"in proto\" });\n var theReplacement = \"yay\";\n var serialized = bidar.serialize(theHole, holeFilter);\n var parsed = bidar.parse(serialized, holeFiller);\n\n assert.equal(parsed, theReplacement);\n\n function holeFilter(x) {\n assert.equal(x, theHole);\n return { data: \"blort\" };\n }\n\n function holeFiller(x) {\n assert.equal(x, \"blort\");\n return theReplacement;\n }\n}", "function test() {\n\t// \"ex nihilo\" object creation using the literal\n\t// object notation {}.\n\tvar foo = {\n\t\tname : \"foo\",\n\t\tone : 1,\n\t\ttwo : 2\n\t};\n\n\t// Another \"ex nihilo\" object.\n\tvar bar = {\n\t\ttwo : \"two\",\n\t\tthree : 3\n\t};\n\n\t// Gecko and Webkit JavaScript engines can directly\n\t// manipulate the internal prototype link.\n\t// For the sake of simplicity, let us pretend\n\t// that the following line works regardless of the\n\t// engine used:\n\tbar.__proto__ = foo; // foo is now the prototype of bar.\n\n\t// If we try to access foo's properties from bar\n\t// from now on, we'll succeed.\n\tlog(bar.one) // Resolves to 1.\n\n\t// The child object's properties are also accessible.\n\tlog(bar.three) // Resolves to 3.\n\n\t// Own properties shadow prototype properties\n\tlog(bar.two); // Resolves to \"two\"\n\tlog(foo.name); // unaffected, resolves to \"foo\"\n\tlog(bar.name); // Resolves to \"foo\"\n log(foo.__proto__);\n}", "function wrappedPrimitivePreviewer(className, classObj, objectActor, grip) {\r\n let {_obj} = objectActor;\r\n\r\n if (!_obj.proto || _obj.proto.class != className) {\r\n return false;\r\n }\r\n\r\n let raw = _obj.unsafeDereference();\r\n let v = null;\r\n try {\r\n v = classObj.prototype.valueOf.call(raw);\r\n } catch (ex) {\r\n // valueOf() can throw if the raw JS object is \"misbehaved\".\r\n return false;\r\n }\r\n\r\n if (v === null) {\r\n return false;\r\n }\r\n\r\n let canHandle = GenericObject(objectActor, grip, className === \"String\");\r\n if (!canHandle) {\r\n return false;\r\n }\r\n\r\n grip.preview.wrappedValue = objectActor.getGrip(makeDebuggeeValueIfNeeded(_obj, v));\r\n return true;\r\n}", "function DartObject(o) {\n this.o = o;\n}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function likeVsLikes(toyLikeCount){\n\t\tif (toyLikeCount == 1){\n\t\t\treturn 'Like';\n\t\t} else {\n\t\t\treturn 'Likes';\n\t\t}\n\t}", "constructor(spec) {\n this.cached = /* @__PURE__ */ Object.create(null);\n let instanceSpec = this.spec = {};\n for (let prop in spec)\n instanceSpec[prop] = spec[prop];\n instanceSpec.nodes = OrderedMap.from(spec.nodes), instanceSpec.marks = OrderedMap.from(spec.marks || {}), this.nodes = NodeType$1.compile(this.spec.nodes, this);\n this.marks = MarkType.compile(this.spec.marks, this);\n let contentExprCache = /* @__PURE__ */ Object.create(null);\n for (let prop in this.nodes) {\n if (prop in this.marks)\n throw new RangeError(prop + \" can not be both a node and a mark\");\n let type = this.nodes[prop], contentExpr = type.spec.content || \"\", markExpr = type.spec.marks;\n type.contentMatch = contentExprCache[contentExpr] || (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));\n type.inlineContent = type.contentMatch.inlineContent;\n type.markSet = markExpr == \"_\" ? null : markExpr ? gatherMarks(this, markExpr.split(\" \")) : markExpr == \"\" || !type.inlineContent ? [] : null;\n }\n for (let prop in this.marks) {\n let type = this.marks[prop], excl = type.spec.excludes;\n type.excluded = excl == null ? [type] : excl == \"\" ? [] : gatherMarks(this, excl.split(\" \"));\n }\n this.nodeFromJSON = this.nodeFromJSON.bind(this);\n this.markFromJSON = this.markFromJSON.bind(this);\n this.topNodeType = this.nodes[this.spec.topNode || \"doc\"];\n this.cached.wrappings = /* @__PURE__ */ Object.create(null);\n }", "wordClass(word) {\r\n return {\r\n der: word.artikel == \"der\",\r\n die: word.artikel == \"die\",\r\n das: word.artikel == \"das\",\r\n marked: word.marker\r\n }\r\n }", "function dummyObjects(name, age){\n this.name = name\n this.age = age\n}", "function handleLikes() {\n // Get a random number\n let randomNumber = Math.random();\n // To make it unpredictable, only change the likes if =>\n if (randomNumber < REVEAL_PROBABILITY) {\n defineLikes();\n }\n}", "constructor() { \n \n Like.initialize(this);\n }", "like() {\r\n return this.clone(Comment, \"Like\").postCore();\r\n }", "like() {\r\n return this.getItem().then(i => {\r\n return i.like();\r\n });\r\n }", "added(vrobject){}", "classify(phrase) { return this.clf.classify(phrase) }", "function badIdea(){\n this.idea = \"bad\";\n}", "shouldSerialize(prop, dataKey) {\n const contains = (str, re) => (str.match(re) || []).length > 0;\n const a = contains(dataKey, /\\./g);\n const b = contains(dataKey, /\\[/g);\n return !!prop.object && !(a || b);\n }", "static get observedAttributes(){this.finalize();const e=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nreturn this._classProperties.forEach((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))}),e}", "function oldAndLoud(object){\n\tobject.age++;\n\tobject.name = object.name.toUpperCase();\n}", "like() {\r\n return this.clone(Item, \"like\").postCore();\r\n }", "function classifyPose() {\n if (pose && working) {\n inputs = [];\n for (let i = 0; i < pose.landmarks.length; i++) {\n inputs.push(pose.landmarks[i][0]);\n inputs.push(pose.landmarks[i][1]);\n inputs.push(pose.landmarks[i][2]);\n }\n brain.classify(inputs, gotResult)\n }\n }", "function PropertyDetection() {}", "constructor()\n {\n this.likes = [];\n }", "async TestLikeDoctorPost(){\n var response = await entity.Likes(6,28,true,true);\n //console.log(response)\n if(response != null){\n console.log(\"\\x1b[32m%s\\x1b[0m\",\"TestDOctorRating Passed\");\n }else{\n console.log(\"\\x1b[31m%s\\x1b[0m\",\"TestDOctorRating Failed\");\n }\n\n }", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function showLikes(likes) {\n\tconsole.log(`THINGS I LIKE:\\n`);\n\tfor(let like of likes) {\n\t\tconsole.log(like);\n\t}\n}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function Nevis() {}", "function Nevis() {}", "function Nevis() {}", "test_primitivesExtended() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitivesExtended);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.PrimitivesExtended\", object.constructor.__getClass());\n Assert.equals(\"alpha16\", object.string);\n }", "function buildObjectsObj(gCloudV, azureCV, minScore = 0.0){\n let objects = [];\n\n if(gCloudV) {// gcloud vision results are available\n let gCloudObjects = gCloudV['localizedObjectAnnotations'];\n\n //apply standard bounding box to all the detected objects\n if(azureCV)// azure computer vision results are available\n gCloudVObjsToCogniBoundingBox(gCloudObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n\n else//need to retrieve image sizes from gcloud (already done and put in the metadata tag of gcloudv with appropriate calls)\n gCloudVObjsToCogniBoundingBox(gCloudObjects, gCloudV['metadata']['width'], gCloudV['metadata']['height']);\n\n for (let gCloudObj of gCloudObjects) {\n if (gCloudObj['score'] > minScore) { //filter out unwanted tags\n objects.push({\n name: gCloudObj['name'],\n mid: (gCloudObj['mid'] && gCloudObj['mid']!= '')? gCloudObj['mid']: undefined,\n confidence: gCloudObj['score'],\n boundingBox: gCloudObj['boundingBox']\n });\n }\n }\n }\n\n if(azureCV){// azure computer vision results are available\n let azureObjects = azureCV['objects'];\n //apply standard bounding box to all the detected objects\n azureCVObjsToCogniBoundingBox(azureObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n for(let aObj of azureObjects){\n if(aObj['confidence'] > minScore) { //filter out unwanted tags\n objects.push({\n name: aObj['object'],\n confidence: aObj['confidence'],\n boundingBox: aObj['boundingBox']\n });\n }\n }\n }\n\n objects = combineObjectsArray(objects);// build an array where labels regarding the same exact object are combined with averaged confidence\n\n objects.sort((a, b) => {\n if(a['confidence']>b['confidence'])\n return -1;\n else if(a['confidence']==b['confidence'])\n return 0;\n else\n return 1;\n });\n\n return objects;\n}", "function V(e){if(null===e||\"[object Object]\"!==function(e){return Object.prototype.toString.call(e)}(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}", "function classifyVideo() {\r\n classifier.classify(vid, gotResult);\r\n\r\n}", "function test_nountag_does_not_think_it_has_watch_tag_when_it_does_not() {\n Assert.equal(TagNoun.fromJSON(\"watch\"), undefined);\n}", "function v11(v12,v13) {\n const v15 = v11(Object,Function);\n // v15 = .unknown\n const v16 = Object(v13,v8,0,v6);\n // v16 = .object()\n const v17 = 0;\n // v17 = .integer\n const v18 = 1;\n // v18 = .integer\n const v19 = 512;\n // v19 = .integer\n const v20 = \"-1024\";\n // v20 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v21 = isFinite;\n // v21 = .function([.anything] => .boolean)\n const v23 = [1337];\n // v23 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v24 = {};\n // v24 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v25 = v23;\n const v26 = -29897853;\n // v26 = .integer\n const v27 = \"replace\";\n // v27 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v28 = Boolean;\n // v28 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v30 = [13.37,13.37];\n // v30 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v31 = 1337;\n // v31 = .integer\n let v32 = 13.37;\n const v36 = [13.37,13.37,13.37];\n // v36 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v38 = [1337,1337];\n // v38 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v39 = [13.37,1337,v38,1337,\"-128\",13.37,\"-128\",\"-128\",2147483647,1337];\n // v39 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v40 = {__proto__:v36,length:v39};\n // v40 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"length\"])\n const v41 = \"0\";\n // v41 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v42 = -4130093409;\n // v42 = .integer\n const v44 = {b:2147483647,e:v38,valueOf:v36};\n // v44 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\", \"valueOf\", \"e\"])\n const v45 = \"k**baeaDif\";\n // v45 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v46 = 65536;\n // v46 = .integer\n const v47 = \"k**baeaDif\";\n // v47 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v48 = 13.37;\n // v48 = .float\n const v50 = [13.37,13.37];\n // v50 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v51 = ~v50;\n // v51 = .boolean\n const v53 = [13.37];\n // v53 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n let v54 = v53;\n const v55 = gc;\n // v55 = .function([] => .undefined)\n const v58 = [13.37,13.37,13.37,13.37];\n // v58 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v60 = [1337,1337,1337,1337];\n // v60 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v61 = [3697200800,v58,v60];\n // v61 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v62 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v61};\n // v62 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"length\", \"constructor\", \"toString\", \"valueOf\"])\n const v65 = [13.37,13.37,13.37,13.37];\n // v65 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v67 = [1337,1337,1337,1337];\n // v67 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v68 = [3697200800,v65,v67];\n // v68 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v69 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v68};\n // v69 = .object(ofGroup: Object, withProperties: [\"e\", \"constructor\", \"__proto__\", \"length\", \"toString\", \"valueOf\"])\n const v70 = Object;\n // v70 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n function v71(v72) {\n }\n const v74 = [13.37];\n // v74 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v75 = 1337;\n // v75 = .integer\n const v76 = v44 ** 13.37;\n // v76 = .integer | .float | .bigint\n function v77(v78,v79,v80,v81,v82) {\n }\n let v83 = v74;\n const v84 = \"2\";\n // v84 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v85 = \"2\";\n // v85 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v88 = [13.37,13.37,1337,13.37];\n // v88 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v89(v90,v91,v92) {\n }\n const v94 = [1337,1337,1337,1337];\n // v94 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v95 = [3697200800,v88,v94];\n // v95 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v96(v97,v98) {\n }\n const v99 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,d:v95};\n // v99 = .object(ofGroup: Object, withProperties: [\"toString\", \"length\", \"constructor\", \"__proto__\", \"e\", \"d\"])\n let v100 = 13.37;\n const v101 = typeof v74;\n // v101 = .string\n const v102 = \"symbol\";\n // v102 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v103 = 3697200800;\n // v103 = .integer\n const v104 = \"2\";\n // v104 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v105 = Boolean;\n // v105 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v106 = Function;\n // v106 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v107 = 13.37;\n // v107 = .float\n const v108 = 1337;\n // v108 = .integer\n const v109 = \"2\";\n // v109 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v110 = Function;\n // v110 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v112 = [13.37,13.37,13.37,13.37];\n // v112 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v113 = 1337;\n // v113 = .integer\n let v114 = 13.37;\n const v116 = {...3697200800,...3697200800};\n // v116 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n const v117 = Object;\n // v117 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v118 = Function;\n // v118 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v119 = {};\n // v119 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v120 = v119;\n const v121 = (3697200800).constructor;\n // v121 = .unknown\n function v122(v123,v124) {\n }\n const v125 = Promise;\n // v125 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"race\", \"allSettled\", \"reject\", \"all\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"]))\n const v128 = 4;\n // v128 = .integer\n let v129 = 0;\n const v131 = [13.37,13.37,13.37,13.37];\n // v131 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v133 = [1337,1337,1337,1337];\n // v133 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v134 = [3697200800,v131,v133];\n // v134 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v135 = Object;\n // v135 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v136 = -944747134;\n // v136 = .integer\n const v139 = [13.37,13.37,13.37,13.37];\n // v139 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v141 = [1337,1337,1337,1337];\n // v141 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v142 = [3697200800,v139,v141];\n // v142 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v143 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v142};\n // v143 = .object(ofGroup: Object, withProperties: [\"toString\", \"constructor\", \"e\", \"__proto__\", \"valueOf\", \"length\"])\n let v144 = v143;\n const v145 = gc;\n // v145 = .function([] => .undefined)\n let v146 = 13.37;\n const v150 = [13.37,13.37,13.37,Function];\n // v150 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v152 = [1337,1337,1337,1337];\n // v152 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v153 = [3697200800,v150,v152];\n // v153 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v154 = v153 + 1;\n // v154 = .primitive\n let v155 = 0;\n const v156 = v155 + 1;\n // v156 = .primitive\n const v158 = \"2\";\n // v158 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v160 = [13.37,13.37,13.37,13.37];\n // v160 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v162 = 0;\n // v162 = .integer\n const v163 = [1337,1337,1337,1337];\n // v163 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v164 = [3697200800,1337,v163];\n // v164 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v166 = 1337;\n // v166 = .integer\n let v167 = 2594067260;\n const v169 = 4;\n // v169 = .integer\n let v170 = 0;\n const v171 = v167 + 1;\n // v171 = .primitive\n const v172 = {__proto__:3697200800,constructor:v163,e:3697200800,length:13.37,toString:3697200800,valueOf:v164};\n // v172 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"constructor\", \"valueOf\", \"length\", \"toString\"])\n const v173 = 0;\n // v173 = .integer\n const v174 = 5;\n // v174 = .integer\n const v175 = 2937513072;\n // v175 = .integer\n const v176 = Object;\n // v176 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v177 = v172.constructor;\n // v177 = .unknown\n const v178 = 0;\n // v178 = .integer\n const v179 = 1;\n // v179 = .integer\n try {\n } catch(v180) {\n const v182 = [13.37,13.37,13.37,13.37];\n // v182 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v183 = v182.__proto__;\n // v183 = .object()\n function v185(v186) {\n }\n const v187 = Object >>> v183;\n // v187 = .integer | .bigint\n }\n function v188(v189,v190,v191,v192,...v193) {\n }\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "transient private internal function m185() {}", "function rekognizeLabels(bucket, key) {\n let params = {\n Image: {\n S3Object: {\n Bucket: bucket,\n Name: key\n }\n },\n MaxLabels: 3,\n MinConfidence: 80\n };\n\n return rekognition.detectLabels(params).promise()\n}", "test_doNotRetainAnno(){\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.doNotRetainAnno);\n let object1 = translator.decode(text).getRoot();\n let object2 = translator.decode(text).getRoot();\n\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object1.constructor.__getClass());\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object2.constructor.__getClass());\n Assert.notEquals(object1, object2);\n }", "function LK_likeIt(elem) {\n var likeGroup = elem.getAttribute(LK_LIKEGROUP);\n var likeValue = elem.getAttribute(LK_LIKEVALUE);\n localStorage[likeGroup] = likeValue;\n\n // Change the style of the liker nodes\n var siblings = elem.parentNode.childNodes;\n for (var i = 0; i < siblings.length; i++) {\n if (siblings[i].style) { \n LK_applyNormalStyle(siblings[i]);\n }\n }\n LK_applySelectedStyle(elem, likeValue);\n\n // Change the value of any mini likers\n var allSpans = document.getElementsByTagName('span');\n for (var i = 0; i < allSpans.length; i++) {\n var span = allSpans[i];\n if (span.getAttribute(LK_LIKEGROUP) == likeGroup) {\n if (span.getAttribute(LK_LIKETYPE) == 'mini') {\n span.innerHTML = LK_MAPPINGS[likeValue].label;\n LK_applySelectedStyle(allSpans[i], likeValue);\n }\n }\n }\n}", "function OOPExample(who) {\n this.me = who;\n}", "getLikes(state, data) {\n state.likes = data\n }", "function _isAlternativeRecognitionResult(obj) {\r\n return obj && typeof obj === 'object';\r\n}", "function addLikes() {\n if (propLike?.includes(user.username)) {\n let index = propLike.indexOf(user.username);\n let removeLike = [\n ...propLike.slice(0, index),\n ...propLike.slice(index + 1),\n ];\n setLikeGet(removeLike);\n setPropLike(removeLike);\n setRedLike(\"\");\n\n addToLike(eventid, removeLike);\n } else {\n let likesArr = [...propLike, `${user.username}`];\n\n setLikeGet(likesArr);\n setPropLike(likesArr);\n setRedLike(\"red\");\n addToLike(eventid, likesArr);\n }\n }", "function LiteralObject() {\r\n}", "function Komunalne() {}", "function Bevy() {}", "function Prediction() {\n this.score = {};\n}", "function Object() {}", "function Object() {}", "function canEnumPub(obj, name) {\n if (obj === null) { return false; }\n if (obj === void 0) { return false; }\n name = String(name);\n if (obj[name + '_canEnum___']) { return true; }\n if (endsWith__.test(name)) { return false; }\n if (!isJSONContainer(obj)) { return false; }\n if (!myOriginalHOP.call(obj, name)) { return false; }\n fastpathEnum(obj, name);\n if (name === 'toString') { return true; }\n fastpathRead(obj, name);\n return true;\n }", "function Obj(){ return Literal.apply(this,arguments) }", "test_primitives() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitives);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.Primitives\", object.constructor.__getClass());\n Assert.equals(\"alpha9\", object.string);\n }", "function hello()\n{\n /* ATTRIBUTES */\n this.coolbeans = 'class';\n this.something = 'hello-class';\n\n}", "function test_cluster_tagged_crosshair_op_vsphere65() {}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "constructor(papa,mummy,sivlings,belongs,loving_bro,favs_bro){\n super(papa,mummy,sivlings,belongs)\n this.loving_bro=loving_bro\n this.favs_bro=favs_bro\n }", "function v8(v9,v10) {\n const v16 = [1337,1337];\n // v16 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v17 = [\"536870912\",-3848843708,v16,-3848843708,1337,13.37,13.37,WeakMap,-3848843708];\n // v17 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v18 = {constructor:13.37,e:v16};\n // v18 = .object(ofGroup: Object, withProperties: [\"constructor\", \"e\", \"__proto__\"])\n const v19 = {__proto__:-3848843708,a:v18,b:-3848843708,constructor:1337,d:v18,e:v17,length:WeakMap};\n // v19 = .object(ofGroup: Object, withProperties: [\"d\", \"b\", \"a\", \"__proto__\", \"e\", \"constructor\", \"length\"])\n const v21 = new Float64Array(v19);\n // v21 = .object(ofGroup: Float64Array, withProperties: [\"byteOffset\", \"constructor\", \"buffer\", \"__proto__\", \"byteLength\", \"length\"], withMethods: [\"map\", \"values\", \"subarray\", \"find\", \"fill\", \"set\", \"findIndex\", \"some\", \"reduceRight\", \"reverse\", \"join\", \"includes\", \"entries\", \"reduce\", \"every\", \"copyWithin\", \"sort\", \"forEach\", \"lastIndexOf\", \"indexOf\", \"filter\", \"slice\", \"keys\"])\n v6[6] = v7;\n v7.toString = v9;\n }", "function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol[\"a\" /* default */]) {\n classObject.prototype[nodejsCustomInspectSymbol[\"a\" /* default */]] = fn;\n }\n}", "annotate(message: string, data: Object) {\n this.message = message;\n this.data = assign(this.data, data);\n }", "function encodeObject(o) {\n if (_.isNumber(o)) {\n if (_.isNaN(o)) {\n return ['SPECIAL_FLOAT', 'NaN'];\n } else if (o === Infinity) {\n return ['SPECIAL_FLOAT', 'Infinity'];\n } else if (o === -Infinity) {\n return ['SPECIAL_FLOAT', '-Infinity'];\n } else {\n return o;\n }\n } else if (_.isString(o)) {\n return o;\n } else if (_.isBoolean(o) || _.isNull(o) || _.isUndefined(o)) {\n return ['JS_SPECIAL_VAL', String(o)];\n } else if (typeof o === 'symbol') {\n // ES6 symbol\n return ['JS_SPECIAL_VAL', String(o)];\n } else {\n // render these as heap objects\n\n // very important to use _.has since we don't want to\n // grab the property in your prototype, only in YOURSELF ... SUBTLE!\n if (!_.has(o, 'smallObjId_hidden_')) {\n // make this non-enumerable so that it doesn't show up in\n // console.log() or other inspector functions\n Object.defineProperty(o, 'smallObjId_hidden_', { value: smallObjId,\n enumerable: false });\n smallObjId++;\n }\n assert(o.smallObjId_hidden_ > 0);\n\n var ret = ['REF', o.smallObjId_hidden_];\n\n if (encodedHeapObjects[String(o.smallObjId_hidden_)] !== undefined) {\n return ret;\n }\n else {\n assert(_.isObject(o));\n\n var newEncodedObj = [];\n encodedHeapObjects[String(o.smallObjId_hidden_)] = newEncodedObj;\n\n var i;\n\n if (_.isFunction(o)) {\n var funcProperties = []; // each element is a pair of [name, encoded value]\n\n var encodedProto = null;\n if (_.isObject(o.prototype)) {\n // TRICKY TRICKY! for inheritance to be displayed properly, we\n // want to find the prototype of o.prototype and see if it's\n // non-empty. if that's true, then even if o.prototype is\n // empty (i.e., has no properties of its own), then we should\n // still encode it since its 'prototype' \"uber-hidden\n // property\" is non-empty\n var prototypeOfPrototype = Object.getPrototypeOf(o.prototype);\n if (!_.isEmpty(o.prototype) ||\n (_.isObject(prototypeOfPrototype) && !_.isEmpty(prototypeOfPrototype))) {\n encodedProto = encodeObject(o.prototype);\n }\n }\n\n if (encodedProto) {\n funcProperties.push(['prototype', encodedProto]);\n }\n\n // now get all of the normal properties out of this function\n // object (it's unusual to put properties in a function object,\n // but it's still legal!)\n var funcPropPairs = _.pairs(o);\n for (i = 0; i < funcPropPairs.length; i++) {\n funcProperties.push([funcPropPairs[i][0], encodeObject(funcPropPairs[i][1])]);\n }\n\n var funcCodeString = o.toString();\n\n /*\n\n #craftsmanship -- make nested functions look better by indenting\n the first line of a nested function definition by however much\n the LAST line is indented, ONLY if the last line is simply a\n single ending '}'. otherwise it will look ugly since the\n function definition doesn't start out indented, like so:\n\nfunction bar(x) {\n globalZ += 100;\n return x + y + globalZ;\n }\n\n */\n var codeLines = funcCodeString.split('\\n');\n if (codeLines.length > 1) {\n var lastLine = _.last(codeLines);\n if (lastLine.trim() === '}') {\n var lastLinePrefix = lastLine.slice(0, lastLine.indexOf('}'));\n funcCodeString = lastLinePrefix + funcCodeString; // prepend!\n }\n }\n\n newEncodedObj.push('JS_FUNCTION',\n o.name,\n funcCodeString, /* code string*/\n funcProperties.length ? funcProperties : null, /* OPTIONAL */\n null /* parent frame */);\n } else if (_.isArray(o)) {\n newEncodedObj.push('LIST');\n for (i = 0; i < o.length; i++) {\n newEncodedObj.push(encodeObject(o[i]));\n }\n } else if (o.__proto__.toString() === canonicalSet.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n newEncodedObj.push('SET');\n // ES6 Set (TODO: add WeakSet)\n for (let item of o) {\n newEncodedObj.push(encodeObject(item));\n }\n } else if (o.__proto__.toString() === canonicalMap.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n // ES6 Map (TODO: add WeakMap)\n newEncodedObj.push('DICT'); // use the Python 'DICT' type since it's close enough; adjust display in frontend\n for (let [key, value] of o) {\n newEncodedObj.push([encodeObject(key), encodeObject(value)]);\n }\n } else {\n // a true object\n\n // if there's a custom toString() function (note that a truly\n // prototypeless object won't have toString method, so check first to\n // see if toString is *anywhere* up the prototype chain)\n var s = (o.toString !== undefined) ? o.toString() : '';\n if (s !== '' && s !== '[object Object]') {\n newEncodedObj.push('INSTANCE_PPRINT', 'object', s);\n } else {\n newEncodedObj.push('INSTANCE', '');\n var pairs = _.pairs(o);\n for (i = 0; i < pairs.length; i++) {\n var e = pairs[i];\n newEncodedObj.push([encodeObject(e[0]), encodeObject(e[1])]);\n }\n\n var proto = Object.getPrototypeOf(o);\n if (_.isObject(proto) && !_.isEmpty(proto)) {\n //log('obj.prototype', proto, proto.smallObjId_hidden_);\n // I think __proto__ is the official term for this field,\n // *not* 'prototype'\n newEncodedObj.push(['__proto__', encodeObject(proto)]);\n }\n }\n }\n\n return ret;\n }\n\n }\n assert(false);\n}", "function dist_index_esm_contains(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}", "function isRawPostcodeObject(o, additionalAttr, blackListedAttr) {\n\tif (!additionalAttr) additionalAttr = [];\n\tif (!blackListedAttr) blackListedAttr = [];\n\tisSomeObject(o, rawPostcodeAttributes, additionalAttr, blackListedAttr);\n}", "function _meta_(v,m){var ms=v['__meta__']||{};for(var k in m){ms[k]=m[k]};v['__meta__']=ms;return v}", "function Animal() {\n this.kind = \"Dog\"\n}", "function Kitten(name, photo, interests, isGoodWithKids, isGoodWithDogs, isGoodWithCats) {\n this.name = name;\n this.photo = photo;\n this.interests = interests;\n this.isGoodWithKids = isGoodWithKids;\n this.isGoodWithCats = isGoodWithCats;\n this.isGoodWithDogs = isGoodWithDogs;\n}", "getMeta () {\n }", "function np(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function Obj() {}", "function isFriend(name, object) {\n//use hasWord function to check object names array\n// console.log(object);\n// console.log(name);\n//conditional to check for property\nif (object['friends'] !== undefined) {\nreturn hasWord(object.friends.join(' '), name);\n}\nelse {return false};\n \n}", "function test_fail_hole_prototype() {\n var obj = Object.create({ stuff: \"in prototype\" });\n obj.foo = \"bar\";\n\n function f1() {\n bidar.serialize(obj);\n }\n assert.throws(f1, /Hole-ful graph, but no hole filter/);\n}", "function Person(saying) {\n this.saying = saying;\n /*\n return {\n dumbObject: true\n }\n */\n}", "transient private protected internal function m182() {}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "function Surrogate(){}", "function Surrogate(){}", "function Surrogate(){}", "static serialize(obj, allowPrimitives, fallbackToJson, requireJsonType = false) {\n if (allowPrimitives) {\n if (typeof obj === \"string\") {\n return this.serializePrimitive(obj, \"string\");\n } else if (typeof obj === \"number\") {\n return this.serializePrimitive(obj, \"double\");\n } else if (Buffer.isBuffer(obj)) {\n return this.serializePrimitive(obj, \"bytes\");\n } else if (typeof obj === \"boolean\") {\n return this.serializePrimitive(obj, \"bool\");\n } else if (Long.isLong(obj)) {\n return this.serializePrimitive(obj, \"int64\");\n }\n }\n if (obj.constructor && typeof obj.constructor.encode === \"function\" && obj.constructor.$type) {\n return Any.create({\n // I have *no* idea why it's type_url and not typeUrl, but it is.\n type_url: \"type.googleapis.com/\" + AnySupport.fullNameOf(obj.constructor.$type),\n value: obj.constructor.encode(obj).finish()\n });\n } else if (fallbackToJson && typeof obj === \"object\") {\n let type = obj.type;\n if (type === undefined) {\n if (requireJsonType) {\n throw new Error(util.format(\"Fallback to JSON serialization supported, but object does not define a type property: %o\", obj));\n } else {\n type = \"object\";\n }\n }\n return Any.create({\n type_url: CloudStateJson + type,\n value: this.serializePrimitiveValue(stableJsonStringify(obj), \"string\")\n });\n } else {\n throw new Error(util.format(\"Object %o is not a protobuf object, and hence can't be dynamically \" +\n \"serialized. Try passing the object to the protobuf classes create function.\", obj));\n }\n }" ]
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992", "0.46990207", "0.4690639", "0.46904448", "0.46862254", "0.46716532", "0.46667543", "0.46522382", "0.46354175", "0.46053663", "0.46017453", "0.45926702", "0.45891586", "0.45877746", "0.458541", "0.45851982", "0.45847243", "0.4584686", "0.458378", "0.45767823", "0.45753202", "0.45753202", "0.45753202", "0.45713404", "0.45637134", "0.45637134", "0.4557141", "0.4557141", "0.4557141", "0.45494914", "0.45366898", "0.45342454", "0.4533338", "0.45322663", "0.45229813", "0.452288", "0.452288", "0.45159692", "0.45102093", "0.45099118", "0.45062032", "0.4506134", "0.45033473", "0.4502599", "0.44998378", "0.4497197", "0.44843012", "0.44764578", "0.44738895", "0.44715428", "0.44715428", "0.4471341", "0.44594073", "0.44552016", "0.44538808", "0.44522536", "0.44464657", "0.44464657", "0.4443469", "0.4443427", "0.44433454", "0.4437557", "0.4436382", "0.4430658", "0.4429719", "0.4428169", "0.44260293", "0.4420813", "0.44155774", "0.44130567", "0.4406073", "0.4401904", "0.44010627", "0.43994573", "0.43948644", "0.43847254", "0.43847254", "0.43830302", "0.43830302", "0.43830302", "0.4381413" ]
0.0
-1
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. resolves . and .. elements in a path array with directory names there must be no slashes, empty elements, or device names (c:\) in the array (so also no leading and trailing slashes it does not distinguish relative and absolute paths)
function normalizeArray(parts, allowAboveRoot) { // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = parts.length - 1; i >= 0; i--) { var last = parts[i]; if (last === '.') { parts.splice(i, 1); } else if (last === '..') { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (allowAboveRoot) { for (; up--; up) { parts.unshift('..'); } } return parts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rationalizePaths(array){\n for(var i = 0, len = array.length; i < len; i++){\n //I know, this is very unneeded, but I like having it because of it's over bearing round-a-bout-ness\n array[i] = require.resolve(array[i]).split('\\\\').filter(function(o,i,a){ return (a.length-1) !== i; }).join('\\\\');\n }\n\n return array;\n}", "function _resolvePointer(...paths) {\n return paths\n // reduce to /-separated string, ignoring anything before the last-\n // specified absolute path (e.g. [\"/a\", \"/b\", \"./c\"] becomes \"/b/./c\")\n .reduce((joined, next) => {\n // next child is absolute; discard previous\n if (next.startsWith(\"/\")) {\n return next;\n }\n\n return `${joined}/${next}`;\n }, \"\")\n\n // now, remove .. and .\n .split(\"/\").reduce((resolved, next) => {\n switch (next) {\n case \"..\":\n return resolved.slice(0, -1);\n case \".\":\n return resolved;\n default:\n return resolved.concat(next);\n }\n }, []).join(\"/\");\n}", "function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;}// Split a filename into [root, dir, basename, ext], unix version", "function normalizeArray(parts,allowAboveRoot){ // if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}} // if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;} // Split a filename into [root, dir, basename, ext], unix version", "function joinPath(...paths){var _path$default;const joinedPath=(_path$default=_path.default).join.apply(_path$default,paths);if(_os.default.platform()===`win32`){return joinedPath.replace(/\\\\/g,`\\\\\\\\`);}return joinedPath;}// copied from https://runpkg.com/[email protected]/lib/nodePaths.js", "function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;}// path.resolve([from ...], to)", "resolveAsPath() { }", "function resolvePath(...paths) {\n return [].concat(...paths)\n .filter(v => typeof v === 'string' || isArray(v))\n .join('.').split('.')\n .filter(v => !!v);\n}", "resolve(...paths) {\n // first figure out the minimum number of paths we have to test\n // we always start at cwd, but any absolutes will bump the start\n let r = '';\n for (let i = paths.length - 1; i >= 0; i--) {\n const p = paths[i];\n if (!p || p === '.')\n continue;\n r = r ? `${p}/${r}` : p;\n if (this.isAbsolute(p)) {\n break;\n }\n }\n const cached = this.#resolveCache.get(r);\n if (cached !== undefined) {\n return cached;\n }\n const result = this.cwd.resolve(r).fullpath();\n this.#resolveCache.set(r, result);\n return result;\n }", "function resolvePathDots(input) {\r\n\t\tvar output = [];\r\n\t\tinput.replace(/^(\\.\\.?(\\/|$))+/, '')\r\n\t\t .replace(/\\/(\\.(\\/|$))+/g, '/')\r\n\t\t .replace(/\\/\\.\\.$/, '/../')\r\n\t\t .replace(/\\/?[^\\/]*/g, function (part) { part === '/..' ? output.pop() : output.push(part); });\r\n\t\treturn output.join('').replace(/^\\//, input.charAt(0) === '/' ? '/' : '');\r\n\t}", "function resolve(...input) {\n return path.resolve(...input)\n}", "resolvePosix(...paths) {\n // first figure out the minimum number of paths we have to test\n // we always start at cwd, but any absolutes will bump the start\n let r = '';\n for (let i = paths.length - 1; i >= 0; i--) {\n const p = paths[i];\n if (!p || p === '.')\n continue;\n r = r ? `${p}/${r}` : p;\n if (this.isAbsolute(p)) {\n break;\n }\n }\n const cached = this.#resolvePosixCache.get(r);\n if (cached !== undefined) {\n return cached;\n }\n const result = this.cwd.resolve(r).fullpathPosix();\n this.#resolvePosixCache.set(r, result);\n return result;\n }", "function resolve() {\n var root = '';\n var elements = [];\n var leaf = '';\n var path;\n for (var i = 0; i < arguments.length; i++) {\n path = String(arguments[i]);\n if (path.trim() == '') {\n continue;\n }\n var parts = path.split(SEPARATOR_RE);\n if (isAbsolute(path)) {\n // path is absolute, throw away everyting we have so far\n root = parts.shift() + SEPARATOR;\n elements = [];\n }\n leaf = parts.pop();\n if (leaf == '.' || leaf == '..') {\n parts.push(leaf);\n leaf = '';\n }\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j];\n if (part == '..') {\n if (elements.length > 0 && elements.peek() != '..') {\n elements.pop();\n } else if (!root) {\n elements.push(part);\n }\n } else if (part != '' && part != '.') {\n elements.push(part);\n }\n }\n }\n path = elements.join(SEPARATOR);\n if (path.length > 0) {\n leaf = SEPARATOR + leaf;\n }\n return root + path + leaf;\n}", "function path_resolve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var resolvedPath = '';\n var resolvedAbsolute = false;\n for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? args[i] : '/';\n // Skip empty entries\n if (!path) {\n continue;\n }\n resolvedPath = path + \"/\" + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n // Normalize the path\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/');\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}", "function resolve$2() {\n var resolvedPath = '',\n resolvedAbsolute = false\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? arguments[i] : '/'\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings')\n } else if (!path) {\n continue\n }\n\n resolvedPath = path + '/' + resolvedPath\n resolvedAbsolute = path.charAt(0) === '/'\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(\n filter(resolvedPath.split('/'), function (p) {\n return !!p\n }),\n !resolvedAbsolute\n ).join('/')\n\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'\n}", "function a(e){var t=e,n=o(e);if(n){if(!n.path)return e;t=n.path}for(var r,a=\"/\"===t.charAt(0),s=t.split(/\\/+/),l=0,u=s.length-1;u>=0;u--)r=s[u],\".\"===r?s.splice(u,1):\"..\"===r?l++:l>0&&(\"\"===r?(\n// The first part is blank if the path is absolute. Trying to go\n// above the root is a no-op. Therefore we can remove all '..' parts\n// directly after the root.\ns.splice(u+1,l),l=0):(s.splice(u,2),l--));return t=s.join(\"/\"),\"\"===t&&(t=a?\"/\":\".\"),n?(n.path=t,i(n)):t}", "function toFilePath(pathArray){\n\tif (typeof(pathArray) === 'string') return pathArray;\n\tvar expanded = '';\n\tfor(var i=0; i < pathArray.length; i++){\n\t\texpanded = OS.Path.join(pathArray, dirName[i]);\n\t}\n\treturn expanded;\n}", "function win32SplitPath(filename){// Separate device+slash from tail\nvar result=splitDeviceRe.exec(filename),device=(result[1]||\"\")+(result[2]||\"\"),tail=result[3]||\"\";// Split the tail into dir, basename and extension\nvar result2=splitTailRe.exec(tail),dir=result2[1],basename=result2[2],ext=result2[3];return[device,dir,basename,ext]}", "function resolve$2() {\n\t var resolvedPath = '',\n\t resolvedAbsolute = false;\n\n\t for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n\t var path = (i >= 0) ? arguments[i] : '/';\n\n\t // Skip empty and invalid entries\n\t if (typeof path !== 'string') {\n\t throw new TypeError('Arguments to path.resolve must be strings');\n\t } else if (!path) {\n\t continue;\n\t }\n\n\t resolvedPath = path + '/' + resolvedPath;\n\t resolvedAbsolute = path.charAt(0) === '/';\n\t }\n\n\t // At this point the path should be resolved to a full absolute path, but\n\t // handle relative paths to be safe (might happen when process.cwd() fails)\n\n\t // Normalize the path\n\t resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n\t return !!p;\n\t }), !resolvedAbsolute).join('/');\n\n\t return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n\t}", "function i(e){var t=e,n=r(e);if(n){if(!n.path)return e;t=n.path}for(var i,a=\"/\"===t.charAt(0),s=t.split(/\\/+/),l=0,u=s.length-1;u>=0;u--)i=s[u],\".\"===i?s.splice(u,1):\"..\"===i?l++:l>0&&(\"\"===i?(// The first part is blank if the path is absolute. Trying to go\n// above the root is a no-op. Therefore we can remove all '..' parts\n// directly after the root.\ns.splice(u+1,l),l=0):(s.splice(u,2),l--));return t=s.join(\"/\"),\"\"===t&&(t=a?\"/\":\".\"),n?(n.path=t,o(n)):t}", "function path() {\n return new Path(join.apply(null, arguments));\n}", "function quotePaths() {\n // Replace this comment with your code...\n\n let result = [];\n // if (arguments.length == 1) {\n // result = quotePath(arguments);\n // } else if (arguments.length > 1) {\n for (var i = 0; i < arguments.length; i++) {\n result.push(quotePath(arguments[i]));\n }\n return result.join(' ');\n}", "function normalizePath(p) {\n return fslib_1.npath.toPortablePath(p);\n }", "function makePath() {\n var path = [''];\n for (var i=0,l=arguments.length,arg,argType; i<l; i++) {\n arg = arguments[i];\n argType = typeof arg;\n if (argType === 'string' || (argType === 'number' && !isNaN(arg))) {\n arg = String(arg);\n if (arg.length) path.push(arg.replace(/^\\/|\\/$/g, ''));\n }\n }\n return path.join('/').replace(/\\/$/, '');\n}", "function getPathsFromArgs() {\n var _a;\n return (_a = []).concat.apply(_a, (process.argv || [])\n .map(function (arg) {\n if (arg.includes('paths='))\n return arg.split(/(?:paths=|,)+/)\n .filter(function (i) { return !!i; });\n })\n .filter(function (i) { return !!i; }));\n}", "function getArrayOfPathsWithDotSlash(paths) {\n if (!Array.isArray(paths)) {\n return undefined;\n }\n var pathsWithDotSlash = [];\n for (var _i = 0, paths_1 = paths; _i < paths_1.length; _i++) {\n var path = paths_1[_i];\n pathsWithDotSlash.push(getPathWithDotSlash(path));\n }\n return pathsWithDotSlash;\n}", "function GetNormalizedPath() {\n}", "function pathResolve(path1, path2) {\n path1 = path1.split('/');\n path1.pop();\n var pathArr = path1.concat(path2.split('/'));\n var up = 0;\n for (var i = pathArr.length - 1; i >= 0; i--) {\n var last = pathArr[i];\n if (last === '.') {\n pathArr.splice(i, 1)\n } else if (last === '..') {\n pathArr.splice(i, 1);\n up++\n } else if (up) {\n pathArr.splice(i, 1);\n up--\n }\n }\n return pathArr.join('/')\n }", "function c(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];\".\"===o?e.splice(r,1):\"..\"===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}\n// if the path is allowed to go above the root, restore leading ..s\nif(t)for(;n--;n)e.unshift(\"..\");return e}", "function resolve(...args) {\n let resolvedPath = '';\n let resolvedAbsolute = false;\n\n for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n const path = i >= 0 ? args[i] : '/';\n\n // Skip empty entries\n if (!path) {\n continue;\n }\n\n resolvedPath = `${path}/${resolvedPath}`;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(\n resolvedPath.split('/').filter(p => !!p),\n !resolvedAbsolute,\n ).join('/');\n\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}", "[_changePath] (newPath) {\n // have to de-list before changing paths\n this[_delistFromMeta]()\n const oldPath = this.path\n this.path = newPath\n const namePattern = /(?:^|\\/|\\\\)node_modules[\\\\/](@[^/\\\\]+[\\\\/][^\\\\/]+|[^\\\\/]+)$/\n const nameChange = newPath.match(namePattern)\n if (nameChange && this.name !== nameChange[1])\n this.name = nameChange[1].replace(/\\\\/g, '/')\n\n // if we move a link target, update link realpaths\n if (!this.isLink) {\n this.realpath = newPath\n for (const link of this.linksIn) {\n link[_delistFromMeta]()\n link.realpath = newPath\n link[_refreshLocation]()\n }\n }\n // if we move /x to /y, then a module at /x/a/b becomes /y/a/b\n for (const child of this.fsChildren)\n child[_changePath](resolve(newPath, relative(oldPath, child.path)))\n for (const [name, child] of this.children.entries())\n child[_changePath](resolve(newPath, 'node_modules', name))\n\n this[_refreshLocation]()\n }", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n } // if the path is allowed to go above the root, restore leading ..s\n\n\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n} // path.resolve([from ...], to)", "function realpath(path) {\n // /a/b/./c/./d ==> /a/b/c/d\n path = path.replace(DOT_RE, \"/\")\n /*\n @author\n a//b/c ==> a/b/c\n a///b/////c ==> a/b/c\n DOUBLE_DOT_RE matches a/b/c//../d path correctly only if replace // with / first\n */\n path = path.replace(MULTI_SLASH_RE, \"$1/\")\n\n // a/b/c/../../d ==> a/b/../d ==> a/d\n while (path.match(DOUBLE_DOT_RE)) {\n path = path.replace(DOUBLE_DOT_RE, \"/\")\n }\n\n return path\n}", "function l(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");\n// XXX: It is possible to remove this block, and the tests still pass!\nvar n=o(e);return\"/\"==t.charAt(0)&&n&&\"/\"==n.path?t.slice(1):0===t.indexOf(e+\"/\")?t.substr(e.length+1):t}", "function posixify_path(str) {\n\treturn str.split(path.sep).join(path.posix.sep);\n}", "function platformPath(p) {\n return p.split('/').join(path.sep);\n}", "expandGlobPatterns(context, argv) {\n const nextArgv = [];\n this.debug('Expanding glob patterns');\n argv.forEach((arg) => {\n if (arg.charAt(0) !== '-' && is_glob_1.default(arg)) {\n const paths = fast_glob_1.default\n .sync(arg, {\n cwd: String(context.cwd),\n onlyDirectories: false,\n onlyFiles: false,\n })\n .map((path) => new common_1.Path(path).path());\n this.debug(' %s %s %s', arg, chalk_1.default.gray('->'), paths.length > 0 ? paths.join(', ') : chalk_1.default.gray(this.tool.msg('app:noMatch')));\n nextArgv.push(...paths);\n }\n else {\n nextArgv.push(arg);\n }\n });\n return nextArgv;\n }", "function normalizePaths(path) {\n // @ts-ignore (not sure why this happens)\n return path.map(segment => typeof segment === 'string' ? segment.split('.') : segment);\n} // Supports passing either an id or a value (document/reference/object)", "static resolve(basedir, path) {\n if (path.startsWith(\"/\")) {\n basedir = \"/\";\n }\n\n const base = basedir.split(\"/\").filter(x => x !== \"\");\n const rest = path.split(\"/\").filter(x => x !== \"\");\n const full = base.concat(rest);\n\n const result = [];\n for (const part of full) {\n if (part === \"..\") {\n result.pop();\n } else if (part !== \".\") {\n result.push(part);\n }\n }\n\n if (path.endsWith(\"/\") && result.length > 0) {\n return \"/\" + result.join(\"/\") + \"/\";\n } else {\n return \"/\" + result.join(\"/\");\n }\n }", "function combine() {\r\n var paths = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n paths[_i] = arguments[_i];\r\n }\r\n return paths\r\n .filter(function (path) { return !stringIsNullOrEmpty(path); })\r\n .map(function (path) { return path.replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"); })\r\n .join(\"/\")\r\n .replace(/\\\\/g, \"/\");\r\n}", "extendArrayWithPaths (array, path) {\n if (array.length && path) {\n const extendedArray = []\n array.forEach(function (value) {\n extendedArray.push(`${path}/${value}`)\n })\n return extendedArray\n }\n }", "function applyNodeExtensionResolution(unqualifiedPath, candidates, {\n extensions\n }) {\n // We use this \"infinite while\" so that we can restart the process as long as we hit package folders\n while (true) {\n let stat;\n\n try {\n candidates.push(unqualifiedPath);\n stat = opts.fakeFs.statSync(unqualifiedPath);\n } catch (error) {} // If the file exists and is a file, we can stop right there\n\n\n if (stat && !stat.isDirectory()) return opts.fakeFs.realpathSync(unqualifiedPath); // If the file is a directory, we must check if it contains a package.json with a \"main\" entry\n\n if (stat && stat.isDirectory()) {\n let pkgJson;\n\n try {\n pkgJson = JSON.parse(opts.fakeFs.readFileSync(fslib_2.ppath.join(unqualifiedPath, fslib_2.toFilename(`package.json`)), `utf8`));\n } catch (error) {}\n\n let nextUnqualifiedPath;\n if (pkgJson && pkgJson.main) nextUnqualifiedPath = fslib_2.ppath.resolve(unqualifiedPath, pkgJson.main); // If the \"main\" field changed the path, we start again from this new location\n\n if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) {\n const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, {\n extensions\n });\n\n if (resolution !== null) {\n return resolution;\n }\n }\n } // Otherwise we check if we find a file that match one of the supported extensions\n\n\n const qualifiedPath = extensions.map(extension => {\n return `${unqualifiedPath}${extension}`;\n }).find(candidateFile => {\n candidates.push(candidateFile);\n return opts.fakeFs.existsSync(candidateFile);\n });\n if (qualifiedPath) return qualifiedPath; // Otherwise, we check if the path is a folder - in such a case, we try to use its index\n\n if (stat && stat.isDirectory()) {\n const indexPath = extensions.map(extension => {\n return fslib_2.ppath.format({\n dir: unqualifiedPath,\n name: fslib_2.toFilename(`index`),\n ext: extension\n });\n }).find(candidateFile => {\n candidates.push(candidateFile);\n return opts.fakeFs.existsSync(candidateFile);\n });\n\n if (indexPath) {\n return indexPath;\n }\n } // Otherwise there's nothing else we can do :(\n\n\n return null;\n }\n }", "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n }", "normalizePath() {\n const {path} = options;\n switch (typeof path) {\n case 'function': return path(this.props);\n case 'string': return [path];\n default: return path;\n }\n }", "function arr2strN(arr,n){\n\tstr=\"\";\n\tfor (var i = 0; i < ((n <= arr.length)? n:arr.length); i++) {\n\t\tstr+=arr[i]+\"/\";\n\t};\n\treturn path.normalize(str);\n}", "function genetatePath(path) {\n if (!path) path = [];\n try {\n return pathConverter.join(directory + '/' + path.join('/'));\n } catch (error) {\n console.log(error);\n return '';\n }\n}", "function fromPortablePath(p) {\n if (process.platform !== `win32`)\n return p;\n let portablePathMatch, uncPortablePathMatch;\n if ((portablePathMatch = p.match(PORTABLE_PATH_REGEXP)))\n p = portablePathMatch[1];\n else if ((uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)))\n p = `\\\\\\\\${uncPortablePathMatch[1] ? `.\\\\` : ``}${uncPortablePathMatch[2]}`;\n else\n return p;\n return p.replace(/\\//g, `\\\\`);\n}", "function fixPath(path) {\n \n \n if(path.startsWith('\\\\\\\\') === false) {\n \n console.log('Path does not starts with \\\\\\\\. Throw error');\n throw \"Path does not starts with \\\\\\\\\";\n \n } else {\n \n // storing path slash into variable\t \n var result = '\\\\\\\\';\n for(var i = 0; i < path.length; i++) {\n \n // Current character is back slash or not\n if(path.charAt(i) === '\\\\') {\n \n // Is result ends with back slash?\n if(result.endsWith('\\\\') === false) {\n result += '\\\\';\n }\n } else {\n result += path.charAt(i);\n }\n }\n return result;\n \n }\n \n}", "static async getDirectoryFor(pathString) {\n let rns = fdio.nsExportRoot();\n let splitDirString = pathString.split('/');\n const rootElements = rns.getElements();\n let restOfPath = undefined;\n let element = undefined;\n let checkDirectory = fidling.fuchsia_io.OPEN_FLAG_DESCRIBE;\n\n // The root elements are special, top-level paths. Every path is relative to one.\n // So, we have to start looking for the given path from one of the root strings.\n // Iterate until we find the right one.\n for (let e in rootElements) {\n let splitElement = e.split('/');\n if (util.arraysEqual(splitDirString, splitElement)) {\n restOfPath = '.';\n element = e;\n // For some reason, waiting for OnOpen below in this code path\n // causes memory corruption. We don't really need the check,\n // and we're likely to deprecate this code anyway.\n checkDirectory = 0;\n } else if (util.isPrefixOf(splitElement, splitDirString)) {\n // We are trying to list something reachable from a root handle.\n // element.length + 1 gets rid of the next path separator.\n restOfPath = pathString.substring(e.length + 1);\n element = e;\n }\n }\n\n if (typeof element == 'undefined') {\n throw 'Node ' + pathString + ' not found';\n }\n // Each Node (i.e., the thing we want listed) is contained within a root namespace\n // For example, if you want to list /bin/ls, it is going to be the ls node inside\n // the /bin root element. |element| is the root namespace element.\n // rootChannel is a channel to the service providing the root namespace element.\n let rootHandle = rootElements[element].handle;\n let rootChannel = new zx.Channel(rootHandle);\n\n // dirClient is a wrapper that lets you speak the fuchsia.io.Directory protocol\n // to the root namespace.\n let dirClient = new fidl.ProtocolClient(rootChannel, fidling.fuchsia_io.Directory);\n\n // When we want to interact with the node within the root namespace (this\n // would be \"ls\" if you are opening \"/bin/ls\"), you need to create a\n // channel to speak to it using the fuchsia.io.Node protocol. The way we\n // set up that channel is to call the Open() method of the root namespace\n // directory (\"/bin\"), and send it |restOfPath| (\"ls\") and one end of a\n // channel. We can then communicate via that Node by speaking\n // fuchsia.io.Node over the other end of that channel.\n // |request| is a wrapper that gives you two ends of a channel.\n const request = new fidl.Request(fidling.fuchsia_io.Node);\n // |nodeClient| is going to be the end of the channel that we speak Node over.\n let nodeClient = request.getProtocolClient();\n let openedPromise = undefined;\n if (checkDirectory != 0) {\n // We can get notified when the Node gets opened.\n openedPromise = nodeClient.OnOpen((args) => {\n return args;\n });\n }\n // Ask the service providing the root namespace element to open the Node\n // we want to inspect.\n dirClient.Open(\n fidling.fuchsia_io.OPEN_RIGHT_READABLE | checkDirectory, 0, restOfPath,\n request.getChannelForServer());\n if (checkDirectory != 0) {\n let args = await openedPromise;\n // TODO: check the value of args.s\n if ('directory' in args.info) {\n return new Directory(nodeClient);\n } else {\n throw pathString + \" is not a directory\"\n }\n } else {\n return new Directory(nodeClient);\n }\n fidl.ProtocolClient.close(request.getProtocolClient());\n }", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path$1.sep);\n}", "getProjectRoots() {\n return [__dirname];\n }", "function relPath() {\n return '.' + path.sep + path.join.apply(null, arguments);\n}", "function resolve() {\n\t var resolvedPath = '',\n\t resolvedAbsolute = false;\n\n\t for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n\t var path = (i >= 0) ? arguments[i] : '/';\n\n\t // Skip empty and invalid entries\n\t if (typeof path !== 'string') {\n\t throw new TypeError('Arguments to path.resolve must be strings');\n\t } else if (!path) {\n\t continue;\n\t }\n\n\t resolvedPath = path + '/' + resolvedPath;\n\t resolvedAbsolute = path.charAt(0) === '/';\n\t }\n\n\t // At this point the path should be resolved to a full absolute path, but\n\t // handle relative paths to be safe (might happen when process.cwd() fails)\n\n\t // Normalize the path\n\t resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n\t return !!p;\n\t }), !resolvedAbsolute).join('/');\n\n\t return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n\t}", "function resolve() {\n\t var resolvedPath = '',\n\t resolvedAbsolute = false;\n\n\t for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n\t var path = (i >= 0) ? arguments[i] : '/';\n\n\t // Skip empty and invalid entries\n\t if (typeof path !== 'string') {\n\t throw new TypeError('Arguments to path.resolve must be strings');\n\t } else if (!path) {\n\t continue;\n\t }\n\n\t resolvedPath = path + '/' + resolvedPath;\n\t resolvedAbsolute = path.charAt(0) === '/';\n\t }\n\n\t // At this point the path should be resolved to a full absolute path, but\n\t // handle relative paths to be safe (might happen when process.cwd() fails)\n\n\t // Normalize the path\n\t resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n\t return !!p;\n\t }), !resolvedAbsolute).join('/');\n\n\t return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n\t}", "function resolve() {\n\t var resolvedPath = '',\n\t resolvedAbsolute = false;\n\n\t for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n\t var path = (i >= 0) ? arguments[i] : '/';\n\n\t // Skip empty and invalid entries\n\t if (typeof path !== 'string') {\n\t throw new TypeError('Arguments to path.resolve must be strings');\n\t } else if (!path) {\n\t continue;\n\t }\n\n\t resolvedPath = path + '/' + resolvedPath;\n\t resolvedAbsolute = path.charAt(0) === '/';\n\t }\n\n\t // At this point the path should be resolved to a full absolute path, but\n\t // handle relative paths to be safe (might happen when process.cwd() fails)\n\n\t // Normalize the path\n\t resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n\t return !!p;\n\t }), !resolvedAbsolute).join('/');\n\n\t return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n\t}", "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n}", "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n}", "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n}", "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n}", "function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n}", "normalize(...variants) {\n\n if (variants.length <= 0)\n return null;\n if (variants.length > 0\n && !Object.usable(variants[0]))\n return null;\n if (variants.length > 1\n && !Object.usable(variants[1]))\n return null;\n\n if (variants.length > 1\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid root: \" + typeof variants[0]);\n let root = \"#\";\n if (variants.length > 1) {\n root = variants[0];\n try {root = Path.normalize(root);\n } catch (error) {\n root = (root || \"\").trim();\n throw new TypeError(`Invalid root${root ? \": \" + root : \"\"}`);\n }\n }\n\n if (variants.length > 1\n && typeof variants[1] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[1]);\n if (variants.length > 0\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[0]);\n let path = \"\";\n if (variants.length === 1)\n path = variants[0];\n if (variants.length === 1\n && path.match(PATTERN_URL))\n path = path.replace(PATTERN_URL, \"$1\");\n else if (variants.length > 1)\n path = variants[1];\n path = (path || \"\").trim();\n\n if (!path.match(PATTERN_PATH))\n throw new TypeError(`Invalid path${String(path).trim() ? \": \" + path : \"\"}`);\n\n path = path.replace(/([^#])#$/, \"$1\");\n path = path.replace(/^([^#])/, \"#$1\");\n\n // Functional paths are detected.\n if (path.match(PATTERN_PATH_FUNCTIONAL))\n return \"###\";\n\n path = root + path;\n path = path.toLowerCase();\n\n // Path will be balanced\n const pattern = /#[^#]+#{2}/;\n while (path.match(pattern))\n path = path.replace(pattern, \"#\");\n path = \"#\" + path.replace(/(^#+)|(#+)$/g, \"\");\n\n return path;\n }", "findRelPath(path) {\n /// Are the `prefix_len` bytes pointed to by `prefix` a prefix of `path`?\n function prefixMatches(prefix, path) {\n // Allow an empty string as a prefix of any relative path.\n if (path[0] != '/' && !prefix) {\n return true;\n }\n // Check whether any bytes of the prefix differ.\n if (!path.startsWith(prefix)) {\n return false;\n }\n // Ignore trailing slashes in directory names.\n let i = prefix.length;\n while (i > 0 && prefix[i - 1] == '/') {\n --i;\n }\n // Match only complete path components.\n let last = path[i];\n return last === '/' || last === '\\0';\n }\n // Search through the preopens table. Iterate in reverse so that more\n // recently added preopens take precedence over less recently addded ones.\n let matchLen = 0;\n let foundPre;\n for (let i = this._firstNonPreopenFd - 1; i >= FIRST_PREOPEN_FD; --i) {\n let pre = this.get(i);\n let prefix = pre.path;\n if (path !== '.' && !path.startsWith('./')) {\n // We're matching a relative path that doesn't start with \"./\" and\n // isn't \".\".\n if (prefix.startsWith('./')) {\n prefix = prefix.slice(2);\n }\n else if (prefix === '.') {\n prefix = prefix.slice(1);\n }\n }\n // If we haven't had a match yet, or the candidate path is longer than\n // our current best match's path, and the candidate path is a prefix of\n // the requested path, take that as the new best path.\n if ((!foundPre || prefix.length > matchLen) &&\n prefixMatches(prefix, path)) {\n foundPre = pre;\n matchLen = prefix.length;\n }\n }\n if (!foundPre) {\n throw new Error(`Couldn't resolve the given path via preopened directories.`);\n }\n // The relative path is the substring after the portion that was matched.\n let computed = path.slice(matchLen);\n // Omit leading slashes in the relative path.\n computed = computed.replace(/^\\/+/, '');\n // *at syscalls don't accept empty relative paths, so use \".\" instead.\n computed = computed || '.';\n return {\n preOpen: foundPre,\n relativePath: computed\n };\n }", "function combine() {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n paths[_i] = arguments[_i];\n }\n return paths\n .filter(function (path) { return !stringIsNullOrEmpty(path); })\n .map(function (path) { return path.replace(/^[\\\\|/]/, \"\").replace(/[\\\\|/]$/, \"\"); })\n .join(\"/\")\n .replace(/\\\\/g, \"/\");\n}", "function splitPath(p) {\n if (typeof p === 'string') {\n return splitPath({'path' : p});\n }\n\n var a = p.path.split(\"/\");\n p.name = a.pop();\n // console.log(a);\n p.cpath = a.join(\"/\");\n // a.shift();\n // console.log(a);\n p.topname = a.shift(); // get the name of the top dir\n // console.log(a);\n a.unshift(\"\");\n // console.log(a);\n p.cpath1 = a.join(\"/\"); // remove the topdir\n\n var e = p.name.split(\".\");\n if (e.length < 2) {\n p.ext = \"\";\n p.bname = p.name;\n } else {\n p.ext = e.pop();\n p.bname = e.join(\".\");\n }\n return p;\n}", "function prepareDebuggerPath(...parts) {\r\n return path.join(...parts)\r\n .replace('\\\\', '\\\\\\\\')\r\n .replace('.', '\\\\.');\r\n}", "function getNamePath(path) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__typeUtil__[\"a\" /* toArray */])(path);\n}", "_setPathLocation() {\n // TODO need better way to differentiate between macOS and Windows FILES_PATHs\n let dlabsLocation = shell.which('dlabs-cli')?.stdout?.trim();\n\n /* istanbul ignore if */\n if (dlabsLocation[0] === '/') {\n dlabsLocation = dlabsLocation.replace(/(\\/\\w+){1}$/, '');\n return `${dlabsLocation}/lib/node_modules/dlabs-cli`;\n } else if (dlabsLocation.includes('C:')) {\n dlabsLocation = dlabsLocation.replace(/\\\\DLABS-CLI.CMD/, '').replace(/\\\\\\\\/g, '\\\\');\n return `${dlabsLocation.toLowerCase()}\\\\node_modules\\\\dlabs-cli`;\n } else {\n this._consoleOutput('error', this.LOG_MESSAGES.noPathDetected);\n }\n }", "function toPortablePath(p) {\n if (process.platform !== `win32`)\n return p;\n let windowsPathMatch, uncWindowsPathMatch;\n if ((windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)))\n p = `/${windowsPathMatch[1]}`;\n else if ((uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)))\n p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`;\n return p.replace(/\\\\/g, `/`);\n}", "function prettyPath(path) {\n return path.length ? path.join('.') : '[]';\n}", "function resolvePath( /* path segments */ ) {\n\t\t// Split the inputs into a list of path commands.\n\t\tvar parts = [];\n\t\tfor (var i = 0, l = arguments.length; i < l; i++) {\n\t\t\tparts = parts.concat(arguments[i].split(\"/\"));\n\t\t}\n\t\t// Interpret the path commands to get the new resolved path.\n\t\tvar newParts = [];\n\t\tvar stillDotDot = true; // Used in the first piece to determine if still using `../`. This preserves it on the first piece\n\t\tfor (i = 0, l = parts.length; i < l; i++) {\n\t\t\tvar part = parts[i];\n\t\t\t// Remove leading and trailing slashes\n\t\t\tif (!part) continue;\n\t\t\t// Interpret \".\" to pop the last segment\n\t\t\t// If the second to last part is a dot\n\t\t\t// and If there is not a trailing slash on the previous piece\n\t\t\tif (part === \".\" && i == l-2 && parts[i-1]) {\n\t\t\t\tnewParts.pop();\n\t\t\t\tstillDotDot = false;\n\t\t\t}\n\t\t\telse if(part === \".\") {\n\t\t\t\tstillDotDot = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Interpret \"..\" to pop the last segment\n\t\t\t// If not stillDotDot.\n\t\t\telse if (part === \"..\" && !stillDotDot) {\n\t\t\t\tnewParts.pop();\n\t\t\t}\n\t\t\telse if (part === \"..\") {\n\t\t\t\tnewParts.push(part); \n\t\t\t}\n\t\t\t// Push new path segments.\n\t\t\telse {\n\t\t\t\tstillDotDot = false;\n\t\t\t\tnewParts.push(part);\n\t\t\t}\n\t\t}\n\t\t// Preserve the initial slash if there was one.\n\t\tif (parts[0] === \"\") newParts.unshift(\"\");\n\t\t// Turn back into a single string path.\n\t\treturn newParts.join(\"/\") || (newParts.length ? \"/\" : \".\");\n\t}", "function normalize (actual) {\n const dir = path.join(__dirname, '..', '..', '..');\n const reDir = new RegExp(dir.replace(reEscape, '\\\\$1'), 'g');\n const reSep = new RegExp(path.sep.replace(reEscape, '\\\\$1'), 'g');\n\n return actual\n .replace(reDir, '/qunit')\n // Replace backslashes (\\) in stack traces on Windows to POSIX\n .replace(reSep, '/')\n // Convert \"at processModule (/qunit/qunit/qunit.js:1:2)\" to \"at qunit.js\"\n // Convert \"at /qunit/qunit/qunit.js:1:2\" to \"at qunit.js\"\n .replace(/^(\\s+at ).*\\/qunit\\/qunit\\/qunit\\.js.*$/gm, '$1qunit.js')\n // Strip inferred names for anonymous test closures (as Node 10 did),\n // to match the output of Node 12+.\n // Convert \"at QUnit.done (/qunit/test/foo.js:1:2)\" to \"at /qunit/test/foo.js:1:2\"\n .replace(/\\b(at )\\S+ \\((\\/qunit\\/test\\/[^:]+:\\d+:\\d+)\\)/g, '$1$2')\n // Convert sourcemap'ed traces from Node 14 and earlier to the\n // standard format used by Node 15+.\n // https://github.com/nodejs/node/commit/15804e0b3f\n // https://github.com/nodejs/node/pull/37252\n // Convert \"at foo (/min.js:1)\\n -> /src.js:2\" to \"at foo (/src.js:2)\"\n .replace(/\\b(at [^(]+\\s\\()[^)]+(\\))\\n\\s+-> ([^\\n]+)/g, '$1$3$2')\n // CJS-style internal traces:\n // Convert \"at load (internal/modules/cjs/loader.js:7)\" to \"at internal\"\n //\n // ESM-style internal traces from Node 14+:\n // Convert \"at wrap (node:internal/modules/cjs/loader:1)\" to \"at internal\"\n .replace(/^(\\s+at ).+\\([^/)][^)]*\\)$/gm, '$1internal')\n\n // Convert /bin/qunit and /src/cli to internal as well\n // Because there are differences between Node 10 and Node 12 in terms\n // of how much back and forth occurs, so by mapping both to internal\n // we can flatten and normalize across.\n .replace(/^(\\s+at ).*\\/qunit\\/bin\\/qunit\\.js.*$/gm, '$1internal')\n .replace(/^(\\s+at ).*\\/qunit\\/src\\/cli\\/.*$/gm, '$1internal')\n\n // Strip frames from indirect nyc dependencies that are specific\n // to code coverage jobs:\n // Convert \"at load (/qunit/node_modules/append-transform/index.js:6\" to \"at internal\"\n .replace(/ {2}at .+\\/.*node_modules\\/append-transform\\/.*\\)/g, ' at internal')\n // Consolidate subsequent qunit.js frames\n .replace(/^(\\s+at qunit\\.js$)(\\n\\s+at qunit\\.js$)+/gm, '$1')\n // Consolidate subsequent internal frames\n .replace(/^(\\s+at internal$)(\\n\\s+at internal$)+/gm, '$1');\n}", "static join() {\n // Split the inputs into a list of path commands.\n var parts = [];\n for (var i = 0, l = arguments.length; i < l; i++) {\n parts = parts.concat(arguments[i].split('/'));\n }\n // Interpret the path commands to get the new resolved path.\n var newParts = [];\n for (i = 0, l = parts.length; i < l; i++) {\n var part = parts[i];\n // Remove leading and trailing slashes\n // Also remove '.' segments\n if (!part || part === '.') {\n continue;\n }\n // Interpret '..' to pop the last segment\n if (part === '..') {\n newParts.pop();\n }\n // Push new path segments.\n else {\n newParts.push(part);\n }\n }\n // Preserve the initial slash if there was one.\n if (parts[0] === '') {\n newParts.unshift('');\n }\n // Turn back into a single string path.\n return newParts.join('/') || (newParts.length ? '/' : '.');\n }", "function normalizeStringPosix(path, allowAboveRoot) {\r\n var res = '';\r\n var lastSlash = -1;\r\n var dots = 0;\r\n var code;\r\n for (var i = 0; i <= path.length; ++i) {\r\n if (i < path.length)\r\n code = path.charCodeAt(i);\r\n else if (code === 47/*/*/)\r\n break;\r\n else\r\n code = 47/*/*/;\r\n if (code === 47/*/*/) {\r\n if (lastSlash === i - 1 || dots === 1) {\r\n // NOOP\r\n } else if (lastSlash !== i - 1 && dots === 2) {\r\n if (res.length < 2 ||\r\n res.charCodeAt(res.length - 1) !== 46/*.*/ ||\r\n res.charCodeAt(res.length - 2) !== 46/*.*/) {\r\n if (res.length > 2) {\r\n const start = res.length - 1;\r\n var j = start;\r\n for (; j >= 0; --j) {\r\n if (res.charCodeAt(j) === 47/*/*/)\r\n break;\r\n }\r\n if (j !== start) {\r\n if (j === -1)\r\n res = '';\r\n else\r\n res = res.slice(0, j);\r\n lastSlash = i;\r\n dots = 0;\r\n continue;\r\n }\r\n } else if (res.length === 2 || res.length === 1) {\r\n res = '';\r\n lastSlash = i;\r\n dots = 0;\r\n continue;\r\n }\r\n }\r\n if (allowAboveRoot) {\r\n if (res.length > 0)\r\n res += '/..';\r\n else\r\n res = '..';\r\n }\r\n } else {\r\n if (res.length > 0)\r\n res += '/' + path.slice(lastSlash + 1, i);\r\n else\r\n res = path.slice(lastSlash + 1, i);\r\n }\r\n lastSlash = i;\r\n dots = 0;\r\n } else if (code === 46/*.*/ && dots !== -1) {\r\n ++dots;\r\n } else {\r\n dots = -1;\r\n }\r\n }\r\n return res;\r\n}", "function resolve() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var resolvedPath = '';\r\n var resolvedAbsolute = false;\r\n for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\r\n var path = i >= 0 ? args[i] : '/';\r\n // Skip empty entries\r\n if (!path) {\r\n continue;\r\n }\r\n resolvedPath = path + \"/\" + resolvedPath;\r\n resolvedAbsolute = path.charAt(0) === '/';\r\n }\r\n // At this point the path should be resolved to a full absolute path, but\r\n // handle relative paths to be safe (might happen when process.cwd() fails)\r\n // Normalize the path\r\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) {\r\n return !!p;\r\n }), !resolvedAbsolute).join('/');\r\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\r\n}", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}", "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n } // if the path is allowed to go above the root, restore leading ..s\n\n\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n } // Split a filename into [root, dir, basename, ext], unix version", "function resolve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var resolvedPath = '';\n var resolvedAbsolute = false;\n for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? args[i] : '/';\n // Skip empty entries\n if (!path) {\n continue;\n }\n resolvedPath = path + \"/\" + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n // Normalize the path\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/');\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}", "function resolve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var resolvedPath = '';\n var resolvedAbsolute = false;\n for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? args[i] : '/';\n // Skip empty entries\n if (!path) {\n continue;\n }\n resolvedPath = path + \"/\" + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n // Normalize the path\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/');\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}", "function resolve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var resolvedPath = '';\n var resolvedAbsolute = false;\n for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? args[i] : '/';\n // Skip empty entries\n if (!path) {\n continue;\n }\n resolvedPath = path + \"/\" + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n // Normalize the path\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/');\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n let res = '';\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let code;\n for (let i = 0; i <= path.length; ++i) {\n if (i < path.length) {\n code = path.charCodeAt(i);\n }\n else if (code === 47 /*/*/) {\n break;\n }\n else {\n code = 47 /*/*/;\n }\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n }\n else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 ||\n lastSegmentLength !== 2 ||\n res.charCodeAt(res.length - 1) !== 46 /*.*/ ||\n res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n }\n else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n }\n else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n }\n else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n }\n else {\n dots = -1;\n }\n }\n return res;\n}", "function $UUq2$var$normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n } // if the path is allowed to go above the root, restore leading ..s\n\n\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n} // path.resolve([from ...], to)", "function globifyPath(path) {\n\treturn path.replace(/\\/|\\\\$/, \"\").replace(/\\\\/g, \"/\");\n}", "function realpath(path) {\n\t// /a/b/./c/./d ==> /a/b/c/d\n\tpath = path.replace(DOT_RE, \"/\");\n\n\t// a/b/c/../../d ==> a/b/../d ==> a/d\n\twhile (path.match(DOUBLE_DOT_RE)) {\n\t\tpath = path.replace(DOUBLE_DOT_RE, \"/\");\n\t}\n\n\treturn path;\n}", "function trimArray(arr){var lastIndex=arr.length-1;var start=0;for(;start<=lastIndex;start++){if(arr[start])break}var end=lastIndex;for(;end>=0;end--){if(arr[end])break}if(start===0&&end===lastIndex)return arr;if(start>end)return[];return arr.slice(start,end+1)}// Regex to split a windows path into three parts: [*, device, slash,", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length) code = path.charCodeAt(i);else if (code === 47 /*/*/) break;else code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n const start = res.length - 1;\n var j = start;\n for (; j >= 0; --j) {\n if (res.charCodeAt(j) === 47 /*/*/) break;\n }\n if (j !== start) {\n if (j === -1) res = '';else res = res.slice(0, j);\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) res += '/..';else res = '..';\n }\n } else {\n if (res.length > 0) res += '/' + path.slice(lastSlash + 1, i);else res = path.slice(lastSlash + 1, i);\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n }", "function parseCd (path, cd) {\n\n cdA = cd.split(\"/\");\n\n console.log(cdA);\n\n for (x in cdA) {\n\n console.log(cdA[x]+'\\n');\n\n if (cdA[x] == '..') {\n\n return;\n\n // saw = 0;\n\n // while (saw == 0){\n\n // if (path[-1] == '/') saw = 1;\n\n // path = path.slice(0, -1);\n\n // }\n\n }\n\n\n\n else path += (cdA[x] + '/');\n\n }\n\n\n\n return path;\n\n}", "function __ncc_wildcard$0 (arg) {\n if (arg === \"cat.js\" || arg === \"cat\") return __webpack_require__(271);\n else if (arg === \"cd.js\" || arg === \"cd\") return __webpack_require__(2051);\n else if (arg === \"chmod.js\" || arg === \"chmod\") return __webpack_require__(4975);\n else if (arg === \"common.js\" || arg === \"common\") return __webpack_require__(3687);\n else if (arg === \"cp.js\" || arg === \"cp\") return __webpack_require__(4932);\n else if (arg === \"dirs.js\" || arg === \"dirs\") return __webpack_require__(1178);\n else if (arg === \"echo.js\" || arg === \"echo\") return __webpack_require__(243);\n else if (arg === \"error.js\" || arg === \"error\") return __webpack_require__(232);\n else if (arg === \"exec-child.js\" || arg === \"exec-child\") return __webpack_require__(9607);\n else if (arg === \"exec.js\" || arg === \"exec\") return __webpack_require__(896);\n else if (arg === \"find.js\" || arg === \"find\") return __webpack_require__(7838);\n else if (arg === \"grep.js\" || arg === \"grep\") return __webpack_require__(7417);\n else if (arg === \"head.js\" || arg === \"head\") return __webpack_require__(6613);\n else if (arg === \"ln.js\" || arg === \"ln\") return __webpack_require__(5787);\n else if (arg === \"ls.js\" || arg === \"ls\") return __webpack_require__(5561);\n else if (arg === \"mkdir.js\" || arg === \"mkdir\") return __webpack_require__(2695);\n else if (arg === \"mv.js\" || arg === \"mv\") return __webpack_require__(9849);\n else if (arg === \"popd.js\" || arg === \"popd\") return __webpack_require__(227);\n else if (arg === \"pushd.js\" || arg === \"pushd\") return __webpack_require__(4177);\n else if (arg === \"pwd.js\" || arg === \"pwd\") return __webpack_require__(8553);\n else if (arg === \"rm.js\" || arg === \"rm\") return __webpack_require__(2830);\n else if (arg === \"sed.js\" || arg === \"sed\") return __webpack_require__(5899);\n else if (arg === \"set.js\" || arg === \"set\") return __webpack_require__(6366);\n else if (arg === \"sort.js\" || arg === \"sort\") return __webpack_require__(2116);\n else if (arg === \"tail.js\" || arg === \"tail\") return __webpack_require__(2284);\n else if (arg === \"tempdir.js\" || arg === \"tempdir\") return __webpack_require__(6150);\n else if (arg === \"test.js\" || arg === \"test\") return __webpack_require__(9723);\n else if (arg === \"to.js\" || arg === \"to\") return __webpack_require__(1961);\n else if (arg === \"toEnd.js\" || arg === \"toEnd\") return __webpack_require__(3736);\n else if (arg === \"touch.js\" || arg === \"touch\") return __webpack_require__(8358);\n else if (arg === \"uniq.js\" || arg === \"uniq\") return __webpack_require__(7286);\n else if (arg === \"which.js\" || arg === \"which\") return __webpack_require__(4766);\n}", "function path(input) {\n if(input == null) return input\n let returnObj = {}\n\n returnObj.root = input.startsWith('/') ? '/' : ''\n\n let dirs = input.split('/')\n returnObj.base = dirs.pop()\n returnObj.dir = dirs.join('/')\n\n let file = returnObj.base.split('.')\n returnObj.ext = '.' + file.pop()\n returnObj.name = file.shift()\n\n return returnObj\n}", "function buildPathArray(prefix, paths) {\n\tvar list = [];\n\tprefix = prefix || \"\";\n\t\n\tfor (var u = 0; u < paths.length; u++)\n\tlist.push(prefix + paths[u]);\n\t\n\treturn list;\n}", "function normalizePath(path) { return path.replace(/\\\\/g, '/') }", "findPath(fromDevice, toDevice) {\n // Handle the empty path first.\n if (fromDevice === toDevice) {\n return [];\n }\n const walk = (from, to, links) => {\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n if (link[0].device === from) {\n if (link[1].device === to) {\n return [ [ link[0], link[1] ] ];\n }\n else {\n const nlinks = [].concat(links);\n nlinks.splice(i, 1);\n const r = walk(link[1].device, to, nlinks);\n if (r) {\n r.unshift([ link[0], link[1] ] );\n return r;\n }\n }\n }\n else if (link[1].device === from) {\n if (link[0].device === to) {\n return [ [ link[1], link[0] ] ];\n }\n else {\n const nlinks = [].concat(links);\n nlinks.splice(i, 1);\n const r = walk(link[0].device, to, nlinks);\n if (r) {\n r.unshift([ link[1], link[0] ]);\n return r;\n }\n }\n }\n }\n return null;\n }\n return walk(fromDevice, toDevice, this._topology);\n }", "function removePath(...args) {\n return R.dissocPath(...args);\n}" ]
[ "0.62572104", "0.6090412", "0.5959142", "0.5926828", "0.59113187", "0.5872586", "0.58484083", "0.58189994", "0.5759454", "0.5741373", "0.5709317", "0.5640396", "0.55562675", "0.55114317", "0.5476231", "0.5438098", "0.5435966", "0.54343283", "0.5427441", "0.54015446", "0.53997886", "0.5389237", "0.5377941", "0.5368989", "0.53639334", "0.53294027", "0.5322348", "0.5308683", "0.5296715", "0.52959013", "0.5292471", "0.5284918", "0.5279964", "0.527622", "0.5261565", "0.5261249", "0.5249429", "0.52493954", "0.52389413", "0.5237427", "0.5229986", "0.5222543", "0.52218664", "0.52202153", "0.52184856", "0.5209737", "0.5208635", "0.5206952", "0.5202716", "0.5200347", "0.519266", "0.51925856", "0.5191533", "0.5191533", "0.5191533", "0.5181267", "0.5181267", "0.5181267", "0.5181267", "0.5181267", "0.5176713", "0.5176602", "0.51747346", "0.51669526", "0.5159152", "0.5151378", "0.51475465", "0.51474357", "0.51447535", "0.5143626", "0.51425445", "0.5141345", "0.51392597", "0.513868", "0.51381826", "0.51381826", "0.51381826", "0.51381826", "0.51381826", "0.51381826", "0.51381826", "0.51381826", "0.51381826", "0.51381826", "0.5134653", "0.51288223", "0.51288223", "0.51288223", "0.5123872", "0.5123801", "0.512031", "0.5114473", "0.51090086", "0.5100262", "0.5098774", "0.5079979", "0.50795156", "0.5076548", "0.5072811", "0.5071049", "0.5067261" ]
0.0
-1
Check if the given character code, or the character code at the first character, is alphabetical.
function alphabetical(character) { var code = typeof character === 'string' ? character.charCodeAt(0) : character return ( (code >= 97 && code <= 122) /* a-z */ || (code >= 65 && code <= 90) /* A-Z */ ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 97 && code <= 122 /* a-z */ || code >= 65 && code <= 90 /* A-Z */;\n}", "function sc_isCharAlphabetic(c)\n { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||\n\t sc_isCharOfClass(c.val, SC_UPPER_CLASS); }", "function isLetter(code) {\n return isUppercaseLetter(code) || isLowercaseLetter(code);\n}", "function isAlphabetCharacter(letter) {\n return (letter.length === 1) && /[a-z]/i.test(letter);\n}", "function isLetter(code) {\n return (\n (code >= 0x0061 && code <= 0x007a) || // A-Z\n (code >= 0x0041 && code <= 0x005a) // a-z\n );\n}", "function isAlphabet(x){\n var as = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n return (as.indexOf(x) != -1);\n}", "function isLetter(c) {\n\treturn isUppercase(c) || isLowercase(c) || c==32;\n}", "function isLetter (c)\r\n{ return ( ((c >= \"a\") && (c <= \"z\")) || ((c >= \"A\") && (c <= \"Z\")) )\r\n}", "function isLetter (c)\r\n{ return ( ((c >= \"a\") && (c <= \"z\")) || ((c >= \"A\") && (c <= \"Z\")) )\r\n}", "function isAlphabetic(string) {\n\treturn isAlphabetic1(string, true);\n}", "function isAlphabet(str) {\n var code, i, len;\n\n for (i = 0, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (\n !(code > 64 && code < 91) && // upper alpha (A-Z)\n !(code > 96 && code < 123)\n ) {\n // lower alpha (a-z)\n return false;\n }\n }\n return true;\n}", "function isAlpha(aChar)\n{\n myCharCode = aChar.charCodeAt(0);\n \n if(((myCharCode > 64) && (myCharCode < 91)) ||\n ((myCharCode > 96) && (myCharCode < 123)))\n {\n return true;\n }\n \n return false;\n}", "function isAlpha (ch){\n return /^[A-Z]$/i.test(ch);\n }", "function isAlpha (ch){\n return /^[A-Z]$/i.test(ch);\n }", "function isLetter(c) {\r\n return isUppercase(c) || isLowercase(c);\r\n}", "function isAlpha(aChar) {\n myCharCode = aChar.charCodeAt(0);\n\n if (((myCharCode > 64) && (myCharCode < 91)) ||\n ((myCharCode > 96) && (myCharCode < 123))) {\n return true;\n }\n\n return false;\n}", "function isAlpha(text) {\n\t\tif (text.length === 1) {\n\t\t\tif (alphabet.indexOf(text) !== false)\n\t\t\t\treturn true;\n\t\t} return false;\n\t}", "function isAsciiCodeAlphabet(charCode) {\n let isUpper = (charCode >= UPPER_A_CODE &&\n charCode <= UPPER_Z_CODE);\n\n let isLower = (charCode >= LOWER_A_CODE &&\n charCode <= LOWER_Z_CODE);\n\n return (isUpper || isLower);\n}", "function isalpha(char) {\n return /^[A-Z]$/i.test(char);\n}", "function isAlphabetic (s)\r\n\r\n{ var i;\r\n\r\n if (isEmpty(s))\r\n if (isAlphabetic.arguments.length == 1) return defaultEmptyOK;\r\n else return (isAlphabetic.arguments[1] == true);\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-alphabetic character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is letter.\r\n var c = s.charAt(i);\r\n\r\n if (!isLetter(c))\r\n return false;\r\n }\r\n\r\n // All characters are letters.\r\n return true;\r\n}", "function isAlphabetic (s)\r\n\r\n{ var i;\r\n\r\n if (isEmpty(s))\r\n if (isAlphabetic.arguments.length == 1) return defaultEmptyOK;\r\n else return (isAlphabetic.arguments[1] == true);\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-alphabetic character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is letter.\r\n var c = s.charAt(i);\r\n\r\n if (!isLetter(c))\r\n return false;\r\n }\r\n\r\n // All characters are letters.\r\n return true;\r\n}", "function isLetter(char) {\n const alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n return alphabet.includes(char);\n }", "function valid_alphabhet(alphabet) {\n var pola = new RegExp(/^[a-z A-Z]+$/);\n return pola.test(alphabet);\n }", "function isAlpha(c){\r\n return /^\\w$/.test(c) && /^\\D$/.test(c);\r\n}", "function isAlpha(characters) {\n return /^[A-Z ]*$/.test(characters);\n}", "function isLetter (c)\n{\nvar lowercaseLetters = \"abcdefghijklmnopqrstuvwxyzáéíóúñü.,\"\nvar uppercaseLetters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZÁÉÍÓÚÑ\"\n return( ( uppercaseLetters.indexOf( c ) != -1 ) ||\n ( lowercaseLetters.indexOf( c ) != -1 ) )\n}", "function isDigitOrAlphabetChar(c) {\nreturn ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z'));\n}", "function isLetter(char) {\r\n return char.match(/[a-z]/i);\r\n}", "function isLetter(char){\n\treturn char.match(/[a-z]/i);\n}", "function isLowercaseLetter(code) {\n return code >= 0x0061 && code <= 0x007A;\n}", "function isLetter(char) {\n return char.toLowerCase() != char.toUpperCase();\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function _alphabetChecker(alphabet) {\n if (!alphabet || alphabet.length != 26) return false;\n const alphabetArray = alphabet.split(\"\").reduce((acc, letter) => {\n if (!acc.includes(letter)) {\n acc.push(letter);\n }\n return acc;\n }, []);\n if (alphabetArray.length === 26) {\n return true;\n } else {\n return false;\n }\n }", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(c) {\n return (c.toUpperCase() != c.toLowerCase());\n}", "function validAlphabet(letter){\n\tif(letter>26){\n\t\treturn letter-26;\n\t}else if(letter<=0){\n\t\treturn letter+26;\n\t}else{\n\t\treturn letter;\n\t}\n}", "function isLetter(ch) {\n if (ch.match(/[a-zA-Z]/i)) {\n return true;\n } else {\n return false;\n }\n}", "function isLetter( character ) {\n\treturn character.toLowerCase() != character.toUpperCase();\n}", "function isLetter(key) {\n if (key.toLowerCase() != key.toUpperCase() && key.length === 1) {\n return true;\n } else {\n return false;\n }\n}", "function isLetter(str) {\r\n\tif (str.length === 1 && str.match(/[a-z]/i)) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function abcAlphaEqualizer(ABCs, alphabet) {\n ABCs.split(\"\").forEach((char) => {\n if (!alphabet.includes(char));\n return false;\n });\n return true;\n}", "function isLowerCaseAlphaKey(charCode) {\n return (charCode >= 97 && charCode <= 122);\n }", "function isLetterOrDigit(char) {\n return \"abcdefghijklmnopqrstuvwxyz0123456789\".indexOf(char) >= 0;\n }", "function isLetter(character) {\n if (character.length > 1) {\n return false;\n }\n var regex = /[A-Za-z]/;\n //character.search returns -1 if not found\n return character.search(regex) > -1;\n}", "function inputAlphabet(inputField) {\n const alphaExp = /^[a-zA-Z]+$/;\n if (inputField.value.match(alphaExp)) {\n return true;\n }\n return false;\n}", "function isAlphabeticString(string) {\n var isNotEmpty = !isEmpty(string);\n var doesNotContainDigits = !CONTAINS_DIGIT_REGEX.test(string);\n var doesNotContainInvalidChars = !/[\\{\\}\\(\\)_\\$#\"'@\\|!\\?\\+\\*%<>/]/.test(string);\n return isNotEmpty && doesNotContainDigits && doesNotContainInvalidChars;\n}", "function isAlphaNum(code) {\n return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n}", "function isAlphaNum(code) {\n return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n}", "function onlyLetters(input) {\n\tinput = input.toUpperCase();\n\tfor (var i = 0; i < input.length; i++) {\n\t\tif (input[i] > 'Z' || input[i] < 'A')\n\t\t\treturn false\n\t}\n\treturn true;\n}", "function isFirstLetter(letter, string) {\n\n}", "function isAlphaNum(code) {\n return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n }", "function isUnicodeLetter(code) {\n for (var _i = 0; _i < unicodeLetterTable.length;) {\n if (code < unicodeLetterTable[_i++]) {\n return false;\n }\n\n if (code <= unicodeLetterTable[_i++]) {\n return true;\n }\n }\n\n return false;\n }", "function isLetter(input){\n return /^[a-zA-Z()]*$/.test(input);\n}", "function isLetter(str) {\r\n\tvar re = /[^a-zA-Z]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function letterCheck(str, letter) { return str.includes(letter) }", "function isAlnum_Original(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlphabetic(string, ignoreWhiteSpace) {\n if (string.search) {\n if ((ignoreWhiteSpace && string.search(/[^a-zA-Z\\s]/) != -1) || (!ignoreWhiteSpace && string.search(/[^a-zA-Z]/) != -1)) return false;\n }\n return true;\n}", "function validateAlphabetic(value){\n if(value){ //if value isn't null\n if(/^[a-zA-Z\\s]+$/.test(value)){ //use regex to see if all the characters are between a to z or A to Z\n return {isValid: true, error: null, details: null};\n }\n return {isValid: false, error: 'Must be alphabetic', details: '\"'+value+'\" contains other characters than letters.'};\n }\n return {isValid: false, error:'Empty Field', details: 'Please fill out this field to resolve this issue.'};\n}", "function isFullLetter(char)\n{\n\tif ((char < 'a' || char > 'z') && (char <'A' || char > 'Z') && char != \" \")\n\t{\n\t\treturn false;\n\t}\n\treturn true;\n}", "function isSameLetter(a = \"_\", b = \"_\") {\n // return a.toLowerCase() === b.toLowerCase();\n return (32 | a.charCodeAt()) === b.charCodeAt();\n}", "function isChar (code) {\n\t// http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes\n\treturn code === 32 || (code > 46 && !(code >= 91 && code <= 123) && code !== 144 && code !== 145);\n}", "checkLetter(char) {\r\n if (this.phrase.includes(char)) {\r\n return char;\r\n }\r\n return null;\r\n }", "function isLetter(keyInput) {\r\n\r\n // Define default result state to avoid mix-matched data\r\n let result = false;\r\n \r\n // Verify character code is letter\r\n if (keyInput >= 65 && keyInput <= 90 || keyInput >= 97 && keyInput <= 122) {\r\n result = true;\r\n }\r\n\r\n return result;\r\n}", "function isAlphaNum(code) {\n\t return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n\t (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n\t (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n\t}", "function isAlphaName(alphan_str) {\n\t// Following code based on SIT104 prac6 exercise code\n\tvar result = true;\n\tvar range = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ- .\";\n\tvar temp;\n\n\tfor (i = 0; i < alphan_str.length; i++)\n\t{\n\t\ttemp = alphan_str.substring(i, i+1);\n\t\tif (range.indexOf(temp) == -1)\n\t\t\tresult = false;\n\t}\n\treturn result;\n}", "function isAlphabet(thisField) \r\n{\r\n\tthisField.value=trim(thisField.value);\r\n\tif(thisField.value!=\"\")\r\n\t{\r\n\t\tfor(var i = 0; i < thisField.value.length; i++) \r\n\t\t{\r\n\t\t\tvar ch = thisField.value.substring(i,i+1);\r\n\t\t\t//alert(ch);\r\n\t\t\tif(ch>=\"A\" && ch<=\"Z\") { \t\t\t\r\n\t\t\t} else if(ch>=\"a\" && ch<=\"z\") {\r\n\t\t\t} else if(ch == \" \") {\r\n\t\t\t} else if(ch== \".\"){\r\n }\r\n\t\t\t else{\r\n\t\t\t\talert(\"Enter Only Alphabets.\");\r\n\t\t\t\tthisField.value=\"\";\r\n\t\t\t\tthisField.focus();\r\n\t\t\t\t//thisField.select();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t//checkDomain(thisField); \r\n}//*********************End of Function*********************//", "function isAlpha(str) {\n var code = void 0,\n i = void 0,\n len = void 0;\n for (i = 0, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (!(code > 64 && code < 91) && // upper alpha (A-Z)\n !(code > 96 && code < 123)) {\n // lower alpha (a-z)\n return false;\n }\n }\n return true;\n}", "function isLetterOrDigit (c)\r\n{ return (isLetter(c) || isDigit(c))\r\n}", "function isLetterOrDigit (c)\r\n{ return (isLetter(c) || isDigit(c))\r\n}", "function isAnsiLetter(ch) {\n const Ascii_a = 97;\n const Ascii_z = 122;\n const Ascii_A = 65;\n const Ascii_Z = 90;\n let code = ch.charCodeAt(0);\n return (Ascii_A <= code && code <= Ascii_Z) || (Ascii_a <= code && code <= Ascii_z);\n }", "function checkForLetter(str) {\r\n\tfor (char of str) {\r\n\t\tif (isLetter(char)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function isAlphaNum(c){\r\n return /^\\w$/.test(c);\r\n}", "function isAlpha(parm)\n{\n\tvar lwr = 'abcdefghijklmnñopqrstuvwxyzàáâãäåæçèéêëìíîïðòóôõöøùúûüýþÿ ';\n\tvar upr = 'ABCDEFGHIJKLMNÑOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÒÓÔÕÖרÙÚÛÜÝÞß';\n\tvar val = lwr+upr;\n\tif (parm == \"\") return true;\n\tfor (i=0; i<parm.length; i++)\n\t{\n\t\tif (val.indexOf(parm.charAt(i),0) == -1) return false;\n\t}\n\treturn true;\n}", "function isLowercase(c) {\r\n return 97 <= c && c <= 122; \r\n }", "function isAAlphebetCharacter() {\n for (i = 0; i < alphabet.length; i++) {\n if (userInput === alphabet[i]) {\n return true;\n }\n }\n}", "function validateAlphabet(alphabet) {\n switch(alphabet) {\n case AlphabetType.RFC_1421:\n case AlphabetType.RFC_2045:\n case AlphabetType.RFC_3548:\n case AlphabetType.RFC_4880:\n case AlphabetType.RFC_1642:\n case AlphabetType.RFC_3501:\n case AlphabetType.RFC_4648:\n case AlphabetType.FILE_SAFE:\n case AlphabetType.RFC_6920:\n case AlphabetType.YUI:\n case AlphabetType.XML_NAME_TOKEN:\n case AlphabetType.PROGRAM_IDENTIFIERS_V2:\n case AlphabetType.XML_IDENTIFIER:\n case AlphabetType.PROGRAM_IDENTIFIERS_V1:\n case AlphabetType.REGULAR_EXPRESSIONS:\n case AlphabetType.FREENET:\n return true;\n\n default:\n throw new Error(\"Unknown alphabet (\"+alphabet+\")\");\n }\n}", "function isAlphaNumeric(char){\n let code = char.charCodeAt(0);\n if(!(code > 47 && code < 58) &&\n !(code > 64 && code < 91) &&\n !(code > 96 && code < 123)){\n return false;\n }\n return true;\n}", "function isFirstLetter(letter, string) {\n return (string.charAt(0) === letter);\n}", "function checkLetter (letter)\r\n{\r\n\tif (letter.match(/[a-z]/i) || letter.match(/[A-Z]/i) || letter.match(/[0-9]/i))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function isAlnum_(char) {\n return char >= 'A' && char <= 'Z'\n || char >= 'a' && char <= 'z' \n || isDigit_(char);\n}", "function isAlphaNumeric(char) {\n var code = char.charCodeAt(0);\n if (!(code > 47 && code < 58) && !(code > 64 && code < 91) && !(code > 96 && code < 123)) {\n return false;\n }\n return true;\n}", "function matchChar() {\n\t\tvar pattern = /^[a-z]/;\n\t\tvar x = lexString.match(pattern);\n\t\tif(x !== null) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function isAlphaNumeric(char) {\n var code = char.charCodeAt(0);\n if (!(code > 47 && code < 58) &&\n !(code > 64 && code < 91) &&\n !(code > 96 && code < 123)) {\n return false\n }\n return true\n}", "function isLetter(myString){\n return /[a-zA-Z]/.test(myString);\n}", "function alphanumerical(character) {\n return alphabetical(character) || decimal(character)\n}", "function alphanumerical(character) {\n return alphabetical(character) || decimal(character)\n}", "function alphanumerical(character) {\n return alphabetical(character) || decimal(character)\n}", "function alphanumerical(character) {\n return alphabetical(character) || decimal(character)\n}", "function alphanumerical(character) {\n return alphabetical(character) || decimal(character)\n}", "function alphanumerical(character) {\n return alphabetical(character) || decimal(character)\n}", "function alphanumerical(character) {\n return alphabetical(character) || decimal(character)\n}", "function isLetter(codepoint) {\n return ((codepoint >= Character.a && codepoint <= Character.z) ||\n (codepoint >= Character.A && codepoint <= Character.Z));\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}" ]
[ "0.8075103", "0.8058104", "0.7876275", "0.78079677", "0.7781606", "0.7738573", "0.77375126", "0.7683825", "0.7683825", "0.7679425", "0.7608251", "0.7583648", "0.7579424", "0.75713086", "0.75505906", "0.74917066", "0.74879587", "0.74806297", "0.74661064", "0.7437811", "0.7437811", "0.7434147", "0.7350854", "0.7293664", "0.72805005", "0.7272301", "0.72699726", "0.7233188", "0.72187275", "0.7213911", "0.7213227", "0.72122484", "0.71946794", "0.7192744", "0.7192744", "0.71801156", "0.7169931", "0.71645796", "0.7151469", "0.71307343", "0.7126536", "0.70927596", "0.70833844", "0.7077546", "0.7073933", "0.7047639", "0.70138156", "0.7010823", "0.7010823", "0.69938654", "0.6993088", "0.6985583", "0.6969841", "0.69634557", "0.6957335", "0.6947149", "0.6926468", "0.6925999", "0.6919467", "0.6902753", "0.6892189", "0.6877932", "0.68746626", "0.6868854", "0.68658745", "0.6863878", "0.68589264", "0.68565124", "0.68529767", "0.68529767", "0.6844584", "0.6842836", "0.68422186", "0.68353313", "0.6832119", "0.68260527", "0.6825086", "0.6806928", "0.6797743", "0.67875737", "0.6786603", "0.67772645", "0.6769739", "0.67477083", "0.67251563", "0.67247194", "0.67247194", "0.67247194", "0.67247194", "0.67247194", "0.67247194", "0.67247194", "0.6716557", "0.670038" ]
0.7922871
8
Gets indentation information for a line.
function indentation(value) { var index = 0; var indent = 0; var character = value.charAt(index); var stops = {}; var size; while (character in characters) { size = characters[character]; indent += size; if (size > 1) { indent = Math.floor(indent / size) * size; } stops[indent] = index; character = value.charAt(++index); } return {indent: indent, stops: stops}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIndent (line) {\n return line.match(/^\\s*/)[0].length\n}", "getCurrentLineIndentation() {\n return this.currentLine.length - Utils.ltrim(this.currentLine, ' ').length;\n }", "function indentLevel(linea) {\n var level = 0;\n for ( i in linea ) {\n if ( linea[i] != ' ' ) { break;}\n level += 1;\n }\n return (level);\n}", "baseIndentFor(node) {\n let line = this.state.doc.lineAt(node.from);\n // Skip line starts that are covered by a sibling (or cousin, etc)\n for (;;) {\n let atBreak = node.resolve(line.from);\n while (atBreak.parent && atBreak.parent.from == atBreak.from)\n atBreak = atBreak.parent;\n if (isParent(atBreak, node))\n break;\n line = this.state.doc.lineAt(atBreak.from);\n }\n return this.lineIndent(line.from);\n }", "get firstLineIndent() {\n return this.firstLineIndentIn;\n }", "function getIndentationOffset(text, indentation, tabSize) {\r\n var distance = regex_1.getDistance(text, tabSize);\r\n return { offset: indentation - distance, distance: distance };\r\n}", "function renderIndentation(inputObject, inputLine) {\n\n var leadingIndentTag = \"<a class=\\\"mIndentation\\\" data-toggle=\\\"tooltip\\\" data-placement=\\\"top\\\" title=\\\"Line Level\\\">\";\n var trailingTag = \"</a>\";\n var tmpIndentation = \"\";\n\n if (inputObject.lineIndentationArray) {\n if (inputObject.lineIndentationArray.length > 0) {\n for (var i in inputObject.lineIndentationArray) {\n tmpIndentation = tmpIndentation + leadingIndentTag + \".\" + trailingTag + inputObject.lineIndentationArray[i];\n }\n inputLine = inputLine + tmpIndentation;\n }\n }\n return inputLine;\n}", "function findIndentationPositionInLineAndTallyOpenBrackets(line, tallies, tabSize) {\n var bracketPositions = allBracketsInString(line);\n // No brackets in this line\n if (bracketPositions.length === 0) {\n return null;\n }\n var offset = 1;\n for (var i = bracketPositions.length - 1; i >= 0; --i) {\n var position = bracketPositions[i];\n var char = line[position];\n if (isClosingBracket(char)) {\n tallies.addToTallyForBracket(char, 1);\n }\n else if (tallies.bracketTallyForBracket(char) == 0) {\n // An open bracket that has no matching closing bracket -- we want to indent to the column after it!\n if (!useDefaultNewlineIndent && position == line.length - 1) {\n // It was the last character on the line, thus we want to\n // indent to tabSize characters after the next open bracket\n offset += tabSize;\n continue;\n }\n return columnOfCharacterInLine(line, position, tabSize) + offset;\n }\n else {\n tallies.addToTallyForBracket(char, -1);\n }\n }\n // All brackets on this line were closed before the cursor.\n return null;\n}", "indentation() {\n var _a;\n return (_a = this.overrideIndent) !== null && _a !== void 0 ? _a : countCol(this.string, null, this.tabSize);\n }", "function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }", "function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }", "function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }", "function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }", "function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }", "function getIndentation(context, pos) {\n if (context instanceof state.EditorState)\n context = new IndentContext(context);\n for (let service of context.state.facet(indentService)) {\n let result = service(context, pos);\n if (result !== undefined)\n return result;\n }\n let tree = syntaxTree(context.state);\n return tree ? syntaxIndentation(context, tree, pos) : null;\n}", "async _indentToLine() {\n const editor = vscode.window.activeTextEditor;\n\n if (editor && editor.selection.active.line) {\n const pos = editor.selection.active;\n\n await this._addUnderscore(editor.document, pos, '');\n\n // Update current line and preceeding lines\n const {lines, firstRow} = MagikUtils.indentRegion();\n if (lines) {\n await this._indentMagikLines(lines, firstRow, pos.line, true);\n }\n }\n }", "function getIndent()\n{\n var indent = \"\";\n \n for(var i=0; i < indentAmount; i++)\n {\n indent += indentValue;\n }\n \n return indent;\n}", "getInheritIndentForLine(autoIndent, model, lineNumber, honorIntentialIndent = true) {\r\n if (autoIndent < 4 /* Full */) {\r\n return null;\r\n }\r\n const indentRulesSupport = this.getIndentRulesSupport(model.getLanguageIdentifier().id);\r\n if (!indentRulesSupport) {\r\n return null;\r\n }\r\n if (lineNumber <= 1) {\r\n return {\r\n indentation: '',\r\n action: null\r\n };\r\n }\r\n const precedingUnIgnoredLine = this.getPrecedingValidLine(model, lineNumber, indentRulesSupport);\r\n if (precedingUnIgnoredLine < 0) {\r\n return null;\r\n }\r\n else if (precedingUnIgnoredLine < 1) {\r\n return {\r\n indentation: '',\r\n action: null\r\n };\r\n }\r\n const precedingUnIgnoredLineContent = model.getLineContent(precedingUnIgnoredLine);\r\n if (indentRulesSupport.shouldIncrease(precedingUnIgnoredLineContent) || indentRulesSupport.shouldIndentNextLine(precedingUnIgnoredLineContent)) {\r\n return {\r\n indentation: strings.getLeadingWhitespace(precedingUnIgnoredLineContent),\r\n action: IndentAction.Indent,\r\n line: precedingUnIgnoredLine\r\n };\r\n }\r\n else if (indentRulesSupport.shouldDecrease(precedingUnIgnoredLineContent)) {\r\n return {\r\n indentation: strings.getLeadingWhitespace(precedingUnIgnoredLineContent),\r\n action: null,\r\n line: precedingUnIgnoredLine\r\n };\r\n }\r\n else {\r\n // precedingUnIgnoredLine can not be ignored.\r\n // it doesn't increase indent of following lines\r\n // it doesn't increase just next line\r\n // so current line is not affect by precedingUnIgnoredLine\r\n // and then we should get a correct inheritted indentation from above lines\r\n if (precedingUnIgnoredLine === 1) {\r\n return {\r\n indentation: strings.getLeadingWhitespace(model.getLineContent(precedingUnIgnoredLine)),\r\n action: null,\r\n line: precedingUnIgnoredLine\r\n };\r\n }\r\n const previousLine = precedingUnIgnoredLine - 1;\r\n const previousLineIndentMetadata = indentRulesSupport.getIndentMetadata(model.getLineContent(previousLine));\r\n if (!(previousLineIndentMetadata & (1 /* INCREASE_MASK */ | 2 /* DECREASE_MASK */)) &&\r\n (previousLineIndentMetadata & 4 /* INDENT_NEXTLINE_MASK */)) {\r\n let stopLine = 0;\r\n for (let i = previousLine - 1; i > 0; i--) {\r\n if (indentRulesSupport.shouldIndentNextLine(model.getLineContent(i))) {\r\n continue;\r\n }\r\n stopLine = i;\r\n break;\r\n }\r\n return {\r\n indentation: strings.getLeadingWhitespace(model.getLineContent(stopLine + 1)),\r\n action: null,\r\n line: stopLine + 1\r\n };\r\n }\r\n if (honorIntentialIndent) {\r\n return {\r\n indentation: strings.getLeadingWhitespace(model.getLineContent(precedingUnIgnoredLine)),\r\n action: null,\r\n line: precedingUnIgnoredLine\r\n };\r\n }\r\n else {\r\n // search from precedingUnIgnoredLine until we find one whose indent is not temporary\r\n for (let i = precedingUnIgnoredLine; i > 0; i--) {\r\n const lineContent = model.getLineContent(i);\r\n if (indentRulesSupport.shouldIncrease(lineContent)) {\r\n return {\r\n indentation: strings.getLeadingWhitespace(lineContent),\r\n action: IndentAction.Indent,\r\n line: i\r\n };\r\n }\r\n else if (indentRulesSupport.shouldIndentNextLine(lineContent)) {\r\n let stopLine = 0;\r\n for (let j = i - 1; j > 0; j--) {\r\n if (indentRulesSupport.shouldIndentNextLine(model.getLineContent(i))) {\r\n continue;\r\n }\r\n stopLine = j;\r\n break;\r\n }\r\n return {\r\n indentation: strings.getLeadingWhitespace(model.getLineContent(stopLine + 1)),\r\n action: null,\r\n line: stopLine + 1\r\n };\r\n }\r\n else if (indentRulesSupport.shouldDecrease(lineContent)) {\r\n return {\r\n indentation: strings.getLeadingWhitespace(lineContent),\r\n action: null,\r\n line: i\r\n };\r\n }\r\n }\r\n return {\r\n indentation: strings.getLeadingWhitespace(model.getLineContent(1)),\r\n action: null,\r\n line: 1\r\n };\r\n }\r\n }\r\n }", "function num_indent (line, indent_string) {\n\tvar amt = 0;\n\tvar index = 0;\n\twhile (line.substring(index, index + indent_string.length) == indent_string) {\n\t\tamt += 1;\n\t\tindex += indent_string.length;\n\t}\n\treturn amt;\n}", "function getIndentation(s) {\n let indentation = s.match(/[ \\t]*/)[0];\n indentation = indentation.replace(/\\t/g, INDENT); // replace tabs by INDENT\n return Math.floor(indentation.length / INDENT.length);\n }", "lineIndent(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let override = this.options.overrideIndentation;\n if (override) {\n let overriden = override(from);\n if (overriden > -1)\n return overriden;\n }\n return this.countColumn(text, text.search(/\\S|$/));\n }", "indent() {\n var session = this.session;\n var range = this.getSelectionRange();\n\n if (range.start.row < range.end.row) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n } else if (range.start.column < range.end.column) {\n var text = session.getTextRange(range);\n if (!/^\\s+$/.test(text)) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n }\n }\n \n var line = session.getLine(range.start.row);\n var position = range.start;\n var size = session.getTabSize();\n var column = session.documentToScreenColumn(position.row, position.column);\n\n if (this.session.getUseSoftTabs()) {\n var count = (size - column % size);\n var indentString = lang.stringRepeat(\" \", count);\n } else {\n var count = column % size;\n while (line[range.start.column - 1] == \" \" && count) {\n range.start.column--;\n count--;\n }\n this.selection.setSelectionRange(range);\n indentString = \"\\t\";\n }\n return this.insert(indentString);\n }", "function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) {\n // actual indentation is used for statements\\declarations if one of cases below is true:\n // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually\n // - parent and child are not on the same line\n var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) &&\n (parent.kind === 256 /* SourceFile */ || !parentAndChildShareLine);\n if (!useActualIndentation) {\n return -1 /* Unknown */;\n }\n return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options);\n }", "function getCurrentIndent(opts, value) {\n if (opts.getIndent) {\n return opts.getIndent(value)\n }\n\n const currentCode = getCurrentCode(opts, value)\n if (!currentCode) {\n return ''\n }\n\n const text = currentCode\n .getTexts()\n .map((t) => t.text)\n .join('\\n')\n return getIndent(text)\n}", "function indentLine(cm, n, how, aggressive) {\n\t\t var doc = cm.doc, state;\n\t\t if (how == null) { how = \"add\"; }\n\t\t if (how == \"smart\") {\n\t\t // Fall back to \"prev\" when the mode doesn't have an indentation\n\t\t // method.\n\t\t if (!doc.mode.indent) { how = \"prev\"; }\n\t\t else { state = getContextBefore(cm, n).state; }\n\t\t }\n\n\t\t var tabSize = cm.options.tabSize;\n\t\t var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n\t\t if (line.stateAfter) { line.stateAfter = null; }\n\t\t var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n\t\t if (!aggressive && !/\\S/.test(line.text)) {\n\t\t indentation = 0;\n\t\t how = \"not\";\n\t\t } else if (how == \"smart\") {\n\t\t indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n\t\t if (indentation == Pass || indentation > 150) {\n\t\t if (!aggressive) { return }\n\t\t how = \"prev\";\n\t\t }\n\t\t }\n\t\t if (how == \"prev\") {\n\t\t if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n\t\t else { indentation = 0; }\n\t\t } else if (how == \"add\") {\n\t\t indentation = curSpace + cm.options.indentUnit;\n\t\t } else if (how == \"subtract\") {\n\t\t indentation = curSpace - cm.options.indentUnit;\n\t\t } else if (typeof how == \"number\") {\n\t\t indentation = curSpace + how;\n\t\t }\n\t\t indentation = Math.max(0, indentation);\n\n\t\t var indentString = \"\", pos = 0;\n\t\t if (cm.options.indentWithTabs)\n\t\t { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n\t\t if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n\t\t if (indentString != curSpaceString) {\n\t\t replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n\t\t line.stateAfter = null;\n\t\t return true\n\t\t } else {\n\t\t // Ensure that, if the cursor was in the whitespace at the start\n\t\t // of the line, it is moved to the end of that space.\n\t\t for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n\t\t var range = doc.sel.ranges[i$1];\n\t\t if (range.head.line == n && range.head.ch < curSpaceString.length) {\n\t\t var pos$1 = Pos(n, curSpaceString.length);\n\t\t replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n\t\t break\n\t\t }\n\t\t }\n\t\t }\n\t\t }", "function indention() {\n return parser(function (ps) {\n var snapshot = ps.snapshot();\n\n if (ps.indent === 0) {\n return ps.succeed(0);\n }\n\n var satisy = function (ch, pos) {\n return pos < ps.indent && ch === 0x09;\n };\n var tabs = ps.skipAdvance(satisy);\n\n if (tabs !== ps.indent) {\n ps.restore(snapshot);\n return ps.fail();\n }\n\n return ps.succeed(tabs);\n });\n }", "function indentLine(cm, n, how, aggressive) {\n\t\t var doc = cm.doc, state;\n\t\t if (how == null) how = \"add\";\n\t\t if (how == \"smart\") {\n\t\t // Fall back to \"prev\" when the mode doesn't have an indentation\n\t\t // method.\n\t\t if (!doc.mode.indent) how = \"prev\";\n\t\t else state = getStateBefore(cm, n);\n\t\t }\n\t\t\n\t\t var tabSize = cm.options.tabSize;\n\t\t var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n\t\t if (line.stateAfter) line.stateAfter = null;\n\t\t var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n\t\t if (!aggressive && !/\\S/.test(line.text)) {\n\t\t indentation = 0;\n\t\t how = \"not\";\n\t\t } else if (how == \"smart\") {\n\t\t indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n\t\t if (indentation == Pass || indentation > 150) {\n\t\t if (!aggressive) return;\n\t\t how = \"prev\";\n\t\t }\n\t\t }\n\t\t if (how == \"prev\") {\n\t\t if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n\t\t else indentation = 0;\n\t\t } else if (how == \"add\") {\n\t\t indentation = curSpace + cm.options.indentUnit;\n\t\t } else if (how == \"subtract\") {\n\t\t indentation = curSpace - cm.options.indentUnit;\n\t\t } else if (typeof how == \"number\") {\n\t\t indentation = curSpace + how;\n\t\t }\n\t\t indentation = Math.max(0, indentation);\n\t\t\n\t\t var indentString = \"\", pos = 0;\n\t\t if (cm.options.indentWithTabs)\n\t\t for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n\t\t if (pos < indentation) indentString += spaceStr(indentation - pos);\n\t\t\n\t\t if (indentString != curSpaceString) {\n\t\t replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n\t\t line.stateAfter = null;\n\t\t return true;\n\t\t } else {\n\t\t // Ensure that, if the cursor was in the whitespace at the start\n\t\t // of the line, it is moved to the end of that space.\n\t\t for (var i = 0; i < doc.sel.ranges.length; i++) {\n\t\t var range = doc.sel.ranges[i];\n\t\t if (range.head.line == n && range.head.ch < curSpaceString.length) {\n\t\t var pos = Pos(n, curSpaceString.length);\n\t\t replaceOneSelection(doc, i, new Range(pos, pos));\n\t\t break;\n\t\t }\n\t\t }\n\t\t }\n\t\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t { line = merged.find(-1, true).line; }\n\t\t return line\n\t\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n var merged;\n\n while (merged = collapsedSpanAtStart(line)) {\n line = merged.find(-1, true).line;\n }\n\n return line;\n }", "indent(level) {\n this.level = this.level || 1;\n if (level) {\n this.level += level;\n return '';\n }\n return Array(this.level).join(this.indentation);\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "getYForLine(line) {\n const options = this.options;\n const spacing = options.spacing_between_lines_px;\n const headroom = options.space_above_staff_ln;\n\n const y = this.y + (line * spacing) + (headroom * spacing);\n\n return y;\n }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t line = merged.find(-1, true).line;\n\t\t return line;\n\t\t }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function indentLines(text, indentation) {\n return text.join(\"\\n\").replace(/^/gm, indentation);\n }", "function indentLine(cm, n, how, aggressive) {\n\t var doc = cm.doc, state;\n\t if (how == null) how = \"add\";\n\t if (how == \"smart\") {\n\t // Fall back to \"prev\" when the mode doesn't have an indentation\n\t // method.\n\t if (!doc.mode.indent) how = \"prev\";\n\t else state = getStateBefore(cm, n);\n\t }\n\t\n\t var tabSize = cm.options.tabSize;\n\t var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n\t if (line.stateAfter) line.stateAfter = null;\n\t var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n\t if (!aggressive && !/\\S/.test(line.text)) {\n\t indentation = 0;\n\t how = \"not\";\n\t } else if (how == \"smart\") {\n\t indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n\t if (indentation == Pass || indentation > 150) {\n\t if (!aggressive) return;\n\t how = \"prev\";\n\t }\n\t }\n\t if (how == \"prev\") {\n\t if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n\t else indentation = 0;\n\t } else if (how == \"add\") {\n\t indentation = curSpace + cm.options.indentUnit;\n\t } else if (how == \"subtract\") {\n\t indentation = curSpace - cm.options.indentUnit;\n\t } else if (typeof how == \"number\") {\n\t indentation = curSpace + how;\n\t }\n\t indentation = Math.max(0, indentation);\n\t\n\t var indentString = \"\", pos = 0;\n\t if (cm.options.indentWithTabs)\n\t for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n\t if (pos < indentation) indentString += spaceStr(indentation - pos);\n\t\n\t if (indentString != curSpaceString) {\n\t replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n\t line.stateAfter = null;\n\t return true;\n\t } else {\n\t // Ensure that, if the cursor was in the whitespace at the start\n\t // of the line, it is moved to the end of that space.\n\t for (var i = 0; i < doc.sel.ranges.length; i++) {\n\t var range = doc.sel.ranges[i];\n\t if (range.head.line == n && range.head.ch < curSpaceString.length) {\n\t var pos = Pos(n, curSpaceString.length);\n\t replaceOneSelection(doc, i, new Range(pos, pos));\n\t break;\n\t }\n\t }\n\t }\n\t }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n line = merged.find(-1, true).line;\r\n return line;\r\n }", "function findIndentation(input)\n{\n\tvar count = 0;\n\n\tif (input.length === 0)\n\t{\n\t\treturn 0;\n\t}\n\n\treturn input.split(/[^ \\t\\r\\n]/)[0].length; //**returns the number of tabs as well as the number of spaces!!!\n}", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc,\n state;\n\n if (how == null) {\n how = \"add\";\n }\n\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) {\n how = \"prev\";\n } else {\n state = getContextBefore(cm, n).state;\n }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n),\n curSpace = countColumn(line.text, null, tabSize);\n\n if (line.stateAfter) {\n line.stateAfter = null;\n }\n\n var curSpaceString = line.text.match(/^\\s*/)[0],\n indentation;\n\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) {\n return;\n }\n\n how = \"prev\";\n }\n }\n\n if (how == \"prev\") {\n if (n > doc.first) {\n indentation = countColumn(getLine(doc, n - 1).text, null, tabSize);\n } else {\n indentation = 0;\n }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n\n indentation = Math.max(0, indentation);\n var indentString = \"\",\n pos = 0;\n\n if (cm.options.indentWithTabs) {\n for (var i = Math.floor(indentation / tabSize); i; --i) {\n pos += tabSize;\n indentString += \"\\t\";\n }\n }\n\n if (pos < indentation) {\n indentString += spaceStr(indentation - pos);\n }\n\n if (indentString != curSpaceString) {\n _replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n\n line.stateAfter = null;\n return true;\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break;\n }\n }\n }\n } // This will be set to a {lineWise: bool, text: [string]} object, so", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n { line = merged.find(-1, true).line; }\r\n return line\r\n}", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) how = \"add\";\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) how = \"prev\";\n else state = getStateBefore(cm, n);\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) line.stateAfter = null;\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) return;\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n else indentation = 0;\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n if (pos < indentation) indentString += spaceStr(indentation - pos);\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i, new Range(pos, pos));\n break;\n }\n }\n }\n line.stateAfter = null;\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) how = \"add\";\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) how = \"prev\";\n else state = getStateBefore(cm, n);\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) line.stateAfter = null;\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) return;\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n else indentation = 0;\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n if (pos < indentation) indentString += spaceStr(indentation - pos);\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i, new Range(pos, pos));\n break;\n }\n }\n }\n line.stateAfter = null;\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) how = \"add\";\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) how = \"prev\";\n else state = getStateBefore(cm, n);\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) line.stateAfter = null;\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) return;\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n else indentation = 0;\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n if (pos < indentation) indentString += spaceStr(indentation - pos);\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i, new Range(pos, pos));\n break;\n }\n }\n }\n line.stateAfter = null;\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) how = \"add\";\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) how = \"prev\";\n else state = getStateBefore(cm, n);\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) line.stateAfter = null;\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) return;\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n else indentation = 0;\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n if (pos < indentation) indentString += spaceStr(indentation - pos);\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i, new Range(pos, pos));\n break;\n }\n }\n }\n line.stateAfter = null;\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) how = \"add\";\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) how = \"prev\";\n else state = getStateBefore(cm, n);\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) line.stateAfter = null;\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) return;\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n else indentation = 0;\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n if (pos < indentation) indentString += spaceStr(indentation - pos);\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true;\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i, new Range(pos, pos));\n break;\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) how = \"add\";\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) how = \"prev\";\n else state = getStateBefore(cm, n);\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) line.stateAfter = null;\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) return;\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n else indentation = 0;\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n if (pos < indentation) indentString += spaceStr(indentation - pos);\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true;\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i, new Range(pos, pos));\n break;\n }\n }\n }\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) how = \"add\";\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!cm.doc.mode.indent) how = \"prev\";\n else state = getStateBefore(cm, n);\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) line.stateAfter = null;\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = cm.doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass) {\n if (!aggressive) return;\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n else indentation = 0;\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n if (pos < indentation) indentString += spaceStr(indentation - pos);\n\n if (indentString != curSpaceString) {\n replaceRange(cm.doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i, new Range(pos, pos));\n break;\n }\n }\n }\n line.stateAfter = null;\n }", "function getIndentText(text, node) {\n return leadingWhitespaceRegex.exec(text.slice(getBeginningOfLineOffset(node)))[0];\n}", "function indentLine(cm, n, how, aggressive) {\r\n var doc = cm.doc, state;\r\n if (how == null) { how = \"add\"; }\r\n if (how == \"smart\") {\r\n // Fall back to \"prev\" when the mode doesn't have an indentation\r\n // method.\r\n if (!doc.mode.indent) { how = \"prev\"; }\r\n else { state = getContextBefore(cm, n).state; }\r\n }\r\n\r\n var tabSize = cm.options.tabSize;\r\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\r\n if (line.stateAfter) { line.stateAfter = null; }\r\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\r\n if (!aggressive && !/\\S/.test(line.text)) {\r\n indentation = 0;\r\n how = \"not\";\r\n } else if (how == \"smart\") {\r\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\r\n if (indentation == Pass || indentation > 150) {\r\n if (!aggressive) { return }\r\n how = \"prev\";\r\n }\r\n }\r\n if (how == \"prev\") {\r\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\r\n else { indentation = 0; }\r\n } else if (how == \"add\") {\r\n indentation = curSpace + cm.options.indentUnit;\r\n } else if (how == \"subtract\") {\r\n indentation = curSpace - cm.options.indentUnit;\r\n } else if (typeof how == \"number\") {\r\n indentation = curSpace + how;\r\n }\r\n indentation = Math.max(0, indentation);\r\n\r\n var indentString = \"\", pos = 0;\r\n if (cm.options.indentWithTabs)\r\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\r\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\r\n\r\n if (indentString != curSpaceString) {\r\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\r\n line.stateAfter = null;\r\n return true\r\n } else {\r\n // Ensure that, if the cursor was in the whitespace at the start\r\n // of the line, it is moved to the end of that space.\r\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\r\n var range = doc.sel.ranges[i$1];\r\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\r\n var pos$1 = Pos(n, curSpaceString.length);\r\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\r\n break\r\n }\r\n }\r\n }\r\n}", "get lineNumber() {\n return this._lineNum;\n }", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n}", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n}", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n}", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n}", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n}", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n}", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n}", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n}", "function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n}" ]
[ "0.7321178", "0.68024457", "0.673355", "0.6241265", "0.6205445", "0.6142215", "0.61237204", "0.5931858", "0.5885914", "0.58800983", "0.58800983", "0.58800983", "0.58800983", "0.58800983", "0.58320516", "0.57890755", "0.5771645", "0.57372", "0.5698956", "0.565636", "0.5610286", "0.559663", "0.55583924", "0.5553523", "0.5465671", "0.5455806", "0.5451199", "0.5419539", "0.54084724", "0.54084724", "0.54084724", "0.54068565", "0.5405934", "0.5405041", "0.5405041", "0.5405041", "0.5405041", "0.5405041", "0.5405041", "0.5405041", "0.5404636", "0.5400984", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53950757", "0.53878176", "0.5381895", "0.53748184", "0.5365235", "0.5337524", "0.53279686", "0.5320145", "0.5320145", "0.5320145", "0.5320145", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5318036", "0.5306113", "0.5306113", "0.530134", "0.530111", "0.5298175", "0.529766", "0.52892154", "0.52892154", "0.52892154", "0.52892154", "0.52892154", "0.52892154", "0.52892154", "0.52892154", "0.52892154" ]
0.0
-1
wrapper for elt, which removes the elt from the accessibility tree
function eltP(tag, content, className, style) { var e = elt(tag, content, className, style); e.setAttribute("role", "presentation"); return e }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeElement() {\n this.el.parentNode.removeChild(this.el);\n }", "function removeElement(elem){ if (elem) elem.parentNode.removeChild(elem) }", "function removeElement(elem){ if (elem) elem.parentNode.removeChild(elem) }", "@chained\n\tremove() {\n\t\tlet parent = this.element.parentNode;\n\t\tparent.removeChild(this.element);\n\t}", "function removeElement(element) {\n\n element.outerHTML = \"\";\n delete element;\n\n}", "static deleteDomElement(element) {\n element.parentNode.removeChild(element);\n }", "function remove(el) {\r\n el.parentNode.removeChild(el);\r\n }", "function removeElement (el) {\n if (el.parentNode) {\n el.parentNode.removeChild(el);\n }\n }", "function removeElement(elm) {\n elm.parentNode.removeChild(elm);\n}", "static removeBook(el) {\n el.parentElement.parentElement.parentElement.remove();\n }", "remove() {\n this.#el.remove();\n }", "delete () {\n this.element = this.element.delete(this)\n }", "remove() {\n this.element.remove();\n }", "function removeElement(elem) {\r\n\telem.parentNode.removeChild(elem);\r\n}", "removeBook(ele){\n ele.parentNode.parentNode.remove();\n }", "function removeElement(elem) {\n\telem.parentNode.removeChild(elem);\n}", "function remove(el) {\n var parent = el.parentNode;\n\n if (parent) {\n parent.removeChild(el);\n }\n } // @function empty(el: HTMLElement)", "function apagarButton(element) {\n console.log(element);\n element.parentNode.parentNode.remove();\n}", "remove() {\n try { this.element.remove(); }\n catch (e) {}\n }", "__remove() {\n this.__detach();\n this.attrs.onRemoved && this.attrs.onRemoved.trigger();\n this.removed();\n Akili.removeScope(this.__scope.__name);\n this.el.remove();\n }", "function unrefElement(elRef) {\n var _a, _b;\n\n const plain = unref(elRef);\n return (_b = (_a = plain) === null || _a === void 0 ? void 0 : _a.$el) !== null && _b !== void 0 ? _b : plain;\n}", "unregister(element) {\n const set = this.getSet(element.name);\n set.set.delete(element);\n set.ordered = null;\n if (set.selected == element) {\n set.selected = null;\n }\n }", "remove () {\n $(this.element).remove ();\n }", "function mg_exit_and_remove (elem) {\n elem.exit().remove();\n}", "function removeElement(el) {\n if (typeof el.remove !== 'undefined') {\n el.remove()\n } else {\n el.parentNode.removeChild(el)\n }\n}", "removeElement(element) {\n this.node.removeChild(element.node);\n return this;\n }", "function removeElement(elem){if(elem.prev)elem.prev.next=elem.next;if(elem.next)elem.next.prev=elem.prev;if(elem.parent){var childs=elem.parent.children;childs.splice(childs.lastIndexOf(elem),1);}}", "domRemoveChildren(el) {\n if (!el) return;\n while (el.firstChild) {\n el.firstChild.remove();\n };\n }", "function removeElement(elem) {\n if (elem.prev) elem.prev.next = elem.next;\n if (elem.next) elem.next.prev = elem.prev;\n if (elem.parent) {\n var childs = elem.parent.children;\n childs.splice(childs.lastIndexOf(elem), 1);\n }\n }", "unmount() {\n let el;\n\n try {\n el = this.el;\n } catch (error) {\n return;\n }\n\n if (el.parentNode) {\n el.parentNode.removeChild(this.el); // use removeChild for IE11 support\n }\n }", "function removeElement(element) {\n\t element && element.parentNode && element.parentNode.removeChild(element);\n\t }", "function removeElement(element) {\n\t element && element.parentNode && element.parentNode.removeChild(element);\n\t }", "function removeElement(element) {\n\t element && element.parentNode && element.parentNode.removeChild(element);\n\t }", "function removeElement(element) {\n\t element && element.parentNode && element.parentNode.removeChild(element);\n\t }", "function remove(element) {\n element.parentNode.removeChild(element);\n\n}", "function del(elt) {\n //if the element is a garden with plants, remove the plants from local storage first\n if (elt.id[0] === \"g\") {\n let plants = elt.getElementsByTagName(\"g\");\n for (let i = 0, len = plants.length; i < len; i++) {\n removeFromLocalStorage(plants[i].id);\n }\n }\n //next remove the element from html (if a garden, plants will be deleted as part of garden's group)\n elt.parentElement.removeChild(elt);\n //finally, remove the element from local storage\n removeFromLocalStorage(elt.id);\n}", "delete() {\n this.eachElem((node) => {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n });\n }", "delete() {\n this.eachElem((node) => {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n });\n }", "function apagarButton(element) {\n element.parentNode.parentNode.remove();\n}", "function removeElement() {\n if(this instanceof HTMLCollection || this instanceof NodeList) {\n for(var i = 0; i < this.length; i++) {\n this[i].parentNode.removeChild(this);\n }\n }\n else if(this instanceof HTMLElement) {\n this.parentNode.removeChild(this);\n }\n }", "function detachElement(element, opts) {\n if (element[0].parentNode === opts.parent[0]) {\n opts.parent[0].removeChild(element[0]);\n }\n }", "function deleteElement(element){\n\t\tvar deleted = null;\n\t\tvar dc = element.dotComponent;\n\t\tif(dc){\n\t\t\tvar d = dc.__prms.deleting;\n\t\t\td && d.apply(dc);\n\t\t\tdc.$el = null;\n\t\t\tdeleted = dc.__prms.deleted;\n\t\t}\n\t\tif(element.parentNode) element.parentNode.removeChild(element);\n\t\tdeleted && deleted.apply(dc);\n\t}", "del(_id) {\n const _elem = this._elements[_id];\n const i = this._elemTodo.indexOf(_id);\n if (i !== -1) {\n this._elemTodo.splice(i, 1);\n }\n delete this._styleCache[_id];\n delete this._elemTodoH[_id];\n delete this._elements[_id];\n this._freeElemIds.push(_id);\n const _parent = _elem.parentNode;\n if (_parent) {\n _parent.removeChild(_elem);\n }\n else {\n console.warn('ELEM.del(', _id,\n '): Invalid parent: ', _parent,\n 'for elem:', _elem);\n }\n }", "del(_id) {\n const _elem = this._elements[_id];\n const i = this._elemTodo.indexOf(_id);\n if (i !== -1) {\n this._elemTodo.splice(i, 1);\n }\n delete this._styleCache[_id];\n delete this._elemTodoH[_id];\n delete this._elements[_id];\n this._freeElemIds.push(_id);\n const _parent = _elem.parentNode;\n if (_parent) {\n _parent.removeChild(_elem);\n }\n else {\n console.warn('ELEM.del(', _id,\n '): Invalid parent: ', _parent,\n 'for elem:', _elem);\n }\n }", "remove() { this.tooltip.remove(); this.element.remove(); }", "destroy() {\r\n if (this.parent.contains(this.elem)) this.parent.removeChild(this.elem);\r\n }", "function removeItem(element){\n \n}", "function unrefElement(elRef) {\n var _a;\n var plain = (0,_resolveUnref__WEBPACK_IMPORTED_MODULE_0__.resolveUnref)(elRef);\n return (_a = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _a !== void 0 ? _a : plain;\n}", "function removeAttr(elem, attrib) {\r\n elem.removeAttr(attrib);\r\n }", "remove() {\r\n manipulation_1.removeClausedNodeChild(this);\r\n }", "function removeElement(element) {\n element.parentNode.removeChild(element);\n}", "function deleteItem(element){\n element.parentNode.remove();\n}", "remove() {\n\t\tthis.outerElement.style.display = \"none\";\n\t\tthis.removed = true;\n\t}", "function delme() { this.parentNode.removeChild(this);\t}", "function removeElement(elem) {\n if (elem.prev)\n elem.prev.next = elem.next;\n if (elem.next)\n elem.next.prev = elem.prev;\n if (elem.parent) {\n var childs = elem.parent.children;\n childs.splice(childs.lastIndexOf(elem), 1);\n }\n}", "function removeElement(element) {\n element.parentElement.removeChild(element);\n}", "remove() {\n this.node.remove()\n }", "function eliminar(elemento){\n elemento.parentNode.remove();\n}", "function it(e){e.parent=null,ae(e)}", "function removeTreeFromElement()/*: void*/ {\n this.emitSync(\"willDetachFromParent\");\n this[_renderElement].removeChild(this.elementTree);\n this[_renderElement] = null;\n this[_attached] = false;\n this.emit(\"didDetachFromParent\");\n}", "cleanup() {\n this.element.parentNode.removeChild(this.element);\n removeDot(this.id);\n }", "function removeElement(evt) {\n selectedElement = evt.target.parentElement;\n selectedElement.remove();\n}", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "function deleteElement(element){\n\telement.parentNode.remove(element.parentElement);\n}", "function clearSetElement(elem) {\n jQTE.find(elem).each(function () {\n $(this).before($(this).html()).remove();\n });\n }", "function _remElement(elm)\r\n{\r\n while (elm.childNodes.length > 0)\r\n {\r\n _remEle(elm.childNodes[elm.childNodes.length - 1]);\r\n }\r\n}", "function removeTooltip() { \n element.removeAttribute( ariaDescribedBy )\n ops.container.removeChild( tooltip )\n timer = null\n }" ]
[ "0.6625357", "0.66057837", "0.66057837", "0.6573982", "0.6454482", "0.63668096", "0.6310595", "0.6301675", "0.6279491", "0.6267398", "0.62233317", "0.6215944", "0.6156988", "0.6145581", "0.6128828", "0.61132556", "0.60445356", "0.6018156", "0.6015969", "0.6015648", "0.6008385", "0.59996915", "0.5995465", "0.59831846", "0.59799063", "0.5954485", "0.59534323", "0.59426296", "0.593062", "0.591747", "0.5914389", "0.5914389", "0.5914389", "0.5914389", "0.590273", "0.5889159", "0.588372", "0.588372", "0.58644795", "0.5860774", "0.58383447", "0.5830796", "0.5829574", "0.5829574", "0.58284396", "0.58248574", "0.5810856", "0.58088744", "0.5806073", "0.58060527", "0.58047444", "0.5790774", "0.5780104", "0.57770663", "0.57499146", "0.5748547", "0.5746714", "0.5735615", "0.57269526", "0.5723391", "0.57114524", "0.57089233", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.5708617", "0.57046765", "0.5704216", "0.5702604", "0.5700368" ]
0.0
-1
Counts the column offset in a string, taking tabs into account. Used mostly to find indentation.
function countColumn(string, end, tabSize, startIndex, startValue) { if (end == null) { end = string.search(/[^\s\u00a0]/); if (end == -1) { end = string.length; } } for (var i = startIndex || 0, n = startValue || 0;;) { var nextTab = string.indexOf("\t", i); if (nextTab < 0 || nextTab >= end) { return n + (end - i) } n += nextTab - i; n += tabSize - (n % tabSize); i = nextTab + 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countColumn(string, end, tabSize) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = 0, n = 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end, tabSize) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = 0, n = 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end, tabSize) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = 0, n = 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end, tabSize) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = 0, n = 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end, tabSize) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = 0, n = 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end, tabSize) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = 0, n = 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = 0, n = 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = 0, n = 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = 0, n = 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = startIndex || 0, n = startValue || 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = startIndex || 0, n = startValue || 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = startIndex || 0, n = startValue || 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = startIndex || 0, n = startValue || 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n;\n }", "function countCol(string, end, tabSize, startIndex = 0, startValue = 0) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1)\n end = string.length;\n }\n let n = startValue;\n for (let i = startIndex; i < end; i++) {\n if (string.charCodeAt(i) == 9)\n n += tabSize - (n % tabSize);\n else\n n++;\n }\n return n;\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/)\n if (end == -1) { end = string.length }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i)\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i\n n += tabSize - (n % tabSize)\n i = nextTab + 1\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/)\n if (end == -1) { end = string.length }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i)\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i\n n += tabSize - (n % tabSize)\n i = nextTab + 1\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n\t\t if (end == null) {\n\t\t end = string.search(/[^\\s\\u00a0]/);\n\t\t if (end == -1) { end = string.length; }\n\t\t }\n\t\t for (var i = startIndex || 0, n = startValue || 0;;) {\n\t\t var nextTab = string.indexOf(\"\\t\", i);\n\t\t if (nextTab < 0 || nextTab >= end)\n\t\t { return n + (end - i) }\n\t\t n += nextTab - i;\n\t\t n += tabSize - (n % tabSize);\n\t\t i = nextTab + 1;\n\t\t }\n\t\t }", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n\n if (end == -1) {\n end = string.length;\n }\n }\n\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n\n if (nextTab < 0 || nextTab >= end) {\n return n + (end - i);\n }\n\n n += nextTab - i;\n n += tabSize - n % tabSize;\n i = nextTab + 1;\n }\n }", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, end, tabSize, startIndex, startValue) {\r\n if (end == null) {\r\n end = string.search(/[^\\s\\u00a0]/);\r\n if (end == -1) { end = string.length; }\r\n }\r\n for (var i = startIndex || 0, n = startValue || 0;;) {\r\n var nextTab = string.indexOf(\"\\t\", i);\r\n if (nextTab < 0 || nextTab >= end)\r\n { return n + (end - i) }\r\n n += nextTab - i;\r\n n += tabSize - (n % tabSize);\r\n i = nextTab + 1;\r\n }\r\n}", "function count_column( string, end, tabSize, startIndex, startValue )\n{\n var i, n, nextTab;\n if ( null == end )\n {\n end = string.search( Stream.$NONSPC$ );\n if ( -1 == end ) end = string.length;\n }\n for (i=startIndex||0,n=startValue||0 ;;)\n {\n nextTab = string.indexOf( \"\\t\", i );\n if ( nextTab < 0 || nextTab >= end ) return n + (end - i);\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function count_column( string, end, tabSize, startIndex, startValue )\n{\n var i, n, nextTab;\n if ( null == end )\n {\n end = string.search( Stream.$NONSPC$ );\n if ( -1 == end ) end = string.length;\n }\n for (i=startIndex||0,n=startValue||0 ;;)\n {\n nextTab = string.indexOf( \"\\t\", i );\n if ( nextTab < 0 || nextTab >= end ) return n + (end - i);\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n}", "function countColumn(string, tabSize, to = string.length) {\n let n = 0;\n for (let i = 0; i < to;) {\n if (string.charCodeAt(i) == 9) {\n n += tabSize - (n % tabSize);\n i++;\n }\n else {\n n++;\n i = findClusterBreak(string, i);\n }\n }\n return n;\n}", "function findIndentation(input)\n{\n\tvar count = 0;\n\n\tif (input.length === 0)\n\t{\n\t\treturn 0;\n\t}\n\n\treturn input.split(/[^ \\t\\r\\n]/)[0].length; //**returns the number of tabs as well as the number of spaces!!!\n}", "function findColumn(string, goal, tabSize) {\n\t\t for (var pos = 0, col = 0;;) {\n\t\t var nextTab = string.indexOf(\"\\t\", pos);\n\t\t if (nextTab == -1) { nextTab = string.length; }\n\t\t var skipped = nextTab - pos;\n\t\t if (nextTab == string.length || col + skipped >= goal)\n\t\t { return pos + Math.min(skipped, goal - col) }\n\t\t col += nextTab - pos;\n\t\t col += tabSize - (col % tabSize);\n\t\t pos = nextTab + 1;\n\t\t if (col >= goal) { return pos }\n\t\t }\n\t\t }", "function findColumn(string, goal, tabSize) {\r\n for (var pos = 0, col = 0;;) {\r\n var nextTab = string.indexOf(\"\\t\", pos);\r\n if (nextTab == -1) nextTab = string.length;\r\n var skipped = nextTab - pos;\r\n if (nextTab == string.length || col + skipped >= goal)\r\n return pos + Math.min(skipped, goal - col);\r\n col += nextTab - pos;\r\n col += tabSize - (col % tabSize);\r\n pos = nextTab + 1;\r\n if (col >= goal) return pos;\r\n }\r\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }", "function findColumn(string, goal, tabSize) {\r\n for (var pos = 0, col = 0;;) {\r\n var nextTab = string.indexOf(\"\\t\", pos);\r\n if (nextTab == -1) { nextTab = string.length; }\r\n var skipped = nextTab - pos;\r\n if (nextTab == string.length || col + skipped >= goal)\r\n { return pos + Math.min(skipped, goal - col) }\r\n col += nextTab - pos;\r\n col += tabSize - (col % tabSize);\r\n pos = nextTab + 1;\r\n if (col >= goal) { return pos }\r\n }\r\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n\n if (nextTab == -1) {\n nextTab = string.length;\n }\n\n var skipped = nextTab - pos;\n\n if (nextTab == string.length || col + skipped >= goal) {\n return pos + Math.min(skipped, goal - col);\n }\n\n col += nextTab - pos;\n col += tabSize - col % tabSize;\n pos = nextTab + 1;\n\n if (col >= goal) {\n return pos;\n }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos)\n if (nextTab == -1) { nextTab = string.length }\n var skipped = nextTab - pos\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos\n col += tabSize - (col % tabSize)\n pos = nextTab + 1\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos)\n if (nextTab == -1) { nextTab = string.length }\n var skipped = nextTab - pos\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos\n col += tabSize - (col % tabSize)\n pos = nextTab + 1\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, col, tabSize, strict) {\n for (let i = 0, n = 0;;) {\n if (n >= col)\n return i;\n if (i == string.length)\n break;\n n += string.charCodeAt(i) == 9 ? tabSize - (n % tabSize) : 1;\n i = findClusterBreak(string, i);\n }\n return strict === true ? -1 : string.length;\n}", "indentation() {\n var _a;\n return (_a = this.overrideIndent) !== null && _a !== void 0 ? _a : countCol(this.string, null, this.tabSize);\n }", "function num_indent (line, indent_string) {\n\tvar amt = 0;\n\tvar index = 0;\n\twhile (line.substring(index, index + indent_string.length) == indent_string) {\n\t\tamt += 1;\n\t\tindex += indent_string.length;\n\t}\n\treturn amt;\n}", "function getIndentation(s) {\n let indentation = s.match(/[ \\t]*/)[0];\n indentation = indentation.replace(/\\t/g, INDENT); // replace tabs by INDENT\n return Math.floor(indentation.length / INDENT.length);\n }", "function lineNumberOfCharacterIndex(code, idx) {\n var everythingUpUntilTheIndex = code.substring(0, idx);\n // computer science!\n return everythingUpUntilTheIndex.split('\\n').length;\n}", "function updatePosition(str) {\n const lines = str.match(/\\n/g);\n\n if (lines) {\n lineno += lines.length;\n }\n\n const i = str.lastIndexOf('\\n'); // eslint-disable-next-line no-bitwise\n\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }" ]
[ "0.78494596", "0.78494596", "0.78494596", "0.78494596", "0.78494596", "0.78494596", "0.78313595", "0.78313595", "0.78313595", "0.77288246", "0.77288246", "0.77288246", "0.77288246", "0.7564648", "0.7547028", "0.7547028", "0.75413024", "0.7519291", "0.7494119", "0.7494119", "0.7494119", "0.7494119", "0.7494119", "0.7494119", "0.7494119", "0.7494119", "0.7494119", "0.7494119", "0.7494119", "0.7473958", "0.7344049", "0.7344049", "0.7302284", "0.6942895", "0.69376457", "0.68984467", "0.6892121", "0.6892121", "0.6892121", "0.6892121", "0.6892121", "0.6892121", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6874578", "0.6865091", "0.68480057", "0.6820489", "0.6820489", "0.6814616", "0.6814616", "0.6814616", "0.6814616", "0.6814616", "0.6814616", "0.6814616", "0.6814616", "0.6814616", "0.6814616", "0.6814616", "0.68042594", "0.6769882", "0.6569674", "0.6354063", "0.6331614", "0.62961936", "0.6218746", "0.6218746", "0.6218746", "0.6218746" ]
0.7577807
26
The inverse of countColumn find the offset that corresponds to a particular column.
function findColumn(string, goal, tabSize) { for (var pos = 0, col = 0;;) { var nextTab = string.indexOf("\t", pos); if (nextTab == -1) { nextTab = string.length; } var skipped = nextTab - pos; if (nextTab == string.length || col + skipped >= goal) { return pos + Math.min(skipped, goal - col) } col += nextTab - pos; col += tabSize - (col % tabSize); pos = nextTab + 1; if (col >= goal) { return pos } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstInColumnLocation(col) {\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar point = new Point(sets.columns[col],0);\r\n\t\tvar offset = getRelativePoint(point);\r\n\t\treturn offset.x;\r\n\t}", "function getRelativeColStart(col) {\r\n\t\tvar loc = new Point(sets.columns[col],0);\r\n\t\tvar offset = getRelativePoint(loc);\r\n\t\treturn offset.x;\r\n\t}", "function columnIndex(column) {\n return _.indexOf(columns, column);\n }", "column() {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countCol(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue;\n }", "function findColumn(string, col, tabSize, strict) {\n for (let i = 0, n = 0;;) {\n if (n >= col)\n return i;\n if (i == string.length)\n break;\n n += string.charCodeAt(i) == 9 ? tabSize - (n % tabSize) : 1;\n i = findClusterBreak(string, i);\n }\n return strict === true ? -1 : string.length;\n}", "function getColumn(x) {\r\n\t\tvar col = 0;\r\n\t\tx = getAbsolutePoint(new Point(x,0));\r\n\t\tx = x.x+5; // Adds five probably not necessary, but insures x is squarely in the col\r\n\t\t$.each($['mapsettings'].columns, function(i, item) {\r\n\t\t\tif(x>=item) col = i;\r\n\t\t});\r\n\t\treturn col+1; // add one because column count starts from one\r\n\t}", "findSpotForCol(column){\n for(let row = this.height - 1; row >= 0; row--){\n if(!this.board[row][column]){\n return row;\n }\n }\n return null;\n }", "column(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let result = this.countColumn(text, pos - from);\n let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;\n if (override > -1)\n result += override - this.countColumn(text, text.search(/\\S|$/));\n return result;\n }", "function findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n for (let i = board.length-1; i >= 0; i--) {\n if (board[i][x] === null) {\n return i\n }\n }\n //it returns null when the top row is full\n return null;\n}", "private_getActiveColumnFromPosition()\n\t{\n\t\tif (g_mouse.x < this.coords.x || g_mouse.x > this.coords.x + this.size.x)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\tif (g_mouse.y < this.coords.y || g_mouse.y > this.coords.y + this.size.y)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\t// Mouse is over the board, so return the column it's in\n\t\tlet columnSize = this.size.x / this.columns;\n\t\tlet distance = g_mouse.x - this.coords.x;\n\t\treturn Math.floor(distance / columnSize);\n\t}", "function findSpotForCol(x) {\n\t// TODO: write the real version of this, rather than always returning 0\n\tfor (let i = HEIGHT - 1; i >= 0; i--) {\n\t\tif (board[i][x] === null) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn null;\n}", "function getIndexFromColumn(column) {\n return column.split('').reduce(function (acc, currentVal) {\n return lettersInAlphabet * acc + lettersArr.indexOf(currentVal);\n }, 0);\n}", "function getColumnIndexByColumnName(columns, columnName) {\n for (var i in columns) {\n if (columns[i] == columnName) {\n return i;\n }\n }\n\n return null;\n }", "function findColumn(string, goal, tabSize) {\n\t\t for (var pos = 0, col = 0;;) {\n\t\t var nextTab = string.indexOf(\"\\t\", pos);\n\t\t if (nextTab == -1) { nextTab = string.length; }\n\t\t var skipped = nextTab - pos;\n\t\t if (nextTab == string.length || col + skipped >= goal)\n\t\t { return pos + Math.min(skipped, goal - col) }\n\t\t col += nextTab - pos;\n\t\t col += tabSize - (col % tabSize);\n\t\t pos = nextTab + 1;\n\t\t if (col >= goal) { return pos }\n\t\t }\n\t\t }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }", "function col () {\n return index - token.length + 1;\n }", "function findColumn(string, goal, tabSize) {\r\n for (var pos = 0, col = 0;;) {\r\n var nextTab = string.indexOf(\"\\t\", pos);\r\n if (nextTab == -1) nextTab = string.length;\r\n var skipped = nextTab - pos;\r\n if (nextTab == string.length || col + skipped >= goal)\r\n return pos + Math.min(skipped, goal - col);\r\n col += nextTab - pos;\r\n col += tabSize - (col % tabSize);\r\n pos = nextTab + 1;\r\n if (col >= goal) return pos;\r\n }\r\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n\n if (nextTab == -1) {\n nextTab = string.length;\n }\n\n var skipped = nextTab - pos;\n\n if (nextTab == string.length || col + skipped >= goal) {\n return pos + Math.min(skipped, goal - col);\n }\n\n col += nextTab - pos;\n col += tabSize - col % tabSize;\n pos = nextTab + 1;\n\n if (col >= goal) {\n return pos;\n }\n }\n }", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos)\n if (nextTab == -1) { nextTab = string.length }\n var skipped = nextTab - pos\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos\n col += tabSize - (col % tabSize)\n pos = nextTab + 1\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos)\n if (nextTab == -1) { nextTab = string.length }\n var skipped = nextTab - pos\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos\n col += tabSize - (col % tabSize)\n pos = nextTab + 1\n if (col >= goal) { return pos }\n }\n}", "function findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n // first click of every column errors but still playable\n for (let i = board.length-1 ;i >= 0; i--){\n if(board[i][x] === null){\n return i;\n }\n }\n return null;\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n}", "function pageOffset () {\n // const offset = indexOfSelected() - (vs.row * vs.cols + vs.col)\n let i = indexOfSelected()\n const pageSize = vs.rows * vs.cols\n const pageNum = Math.floor(indexOfSelected() / pageSize)\n const offset = pageNum * pageSize\n return offset\n }", "function findColumn(string, goal, tabSize) {\r\n for (var pos = 0, col = 0;;) {\r\n var nextTab = string.indexOf(\"\\t\", pos);\r\n if (nextTab == -1) { nextTab = string.length; }\r\n var skipped = nextTab - pos;\r\n if (nextTab == string.length || col + skipped >= goal)\r\n { return pos + Math.min(skipped, goal - col) }\r\n col += nextTab - pos;\r\n col += tabSize - (col % tabSize);\r\n pos = nextTab + 1;\r\n if (col >= goal) { return pos }\r\n }\r\n}", "function lineColumnToIndex(lineColumn, text) {\n let index = 0;\n for (let i = 0; i < lineColumn.line - 1; ++i) {\n index = text.indexOf(\"\\n\", index) + 1;\n if (index === -1) {\n return -1;\n }\n }\n return index + lineColumn.column;\n}", "function findSpotForCol(col) {\n // find the correct row index\n for (let possibleRow = HEIGHT - 1; possibleRow >= 0; possibleRow--) {\n if (board[possibleRow][col] === null) {\n return possibleRow;\n }\n }\n return null;\n}", "function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "static calculateIndex(row, col) {\n\t\treturn (row - 1) * 9 + (col - 1)\n\t}", "function getCol(position) {\n return (position + 2) % 3;\n}", "function getOffset() {\n\t\t\tif (!vm.current) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t//console.log(vm.getRank(vm.current));\n\t\t\treturn (vm.getRank(vm.current) - 2) * 17;\n\t\t}", "get col() {\n return this.pos - this.lineStartPos + Number(this.lastGapPos !== this.pos);\n }", "findSpotForCol(x) {\n for (let y = this.height - 1; y >= 0; y--) {\n if (!this.board[y][x]) {\n return y;\n }\n }\n return null;\n }", "function findSpotForCol(x) {\n\t// TODO: write the real version of this, rather than always returning 0\n\tfor (let y = HEIGHT - 1; y >= 0; y--) {\n\t\tif (!board[y][x]) {\n\t\t\treturn y;\n\t\t}\n\t}\n\treturn null;\n}", "rowColToIndex(row, col) {\n return col + row * this.col;\n }", "function findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n for(let y = HEIGHT - 1; y >= 0; y--){\n if(board[x][y] === undefined){\n //due to the way the board array was created, I need to use [x][y] instead of [y][x]\n return y;\n }\n }\n return null;\n}", "function findSpotForCol(x) {\n let yLocation = HEIGHT-1;\n\n // iterate through the column starting from the bottom to find the position of y that contains an empty cell\n for (let i=HEIGHT-1; i >= 0; i--){\n yLocation = (board[i][x] === 1 || board[i][x] === 2) ? yLocation-1 : yLocation;\n // console.log(\"i:\",i,\"yLocation\", yLocation);\n }\n // console.log(\"yLocation\", yLocation, \"board\", board[yLocation][x]);\n yLocation = yLocation < 0 ? null : yLocation;\n return yLocation;\n}", "findSpotForCol(x) {\n for (let y = this.height - 1; y >= 0; y--) {\n if (!this.board[y][x]) {\n return y;\n }\n }\n return null;\n }", "findSpotForCol(x) {\n for (let y = this.HEIGHT - 1; y >= 0; y--) {\n if (!this.board[y][x]) {\n return y;\n }\n }\n return null;\n }", "function _fnVisibleToColumnIndex(oSettings, iMatch) {\n\t\t\tvar iColumn = -1;\n\n\t\t\tfor (var i = 0; i < oSettings.aoColumns.length; i++) {\n\t\t\t\tif (oSettings.aoColumns[i].bVisible === true) {\n\t\t\t\t\tiColumn++;\n\t\t\t\t}\n\n\t\t\t\tif (iColumn == iMatch) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "function findSpotForCol(x) {\n for (let y = HEIGHT - 1; y >= 0; y--) {\n if (board[y][x] === undefined) {\n return y;\n }\n }\n return null;\n}", "function _get_column(i) { return i % 9; }", "function findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n for(let y = HEIGHT - 1; y >= 0; y--){\n if(board[y][x] == null){\n return y;\n }\n }\n return null;\n}", "getColumn (colIdx) {\n\t\treturn this.board.filter((e, idx) => {\n\t\t\treturn position.toCol(idx) === colIdx;\n\t\t});\n\t}", "function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n var offset\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n offset = (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return offset > -1 && offset < indices[indices.length - 1] ? offset : -1\n }", "function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n var offset\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n offset = (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return offset > -1 && offset < indices[indices.length - 1] ? offset : -1\n }", "function findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n // return null if none available;\n // starts at x, height is 6\n // access BOARD [height][x], if the coordinate is equal to null, return current height\n for (let y = HEIGHT-1; y >= 0; y--) {\n if (!BOARD[y][x]) {\n return y;\n }\n }\n return null;\n}", "function index(column, row){\n return column + (row * maxColume);\n}", "function pointToOffset(point) {\n var line = point && point.line;\n var column = point && point.column;\n var offset;\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n offset = (indices[line - 2] || 0) + column - 1 || 0;\n }\n\n return offset > -1 && offset < indices[indices.length - 1] ? offset : -1\n }", "function redips_column(std){\n\tvar nrows = std.hall.nrows;\n\treturn nrows - 1 - (std.hall_position.charCodeAt(0) - 65); // 'A' is 65, 'B' is 66, .. Vertical offset -1\n}", "function getColumnLocation(plot, gridpos, numberOfBars) \n { \n var insideheight = plot.grid._height; \n var colheight = insideheight / numberOfBars; \n var column = parseInt(gridpos.y / colheight); \n return (numberOfBars - 1) - column;\n }", "function index(row, col) {\n return row * 8 + col;\n }", "getPageOffset() {\n return this.coord.getPageOffset();\n }", "function findSpotForCol(x) {\n\tfor (let y = HEIGHT - 1; y >= 0; y--) {\n\t\tif (!board[y][x]) return y;\n\t}\n\treturn null;\n}", "get goalColumn() {\n let value = this.flags >> 5 /* RangeFlag.GoalColumnOffset */;\n return value == 33554431 /* RangeFlag.NoGoalColumn */ ? undefined : value;\n }", "function findSpotForCol(x) {\n for (let y = HEIGHT - 1; y >= 0; y--) {\n if (board[y][x] === null) {\n return y;\n }\n }\n return null;\n}", "function findSpotForCol(x) {\n for (let y = HEIGHT - 1; y >= 0; y--) {\n if (board[y][x] === null) {\n return y;\n }\n }\n return null;\n}", "function _fnVisibleToColumnIndex( oSettings, iMatch )\n\t\t{\n\t\t\tvar iColumn = -1;\n\t\t\t\n\t\t\tfor ( var i=0 ; i<oSettings.aoColumns.length ; i++ )\n\t\t\t{\n\t\t\t\tif ( oSettings.aoColumns[i].bVisible === true )\n\t\t\t\t{\n\t\t\t\t\tiColumn++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( iColumn == iMatch )\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn null;\n\t\t}", "function _fnVisibleToColumnIndex( oSettings, iMatch )\n\t\t{\n\t\t\tvar iColumn = -1;\n\t\t\t\n\t\t\tfor ( var i=0 ; i<oSettings.aoColumns.length ; i++ )\n\t\t\t{\n\t\t\t\tif ( oSettings.aoColumns[i].bVisible === true )\n\t\t\t\t{\n\t\t\t\t\tiColumn++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( iColumn == iMatch )\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn null;\n\t\t}", "col_row_from_offset(offset) {\n return this.col_row_offset_from_offset(offset).map(([index, _]) => index);\n }", "function getColNumber(colObj) {\r\n // checks to see if a cellObj has been parsed as argument.\r\n // if yes, then get the colObj for that cell.\r\n colObj = colObj.hasClass(\"slot\") ? $(colObj[0].parentElement) : colObj;\r\n return parseInt(columns.index(colObj));\r\n }", "function colLookup(sheet, value, row) {\n var rowValues = sheet.getRange(row,1,row,sheet.getLastColumn()).getValues();\n for (var i=0; i<columnValues.length; i++) {\n if (rowValues[i] == value) {\n var colNum = i+1;\n return colNum;\n }\n }\n return rowValues;\n}", "function findInColumn(sheet, col, data) {\n var column = sheet.getRange(col + \":\" + col); // like A:A\n var values = column.getValues(); \n var row = 0;\n while ( values[row] && values[row][0] !== data ) { row++ }\n if (values[row][0] === data) { return row+1 } else { return -1 } \n}", "function getColumnVisiblePostion($firstRow, $cell){\n var tdsFirstRow = $firstRow.children();\n for(var i = 0; i < tdsFirstRow.length; i++){\n if($(tdsFirstRow[i]).data('posx') == $cell.data('posx')){\n return i;\n }\n }\n }", "function findSpotForCol(x) {\n for(let y = HEIGHT-1; y >= 0; y--){\n if(board[y][x] === null){\n return y;\n }\n }\n return null;\n}", "function findSpotForCol(x,gameboard) {\n for (let y = 0; y<HEIGHT;y ++){\n if (gameboard[x][y] === 'E'){\n return y;\n }\n }\n //debugger;\n //console.log(\"No spot found to place a piece in the given column\");\n return null;\n}", "countColumn(line, pos = line.length) {\n return state.countColumn(line, this.state.tabSize, pos);\n }", "function findSpotForCol(x) {\n // TODO: write the real version of this, rather than always returning 0\n // iterating over each row to check if the cell is empty === null, if null then use that y location for new chip \n for (let y = HEIGHT - 1; y >= 0; y--) {\n if(board[y][x] === null) {\n return y;\n }\n }\n return null;\n}", "function findSpotForCol(x) {\n\tlet h = HEIGHT - 1;\n\tfor (let y = h; y >= 0; y--) {\n\t\tif (!board[y][x]) {\n\t\t\treturn y;\n\t\t}\n\t}\n\treturn null;\n}", "function offset_from_location(row, col){\n\t\tvar offset = $('.tile-board').offset();\n\t\toffset.left += (col-1)*tileWidth;\n\t\toffset.top += (row-1)*tileHeight;\n\t\treturn offset;\n\t}" ]
[ "0.70207864", "0.6774466", "0.6547042", "0.65317714", "0.6513608", "0.6411472", "0.64103985", "0.6358958", "0.63435084", "0.6293746", "0.62447125", "0.62313", "0.62138146", "0.62027305", "0.6194549", "0.6194549", "0.6194549", "0.6194549", "0.6194549", "0.6194549", "0.615899", "0.6146788", "0.61464524", "0.6128407", "0.6128407", "0.6122685", "0.60905886", "0.60905886", "0.60905886", "0.60905886", "0.60905886", "0.60905886", "0.60905886", "0.60905886", "0.60905886", "0.60905886", "0.60905886", "0.60844547", "0.60369617", "0.6026345", "0.6023489", "0.6017217", "0.6013644", "0.60007524", "0.6000296", "0.59987205", "0.59841657", "0.59811825", "0.5969928", "0.59625995", "0.59378856", "0.59365094", "0.59322864", "0.5928569", "0.59142834", "0.59023464", "0.58990693", "0.5879603", "0.5875572", "0.5875572", "0.58704334", "0.5857993", "0.58540547", "0.5849232", "0.58417046", "0.5832389", "0.5827229", "0.5824106", "0.58124924", "0.5800795", "0.5800795", "0.5794131", "0.5794131", "0.5791439", "0.5786987", "0.5784329", "0.57556057", "0.5747672", "0.5746299", "0.5730945", "0.57254124", "0.572503", "0.5722675", "0.5707531" ]
0.6172878
32
Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.
function skipExtendingChars(str, pos, dir) { while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; } return pos }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStart (pos, len) {\n if (pos == null) return 0;\n return pos < 0 ? (len + (pos % len)) : Math.min(len, pos);\n}", "function getPosAsInt(str) {\n\treturn parseInt(str.substr(0, str.length - 2));\n}", "function collectDigits(input, pos) {\n\t\t'use strict';\n\t\twhile (pos < input.length && input.charCodeAt(pos + 1) >= ZERO && input.charCodeAt(pos + 1) <= NINE) {\n\t\t\tpos += 1;\n\t\t}\n\t\treturn pos;\n\t}", "function getDigit(num, position) {\n const stringNum = String(num);\n const digit = parseInt(stringNum[stringNum.length - 1 - position]);\n return isNaN(digit) ? 0 : digit;\n}", "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 getPosLetter(inpt,position)\r\n{\r\n\tvar len=inpt.length;\r\n\tif(position<=len)\r\n\t{\r\n\t\tfinalOutput=inpt.charAt(position-1);\r\n\t\treturn finalOutput;\r\n\t\t \r\n\t}\r\n\telse\r\n\t{\r\n\t\tdocument.write(\"Invalid Position!\");\r\n\t\treturn; \r\n\t}\r\n\t\r\n}", "function findCoord(str, lower, lowerLetter, upper, upperLetter) {\n let result = 0;\n\n // Check range before final value\n for (let i = 0; i < str.length - 1; i++) {\n let midway = Math.floor((upper - lower) / 2);\n if (str[i] === lowerLetter) {\n upper = midway + lower;\n } else {\n lower = upper - midway;\n }\n }\n\n // Check final value\n if (str[str.length - 1] === lowerLetter) {\n result = lower;\n } else {\n result = upper;\n }\n\n return result;\n}", "function validPos(inpt,position)\r\n{\r\n\tif(pos>inpt.length)\r\n\t{\r\n\t\tdocument.write(\"Invalid Position!\");\r\n\t\treturn;\r\n\t}\r\n\telse\r\n\t\treturn 1;\r\n\r\n}", "function position(posNumber) {\n let position = \"\";\n position = (posNumber - 1) * 18 + \"px\";\n // console.log(\"position \" + position);\n return position;\n}", "function getNthPos(endtag,pos)\n{\n if(pos == 0)\n return 0;\n if(pos > getNumUnderscores(endtag))\n return -1; //error. this is not possible.\n\n for(var i=0; i<pos; i++) { //remove 'pos' number of underscores\n endtag = endtag.substring(endtag.indexOf(\"_\")+1, endtag.length);\n }\n\n if(endtag.indexOf(\"_\") == -1) //has no more underscores so just return everything that's left\n return parseInt(endtag);\n else //otherwise, return up to the next underscore\n return parseInt(endtag.substring(0,endtag.indexOf(\"_\")));\n }", "function posToIndex(pos) {\n var row = pos[0];\n var col = pos[1];\n return (row * 4) + col;\n}", "function substringHandleNegativeLengths(base_s, index_s) {\n\n\t\t//Index s is negative to adding will get us to the right start\n\t\tconst newIndex = ctx.mkAdd(base_s.getLength(), index_s);\n\n\t\t//Bound the minimum index by 0\n\t\tconst aboveMin = ctx.mkGe(newIndex, ctx.mkIntVal(0));\n\t\tconst indexOrZero = ctx.mkIte(aboveMin, newIndex, ctx.mkIntVal(0));\n\n\t\treturn ctx.mkIte(ctx.mkGe(index_s, ctx.mkIntVal(0)), index_s, indexOrZero);\n\t}", "function palindromeX(len, pos) {\n let left = (10 ** Math.floor((len - 1) / 2) + pos - 1).toString();\n let right = [...left].reverse().join('').slice(len % 2);\n return Number(left + right);\n}", "function normalizePosition(val) {\n val = parseInt(val);\n if (isNaN(val))\n return undefined;\n else\n return val;\n}", "function normalizePosition(val) {\n val = parseInt(val);\n if (isNaN(val))\n return undefined;\n else\n return val;\n}", "function truncateString(str, num) {\n // I want to return the string parts\n // from indexOf(0) to indexOf(num), only when the length of string > num\n // otherwise, return the string\n if (str.length > num) {\n return str.slice(0, num) + \"...\";\n } else {\n return str;\n }\n}", "function codePointAt(str, pos) {\n let code0 = str.charCodeAt(pos);\n if (!surrogateHigh(code0) || pos + 1 == str.length)\n return code0;\n let code1 = str.charCodeAt(pos + 1);\n if (!surrogateLow(code1))\n return code0;\n return ((code0 - 0xd800) << 10) + (code1 - 0xdc00) + 0x10000;\n}", "function textToIndex(pos){\n\n\tvar firstRowLength=114; //Header row length not including new line.\n\n\tvar rowLabelLength=4;\t//Lenght of row labels including new line.\n\n\tvar numberOfCharactersPerGroup=11;\t//Total number of characters in a group including space.\n\n\tvar totalNumberOfCharactersPerLine=114;\t//Total number of characters in a line including row label, spaces, and new Line.\n\n\tvar offset=0;\t//Total offset needed to convert text selection index to a valid index.\n\n\t\n\n\t//Amount for length of Header Row (Row 0) and first row label\n\n\toffset+=firstRowLength+rowLabelLength;\n\n\t\n\n\t//Position selected is in the header or first row labels\n\n\tif(pos<offset){\n\n\t\treturn 0;\n\n\t}\n\n\t\n\n\t//Past the first Line (Rows beyond 1)\n\n\tif(pos>=(firstRowLength+rowLabelLength+totalNumberOfCharactersPerLine)){\n\n\t\t//Calculate number of Row Labels needed (including new line)\n\n\t\toffset+=(Math.floor((pos/(totalNumberOfCharactersPerLine)))-1)*rowLabelLength\n\n\t}\n\n\t\n\n\t//Past First Group in Row 1\n\n\tif(pos>=(numberOfCharactersPerGroup+firstRowLength+rowLabelLength)){\n\n\t\t//Calculate number of spaces needed\n\n\t\toffset+=Math.floor((pos-offset)/numberOfCharactersPerGroup);\n\n\t}\n\n\t//Return Index (Position - Offset)\n\n\treturn pos-offset;\n\n\n\n}", "function palindrome(len, pos) {\n let left = Math.pow(10, Math.ceil(len / 2) - 1) + (pos - 1) + '';\n let right = left.slice(0, Math.floor(len / 2)).split('').reverse().join('');\n return +(left + right);\n}", "function inc(s, pos) {\n\tif (pos===undefined) pos = s.length-1\n\tvar c = s.charCodeAt(pos) + 1\n\tif (c===123) {\n\t\tc = 97\n\t\ts = inc(s,pos-1)\n\t}\n\tvar a = s.split('')\n\ta[pos] = String.fromCharCode(c)\n\treturn a.join('')\n}", "function NumerosLargo(string,largo){\n var out = '';\n var filtro = '1234567890';\n \n for (var i=0; i<string.length; i++){\n if (filtro.indexOf(string.charAt(i)) != -1) {\n if(out.length<(largo)){\n out += string.charAt(i);\n }\n }\n }\n\n return out;\n}", "function leftDigit(str) {\n // write your code here\n // let reg = new RegExp([0-9])\n const reg=/[0-9]/\n let left =str.search(reg);\n // return left;\nreturn str[left];\n \n }", "function getLength(string, index = 0) {\n if(string[index] === undefined) {\n return index;\n }\n return getLength(string, index + 1)\n}", "function positionToChar(position) {\n var counter = 0;\n\n loop:\n for (var i = 1; i <= keyboardDimension[0]; i++) {\n for (var j = 1; j <= keyboardDimension[1]; j++) {\n if (!(i in invalidPositions) || !invalidPositions[i].some(xPosition => xPosition == j)) {\n counter++;\n }\n\n if (position[0] == i && position[1] == j) {\n //We are at the position that is given as the parameter, stop the N(2) loop\n // with the label\n break loop;\n }\n }\n }\n\n if (counter >= 10) {\n return String.fromCharCode(65 + (counter - 10));\n }\n\n return counter;\n}", "function strend(str) {\n\t\t\tlet i;\n\t\t\tfor (let i = 0; i < str.length; i++)\n\t\t\t{\n\t\t\t\tif (ord(str[i]) <= 31) break;\n\t\t\t}\n\t\t\treturn i;\n\t\t}", "function h$jsstringIndexR(i, str) {\n ;\n if(i < 0 || i > str.length) return -1;\n var ch = str.charCodeAt(i);\n return (((ch|1023)===0xDFFF)) ? ((((str.charCodeAt(i-1))-0xD800)<<10)+(ch)-9216) : ch;\n}", "function location(pos){\n return dimension * + Math.floor(-pos[2]) + Math.floor(pos[0]);\n}", "function h$jsstringIndexR(i, str) {\n ;\n if(i < 0 || i > str.length) return -1;\n var ch = str.charCodeAt(i);\n return (((ch|1023)===0xDFFF)) ? ((((str.charCodeAt(i-1))-0xD800)<<10)+(ch)-9216) : ch;\n}", "function h$jsstringIndexR(i, str) {\n ;\n if(i < 0 || i > str.length) return -1;\n var ch = str.charCodeAt(i);\n return (((ch|1023)===0xDFFF)) ? ((((str.charCodeAt(i-1))-0xD800)<<10)+(ch)-9216) : ch;\n}", "function h$jsstringIndexR(i, str) {\n ;\n if(i < 0 || i > str.length) return -1;\n var ch = str.charCodeAt(i);\n return (((ch|1023)===0xDFFF)) ? ((((str.charCodeAt(i-1))-0xD800)<<10)+(ch)-9216) : ch;\n}", "function getCharFromPosition(pos) {\n\t\tvar index = pos.row * 5;\n\t\tindex = index + pos.col;\n\t\treturn keyPhrase.charAt(index);\n\t}", "function cigar2pos(cigar, pos)\n{\n\tvar x = 0, y = 0;\n\tfor (var i = 0; i < cigar.length; ++i) {\n\t\tvar op = cigar[i][0], len = cigar[i][1];\n\t\tif (op == 'M') {\n\t\t\tif (y <= pos && pos < y + len)\n\t\t\t\treturn x + (pos - y);\n\t\t\tx += len, y += len;\n\t\t} else if (op == 'D') {\n\t\t\tx += len;\n\t\t} else if (op == 'I') {\n\t\t\tif (y <= pos && pos < y + len)\n\t\t\t\treturn x;\n\t\t\ty += len;\n\t\t} else if (op == 'S' || op == 'H') {\n\t\t\tif (y <= pos && pos < y + len)\n\t\t\t\treturn -1;\n\t\t\ty += len;\n\t\t}\n\t}\n\treturn -1;\n}", "function ml_z_of_substring_base(base, s, pos, len) {\n s = caml_jsbytes_of_string(s);\n if(pos != 0 || len != s.length) {\n if (s.length - pos < len) {\n caml_invalid_argument(\"Z.of_substring_base: invalid offset or length\");\n }\n s = s.slice(pos,pos+len);\n }\n return jsoo_z_of_js_string_base(base, s);\n}", "function position(letter){\n let alphabet ='abcdefghijklmnopqrstuvwxyz';\nreturn `Position of alphabet: ${alphabet.indexOf(letter)+1}`;\n}", "function GiveACharacter(str, num) {\n if (num >=0) {\n return str[num];\n }\n}", "function re(e){return e.inclusiveLeft?-1:0}", "function _getInt(str, l, minlength, maxlength) {\n for (var m = maxlength; m >= minlength; m--) {\n var _token = str.substring(l, l + m);\n if (_token.length < minlength) {\n return null;\n }\n if (_isInteger(_token)) {\n return _token;\n }\n }\n return null;\n }", "function getPosition(num, str) {\n const result = [];\n num.map((a) => {\n str.map((b) => {\n result.push(`${a}${b}`);\n });\n });\n return result.join(' ');\n}", "function beyond(s) {\n if (s.length === 0) {\n return exports.MAX_WORD;\n }\n var code = s.charCodeAt(s.length - 1);\n return s.slice(0, -1) + String.fromCharCode(code + 1);\n}", "function countOfBalStr(string, position, count = null, total = 0) {\n if (position >= string.length) {\n return total\n }\n \n const letter = string[position]\n const value = letter === 'L' ? 1 : -1 // We can hard code this cause this is a contraint on the question\n count += value\n \n if (count === 0) {\n total++\n }\n \n return countOfBalStr(string, position + 1, count, total)\n}", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function n(str) {\n if (str == \"\") { return -1; }\n return Number(str);\n }", "function charAt (str='', position) {\n // var strArray = str.split('')\n return str[position]\n}", "function get_int(str, index) {\n var orig = index;\n while (str[index] >= '0' && str[index] <= '9') {\n index++;\n }\n return { value: parseInt(str.slice(orig)), len: index - orig };\n}", "function skipExtendingChars(str, pos, dir) {\r\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\r\n return pos\r\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "function pos2coord(pos) {\n var coord;\n coord = Math.floor(pos / 64);\n return coord;\n}", "function substring(p0, pos) {\n return filterFunction('substring', 'string', p0, pos);\n}", "function Int_substr(str, a, b) {\n\ta = Int_convertToInt(a);\n\tb = Int_convertToInt(b);\n\n\tvar start = 0;\n\twhile(Int_lt(start, a)) start++;\n\tvar end = 0;\n\twhile(Int_lt(end, b)) end++;\n\treturn str.substring(start,end);\n}", "function deleteNthChar(inputString, position) {\n \"use strict\";\n /*\n * deletes the n-th character of the input string and\n * returns the (now one character shorter) string.\n *\n * n is counted from 0\n */\n if (position > inputString.length) {\n throw new BoundaryException(position, \"deleting char at position\");\n }\n\n var outputString = \"\";\n outputString = inputString.slice(0, position);\n outputString = outputString + inputString.slice(position + 1);\n return outputString;\n}", "function toPosInt(number) {\n return Math.floor(Math.abs(number));\n }", "function at(position) {\n return value.charAt(position);\n }", "convertPointToCharacterPosition(text, point) {\n var position = 0;\n var w = 0;\n for (var i = 0, n = text.length; i < n; i++) {\n\n var charWidth = this.calculateCharacterSize(text.charAt(i))[0];\n var halfWidth = charWidth / 2;\n\n if (i > 0) {\n w = this.calculateSize(text.substr(0, i))[0];\n }\n\n // basic rounding calculation bast on character\n // width\n if (w + halfWidth > point) {\n break;\n }\n\n position++;\n }\n\n return position;\n }", "function displacement(num){\r\n\twhere=1;\r\n\tfor (var i=0; i<incount; ++i){\r\n\t\tif (startin[i] < num){\r\n\t\t\twhere+=lengthin[i]-1;\r\n\t\t}\r\n\t}\r\n\treturn where;\r\n}", "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir }\n return pos\n}", "function getSubstr(strSource,intStartPosition,intOverPosition,cPosition)\r\n{\r\n\tvar strTarget = \"\";\r\n\tvar cTemp = \"\";\r\n\tvar intLoop = 0;\r\n\tvar intCount = 0;\r\n\ttry\r\n\t{\r\n\t strSource = trim(strSource);\r\n\t\tintCount = strSource.length;\r\n\t\tif (intStartPosition>intCount) intStartPosition = intCount;\r\n\t\tif (intOverPosition>intCount) intOverPosition = intCount;\r\n\t\tif (cPosition==null)\r\n\t\t{\r\n\t\t\tstrTarget = strSource.substring(intStartPosition,intOverPosition);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t if (intStartPosition<=intOverPosition)\r\n\t\t\t{\r\n\t\t\t\tfor (intLoop=intStartPosition;intLoop<intOverPosition;intLoop++)\r\n\t\t\t\t{\r\n\t\t\t\t\tcTemp = strSource.substr(intLoop,1);\r\n\t\t\t\t\tif (cTemp==cPosition) break;\r\n\t\t\t\t\telse strTarget = strTarget + cTemp;\r\n\t\t\t\t}\r\n\t\t }\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tfor (intLoop=intStartPosition-1;intLoop>intOverPosition;intLoop--)\r\n\t\t\t\t{\r\n\t\t\t\t\tcTemp = strSource.substr(intLoop,1);\r\n\t\t\t\t\tif (cTemp==cPosition) break;\r\n\t\t\t\t\telse strTarget = cTemp+strTarget;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t}\r\n\treturn strTarget;\r\n}", "findIndex(pos, side, end, startAt = 0) {\n let arr = end ? this.to : this.from;\n for (let lo = startAt, hi = arr.length;;) {\n if (lo == hi)\n return lo;\n let mid = (lo + hi) >> 1;\n let diff = arr[mid] - pos || (end ? this.value[mid].endSide : this.value[mid].startSide) - side;\n if (mid == lo)\n return diff >= 0 ? lo : hi;\n if (diff >= 0)\n hi = mid;\n else\n lo = mid + 1;\n }\n }", "function getCharFromPosition(pos) {\n var index = pos.row * 5;\n index = index + pos.col;\n return cipher.key.charAt(index);\n}", "function isPosInt(val)\n{\n return (\n isInt(val) &&\n val > 0\n );\n}", "function lastPositionOcc (s){\n var position;\n for (i = s.length; i<=0; i--){\n if (s[i] === 'a'){\n position = i;\n }else{\n position = -1\n }\n }\n return position;\n}", "function checkIsInt(pos) {\n if (isNaN(pos) || pos > board.length) {\n return false;\n }\n return true;\n}", "function len(str)\r\n{\r\n if (str) {\r\n return len(str.substring(1))+1;\r\n }\r\n else\r\n return 0;\r\n}", "function range(nbr,min,max){if(nbr<min){return min;}else if(nbr>max){return max;}else{return nbr;}}", "function getSpotNumber(s) // paramwret is a string\r\n{\r\n var number = new String('');\r\n \r\n for(var i = 0; i < s.length; i++)\r\n {\r\n if( (s.charAt(i) >= '0') && (s.charAt(i) <= '9') )\r\n number += s.charAt(i);\r\n }\r\n return number; // return a string\r\n}", "function inBounds(number, bound) {\n\tif (number > (bound-1)) {\n\t\tnumber = bound - 1;\n\t}\n\treturn parseInt(number, 10);\n}", "function clampStartIndexFromRight(startIndex, len) {\n return min(len, max(-1, startIndex));\n }", "function xIndexOf(Val, Str, x) {\n 'use strict';\n\n var Ot,\n i;\n\n if (x <= (Str.split(Val).length - 1)) {\n Ot = Str.indexOf(Val);\n if (x > 1) {\n for (i = 1; i < x; i += 1) {\n Ot = Str.indexOf(Val, Ot + 1);\n }\n }\n return Ot;\n } else {\n alert(Val + \" Occurs less than \" + x + \" times\");\n return 0;\n }\n}", "function StrToIntWithDefault( s, n ) {\r\n var onlyNumbers = /[^0-9]/g;\r\n var t = s.replace( onlyNumbers, \"\" );\r\n\tt = parseInt( t );\r\n\tif ( ! isNaN( t ) ) {\r\n n = t;\r\n }\r\n return n;\r\n}", "function randomIndex(str){\n return Math.floor(Math.random() * str.length);\n }", "function h$jsstringIndexR(i, str) {\n ;\n if(i < 0 || i > str.length) return -1;\n var ch = str.charCodeAt(i);\n return (((ch|1023)===0xDFFF)) ? ((((str.charCodeAt(i-1))-0xD800)<<10)+(ch)-0xDC00+0x10000) : ch;\n}", "function clampStartIndexFromRight(startIndex, len) {\n return min(len, max(-1, startIndex));\n }" ]
[ "0.6600404", "0.65358627", "0.61570245", "0.5993589", "0.57630634", "0.57247585", "0.5646826", "0.56274575", "0.5462163", "0.543008", "0.54007566", "0.53785247", "0.5377223", "0.5372194", "0.5372194", "0.5349353", "0.5318074", "0.5312245", "0.5266459", "0.526095", "0.5196307", "0.51918375", "0.5151161", "0.51388264", "0.512884", "0.51150227", "0.5110294", "0.5103575", "0.5103575", "0.5103575", "0.5101442", "0.50708544", "0.5062798", "0.5051292", "0.504851", "0.50481045", "0.50469244", "0.50450945", "0.50409865", "0.5019482", "0.50137097", "0.50137097", "0.50137097", "0.50137097", "0.5011056", "0.50087655", "0.5000256", "0.4982229", "0.49712825", "0.49712825", "0.49712825", "0.49712825", "0.49712825", "0.49712825", "0.49712825", "0.49712825", "0.49712825", "0.49712825", "0.49712825", "0.49680632", "0.49677184", "0.49675673", "0.49614263", "0.4960497", "0.49550718", "0.49435112", "0.4933135", "0.4920978", "0.49197862", "0.49134153", "0.4909797", "0.49064666", "0.4895173", "0.4890763", "0.4886947", "0.488428", "0.48784858", "0.48758745", "0.48709148", "0.48523375", "0.48506457", "0.4850113", "0.48448363", "0.48422647" ]
0.49225366
78
Returns the value from the range [`from`; `to`] that satisfies `pred` and is closest to `from`. Assumes that at least `to` satisfies `pred`. Supports `from` being greater than `to`.
function findFirst(pred, from, to) { // At any point we are certain `to` satisfies `pred`, don't know // whether `from` does. var dir = from > to ? -1 : 1; for (;;) { if (from == to) { return from } var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF); if (mid == from) { return pred(mid) ? from : to } if (pred(mid)) { to = mid; } else { from = mid + dir; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n}", "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n}", "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n}", "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n}", "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n}", "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n}", "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n}", "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n}", "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n}", "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n}", "function findFirst(pred, from, to) {\n for (;;) {\n if (Math.abs(from - to) <= 1) { return pred(from) ? from : to }\n var mid = Math.floor((from + to) / 2)\n if (pred(mid)) { to = mid }\n else { from = mid }\n }\n}", "function findFirst(pred, from, to) {\n for (;;) {\n if (Math.abs(from - to) <= 1) { return pred(from) ? from : to }\n var mid = Math.floor((from + to) / 2);\n if (pred(mid)) { to = mid; }\n else { from = mid; }\n }\n}", "function findFirst(pred, from, to) {\r\n // At any point we are certain `to` satisfies `pred`, don't know\r\n // whether `from` does.\r\n var dir = from > to ? -1 : 1;\r\n for (;;) {\r\n if (from == to) { return from }\r\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\r\n if (mid == from) { return pred(mid) ? from : to }\r\n if (pred(mid)) { to = mid; }\r\n else { from = mid + dir; }\r\n }\r\n}", "function findFirst(pred, from, to) {\n\t\t // At any point we are certain `to` satisfies `pred`, don't know\n\t\t // whether `from` does.\n\t\t var dir = from > to ? -1 : 1;\n\t\t for (;;) {\n\t\t if (from == to) { return from }\n\t\t var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n\t\t if (mid == from) { return pred(mid) ? from : to }\n\t\t if (pred(mid)) { to = mid; }\n\t\t else { from = mid + dir; }\n\t\t }\n\t\t }", "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n\n for (;;) {\n if (from == to) {\n return from;\n }\n\n var midF = (from + to) / 2,\n mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n\n if (mid == from) {\n return pred(mid) ? from : to;\n }\n\n if (pred(mid)) {\n to = mid;\n } else {\n from = mid + dir;\n }\n }\n } // BIDI HELPERS", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest ( value, to ) {\r\n\t\treturn Math.round(value / to) * to;\r\n\t}", "function closest ( value, to ) {\r\n\t\treturn Math.round(value / to) * to;\r\n\t}", "function closest(value, to) {\n return Math.round(value / to) * to;\n }", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\n\t\treturn Math.round(value / to) * to;\n\t}", "function closest ( value, to ) {\r\n\t\t\treturn Math.round(value / to) * to;\r\n\t\t}", "function closest ( value, to ) {\n\t\t\treturn Math.round(value / to) * to;\n\t\t}", "function C(e,t,a){for(\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var n=t>a?-1:1;;){if(t==a)return t;var r=(t+a)/2,f=n<0?Math.ceil(r):Math.floor(r);if(f==t)return e(f)?t:a;e(f)?a=f:t=f+n}}", "function nearest(value, min, max)\n {\n if((value-min)>(max-value))\n {\n return max;\n }\n else\n {\n return min;\n }\n }", "function mapValueInRange(value, fromLow, fromHigh, toLow, toHigh) {\n var fromRangeSize = fromHigh - fromLow;\n var toRangeSize = toHigh - toLow;\n var valueScale = (value - fromLow) / fromRangeSize;\n return toLow + valueScale * toRangeSize;\n}", "function computeCost(x,min,max,from){\n if(x < min){\n return min-x+from-x;\n }else if(x > max){\n return x-max+x-from;\n }else{\n return Math.abs(x-from);\n }\n}", "rangeMapping(value, from, to) {\n return Math.floor(to[0] + (value - from[0]) * (to[1] - to[0]) / (from[1] - from[0]));\n }", "map(value, startRangeLower, startRangeHigher, targetRangeLower, targetRangeHigher)\n {\n let startSpan = startRangeHigher - startRangeLower;\n let targetSpan = targetRangeHigher - targetRangeLower;\n return (((value - startRangeLower) / startSpan) * targetSpan) + targetRangeLower;\n }", "function lowerbound(arr, value, compare, start, to) {\r\n if (start === void 0) { start = 0; }\r\n if (to === void 0) { to = arr.length; }\r\n var count = to - start;\r\n while (0 < count) {\r\n var count2 = (count >> 1);\r\n var mid = start + count2;\r\n if (compare(arr[mid], value)) {\r\n start = mid + 1;\r\n count -= count2 + 1;\r\n }\r\n else {\r\n count = count2;\r\n }\r\n }\r\n return start;\r\n}", "isCloseTo(value, to) {\n return value >= to - VectorMath.TOLERANCE && value <= to + VectorMath.TOLERANCE;\n }", "function nearest(from) {\n\tvar to = indexOfMin(distances[from]);\n\tif (distances[from][to] < infinDist) {\n\t\tdistances[from][to] = distances[to][from]= infinDist;\n\t\treturn to;\n\t}\n\treturn -1;\n}", "function map_range(value, low1, high1, low2, high2) {\n return low2 + (high2 - low2) * (value - low1) / (high1 - low1);\n}", "function map_range(value, low1, high1, low2, high2) {\n return low2 + (high2 - low2) * (value - low1) / (high1 - low1);\n}", "function map_range(value, low1, high1, low2, high2) {\n return low2 + (high2 - low2) * (value - low1) / (high1 - low1);\n}", "function map_range(value, low1, high1, low2, high2) {\n return low2 + (high2 - low2) * (value - low1) / (high1 - low1);\n}", "function map_range(value, low1, high1, low2, high2) {\n return low2 + (high2 - low2) * (value - low1) / (high1 - low1);\n}", "function closest (num, arr) {\n // mid, low and high are the index values of the arr\n let mid;\n let low = 0;\n let high = arr.length - 1;\n while (high - low > 1) {\n mid = Math.floor((low + high) / 2);\n if (arr[mid] < num) {\n low = mid;\n } else {\n high = mid;\n }\n }\n // This condition checks for the smallest difference and prints the result when the low and high are closest to\n // our num. \n // Ex: If our array is [1, 2, 4] and our num = 2, low = 0, high = 1, it will check for \n // (num - arr[low] which is 2 - 1 = 1 <= arr[high] - num which is 4 - 2 = 2)\n // basically 1 <= 2 and the answer is 1\n if (num - arr[low] <= arr[high] - num) {\n return arr[low];\n }\n return arr[high];\n}", "function getBetween(from, to) {\n\tvar resultX = (from[0] + to[0]) / 2;\n\tvar resultY = (from[1] + to[1]) / 2;\n\treturn [resultX, resultY];\n}", "function map(value, fromRangeMin, fromRangeMax, toRangeMin, toRangeMax) {\n return (value - fromRangeMin) * (toRangeMax - toRangeMin) / (fromRangeMax - fromRangeMin) + toRangeMin;\n }", "function guard(low, high, value) {\n return Math.min(Math.max(low, value), high);\n}", "function valueInRange (start, value, finish) {\n return (start <= value) && (value <= finish);\n}", "function valueInRange (start, value, finish) {\n return (start <= value) && (value <= finish);\n}", "function valueMapRange(value, inValueX, inValueY, outValueX, outValueY) {\n return (value - inValueX) * (outValueY - outValueX) / (inValueY - inValueX) + outValueX;\n}", "function approach(value, valueDest, rate) {\n\tif (value < valueDest) {\n\t\tvalue += Math.abs(value - valueDest) / rate;\n\t}\n\telse if (value > valueDest) {\n\t\tvalue -= Math.abs(value - valueDest) / rate;\n\t}\n\n\treturn value;\n}", "mapDataPoint (value, in_min, in_max, out_min, out_max) {\n // Shift negative values up into positive range\n if (in_min < 0 || in_max < 0) {\n in_max = in_max + -in_min\n value = value + -in_min\n in_min = in_min + -in_min\n }\n return out_min + (out_max - out_min) * ((value - in_min) / (in_max - in_min))\n }", "_getAbsoluteValue(val, min = windowDimensions.width * -2, max = 0)\n {\n if (val < min)\n return min\n else if (val > max)\n return max\n else \n return val\n }", "function rangeChecker(op, target, range){\r\n return op < target + range && op > target - range;\r\n}", "function map_range(value, low1, high1, low2, high2) {\r\n return low2 + (high2 - low2) * (value - low1) / (high1 - low1);\r\n }", "function between(value, min, max) {\n return Math.max(min, Math.min(value, max));\n }", "function getRandomInRange(from, to, fixed) {\n return (Math.random() * (to - from) + from).toFixed(fixed) * 1;\n // .toFixed() returns string, so ' * 1' is a trick to convert to number\n}", "function clampBetween(value, lowerBound, upperBound) {\n let result;\n if ( value >= lowerBound && value <= upperBound) {\n result = value;\n } else if (value < lowerBound) {\n result = lowerBound;\n } else if ( value > upperBound) {\n result = upperBound;\n }\n return result;\n}", "static randomLHS(from, to, affinity) {\n\t\tif (typeof to === 'undefined') {\n\t\t\tto = from;\n\t\t\tfrom = 0;\n\t\t}\n\t\tvar random = Math.random() * (to - from),\n\t\t\tresult = (Math.pow(random, 2) / to) + from;\n\t\tif (to < 2) return result;\n\t\treturn Math.floor(result);\n\t}", "function binarySearch(array, pred) {\r\n let lo = -1,\r\n hi = array.length;\r\n while (1 + lo < hi) {\r\n const mi = lo + ((hi - lo) >> 1);\r\n if (pred(array[mi])) {\r\n hi = mi;\r\n } else {\r\n lo = mi;\r\n }\r\n }\r\n return hi;\r\n}", "function between(val, min, max) {\n\t\treturn Math.min(Math.max(min, val), max);\n\t}", "function avance(val, dist) {\n if (val * 100 < dist) return dist - val * 100\n return 0\n}", "function constrain(x,lower,upper) {\n if (x > upper) {\n return upper;\n } else if (x < lower) {\n return lower;\n } else {\n return x;\n }\n }", "between( between, dependentVal){\n if( dependentVal > between[0] && dependentVal < between[1]){\n return true;\n }else{\n return false;\n }\n\n}", "function binarySearch(array, pred) {\n var lo = -1,\n hi = array.length;\n while (1 + lo < hi) {\n var mi = lo + ((hi - lo) >> 1);\n if (pred(array[mi], array, mi)) {\n hi = mi;\n } else {\n lo = mi;\n }\n }\n return hi;\n}", "function lookup(value, ay, low, high) {\r\n if(high <= low) {\r\n return (value > dst[low]) ? (low + 1) : low\r\n }\r\n // Compute mid\r\n let mid = Math.floor((low + high)/2)\r\n // Compare value with ay[mid]\r\n if(value === dst[mid]) {\r\n return mid\r\n }\r\n if(value < dst[mid]){\r\n //check lower half for match\r\n return lookup(value, ay, low, mid-1)\r\n } else {\r\n //check upper half for match\r\n return lookup(value, ay, mid+1, high)\r\n }\r\n // adjust low or high to either mid+1 or mid-1 respectively\r\n // call lookup again and return the value, like this:\r\n\r\n return lookup(value, ay, low, high)\r\n}", "function closestTo (arr, key, isPrev) {\n const offsetIndex = isPrev ? -1 : 1\n const current = arr.indexOf(key)\n return arr[current + offsetIndex]\n}", "findTarget(value) {\n if (value < this.value && this.left) {\n return this.left.findTarget(value);\n } else if (value >= this.value && this.right) {\n return this.right.findTarget(value);\n }\n\n return this;\n }", "function point(min, max){\n return chance.integer({ min: min || -50, max: max || 150 });\n }", "function array_closest(arr,val) {\n\t\t/*\n\t\tvar min_val=-1; var max_val; var min_key; var max_key;\n\t\tfor(var k in arr) {\n\t\t\tif(val==arr[k]) {\n\t\t\t\treturn [k];\n\t\t\t} else if(arr[k]<val) {\n\t\t\t\tif(arr[k]>min_val) {\n\t\t\t\t\tmin_val = arr[k];\n\t\t\t\t\tmin_key = k;\n\t\t\t\t}\n\t\t\t} else if(arr[k]>val) {\n\t\t\t\tif(!max_val||arr[k]<max_val) {\n\t\t\t\t\tmax_val = arr[k];\n\t\t\t\t\tmax_key = k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn [min_key, max_key];\n*/\n\t\tvar lo = null;\n\t\tvar hi = null;\n\t for(var i in arr) {\n\t \tif(arr[i]==val) {\n\t \t\treturn Array(i);\n\t \t}\n\t if (arr[i] <= val && (lo === null || lo < arr[i])) {\n\t \tlo = arr[i];\n\t \tlo_k = i;\n\t }\n \tif (arr[i] >= val && (hi === null || hi > arr[i])) {\n \t\thi = arr[i];\n \t\thi_k = i;\n \t}\n \t};\n \tif(hi_k!=lo_k+1) {\n \t\tlo_k = hi_k-1;\n \t\t//echo \"hmm... \";\n \t}\n\t return new Array(lo_k, hi_k);\n\t}", "getClosest(arr, val) {\n return arr.reduce(function (prev, curr) {\n return (Math.abs(curr - val) < Math.abs(prev - val) ? curr : prev);\n });\n }", "function map(value, in_min, in_max, out_min, out_max){\n return (value - in_min) * (out_max - out_min) / (in_max - in_min) + out_min\n}", "function point(min, max) {\n return chance.integer({min: min || -100, max: max || 1100})\n }" ]
[ "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.71898764", "0.71822035", "0.71509534", "0.70096433", "0.65164363", "0.60557735", "0.60172063", "0.60172063", "0.60172063", "0.60172063", "0.60172063", "0.60172063", "0.60005677", "0.60005677", "0.59971774", "0.59880227", "0.59880227", "0.59880227", "0.59880227", "0.59880227", "0.59880227", "0.59880227", "0.59880227", "0.59880227", "0.59880227", "0.59880227", "0.59880227", "0.59880227", "0.5937562", "0.59096944", "0.5850752", "0.5602863", "0.5385085", "0.52530754", "0.5238257", "0.5109013", "0.50292456", "0.501029", "0.4932974", "0.49194124", "0.49194124", "0.49194124", "0.49194124", "0.49194124", "0.48383772", "0.48316124", "0.482789", "0.47949162", "0.47796744", "0.47796744", "0.4777058", "0.47370803", "0.47360668", "0.47335905", "0.4715617", "0.46752647", "0.4663089", "0.46578616", "0.46415484", "0.4640864", "0.46404234", "0.46354765", "0.46296442", "0.45987356", "0.45968136", "0.45857897", "0.45693547", "0.45547098", "0.455091", "0.45486733", "0.4546822", "0.4545897", "0.45435643", "0.45246837" ]
0.71492475
27
The display handles the DOM integration, both for input reading and content drawing. It holds references to DOM nodes and displayrelated state.
function Display(place, doc, input) { var d = this; this.input = input; // Covers bottom-right square when both scrollbars are present. d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); d.scrollbarFiller.setAttribute("cm-not-content", "true"); // Covers bottom of gutter when coverGutterNextToScrollbar is on // and h scrollbar is present. d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); d.gutterFiller.setAttribute("cm-not-content", "true"); // Will contain the actual code, positioned to cover the viewport. d.lineDiv = eltP("div", null, "CodeMirror-code"); // Elements are added to these to represent selection and cursors. d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); d.cursorDiv = elt("div", null, "CodeMirror-cursors"); // A visibility: hidden element used to find the size of things. d.measure = elt("div", null, "CodeMirror-measure"); // When lines outside of the viewport are measured, they are drawn in this. d.lineMeasure = elt("div", null, "CodeMirror-measure"); // Wraps everything that needs to exist inside the vertically-padded coordinate system d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], null, "position: relative; outline: none"); var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); // Moved around its parent to cover visible view. d.mover = elt("div", [lines], null, "position: relative"); // Set to the height of the document, allowing scrolling. d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); d.sizerWidth = null; // Behavior of elts with overflow: auto and padding is // inconsistent across browsers. This is used to ensure the // scrollable area is big enough. d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); // Will contain the gutters, if any. d.gutters = elt("div", null, "CodeMirror-gutters"); d.lineGutter = null; // Actual scrollable element. d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); d.scroller.setAttribute("tabIndex", "-1"); // The element in which the editor lives. d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; } if (place) { if (place.appendChild) { place.appendChild(d.wrapper); } else { place(d.wrapper); } } // Current rendered range (may be bigger than the view window). d.viewFrom = d.viewTo = doc.first; d.reportedViewFrom = d.reportedViewTo = doc.first; // Information about the rendered lines. d.view = []; d.renderedView = null; // Holds info about a single rendered line when it was rendered // for measurement, while not in view. d.externalMeasured = null; // Empty space (in pixels) above the view d.viewOffset = 0; d.lastWrapHeight = d.lastWrapWidth = 0; d.updateLineNumbers = null; d.nativeBarWidth = d.barHeight = d.barWidth = 0; d.scrollbarsClipped = false; // Used to only resize the line number gutter when necessary (when // the amount of lines crosses a boundary that makes its width change) d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; // Set to true when a non-horizontal-scrolling line widget is // added. As an optimization, line widget aligning is skipped when // this is false. d.alignWidgets = false; d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; // Tracks the maximum line length so that the horizontal scrollbar // can be kept static when scrolling. d.maxLine = null; d.maxLineLength = 0; d.maxLineChanged = false; // Used for measuring wheel scrolling granularity d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; // True when shift is held down. d.shift = false; // Used to track whether anything happened since the context menu // was opened. d.selForContextMenu = null; d.activeTouch = null; input.init(d); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayDOM(){\r\n\t\tvar str = '';\r\n\t\tcontainer.getChildren().each(function(item){\r\n\t\t\tstr += '<div style=\"' + item.style.cssText + '\">' + item.get('text') + '</div>\\n';\r\n\t\t});\r\n\t\tdocument.id('output').set('text', str);\r\n\t}", "displayScene() {\n\n //Process all component nodes\n this.processNode(this.idRoot, null, null, 1, 1);\n }", "display(ele) {\n // make sure ele is a DOM element\n if (this.isDOM(ele)) {\n ele.style.display = 'block';\n } else {\n console.error('Error while trying to display a non DOM object');\n }\n }", "$render(displayRef) {\n if(this.$alive)\n this.render.apply(this, [this, displayRef]);\n }", "displayScene() {\n // entry point for graph rendering\n //TODO: Render loop starting at root of graph\n //console.log(this.nodes)\n this.components[this.idRoot].display();\n }", "display() {\n this._flushSomeDiv(this._threadHost)\n this._threadHost.appendChild(this._identifiedThread)\n this._scrollBottom()\n }", "createDOM() {\n // outer element hosts the node itself, css background colors,\n // border etc. will be applied here.\n this.domElement = document.createElement('div');\n this.domElement.node = this;\n this.domElement.classList.add('node');\n this.graph.domElement.appendChild(this.domElement);\n\n // content element has the title for the node and maybe some more UI\n // it is centered in the node in css.\n this.content = document.createElement('div');\n this.content.classList.add('node_content');\n this.domElement.appendChild(this.content);\n this.addDragAndDrop();\n }", "function Interpreter_CreateDisplayPanel()\n{\n\t//create a div\n\tvar theDisplayPanel = document.body.appendChild(document.createElement(\"DIV\"));\n\t//set its values\n\ttheDisplayPanel.style.cssText = \"position:absolute;width:100%;height:100%;overflow:auto;left:0px;top:0px;-moz-transform-origin:0 0;\" + (__DESIGNER_CONTROLLER ? \"\" : \"-webkit-transform: translate3d(0, 0, 0);\");\n\t//make it unselectable\n\tBrowser_SetSelectable(theDisplayPanel, false);\n\t//finally add the size change listener\n\tBrowser_AddEvent(window, __BROWSER_EVENT_RESIZE, Interpreter_OnResizeEvent);\n\tBrowser_AddEvent(theDisplayPanel, __BROWSER_EVENT_SCROLL, Interpreter_OnDisplayScroll);\n\t//return it\n\treturn theDisplayPanel;\n}", "_buildDisplayView() {\n this.element.innerHTML = this.value;\n }", "_buildDisplayView() {\n this.element.innerHTML = this.value;\n }", "function Interpreter_UpdateDisplay()\n{\n\t//helpers\n\tvar uidObject, theObject;\n\t//loop through all of our iframes\n\tfor (uidObject in this.LoadedIFrames)\n\t{\n\t\t//get the object\n\t\ttheObject = this.LoadedIFrames[uidObject];\n\t\t//valid?\n\t\tif (theObject && theObject.HTML)\n\t\t{\n\t\t\t//purge all css data\n\t\t\tBrowser_RemoveCSSData_Purge(theObject.HTML.contentDocument);\n\t\t}\n\t}\n\t//purge all css data from main doc too\n\tBrowser_RemoveCSSData_Purge(document);\n\t//loop through all toplevel objects\n\tfor (uidObject in this.TopLevelObjects)\n\t{\n\t\t//get the object\n\t\ttheObject = this.TopLevelObjects[uidObject];\n\t\t//valid?\n\t\tif (theObject)\n\t\t{\n\t\t\t//update it with full recursion\n\t\t\ttheObject.UpdateDisplay(true);\n\t\t}\n\t}\n\t//rearrange the forms\n\tForm_RearrangeForms(this.FocusedFormId);\n\t//and reset this\n\tthis.FocusedFormId = [];\n\t//have we got a focused object id? (AND NOT IN DESIGNER)\n\tif (this.State && this.State.FocusedObjectId > 0)\n\t{\n\t\t//memorise it\n\t\tthis.FocusedObjectId = this.State.FocusedObjectId;\n\t}\n\t//we need to handle the tabs here\n\tthis.PreUpdatePostDisplay();\n}", "display() {\n this.editorNode.style.visibility = \"visible\";\n this.focusInput();\n }", "function DOMRenderer() {}", "render_display() {\n this.element.fadeIn();\n this.visible = true;\n }", "function parseNodes()\r\n{\r\n\tvar browser = gBrowser.mCurrentBrowser;\t\r\n\tdisplayNodes(browser.contentDocument);\r\n\tcreateWindow();\r\n}", "display()\n {\n $(this.element).html(`\n <link rel=\"stylesheet\" href=\"views/tab-view/tab-view.css\">\n <link rel=\"stylesheet\" href=\"views/tab-content/tab-content.css\">\n <link rel=\"stylesheet\" href=\"views/list-tasks/list-tasks.css\">\n <link rel=\"stylesheet\" href=\"views/diagram-view/diagram-view.css\">\n\n <ul id=\"tabs\">\n </ul>\n <div id=\"tab-content\"></div>\n `);\n\n this.ulTabs = document.getElementById('tabs');\n this.divsContent = document.getElementById('tab-content');\n\n //adapt the height of the div to the full width\n $(window).resize(function()\n {\n $('#tab-content').height($('#tab-content').parent().height() - $('#tabs').height());\n });\n\n $(document).ready(function()\n {\n $(window).trigger('resize');\n });\n }", "renderIncDom() {\n\t\tif (this.component_.render) {\n\t\t\tthis.component_.render();\n\t\t} else {\n\t\t\tIncrementalDOM.elementVoid('div');\n\t\t}\n\t}", "get display() {\n return this._display.innerHTML;\n }", "render() {\n console.debug(`Rendering DOM of ${this.constructor.name}`);\n this.shadowRoot.innerHTML = this.html;\n if (this.script != null) {\n console.debug(`Running script of ${this.constructor.name}`);\n this.script();\n console.debug(`Finished running script of ${this.constructor.name}`);\n }\n console.debug(`Finished rendering DOM of ${this.constructor.name}`);\n }", "_render() {\n\n this._el.innerHTML = `\n <div class='itk-slider'>\n <button class='show-prev-btn'> left </button>\n <img class='slide-img' src=''>\n <button class='show-next-btn'> right </button>\n </div>`;\n\n this.showPrevBtn = this._el.querySelector('.show-prev-btn');\n this.showNextBtn = this._el.querySelector('.show-next-btn');\n this.slideImage = this._el.querySelector('.slide-img');\n }", "_render() {\n this._reactComponent = this._getReactComponent();\n if (!this._root) this._root = createRoot(this._container.getElement()[0]);\n this._root.render(this._reactComponent);\n }", "function displayContentUpdate() {\n display.textContent = displayContent.join('');\n}", "function update_display(){\n // canvas\n draw();\n // DOM displaying results\n display_questions_list();\n}", "_registerDisplayListeners () {\n this.display = caller('display', {postMessage: window.parent.postMessage.bind(window.parent)})\n this.hide = caller('hide', {postMessage: window.parent.postMessage.bind(window.parent)})\n }", "render(){\n //createDom (tag, type, name, value, domClass, id, parent)\n this.containerDom = this.htmlHelper.createDom('div', this.parentDom,this.domClass + '_conatiner')\n this.dom = this.htmlHelper.createDom('canvas', this.containerDom);\n this.dom.style.touchAction=\"none\"; // prevent default browser actions\n\n this.setContextData(this.defaultLineWidth, '#000000')\n }", "function display(node){\n if(node.visible){\n if (hasBorder() == true)\n p.stroke(getBorderColor());\n else\n p.noStroke();\n\n if(beingDragged != null && node == beingDragged){\n p.fill(getActiveColor());\n } else if(p.mouseX >= node.x-node.width/2 && p.mouseX <= node.x+node.width/2 \n && p.mouseY >= node.y-node.height/2 && p.mouseY <= node.y+node.height/2){\n if (currentClickedNode == node)\n p.fill(getSelectedColor());\n else\n p.fill(getHoverColor());\n\n document.getElementById('show_label').innerHTML = node.label;\n document.getElementById('show_url').innerHTML = node.url;\n document.getElementById('show_url').href = node.url;\n } else if (currentClickedNode == node){\n p.fill(getSelectedColor()); \n } else {\n p.fill(getNodeColor());\n } \n p.rect(node.x, node.y, node.width, node.height);\n\n //Handle node expander graphic\n if (node.children.length != 0) {\n p.noStroke();\n p.fill(getActiveColor());\n p.rect(node.x+node.width/2, node.y, 3, 3);\n } \n\n //Handle text \n p.fill(getFontColor());\n // calculate text size based on the current size of the node\n p.textSize(getTextSize(node));\n p.text(node.label, node.x - node.width/2 + 5, node.y + 5);\n //p.text(node.label, node.x-35, node.y+5);\n\n //Used for drag/drop\n var x_origin = node.x + node.width/2;\n var y_origin = node.y;\n\n //Recurse on children and draw connecting lines\n for(var i=0; i<node.children.length; i++){\n if(node.children[i].visible && node.children[i].x - node.children[i].width/2 > 0 && node.children[i].y > 0){\n display(node.children[i]);\n p.stroke(getLineColor());\n p.line(x_origin, y_origin, node.children[i].x - node.children[i].width/2, node.children[i].y);\n }\n }\n }\n}", "function Display_showGameElements() {\n\tvar displayContent = document.getElementById(\"displayContent\");\n\n\tvar inputToCrib = document.createElementNS(this.xhtmlns, \"input\");\n\tinputToCrib.setAttribute(\"id\", \"inputToCrib\");\n\tinputToCrib.setAttribute(\"type\", \"button\");\n\tinputToCrib.setAttribute(\"value\", \"To Crib\");\n\tinputToCrib.setAttribute(\"onclick\", \"toCrib();\");\n\n\tvar inputPlay = document.createElementNS(this.xhtmlns, \"input\");\n\tinputPlay.setAttribute(\"id\", \"inputPlay\");\n\tinputPlay.setAttribute(\"type\", \"button\");\n\tinputPlay.setAttribute(\"value\", \"Play card\");\n\n\tdisplayContent.appendChild(inputToCrib);\n\tdisplayContent.appendChild(inputPlay);\n\n\t// Show deck and stack\n\tthis.createCard(null, 490, 10, 120, false);\n\tthis.createCard(null, 620, 10, 120, false);\n\n\t// Display count\n\tvar spanCountHeader = document.createElementNS(this.xhtmlns, \"span\");\n\tspanCountHeader.setAttribute(\"id\", \"spanCountHeader\");\n\tspanCountHeader.appendChild(document.createTextNode(\"Curent Play Count:\"));\n\n\tvar spanCount = document.createElementNS(this.xhtmlns, \"span\");\n\tspanCount.setAttribute(\"id\", \"spanCount\");\n\tspanCount.appendChild(document.createTextNode(\"0\"));\n\n\tvar whosCrib = document.createElementNS(this.xhtmlns, \"img\");\n\twhosCrib.setAttribute(\"id\", \"whosCrib\");\n\twhosCrib.setAttribute(\"src\", \"img/crib.png\");\n\n\tdisplayContent.appendChild(whosCrib);\n\tdisplayContent.appendChild(spanCountHeader);\n\tdisplayContent.appendChild(spanCount);\n}", "render(innerHTML = \"\")\n {\n this.DOMContainer.innerHTML = innerHTML;\n if (this.handleDOMContainer) \n {\n this.DOMContainer.insertAdjacentElement(\"afterbegin\", this.handleDOMContainer);\n } \n }", "render() {\n const { rootNode, sizeSet } = this;\n let visualIndex = this.visualIndex;\n\n if (this.isSharedViewSet() && sizeSet.isPlaceOn(WORKING_SPACE_BOTTOM)) {\n visualIndex += sizeSet.sharedSize.nextSize;\n }\n\n let node = rootNode.childNodes[visualIndex];\n\n if (node.tagName !== this.childNodeType) {\n const newNode = this.nodesPool();\n\n rootNode.replaceChild(newNode, node);\n node = newNode;\n }\n\n this.collectedNodes.push(node);\n this.visualIndex += 1;\n }", "display() {\n\t\tsuper.display();\n\n\t\t/* Display the boxes on the right panel. */\n\t\tthis.scoreBox.display();\n\t\tthis.levelLinesBox.display();\n\t\tthis.nextPieceBox.display();\n\t\tthis.statBox.display();\n\n\t\t/* Display the falling piece. */\n\t\tif (this.piece != undefined) {\n\t\t\tthis.piece.display(this.grid.initialx, this.grid.initialy, this.grid.squareSize);\n\t\t}\n\n\t\t/* Display the grid. */\n\t\tthis.grid.display();\n\n\t\tif (this.state == STATE_SELECT_LEVEL) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.levelSelectorBox.display();\n\t\t}\n\t\telse if (this.state == STATE_WAIT_ADVERSARY_SELECTION) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.waitAdversarySelectionBox.display();\n\t\t}\n\t\telse if (this.state == STATE_GAME_OVER) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.gameOverSelectorBox.display();\n\t\t}\n\t\telse if (this.state == STATE_SUBMIT) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.submitBox.display();\n\t\t}\n\t}", "function renderDom() {\n stackList.innerHTML = \"\";\n myStack.stackControl.forEach(el => {\n stackList.innerHTML += `<li>${el}</li>`;\n })\n }", "connectedCallback() {\n this.renderAndUpdateDom();\n }", "function show() {\n const toShow = document.querySelector(\".show\");\n const showBlock = document.querySelector(\".currentDisplay\");\n showBlock.innerHTML = (toShow.innerHTML)\n}", "function initializeDisplay() {\n // set the data and properties of link lines\n link = svg.append(\"g\")\n .attr(\"class\", \"links\")\n .selectAll(\"line\")\n .data(graph.links)\n .enter().append(\"line\");\n\n // set the data and properties of node circles\n node = svg.append(\"g\")\n .attr(\"class\", \"nodes\")\n .selectAll(\"circle\")\n .data(graph.nodes)\n .enter()\n .append(\"circle\")\n .call(d3.drag()\n .on(\"start\", dragstarted)\n .on(\"drag\", dragged)\n .on(\"end\", dragended));\n\n node.append(\"title\")\n .text(function (d) {\n return d.id;\n });\n\n link.append(\"title\")\n .text(function (d) {\n return d.value;\n });\n \n // visualize the graph\n updateDisplay();\n}", "function displayContent(div){\n\tscrollContentPadding()\n\tprebuildSlideMenu()\n\teditPagerLink()\n\tShadowbox.clearCache()//Re-initialize Shadowbox to include any newly loaded images\n\tShadowbox.setup()\n\n\t\tvar imgLoaded = 0\n\t\tvar contentBox = $(activeContainer).find('.'+div)\n\t\tvar imgCount = $('img',contentBox).size()\t\t\n\t\t\n\t\t\n\t\t$('img',contentBox).each(function(index,element){\n\n\t\t\tif(element.complete){\n\n\t\t\t\timgLoaded ++\n\n\t\t\t} else {\n\n\t\t\t\t$(element).bind('load',function(){\n\t\t\t\t\timgLoaded ++\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t})\t\t\t\t\n\n\t\t\t}\n\t\n\t\t})\t\t\n\n\t\tvar scrollBuilder = setInterval(function(){\t\t\t\n\t\t\tif(imgLoaded == imgCount){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$(activePanel).mCustomScrollbar(\"vertical\",400,\"easeOutCirc\",1.05,\"fixed\",\"yes\",\"yes\",20)\t\n\t\t\t\t\n\t\t\t\t//readOut(\"Building slidemenu\" + smId)\n\t\t\t\t//readOut($(activeContainer).css('width'))\t\t\n\t\t\t\tclearInterval(scrollBuilder)\n\t\t\t}\n\t\t},250)\n\n\n\t\t\n\t$(activeContainer).fadeTo(1000,1)\t \n}", "displayScene() {\n if(this.nodeInfo)\n this.displayNode(this.nodeInfo[this.idRoot],this.defaultMaterialID,\"null\",{s:1,t:1},false);\n }", "function displayHTML()\n{\n document.getElementById( \"outputDiv\" ).innerHTML = outputHTML;\n} // end function displayDoc", "displayScene()\r\n {\r\n this.traverseGraph(this.components[this.idRoot], this.components[this.idRoot].materials, this.components[this.idRoot].texture);\r\n }", "display () {\r\n this.timeout = null;\r\n if (this.pending) return;\r\n let content = this.input.textContent;\r\n if (content === this.oldContent) return;\r\n\r\n if (this.running) {\r\n this.pending = true;\r\n MathJax.Hub.Queue([\"display\", this]);\r\n } else {\r\n this.buffer.innerHTML = this.oldContent = (content.length > 0 ) ? '$' + content + '$' : '';\r\n this.running = true;\r\n MathJax.Hub.Queue([\"Typeset\", MathJax.Hub, this.buffer ], [\"finish\", this] );\r\n }\r\n }", "function css_defaultDisplay(nodeName) {\n var doc = document,\n display = elemdisplay[nodeName];\n\n if (!display) {\n display = actualDisplay(nodeName, doc);\n\n // If the simple way fails, read from inside an iframe\n if (display === \"none\" || !display) {\n // Use the already-created iframe if possible\n iframe = (iframe || jQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n .css(\"cssText\", \"display:block !important\")).appendTo(doc.documentElement);\n\n // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n doc = (iframe[0].contentWindow || iframe[0].contentDocument).document;\n doc.write(\"<!doctype html><html><body>\");\n doc.close();\n\n display = actualDisplay(nodeName, doc);\n iframe.detach();\n }\n\n // Store the correct default display\n elemdisplay[nodeName] = display;\n }\n\n return display;\n }", "function display() {\n\n doSanityCheck();\n initButtons();\n}", "function TrackingDisplay($display) {\n\t\t//Store the canvas element for this display\n\t\tthis.$display = $display;\n\n\t\t//Retrieve and store the 2d drawing context for this canvas\n\t\tthis.drawContext = $display[0].getContext('2d');\n\n\t\t//Store the dimensions of the current display element.\n\t\tthis.width = $display.width();\n\t\tthis.height = $display.height();\n\n\t\t//Determine which axis is the constraining axis for this canvas so we can ensure our displays are squares.\n\t\tif (this.width < this.height) {\n\t\t\tthis.height = this.width;\n\t\t} else {\n\t\t\tthis.width = this.height;\n\t\t}\n\n\t\t//Apply the new dimensions\n\t\t$display.height(this.height).width(this.width).attr(\"width\", this.width).attr(\"height\", this.height);\n\n\t\t//Multidimensional array of values from the CELL_STATE variable representing the state of each cell.\n\t\tthis.gridState = [];\n\n\t\t//Multidimensional array of any values. Used just to contain data related to each cell. At the moment, this only used\n\t\t//to specify the type of ship in a \"SHIP\" cell.\n\t\tthis.gridData = [];\n\n\t\t//Declare the hasInit flag, for controlling when the initialization logic fires\n\t\tthis.hasInit = false;\n\t}", "function renderContent() {\n var content = document.getElementById('content_' + selected);\n // Initialize the pane.\n if (content.id == 'content_blocks') {\n // If the workspace was changed by the XML tab, Firefox will have performed\n // an incomplete rendering due to Blockly being invisible. Rerender.\n Blockly.mainWorkspace.render();\n } else if (content.id == 'content_xml') {\n var xmlTextarea = document.getElementById('textarea_xml');\n var xmlDom = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);\n var xmlText = Blockly.Xml.domToPrettyText(xmlDom);\n xmlTextarea.value = xmlText;\n xmlTextarea.focus();\n } else if (content.id == 'content_javascript') {\n content.innerHTML = Blockly.Generator.workspaceToCode('JavaScript');\n } else if (content.id == 'content_python') {\n content.innerHTML = Blockly.Generator.workspaceToCode('Python');\n }\n}", "createDisplay() {\n const { text, fontSize = 36, color = '#000000' } = this.conf;\n this.display = new ProxyObj();\n // this.setAnchor(0.5);\n this.display.text = text;\n this.display.updateStyle({ fontSize, fill: color });\n }", "function clearDisplay() {\n // Removing all children from an element\n var element = document.getElementById(\"rightSideBar\");\n document.getElementById(\"docDisplay\").innerHTML = \"\";\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}", "display() {\n this.scene.pushMatrix();\n this.scene.multMatrix(this.transfMatrix); /*Add the new transformation matrix to this node \n and all its descendants*/\n\n /*if this node is keyframe animated and the animation has not started yet, node cannot be displayed*/\n if((this.animation != null && (this.animation.checkVisibility() == true)) || this.animation == null) {\n if(this.animation != null) {\n this.animation.apply(this.scene);\n }\n \n if(this.material != \"null\") { //Adicionar o material se não for \"null\"\n materialStack.push(this.material);\n }\n\n if(this.scene.materials[materialStack[materialStack.length - 1]] != null)\n this.scene.materials[materialStack[materialStack.length - 1]].apply();\n\n if(this.texture == \"clear\") {\n if(this.scene.textures[textureStack[textureStack.length - 1]] != null) \n this.scene.textures[textureStack[textureStack.length - 1]].unbind(); \n textureStack.push(0);\n } else if(this.texture == \"null\") {\n if(this.scene.textures[textureStack[textureStack.length - 1]] != null) {\n if(this.scene.textures[textureStack[textureStack.length - 1]] != 0)\n this.scene.textures[textureStack[textureStack.length - 1]].bind();\n }\n } else {\n if(this.scene.textures[this.texture] != 0 && this.scene.textures[this.texture] != null) {\n textureStack.push(this.texture);\n this.scene.textures[textureStack[textureStack.length - 1]].bind();\n }\n }\n\n //Display leaves if they exist\n for(var i = 0; i < this.leaves.length; i++) {\n if(this.leaves[i] != null)\n this.leaves[i].display();\n }\n\n //Recursively run this code for all the children nodes\n for(var j = 0; j < this.descendants.length; j++) {\n this.descendants[j].display();\n }\n\n if(this.texture != \"null\"){\n textureStack.pop();\n }\n\n if(this.material != \"null\")\n materialStack.pop();\n }\n\n this.scene.popMatrix();\n\n }", "async connectedCallback() {\n const ctor = this.constructor;\n this.setAttribute(`_ui5rt${(0, _Runtimes.getCurrentRuntimeIndex)()}`, \"\");\n this.setAttribute(\"_ui5host\", \"\");\n this.setAttribute(ctor.getMetadata().getPureTag(), \"\");\n if (ctor.getMetadata().supportsF6FastNavigation()) {\n this.setAttribute(\"data-sap-ui-fastnavgroup\", \"true\");\n }\n const slotsAreManaged = ctor.getMetadata().slotsAreManaged();\n this._inDOM = true;\n if (slotsAreManaged) {\n // always register the observer before yielding control to the main thread (await)\n this._startObservingDOMChildren();\n await this._processChildren();\n }\n if (!this._inDOM) {\n // Component removed from DOM while _processChildren was running\n return;\n }\n (0, _Render.renderImmediately)(this);\n this._domRefReadyPromise._deferredResolve();\n this._fullyConnected = true;\n this.onEnterDOM();\n }", "display() {\n this.object.display();\n }", "show ()\n\t{\n\t\t//if the view hasn't been initialised, call setup (of the concrete view e.g. LOView)\n\t\tif(!this.initialised)\n\t\t{\n\t\t\tthis.setup();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//unhide the elements of the scene\n\t\t\tthis.root.style.display = 'block';\n\t\t}\n\t}", "render() {\n\t\tif (!this.component_.element) {\n\t\t\tthis.component_.element = document.createElement('div');\n\t\t}\n\t\tthis.emit('rendered', !this.isRendered_);\n\t}", "function __zoot_c3d__process_DOM() {\n let containers = document.body.getElementsByTagName('zoot-c3d-root-container');\n for (let i = 0; i < containers.length; i++) {\n __zoot_c3d__process_Component(undefined, containers[i]);\n __zoot_c3d__g_root_containers.push(containers[i]);\n containers[i].zoot_c3d_sync();\n }\n}", "display() {\n this.scene.pushMatrix();\n this.scene.multMatrix(this.transformationMatrix);\n if ((typeof this.cgfTexture != 'undefined') && this.cgfMaterial != null)\n this.cgfMaterial.setTexture(this.cgfTexture);\n if (this.cgfMaterial != null)\n this.cgfMaterial.apply();\n\n if (typeof this.animations[this.atualAnimationId] != 'undefined')\n this.animations[this.atualAnimationId].display();\n\n for (let children of this.childrens) {\n if (children.cgfTextureId == \"inherit\") {\n children.cgfTexture = this.cgfTexture;\n children.length_sTexture = this.length_sTexture;\n children.length_tTexture = this.length_tTexture;\n }\n if (children.cgfMaterialId == \"inherit\") {\n children.cgfMaterial = this.cgfMaterial;\n }\n if (!(children instanceof Component)) {\n if (!(isNaN(this.length_sTexture) || isNaN(this.length_tTexture)))\n children.updateTexCoords(this.length_sTexture, this.length_tTexture);\n }\n children.display();\n }\n\n this.scene.popMatrix();\n }", "show() {\n for (let node of this.nodes) {\n node.show();\n node.showLinks();\n }\n }", "_renderScreen() {\n\t\tif (this._el && this._component) {\n\t\t\tthis._component.render(this._el);\n\t\t}\n\t}", "connectedCallback() {\n this.innerHTML = this.render();\n\n }", "function renderContent() {\n var content = document.getElementById('content_' + selected);\n // Initialize the pane.\n if (content.id == 'content_blocks') {\n // If the workspace was changed by the XML tab, Firefox will have performed\n // an incomplete rendering due to Blockly being invisible. Rerender.\n Blockly.mainWorkspace.render();\n } else if (content.id == 'content_xml') {\n var xmlTextarea = document.getElementById('textarea_xml');\n var xmlDom = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);\n var xmlText = Blockly.Xml.domToPrettyText(xmlDom);\n xmlTextarea.value = xmlText;\n xmlTextarea.focus();\n } else if (content.id == 'content_javascript') {\n content.innerHTML = Blockly.Generator.workspaceToCode('JavaScript');\n } else if (content.id == 'content_python') {\n content.innerHTML = Blockly.Generator.workspaceToCode('Python');\n } else if (content.id == 'content_whalesong') {\n content.innerHTML = Blockly.Generator.workspaceToCode('Whalesong');\n } else if (content.id == 'content_ray') {\n content.innerHTML = Blockly.Generator.workspaceToCode('Ray');\n }\n}", "displayScene() {\n var root = this.components[this.root];\n if (root == null)\n return \"[displayScene]: root node does not exist!\";\n\n // display scene graph starting at the root component\n root.display(root.materials[root.currentMaterialIndex][1], root.texture);\n }", "render() {\n this._addChooserHandler();\n this._addLoggerListeners();\n this._addButtonHandler();\n }", "onEnterDOM() {}", "function showElement () {\n if(this instanceof HTMLCollection || this instanceof NodeList) {\n for(var i = 0; i < this.length; i++) {\n this[i].style.display = null;\n }\n }\n else if(this instanceof HTMLElement) {\n this.style.display = null;\n }\n\n return this;\n }", "function displayContents() {\n\tif (contentsRequest.readyState === XMLHttpRequest.DONE) {\n\t\tif (contentsRequest.status === 200) {\n\t\t\tdocument.getElementById('tree').textContent = properties.showtree();\n\t\t\tdocument.getElementById('display').innerHTML = formatDirContents(contentsRequest.responseText);\n\t\t} else {\n\t\t\talert('There was a problem with the request.');\n\t\t}\n\t}\n}", "function updateDisplay () {\n const display = document.querySelector('.calculatorDisplay');\n // update value of screen element with content of `displayValue`\n display.value = calcDisplay.displayValue;\n}", "render() {\n this.fetch(() => {\n /**\n * Notice that the order here doesn't matter, if we want it to work like React,\n * we have to set up a virtual DOM and then have another object which it's purpose\n * will be to get the virtual DOM and then put that into the DOM (ReactDOM job is actually just that).\n * Virtual DOM is just any representation of the DOM elements, for that we can use JSX to\n * make our job easier and actually doing that is way easier than what you might think!\n */\n new Articles(this.articles).render();\n });\n }", "function actualDisplay( name, doc ) {\n\tvar elem = DM( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = DM.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "show() {\n this.el.appendChild(this.canvas);\n this.update();\n }", "attachToDOM_() {\n document.body.appendChild(this);\n }", "function changeTheDOM()\n{\n\tconsole.log('DOM change call');\n\tdocument.getElementById('passage').setAttribute('style','display: block');\n\tdocument.getElementById('playagain').setAttribute('style','display: block');\n\tdocument.getElementById('madlibs-entry').setAttribute('style','display: none');\n\n\tdocument.getElementById('classics').innerHTML = selectedPassageTitle;\n}", "function defaultDisplay(nodeName){if(!elemdisplay[nodeName]){var body=document.body,elem=jQuery(\"<\"+nodeName+\">\").appendTo(body),display=elem.css(\"display\");elem.remove(); // If the simple way fails,\n\t// get element's real default display by attaching it to a temp iframe\n\tif(display===\"none\"||display===\"\"){ // No iframe to use yet, so create it\n\tif(!iframe){iframe=document.createElement(\"iframe\");iframe.frameBorder=iframe.width=iframe.height=0;}body.appendChild(iframe); // Create a cacheable copy of the iframe document on first call.\n\t// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n\t// document to it; WebKit & Firefox won't allow reusing the iframe document.\n\tif(!iframeDoc||!iframe.createElement){iframeDoc=(iframe.contentWindow||iframe.contentDocument).document;iframeDoc.write((jQuery.support.boxModel?\"<!doctype html>\":\"\")+\"<html><body>\");iframeDoc.close();}elem=iframeDoc.createElement(nodeName);iframeDoc.body.appendChild(elem);display=jQuery.css(elem,\"display\");body.removeChild(iframe);} // Store the correct default display\n\telemdisplay[nodeName]=display;}return elemdisplay[nodeName];}", "function renderContent() {\n var content = document.getElementById('content_' + selected);\n // Initialize the pane.\n if (content.id == 'content_blocks') {\n // If the workspace was changed by the XML tab, Firefox will have performed\n // an incomplete rendering due to Blockly being invisible. Rerender.\n Blockly.mainWorkspace.render();\n //Check if the arduino code peek is showing\n if(document.getElementById('arduino_code_peek').style.display != 'none' ) {\n renderArduinoCode(null);\n }\n } else if (content.id == 'content_xml') {\n // Initialize the pane.\n var xmlTextarea = document.getElementById('textarea_xml');\n var xmlDom = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);\n var xmlText = Blockly.Xml.domToPrettyText(xmlDom);\n xmlTextarea.value = xmlText;\n xmlTextarea.focus();\n } else if (content.id == 'content_arduino') {\n var code = Blockly.Generator.workspaceToCode('Arduino');\n var arduinoTextarea = document.getElementById('textarea_arduino');\n arduinoTextarea.value = code\n arduinoTextarea.focus();\n }\n}", "setDisplayNodeParent(element) {\n this.display_node.remove();\n element.appendChild(this.display_node);\n }", "function _display(){\n\t\t\t$(levelID).html(level);\n\t\t\t$(pointsID).html(points);\n\t\t\t$(linesID).html(lines);\n\t\t}", "get display () {\n\t\treturn this._display;\n\t}", "get display () {\n\t\treturn this._display;\n\t}", "get display () {\n\t\treturn this._display;\n\t}", "render() {\n this.innerHTML = this.htmlElementsString;\n this.rootElement.appendChild(this);\n this.createScript();\n }", "function updateDisplay(){\n const display = document.querySelector('.calculator-screen');\n // update the value of screen from displayValue in calculator object\n display.value = calculator.displayValue;\n}", "function css_defaultDisplay( nodeName ) {\n var doc = document,\n display = elemdisplay[ nodeName ];\n\n if ( !display ) {\n display = actualDisplay( nodeName, doc );\n\n // If the simple way fails, read from inside an iframe\n if ( display === \"none\" || !display ) {\n // Use the already-created iframe if possible\n iframe = ( iframe ||\n jQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n .css( \"cssText\", \"display:block !important\" )\n ).appendTo( doc.documentElement );\n\n // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n doc.write(\"<!doctype html><html><body>\");\n doc.close();\n\n display = actualDisplay( nodeName, doc );\n iframe.detach();\n }\n\n // Store the correct default display\n elemdisplay[ nodeName ] = display;\n }\n\n return display;\n}", "function css_defaultDisplay( nodeName ) {\n var doc = document,\n display = elemdisplay[ nodeName ];\n\n if ( !display ) {\n display = actualDisplay( nodeName, doc );\n\n // If the simple way fails, read from inside an iframe\n if ( display === \"none\" || !display ) {\n // Use the already-created iframe if possible\n iframe = ( iframe ||\n jQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n .css( \"cssText\", \"display:block !important\" )\n ).appendTo( doc.documentElement );\n\n // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n doc.write(\"<!doctype html><html><body>\");\n doc.close();\n\n display = actualDisplay( nodeName, doc );\n iframe.detach();\n }\n\n // Store the correct default display\n elemdisplay[ nodeName ] = display;\n }\n\n return display;\n}", "createDisplay() {\n const { text, fontSize = 36 } = this.conf;\n this.display = Pool.get(this.type, () => new Label());\n this.display.attr({ text, fontSize });\n }", "_onUpdateDisplay() {}", "function render()\n {\n if (me.triggerEvent('renderBefore', data) === false)\n return;\n\n // remove all child nodes\n container.html('');\n\n // render child nodes\n for (var i=0; i < data.length; i++) {\n data[i].level = 0;\n render_node(data[i], container);\n }\n\n me.triggerEvent('renderAfter', container);\n }", "_render(html){this.$.container.innerHTML=html}", "_initDisplay(value) {}", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "function displayContent(tag) {\n\t\n\tvar pagedisplay = document.getElementsByClassName(\"pagedisplay\")[0];\n\t\n\tswitch(tag) {\n\t\tcase \"projects\":\n\t\t\tvar projects = getProjects();\n\t\t\temptyDiv(\"pagedisplay\");\n\t\t\tpagedisplay.appendChild(projects);\n\t\t\tbreak;\n\t\tcase \"aboutus\":\n\t\t\tvar aboutus = getAboutUs();\n\t\t\temptyDiv(\"pagedisplay\");\n\t\t\tpagedisplay.appendChild(aboutus);\n\t\t\tbreak;\n\t\tcase \"becomemember\":\n\t\t\tvar becomemember = getBecomeMember();\n\t\t\temptyDiv(\"pagedisplay\");\n\t\t\tpagedisplay.appendChild(becomemember);\n\t\t\tbreak;\n\t\tcase \"members\":\n\t\t\tvar membersarea = getMembers();\n\t\t\temptyDiv(\"pagedisplay\");\n\t\t\tpagedisplay.appendChild(membersarea);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n}", "function DisplayObject()\n{\n this.last = this;\n this.first = this;\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n *\n * @property position\n * @type Point\n */\n this.position = new Point();\n\n /**\n * The scale factor of the object.\n *\n * @property scale\n * @type Point\n */\n this.scale = new Point(1,1);//{x:1, y:1};\n\n /**\n * The pivot point of the displayObject that it rotates around\n *\n * @property pivot\n * @type Point\n */\n this.pivot = new Point(0,0);\n\n /**\n * The rotation of the object in radians.\n *\n * @property rotation\n * @type Number\n */\n this.rotation = 0;\n\n /**\n * The opacity of the object.\n *\n * @property alpha\n * @type Number\n */\n this.alpha = 1;\n\n /**\n * The visibility of the object.\n *\n * @property visible\n * @type Boolean\n */\n this.visible = true;\n\n /**\n * This is the defined area that will pick up mouse / touch events. It is null by default.\n * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)\n *\n * @property hitArea\n * @type Rectangle|Circle|Ellipse|Polygon\n */\n this.hitArea = null;\n\n /**\n * This is used to indicate if the displayObject should display a mouse hand cursor on rollover\n *\n * @property buttonMode\n * @type Boolean\n */\n this.buttonMode = false;\n\n /**\n * Can this object be rendered\n *\n * @property renderable\n * @type Boolean\n */\n this.renderable = false;\n\n /**\n * [read-only] The display object container that contains this display object.\n *\n * @property parent\n * @type DisplayObjectContainer\n * @readOnly\n */\n this.parent = null;\n\n /**\n * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.\n *\n * @property stage\n * @type Stage\n * @readOnly\n */\n this.stage = null;\n\n /**\n * [read-only] The multiplied alpha of the displayobject\n *\n * @property worldAlpha\n * @type Number\n * @readOnly\n */\n this.worldAlpha = 1;\n\n /**\n * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property\n *\n * @property _interactive\n * @type Boolean\n * @readOnly\n * @private\n */\n this._interactive = false;\n\n this.defaultCursor = 'pointer';\n\n /**\n * [read-only] Current transform of the object based on world (parent) factors\n *\n * @property worldTransform\n * @type Mat3\n * @readOnly\n * @private\n */\n this.worldTransform = mat3.create();//mat3.identity();\n\n /**\n * [read-only] Current transform of the object locally\n *\n * @property localTransform\n * @type Mat3\n * @readOnly\n * @private\n */\n this.localTransform = mat3.create();//mat3.identity();\n\n /**\n * [NYI] Unkown\n *\n * @property color\n * @type Array<>\n * @private\n */\n this.color = [];\n\n /**\n * [NYI] Holds whether or not this object is dynamic, for rendering optimization\n *\n * @property dynamic\n * @type Boolean\n * @private\n */\n this.dynamic = true;\n\n // chach that puppy!\n this._sr = 0;\n this._cr = 1;\n\n\n this.filterArea = new Rectangle(0,0,1,1);\n\n /*\n * MOUSE Callbacks\n */\n\n /**\n * A callback that is used when the users clicks on the displayObject with their mouse\n * @method click\n * @param interactionData {InteractionData}\n */\n\n /**\n * A callback that is used when the user clicks the mouse down over the sprite\n * @method mousedown\n * @param interactionData {InteractionData}\n */\n\n /**\n * A callback that is used when the user releases the mouse that was over the displayObject\n * for this callback to be fired the mouse must have been pressed down over the displayObject\n * @method mouseup\n * @param interactionData {InteractionData}\n */\n\n /**\n * A callback that is used when the user releases the mouse that was over the displayObject but is no longer over the displayObject\n * for this callback to be fired, The touch must have started over the displayObject\n * @method mouseupoutside\n * @param interactionData {InteractionData}\n */\n\n /**\n * A callback that is used when the users mouse rolls over the displayObject\n * @method mouseover\n * @param interactionData {InteractionData}\n */\n\n /**\n * A callback that is used when the users mouse leaves the displayObject\n * @method mouseout\n * @param interactionData {InteractionData}\n */\n\n\n /*\n * TOUCH Callbacks\n */\n\n /**\n * A callback that is used when the users taps on the sprite with their finger\n * basically a touch version of click\n * @method tap\n * @param interactionData {InteractionData}\n */\n\n /**\n * A callback that is used when the user touch's over the displayObject\n * @method touchstart\n * @param interactionData {InteractionData}\n */\n\n /**\n * A callback that is used when the user releases a touch over the displayObject\n * @method touchend\n * @param interactionData {InteractionData}\n */\n\n /**\n * A callback that is used when the user releases the touch that was over the displayObject\n * for this callback to be fired, The touch must have started over the sprite\n * @method touchendoutside\n * @param interactionData {InteractionData}\n */\n}", "function actualDisplay( name, doc ) {\r\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\r\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\r\n\telem.remove();\r\n\treturn display;\r\n}", "contentDidUpdate() {\n const html = this.getPaneHtml();\n this.props.onPreviewUpdate(html);\n if (this.previewWindow) {\n this.previewWindow.document.write(html);\n }\n }", "function displayCanvas() {\n\ttheCanvas.style.display = 'block';\n}", "function TreeViewItem_Show()\n{\n\t//need to update?\n\tif (this.Update)\n\t{\n\t\t//call update\n\t\tthis.UpdateLine();\n\t}\n\t//have we got html?\n\tif (this.HTML)\n\t{\n\t\t//show it\n\t\tthis.HTML.style.display = \"block\";\n\t\t//correct top\n\t\tthis.HTML.style.top = this.Top + \"px\";\n\t}\n}", "render() {\n this._userEvent('beforeRender');\n const html = this.template.render({data: this.viewData}, (data) => {\n return this.wrapTemplate(data);\n });\n if (!this.wrapper) {\n this.wrapper = this._createWrapper();\n }\n this.updateNode(this.wrapper, html);\n this.resize();\n this._userEvent('afterRender');\n }", "get domContent() {\n return this._domContent;\n }", "function RenderableDOMElement() {\n }", "render() {\n super.render();\n this._outputView = new OutputArea({\n rendermime: renderMime,\n contentFactory: OutputArea.defaultContentFactory,\n model: this.model.outputs\n });\n this.pWidget.insertWidget(0, this._outputView);\n\n this.pWidget.addClass('jupyter-widgets');\n this.pWidget.addClass('widget-output');\n this.update(); // Set defaults.\n }", "function displayHTML() {\n \tvar preview_div = document.getElementById(\"preview_div\");\n \tpreview_div.style.display = \"none\";\n \tvar htmlcode_div = document.getElementById(\"htmlcode_div\");\n \thtmlcode_div.style.display = \"block\";\n }", "function updateDisplay(elem){\n \n activeContent = elem.innerHTML.replace(/<.+?>/g,\"\");\n if(activeContent == \"profiles\"){\n activeContent = \"SearchSpan\"\n toggle_visibility(\"SearchSpan\", \"SEARCHdiv\");\n } else if (activeContent == \"barplot\"){\n toggle_visibility(\"barplot\", \"VISUALIZEdiv\")\n } \n }", "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tDM(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "function render() {\n\tcontainer.innerHTML = htmlStr;\n}", "function defaultDisplay(nodeName) {\n\n if (!elemdisplay[nodeName]) {\n\n var body = document.body,\n\t\t\telem = jQuery(\"<\" + nodeName + \">\").appendTo(body),\n\t\t\tdisplay = elem.css(\"display\");\n\n elem.remove();\n\n // If the simple way fails,\n // get element's real default display by attaching it to a temp iframe\n if (display === \"none\" || display === \"\") {\n // No iframe to use yet, so create it\n if (!iframe) {\n iframe = document.createElement(\"iframe\");\n iframe.frameBorder = iframe.width = iframe.height = 0;\n }\n\n body.appendChild(iframe);\n\n // Create a cacheable copy of the iframe document on first call.\n // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\n // document to it; WebKit & Firefox won't allow reusing the iframe document.\n if (!iframeDoc || !iframe.createElement) {\n iframeDoc = (iframe.contentWindow || iframe.contentDocument).document;\n iframeDoc.write((document.compatMode === \"CSS1Compat\" ? \"<!doctype html>\" : \"\") + \"<html><body>\");\n iframeDoc.close();\n }\n\n elem = iframeDoc.createElement(nodeName);\n\n iframeDoc.body.appendChild(elem);\n\n display = jQuery.css(elem, \"display\");\n\n body.removeChild(iframe);\n }\n\n // Store the correct default display\n elemdisplay[nodeName] = display;\n }\n\n return elemdisplay[nodeName];\n }" ]
[ "0.7111654", "0.6606583", "0.6553395", "0.62436736", "0.62331814", "0.62235034", "0.61459774", "0.6129759", "0.611871", "0.611871", "0.610078", "0.60716736", "0.60686475", "0.6026015", "0.60221195", "0.60136545", "0.60071284", "0.5978854", "0.58669174", "0.5864605", "0.57973814", "0.5770063", "0.5746952", "0.5745933", "0.57237124", "0.5713498", "0.56977147", "0.5693898", "0.5677795", "0.5668535", "0.56663907", "0.56626284", "0.56613165", "0.56555516", "0.5640174", "0.5637062", "0.56370175", "0.5632914", "0.5621141", "0.5620917", "0.5604121", "0.5600483", "0.55879474", "0.5576259", "0.55649716", "0.5537791", "0.5536425", "0.552756", "0.5513903", "0.55136186", "0.54989004", "0.54918116", "0.5481863", "0.5465949", "0.5456527", "0.54538447", "0.54481786", "0.5441136", "0.5432829", "0.54306066", "0.5426365", "0.54214543", "0.5419759", "0.54178363", "0.54020834", "0.54013306", "0.5400585", "0.53943694", "0.53919715", "0.5388352", "0.53873956", "0.5380519", "0.5380519", "0.5380519", "0.53771466", "0.5375754", "0.53705096", "0.53705096", "0.5364279", "0.5363214", "0.5362086", "0.53599274", "0.53587157", "0.5351135", "0.5351135", "0.5351135", "0.53447384", "0.5329329", "0.53252614", "0.532175", "0.53208554", "0.53145766", "0.5310847", "0.5303435", "0.5302407", "0.53009796", "0.5300424", "0.529724", "0.5296434", "0.5295548", "0.52946645" ]
0.0
-1
Find the line object corresponding to the given line number.
function getLine(doc, n) { n -= doc.first; if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") } var chunk = doc; while (!chunk.lines) { for (var i = 0;; ++i) { var child = chunk.children[i], sz = child.chunkSize(); if (n < sz) { chunk = child; break } n -= sz; } } return chunk.lines[n] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function code_line(code, line) {\n return code.findIndex(l => l.line === line)\n}", "function getSourceLine(lineNo) {\n\t\tif ((lineNo >= 1) && (lineNo <= sourceList.length)) {\n\t\t\treturn sourceList[lineNo - 1];\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "getLine(x, y) {\n var cell = this.getCell(x, y)\n if (cell == null) return null\n if (cell.type !== 'line') return null\n return cell.line\n }", "function findDA(source, lineNumber) {\n\tfor (var i=0; i < source.length; i++) {\n\t\tif (source[i].lineNumber === lineNumber) {\n\t\t\treturn source[i];\n\t\t}\n\t}\n\treturn null;\n}", "function getLineItem(primaryLineNumber) {\n\t\t\treturn mainLineItemCollection.getLineItem(primaryLineNumber);\n\n\t\t}", "line(n) {\n if (n < 1 || n > this.lines)\n throw new RangeError(`Invalid line number ${n} in ${this.lines}-line document`);\n return this.lineInner(n, true, 1, 0);\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "getLine(message, lineText) {\n const messageSplit = message.split('\\n');\n const line = messageSplit[messageSplit.findIndex(e => e.includes(lineText))];\n if (line) return line;\n throw new Error('Unable to find desired text within the message');\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\r\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\r\n { return cm.display.view[findViewIndex(cm, lineN)] }\r\n var ext = cm.display.externalMeasured;\r\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\r\n { return ext }\r\n}", "get lineNumber() {\n return this._lineNum;\n }", "function findViewForLine(cm, lineN) {\r\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\r\n return cm.display.view[findViewIndex(cm, lineN)];\r\n var ext = cm.display.externalMeasured;\r\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\r\n return ext;\r\n }", "function findViewForLine(cm, lineN) {\r\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\r\n { return cm.display.view[findViewIndex(cm, lineN)]; }\r\n var ext = cm.display.externalMeasured;\r\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\r\n { return ext; }\r\n }", "function findViewForLine(cm, lineN) {\n\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t return cm.display.view[findViewIndex(cm, lineN)];\n\t var ext = cm.display.externalMeasured;\n\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t return ext;\n\t }", "function findViewForLine(cm, lineN) {\n\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t return cm.display.view[findViewIndex(cm, lineN)];\n\t var ext = cm.display.externalMeasured;\n\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t return ext;\n\t }", "function findViewForLine(cm, lineN) {\n\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t return cm.display.view[findViewIndex(cm, lineN)];\n\t var ext = cm.display.externalMeasured;\n\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t return ext;\n\t }", "function getLine(doc, n) {\n\t\t n -= doc.first;\n\t\t if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n\t\t var chunk = doc;\n\t\t while (!chunk.lines) {\n\t\t for (var i = 0;; ++i) {\n\t\t var child = chunk.children[i], sz = child.chunkSize();\n\t\t if (n < sz) { chunk = child; break }\n\t\t n -= sz;\n\t\t }\n\t\t }\n\t\t return chunk.lines[n]\n\t\t }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN),\n vis = visualLine(line);\n\n if (line == vis) {\n return lineN;\n }\n\n return lineNo(vis);\n } // Get the line number of the start of the next visual line after", "function findViewForLine(cm, lineN) {\n\t\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t\t return cm.display.view[findViewIndex(cm, lineN)];\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t\t return ext;\n\t\t }", "function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}", "function findViewForLine(cm, lineN) {\n\t\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t\t { return cm.display.view[findViewIndex(cm, lineN)] }\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t\t { return ext }\n\t\t }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function getLine(doc, n) {\n\t\t n -= doc.first;\n\t\t if (n < 0 || n >= doc.size) throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\");\n\t\t for (var chunk = doc; !chunk.lines;) {\n\t\t for (var i = 0;; ++i) {\n\t\t var child = chunk.children[i], sz = child.chunkSize();\n\t\t if (n < sz) { chunk = child; break; }\n\t\t n -= sz;\n\t\t }\n\t\t }\n\t\t return chunk.lines[n];\n\t\t }", "getLine(x, y) {\r\n var cell = this.getCell(x, y)\r\n if (cell == undefined) return undefined\r\n if (cell.type !== 'line') return undefined\r\n return cell.color\r\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }" ]
[ "0.6920249", "0.64912915", "0.6366571", "0.6360952", "0.6341226", "0.6221371", "0.62164265", "0.62164265", "0.6216259", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.61878407", "0.61878407", "0.61878407", "0.61878407", "0.61878407", "0.61878407", "0.61878407", "0.61878407", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6175", "0.6150951", "0.61247075", "0.60987043", "0.6090158", "0.606346", "0.606346", "0.606346", "0.60539985", "0.60215336", "0.60063374", "0.5990472", "0.5989386", "0.59815437", "0.59815437", "0.59815437", "0.59815437", "0.59815437", "0.59815437", "0.59815437", "0.5979408", "0.5965741", "0.5963584", "0.5963584", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933", "0.59496933" ]
0.59749305
78
Get the part of a document between two positions, as an array of strings.
function getBetween(doc, start, end) { var out = [], n = start.line; doc.iter(start.line, end.line + 1, function (line) { var text = line.text; if (n == end.line) { text = text.slice(0, end.ch); } if (n == start.line) { text = text.slice(start.ch); } out.push(text); ++n; }); return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBetween(doc, start, end) {\n\t var out = [], n = start.line;\n\t doc.iter(start.line, end.line + 1, function(line) {\n\t var text = line.text;\n\t if (n == end.line) text = text.slice(0, end.ch);\n\t if (n == start.line) text = text.slice(start.ch);\n\t out.push(text);\n\t ++n;\n\t });\n\t return out;\n\t }", "function getBetween(doc, start, end) {\n\t var out = [], n = start.line;\n\t doc.iter(start.line, end.line + 1, function(line) {\n\t var text = line.text;\n\t if (n == end.line) text = text.slice(0, end.ch);\n\t if (n == start.line) text = text.slice(start.ch);\n\t out.push(text);\n\t ++n;\n\t });\n\t return out;\n\t }", "function getBetween(doc, start, end) {\n\t var out = [], n = start.line;\n\t doc.iter(start.line, end.line + 1, function(line) {\n\t var text = line.text;\n\t if (n == end.line) text = text.slice(0, end.ch);\n\t if (n == start.line) text = text.slice(start.ch);\n\t out.push(text);\n\t ++n;\n\t });\n\t return out;\n\t }", "function getBetween(doc, start, end) {\n var out = [], n = start.line\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text\n if (n == end.line) { text = text.slice(0, end.ch) }\n if (n == start.line) { text = text.slice(start.ch) }\n out.push(text)\n ++n\n })\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text\n if (n == end.line) { text = text.slice(0, end.ch) }\n if (n == start.line) { text = text.slice(start.ch) }\n out.push(text)\n ++n\n })\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n\t\t var out = [], n = start.line;\n\t\t doc.iter(start.line, end.line + 1, function (line) {\n\t\t var text = line.text;\n\t\t if (n == end.line) { text = text.slice(0, end.ch); }\n\t\t if (n == start.line) { text = text.slice(start.ch); }\n\t\t out.push(text);\n\t\t ++n;\n\t\t });\n\t\t return out\n\t\t }", "function getBetween(doc, start, end) {\r\n var out = [], n = start.line;\r\n doc.iter(start.line, end.line + 1, function(line) {\r\n var text = line.text;\r\n if (n == end.line) text = text.slice(0, end.ch);\r\n if (n == start.line) text = text.slice(start.ch);\r\n out.push(text);\r\n ++n;\r\n });\r\n return out;\r\n }", "function getBetween(doc, start, end) {\r\n var out = [], n = start.line;\r\n doc.iter(start.line, end.line + 1, function (line) {\r\n var text = line.text;\r\n if (n == end.line) { text = text.slice(0, end.ch); }\r\n if (n == start.line) { text = text.slice(start.ch); }\r\n out.push(text);\r\n ++n;\r\n });\r\n return out\r\n}", "function getBetween(doc, start, end) {\n\t\t var out = [], n = start.line;\n\t\t doc.iter(start.line, end.line + 1, function(line) {\n\t\t var text = line.text;\n\t\t if (n == end.line) text = text.slice(0, end.ch);\n\t\t if (n == start.line) text = text.slice(start.ch);\n\t\t out.push(text);\n\t\t ++n;\n\t\t });\n\t\t return out;\n\t\t }", "function findSameString(startPos, endPos) {\n var oentity = sourceDoc.substring(startPos, endPos);\n var strLen = endPos - startPos;\n\n var ary = new Array();\n var from = 0;\n while (true) {\n var sameStrPos = sourceDoc.indexOf(oentity, from);\n if (sameStrPos == -1) break;\n\n if (!isOutsideDelimiter(sourceDoc, sameStrPos, sameStrPos + strLen)) {\n var obj = new Object();\n obj['begin'] = sameStrPos;\n obj['end'] = sameStrPos + strLen;\n\n var isExist = false;\n for(var sid in spans) {\n if(spans[sid]['begin'] == obj['begin'] && spans[sid]['end'] == obj['end'] && spans[sid].category == obj.category) {\n isExist = true;\n break;\n }\n }\n\n if(!isExist && startPos != sameStrPos) {\n ary.push(obj);\n }\n }\n from = sameStrPos + 1;\n }\n return ary;\n }", "function getLine(doc, n) {\n n -= doc.first;\n\n if (n < 0 || n >= doc.size) {\n throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\");\n }\n\n var chunk = doc;\n\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i],\n sz = child.chunkSize();\n\n if (n < sz) {\n chunk = child;\n break;\n }\n\n n -= sz;\n }\n }\n\n return chunk.lines[n];\n } // Get the part of a document between two positions, as an array of", "function getLines(doc, from, to) {\n\t\t var out = [];\n\t\t doc.iter(from, to, function(line) { out.push(line.text); });\n\t\t return out;\n\t\t }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\r\n var out = [];\r\n doc.iter(from, to, function(line) { out.push(line.text); });\r\n return out;\r\n }", "function getBody(position, body) {\n const { start, end } = position;\n return body.substring(start.offset, end.offset);\n}", "function getLines(doc, from, to) {\n\t var out = [];\n\t doc.iter(from, to, function(line) { out.push(line.text); });\n\t return out;\n\t }", "function getLines(doc, from, to) {\n\t var out = [];\n\t doc.iter(from, to, function(line) { out.push(line.text); });\n\t return out;\n\t }", "function getLines(doc, from, to) {\n\t var out = [];\n\t doc.iter(from, to, function(line) { out.push(line.text); });\n\t return out;\n\t }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }", "function getLines(doc, from, to) {\r\n var out = [];\r\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\r\n return out\r\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n\t\t var out = [];\n\t\t doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n\t\t return out\n\t\t }", "function getLines(doc, from, to) {\n var out = []\n doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = []\n doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value\n return out\n}", "function orderedRange(range) {\r\n if ('anchor' in range)\r\n { range = [range.head, range.anchor]; }\r\n if (CodeMirror.cmpPos(range[0], range[1]) > 0)\r\n { return [range[1], range[0]]; }\r\n else\r\n { return [range[0], range[1]]; }\r\n }", "function getOffsetsAfterListCheck(docStr,offset1,offset2){\n var newOffset1 = offset1;\n var newOffset2 = offset2;\n var openListItems = new Array(\"<ol>\",\"<OL>\",\"<ul>\",\"<UL>\");\n var i, nItems = openListItems.length, closeListItem1, closeListItem2, currItem;\n var selStr = docStr.substring(offset1,offset2);\n \n for (i=0;i<nItems;i++){\n if (selStr.indexOf(openListItems[i]) == 0){\n currItem = openListItems[i];\n closeListItem1 = \"</\" + currItem.toLowerCase().substring(1);\n closeListItem2 = \"</\" + currItem.toUpperCase().substring(1);\n \n if ( selStr.indexOf(closeListItem1) == -1 && selStr.indexOf(closeListItem2) == -1){\n newOffset1 += currItem.length;\n }\n } \n }\n return new Array(newOffset1,newOffset2);\n}", "function getValue(doc, start, end) {\n var s = doc.indexOf(start);\n if (s < 0) return null;\n s = s + start.length;\n if (end !== null) {\n var e = doc.indexOf(end, s);\n if (e < 0) return null;\n return doc.substr(s, e - s);\n }\n return doc.substr(s);\n }", "function substringByStartAndEnd(input, start, end) {}", "function getToAndFrom(str, ind) {\r\n const m = str.match(/^Step (.) must be finished before step (.) can begin\\.$/);\r\n return [m[1], m[2]];\r\n}", "function extractNames(paragraph){\n var start = paragraph.indexOf(\"(mother \") + \"(mother \".length;\n var end = paragraph.indexOf(\")\");\n console.log(start, end);\n return paragraph.slice(start, end);\n \n}", "function getSelectionRanges(document, positions, doc) {\n function getSelectionRange(position) {\n var offset = document.offsetAt(position);\n var node = doc.getNodeFromOffset(offset, true);\n var result = [];\n while (node) {\n switch (node.type) {\n case 'string':\n case 'object':\n case 'array':\n // range without \", [ or {\n var cStart = node.offset + 1, cEnd = node.offset + node.length - 1;\n if (cStart < cEnd && offset >= cStart && offset <= cEnd) {\n result.push(newRange(cStart, cEnd));\n }\n result.push(newRange(node.offset, node.offset + node.length));\n break;\n case 'number':\n case 'boolean':\n case 'null':\n case 'property':\n result.push(newRange(node.offset, node.offset + node.length));\n break;\n }\n if (node.type === 'property' || node.parent && node.parent.type === 'array') {\n var afterCommaOffset = getOffsetAfterNextToken(node.offset + node.length, 5 /* CommaToken */);\n if (afterCommaOffset !== -1) {\n result.push(newRange(node.offset, afterCommaOffset));\n }\n }\n node = node.parent;\n }\n var current = undefined;\n for (var index = result.length - 1; index >= 0; index--) {\n current = vscode_languageserver_types__WEBPACK_IMPORTED_MODULE_0__[\"SelectionRange\"].create(result[index], current);\n }\n if (!current) {\n current = vscode_languageserver_types__WEBPACK_IMPORTED_MODULE_0__[\"SelectionRange\"].create(vscode_languageserver_types__WEBPACK_IMPORTED_MODULE_0__[\"Range\"].create(position, position));\n }\n return current;\n }\n function newRange(start, end) {\n return vscode_languageserver_types__WEBPACK_IMPORTED_MODULE_0__[\"Range\"].create(document.positionAt(start), document.positionAt(end));\n }\n var scanner = Object(jsonc_parser__WEBPACK_IMPORTED_MODULE_1__[\"createScanner\"])(document.getText(), true);\n function getOffsetAfterNextToken(offset, expectedToken) {\n scanner.setPosition(offset);\n var token = scanner.scan();\n if (token === expectedToken) {\n return scanner.getTokenOffset() + scanner.getTokenLength();\n }\n return -1;\n }\n return positions.map(getSelectionRange);\n}", "function between(string, start, end){\n var startAt = string.indexOf(start) + start.length;\n var endAt = string.indexOf(end, startAt);\n \n return string.slice(startAt, endAt);\n}", "function getValue(doc, start, end) {\n var s = doc.indexOf(start);\n if (s < 0) return null;\n\n s = s + start.length;\n\n if (end != null) {\n var e = doc.indexOf(end, s);\n if (e < 0) return null;\n\n return doc.substr(s, e - s);\n }\n\n return doc.substr(s);\n }", "static atStart(doc2) {\n return findSelectionIn(doc2, doc2, 0, 0, 1) || new AllSelection(doc2);\n }", "content() {\n return this.$from.doc.slice(this.from, this.to, true);\n }" ]
[ "0.7319094", "0.7319094", "0.7319094", "0.7309015", "0.7309015", "0.7307082", "0.7307082", "0.7307082", "0.7307082", "0.7307082", "0.7307082", "0.7307082", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.72767013", "0.7271897", "0.72688466", "0.72368896", "0.59274596", "0.59130013", "0.57686216", "0.57541645", "0.57541645", "0.57541645", "0.57541645", "0.57541645", "0.57541645", "0.57435167", "0.57171416", "0.5715687", "0.5715687", "0.5715687", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.56312245", "0.5612647", "0.5583784", "0.5583784", "0.5583784", "0.5583784", "0.5583784", "0.5583784", "0.5583784", "0.5583784", "0.5583784", "0.5583784", "0.5583784", "0.55620414", "0.5554531", "0.5554531", "0.55467445", "0.5524847", "0.5519659", "0.55166227", "0.5499387", "0.5496232", "0.54922205", "0.5480213", "0.5449512", "0.5432724", "0.54306257" ]
0.73343515
13
Get the lines between from and to, as array of strings.
function getLines(doc, from, to) { var out = []; doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\r\n var out = [];\r\n doc.iter(from, to, function(line) { out.push(line.text); });\r\n return out;\r\n }", "function getLines(doc, from, to) {\n\t var out = [];\n\t doc.iter(from, to, function(line) { out.push(line.text); });\n\t return out;\n\t }", "function getLines(doc, from, to) {\n\t var out = [];\n\t doc.iter(from, to, function(line) { out.push(line.text); });\n\t return out;\n\t }", "function getLines(doc, from, to) {\n\t var out = [];\n\t doc.iter(from, to, function(line) { out.push(line.text); });\n\t return out;\n\t }", "function getLines(doc, from, to) {\n\t\t var out = [];\n\t\t doc.iter(from, to, function(line) { out.push(line.text); });\n\t\t return out;\n\t\t }", "function getLines(doc, from, to) {\r\n var out = [];\r\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\r\n return out\r\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n\t\t var out = [];\n\t\t doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n\t\t return out\n\t\t }", "function getLines(doc, from, to) {\n var out = []\n doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to) {\n var out = []\n doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value\n return out\n}", "function getLines(doc, from, to, lineFilter) {\n var out = [];\n doc.iter(from, to, function(line) {\n var text = line.text;\n if(lineFilter){\n text = lineFilter(line);\n }\n out.push(text);\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n\t var out = [], n = start.line;\n\t doc.iter(start.line, end.line + 1, function(line) {\n\t var text = line.text;\n\t if (n == end.line) text = text.slice(0, end.ch);\n\t if (n == start.line) text = text.slice(start.ch);\n\t out.push(text);\n\t ++n;\n\t });\n\t return out;\n\t }", "function getBetween(doc, start, end) {\n\t var out = [], n = start.line;\n\t doc.iter(start.line, end.line + 1, function(line) {\n\t var text = line.text;\n\t if (n == end.line) text = text.slice(0, end.ch);\n\t if (n == start.line) text = text.slice(start.ch);\n\t out.push(text);\n\t ++n;\n\t });\n\t return out;\n\t }", "function getBetween(doc, start, end) {\n\t var out = [], n = start.line;\n\t doc.iter(start.line, end.line + 1, function(line) {\n\t var text = line.text;\n\t if (n == end.line) text = text.slice(0, end.ch);\n\t if (n == start.line) text = text.slice(start.ch);\n\t out.push(text);\n\t ++n;\n\t });\n\t return out;\n\t }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text\n if (n == end.line) { text = text.slice(0, end.ch) }\n if (n == start.line) { text = text.slice(start.ch) }\n out.push(text)\n ++n\n })\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text\n if (n == end.line) { text = text.slice(0, end.ch) }\n if (n == start.line) { text = text.slice(start.ch) }\n out.push(text)\n ++n\n })\n return out\n}", "function getBetween(doc, start, end) {\r\n var out = [], n = start.line;\r\n doc.iter(start.line, end.line + 1, function(line) {\r\n var text = line.text;\r\n if (n == end.line) text = text.slice(0, end.ch);\r\n if (n == start.line) text = text.slice(start.ch);\r\n out.push(text);\r\n ++n;\r\n });\r\n return out;\r\n }", "function getBetween(doc, start, end) {\n\t\t var out = [], n = start.line;\n\t\t doc.iter(start.line, end.line + 1, function (line) {\n\t\t var text = line.text;\n\t\t if (n == end.line) { text = text.slice(0, end.ch); }\n\t\t if (n == start.line) { text = text.slice(start.ch); }\n\t\t out.push(text);\n\t\t ++n;\n\t\t });\n\t\t return out\n\t\t }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n}", "function getBetween(doc, start, end) {\n\t\t var out = [], n = start.line;\n\t\t doc.iter(start.line, end.line + 1, function(line) {\n\t\t var text = line.text;\n\t\t if (n == end.line) text = text.slice(0, end.ch);\n\t\t if (n == start.line) text = text.slice(start.ch);\n\t\t out.push(text);\n\t\t ++n;\n\t\t });\n\t\t return out;\n\t\t }", "function getBetween(doc, start, end) {\r\n var out = [], n = start.line;\r\n doc.iter(start.line, end.line + 1, function (line) {\r\n var text = line.text;\r\n if (n == end.line) { text = text.slice(0, end.ch); }\r\n if (n == start.line) { text = text.slice(start.ch); }\r\n out.push(text);\r\n ++n;\r\n });\r\n return out\r\n}", "iterLines(from, to) {\n let inner;\n if (from == null) {\n inner = this.iter();\n }\n else {\n if (to == null)\n to = this.lines + 1;\n let start = this.line(from).from;\n inner = this.iterRange(start, Math.max(start, to == this.lines + 1 ? this.length : to <= 1 ? 0 : this.line(to - 1).to));\n }\n return new LineCursor(inner);\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }" ]
[ "0.78904086", "0.78904086", "0.78904086", "0.78904086", "0.78904086", "0.78904086", "0.78513694", "0.7843995", "0.7843995", "0.7843995", "0.7803603", "0.77783775", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.77651346", "0.77185714", "0.77185714", "0.7507505", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.66725796", "0.6653445", "0.6653445", "0.6653445", "0.6648661", "0.6648661", "0.6648661", "0.6648661", "0.6648661", "0.6648661", "0.6648661", "0.661851", "0.661851", "0.6595245", "0.65938985", "0.65801287", "0.65801287", "0.65801287", "0.65801287", "0.65801287", "0.65801287", "0.65801287", "0.65801287", "0.65801287", "0.65801287", "0.65801287", "0.6559701", "0.6552818", "0.6457985", "0.6061667", "0.6061667", "0.6061667", "0.6061667", "0.6061667", "0.6061667", "0.6061667", "0.6061667", "0.6059143", "0.6059143", "0.6059143", "0.6059143" ]
0.7850108
22
Update the height of a line, propagating the height change upwards to parent nodes.
function updateLineHeight(line, height) { var diff = height - line.height; if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t\t }", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t\t }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\r\n var diff = height - line.height;\r\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\r\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "function updateLineHeight(line, height) {\r\n var diff = height - line.height;\r\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\r\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\r\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\r\n var w = line.widgets[i], parent = w.node.parentNode;\r\n if (parent) { w.height = parent.offsetHeight; }\r\n } }\r\n}", "function updateWidgetHeight(line) {\n\t\t if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n\t\t var w = line.widgets[i], parent = w.node.parentNode;\n\t\t if (parent) { w.height = parent.offsetHeight; }\n\t\t } }\n\t\t }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }", "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\r\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\r\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\r\n }", "function updateWidgetHeight(line) {\n\t\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t\t }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "function lineHeight(){\n\t\thistoryLine.each(function(index, element){\n\t\t\tif(index == $('.line').length - 1){\n\t\t\t\treturn false;\n\t\t\t} else{\n\t\t\t\tvar thisBlock = $(this).closest('.history-item').height()/2;\n\t\t\t\tvar nextBlock = $(this).closest('.history-item').next().height()/2;\n\t\t\t\tvar h = thisBlock+nextBlock;\n\t\t\t\t$(this).height(h);\n\t\t\t}\n\t\t\t\n\t\t})\n\t}", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\t\t\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) break;\n\t\t else h += line.height;\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i = 0; i < p.children.length; ++i) {\n\t\t var cur = p.children[i];\n\t\t if (cur == chunk) break;\n\t\t else h += cur.height;\n\t\t }\n\t\t }\n\t\t return h;\n\t\t }", "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\r\n\r\n var h = 0, chunk = lineObj.parent;\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\r\n if (line == lineObj) break;\r\n else h += line.height;\r\n }\r\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i = 0; i < p.children.length; ++i) {\r\n var cur = p.children[i];\r\n if (cur == chunk) break;\r\n else h += cur.height;\r\n }\r\n }\r\n return h;\r\n }", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) { break }\n\t\t else { h += line.height; }\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t\t var cur = p.children[i$1];\n\t\t if (cur == chunk) { break }\n\t\t else { h += cur.height; }\n\t\t }\n\t\t }\n\t\t return h\n\t\t }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }" ]
[ "0.8322016", "0.830631", "0.8282418", "0.8282418", "0.8282418", "0.8282418", "0.8282418", "0.8282418", "0.8282418", "0.82768357", "0.82768357", "0.82768357", "0.8260964", "0.8210703", "0.8163414", "0.81575036", "0.81575036", "0.81119776", "0.81119776", "0.81119776", "0.81119776", "0.81119776", "0.81119776", "0.81119776", "0.81119776", "0.81119776", "0.81119776", "0.81119776", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.74375516", "0.7423423", "0.7423423", "0.7423423", "0.7423423", "0.7423423", "0.7423423", "0.7423423", "0.7423423", "0.73969525", "0.7390022", "0.7373789", "0.73639584", "0.73639584", "0.73639584", "0.73587394", "0.73587394", "0.7351786", "0.7351786", "0.7351786", "0.7351786", "0.7351786", "0.7351786", "0.7351786", "0.7344579", "0.7342016", "0.7337207", "0.7337207", "0.7337207", "0.6993215", "0.69376314", "0.68629587", "0.686121", "0.6850907", "0.6850907", "0.6850907", "0.6850907", "0.6850907", "0.6850907", "0.6850907" ]
0.82786244
25
Given a line object, find its line number by walking up through its parent links.
function lineNo(line) { if (line.parent == null) { return null } var cur = line.parent, no = indexOf(cur.lines, line); for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { for (var i = 0;; ++i) { if (chunk.children[i] == cur) { break } no += chunk.children[i].chunkSize(); } } return no + cur.first }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineNo(line) {\n\t\t if (line.parent == null) { return null }\n\t\t var cur = line.parent, no = indexOf(cur.lines, line);\n\t\t for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n\t\t for (var i = 0;; ++i) {\n\t\t if (chunk.children[i] == cur) { break }\n\t\t no += chunk.children[i].chunkSize();\n\t\t }\n\t\t }\n\t\t return no + cur.first\n\t\t }", "function lineNo(line) {\n\t\t if (line.parent == null) return null;\n\t\t var cur = line.parent, no = indexOf(cur.lines, line);\n\t\t for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n\t\t for (var i = 0;; ++i) {\n\t\t if (chunk.children[i] == cur) break;\n\t\t no += chunk.children[i].chunkSize();\n\t\t }\n\t\t }\n\t\t return no + cur.first;\n\t\t }", "function lineNo(line) {\r\n if (line.parent == null) return null;\r\n var cur = line.parent, no = indexOf(cur.lines, line);\r\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\r\n for (var i = 0;; ++i) {\r\n if (chunk.children[i] == cur) break;\r\n no += chunk.children[i].chunkSize();\r\n }\r\n }\r\n return no + cur.first;\r\n }", "function lineNo(line) {\n\t if (line.parent == null) return null;\n\t var cur = line.parent, no = indexOf(cur.lines, line);\n\t for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n\t for (var i = 0;; ++i) {\n\t if (chunk.children[i] == cur) break;\n\t no += chunk.children[i].chunkSize();\n\t }\n\t }\n\t return no + cur.first;\n\t }", "function lineNo(line) {\n\t if (line.parent == null) return null;\n\t var cur = line.parent, no = indexOf(cur.lines, line);\n\t for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n\t for (var i = 0;; ++i) {\n\t if (chunk.children[i] == cur) break;\n\t no += chunk.children[i].chunkSize();\n\t }\n\t }\n\t return no + cur.first;\n\t }", "function lineNo(line) {\n\t if (line.parent == null) return null;\n\t var cur = line.parent, no = indexOf(cur.lines, line);\n\t for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n\t for (var i = 0;; ++i) {\n\t if (chunk.children[i] == cur) break;\n\t no += chunk.children[i].chunkSize();\n\t }\n\t }\n\t return no + cur.first;\n\t }", "function lineNo(line) {\r\n if (line.parent == null) { return null }\r\n var cur = line.parent, no = indexOf(cur.lines, line);\r\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\r\n for (var i = 0;; ++i) {\r\n if (chunk.children[i] == cur) { break }\r\n no += chunk.children[i].chunkSize();\r\n }\r\n }\r\n return no + cur.first\r\n}", "function lineNo(line) {\n if (line.parent == null) return null;\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) break;\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first;\n }", "function lineNo(line) {\n if (line.parent == null) return null;\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) break;\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first;\n }", "function lineNo(line) {\n if (line.parent == null) return null;\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) break;\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first;\n }", "function lineNo(line) {\n if (line.parent == null) return null;\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) break;\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first;\n }", "function lineNo(line) {\n if (line.parent == null) return null;\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) break;\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first;\n }", "function lineNo(line) {\n if (line.parent == null) return null;\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) break;\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first;\n }", "function lineNo(line) {\n if (line.parent == null) return null;\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) break;\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first;\n }", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line)\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize()\n }\n }\n return no + cur.first\n}", "function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line)\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize()\n }\n }\n return no + cur.first\n}", "_getStartRefLineNumber(referenceNumber) {\n var refRef = PassageMarkdown.START_REF_PREFIX + referenceNumber;\n var ref = this.refs[refRef];\n\n if (!ref) {\n return null;\n }\n\n var $ref = $$1(ReactDOM$c.findDOMNode(ref)); // We really care about the first text after the ref, not the\n // ref element itself:\n\n var $refText = $ref.next();\n\n if ($refText.length === 0) {\n // But if there are no elements after the ref, just\n // use the ref itself.\n $refText = $ref;\n }\n\n var vPos = $refText.offset().top;\n return this.state.startLineNumbersAfter + 1 + this._convertPosToLineNumber(vPos);\n }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\t\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\r\n\r\n var h = 0, chunk = lineObj.parent;\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\r\n if (line == lineObj) break;\r\n else h += line.height;\r\n }\r\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i = 0; i < p.children.length; ++i) {\r\n var cur = p.children[i];\r\n if (cur == chunk) break;\r\n else h += cur.height;\r\n }\r\n }\r\n return h;\r\n }", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\t\t\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) break;\n\t\t else h += line.height;\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i = 0; i < p.children.length; ++i) {\n\t\t var cur = p.children[i];\n\t\t if (cur == chunk) break;\n\t\t else h += cur.height;\n\t\t }\n\t\t }\n\t\t return h;\n\t\t }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) { break }\n\t\t else { h += line.height; }\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t\t var cur = p.children[i$1];\n\t\t if (cur == chunk) { break }\n\t\t else { h += cur.height; }\n\t\t }\n\t\t }\n\t\t return h\n\t\t }", "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\r\n\r\n var h = 0, chunk = lineObj.parent;\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\r\n if (line == lineObj) { break }\r\n else { h += line.height; }\r\n }\r\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\r\n var cur = p.children[i$1];\r\n if (cur == chunk) { break }\r\n else { h += cur.height; }\r\n }\r\n }\r\n return h\r\n}", "getPrecedingValidLine(model, lineNumber, indentRulesSupport) {\r\n let languageID = model.getLanguageIdAtPosition(lineNumber, 0);\r\n if (lineNumber > 1) {\r\n let lastLineNumber;\r\n let resultLineNumber = -1;\r\n for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) {\r\n if (model.getLanguageIdAtPosition(lastLineNumber, 0) !== languageID) {\r\n return resultLineNumber;\r\n }\r\n let text = model.getLineContent(lastLineNumber);\r\n if (indentRulesSupport.shouldIgnore(text) || /^\\s+$/.test(text) || text === '') {\r\n resultLineNumber = lastLineNumber;\r\n continue;\r\n }\r\n return lastLineNumber;\r\n }\r\n }\r\n return -1;\r\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "function lineAtHeight(chunk, h) {\n\t\t var n = chunk.first;\n\t\t outer: do {\n\t\t for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n\t\t var child = chunk.children[i$1], ch = child.height;\n\t\t if (h < ch) { chunk = child; continue outer }\n\t\t h -= ch;\n\t\t n += child.chunkSize();\n\t\t }\n\t\t return n\n\t\t } while (!chunk.lines)\n\t\t var i = 0;\n\t\t for (; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i], lh = line.height;\n\t\t if (h < lh) { break }\n\t\t h -= lh;\n\t\t }\n\t\t return n + i\n\t\t }", "get lineNumber() {\n return this._lineNum;\n }", "function lineAtHeight(chunk, h) {\n\t\t var n = chunk.first;\n\t\t outer: do {\n\t\t for (var i = 0; i < chunk.children.length; ++i) {\n\t\t var child = chunk.children[i], ch = child.height;\n\t\t if (h < ch) { chunk = child; continue outer; }\n\t\t h -= ch;\n\t\t n += child.chunkSize();\n\t\t }\n\t\t return n;\n\t\t } while (!chunk.lines);\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i], lh = line.height;\n\t\t if (h < lh) break;\n\t\t h -= lh;\n\t\t }\n\t\t return n + i;\n\t\t }", "function lineAtHeight(chunk, h) {\n\t var n = chunk.first;\n\t outer: do {\n\t for (var i = 0; i < chunk.children.length; ++i) {\n\t var child = chunk.children[i], ch = child.height;\n\t if (h < ch) { chunk = child; continue outer; }\n\t h -= ch;\n\t n += child.chunkSize();\n\t }\n\t return n;\n\t } while (!chunk.lines);\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i], lh = line.height;\n\t if (h < lh) break;\n\t h -= lh;\n\t }\n\t return n + i;\n\t }", "function lineAtHeight(chunk, h) {\n\t var n = chunk.first;\n\t outer: do {\n\t for (var i = 0; i < chunk.children.length; ++i) {\n\t var child = chunk.children[i], ch = child.height;\n\t if (h < ch) { chunk = child; continue outer; }\n\t h -= ch;\n\t n += child.chunkSize();\n\t }\n\t return n;\n\t } while (!chunk.lines);\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i], lh = line.height;\n\t if (h < lh) break;\n\t h -= lh;\n\t }\n\t return n + i;\n\t }", "function lineAtHeight(chunk, h) {\n\t var n = chunk.first;\n\t outer: do {\n\t for (var i = 0; i < chunk.children.length; ++i) {\n\t var child = chunk.children[i], ch = child.height;\n\t if (h < ch) { chunk = child; continue outer; }\n\t h -= ch;\n\t n += child.chunkSize();\n\t }\n\t return n;\n\t } while (!chunk.lines);\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i], lh = line.height;\n\t if (h < lh) break;\n\t h -= lh;\n\t }\n\t return n + i;\n\t }", "function _lineAtHeight(chunk, h) {\n var n = chunk.first;\n\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1],\n ch = child.height;\n\n if (h < ch) {\n chunk = child;\n continue outer;\n }\n\n h -= ch;\n n += child.chunkSize();\n }\n\n return n;\n } while (!chunk.lines);\n\n var i = 0;\n\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i],\n lh = line.height;\n\n if (h < lh) {\n break;\n }\n\n h -= lh;\n }\n\n return n + i;\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }" ]
[ "0.76442444", "0.7633338", "0.760459", "0.75937176", "0.75937176", "0.75937176", "0.75879866", "0.75715834", "0.75715834", "0.75715834", "0.75715834", "0.75715834", "0.75715834", "0.75715834", "0.7512249", "0.7512249", "0.7512249", "0.7512249", "0.7512249", "0.7512249", "0.7512249", "0.7512249", "0.7512249", "0.7512249", "0.7512249", "0.7505289", "0.7505289", "0.6133257", "0.6118993", "0.61019176", "0.60937756", "0.6083303", "0.6083303", "0.6083303", "0.6083303", "0.6083303", "0.6083303", "0.6083303", "0.60718286", "0.60718286", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.6061608", "0.60483843", "0.60483843", "0.6033139", "0.60219336", "0.6001372", "0.5987521", "0.5987521", "0.5987521", "0.5987521", "0.5987521", "0.5987521", "0.5987521", "0.5987521", "0.5987521", "0.5987521", "0.5987521", "0.59467924", "0.5920573", "0.5904709", "0.58997875", "0.5895681", "0.5895681", "0.5895681", "0.5886846", "0.588002", "0.588002", "0.588002" ]
0.7587738
23
Find the line at the given vertical position, using the height information in the document tree.
function lineAtHeight(chunk, h) { var n = chunk.first; outer: do { for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { var child = chunk.children[i$1], ch = child.height; if (h < ch) { chunk = child; continue outer } h -= ch; n += child.chunkSize(); } return n } while (!chunk.lines) var i = 0; for (; i < chunk.lines.length; ++i) { var line = chunk.lines[i], lh = line.height; if (h < lh) { break } h -= lh; } return n + i }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "lineBlockAtHeight(height) {\n this.readMeasured();\n return this.viewState.lineBlockAtHeight(height);\n }", "function lineAtHeight(chunk, h) {\n\t var n = chunk.first;\n\t outer: do {\n\t for (var i = 0; i < chunk.children.length; ++i) {\n\t var child = chunk.children[i], ch = child.height;\n\t if (h < ch) { chunk = child; continue outer; }\n\t h -= ch;\n\t n += child.chunkSize();\n\t }\n\t return n;\n\t } while (!chunk.lines);\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i], lh = line.height;\n\t if (h < lh) break;\n\t h -= lh;\n\t }\n\t return n + i;\n\t }", "function lineAtHeight(chunk, h) {\n\t var n = chunk.first;\n\t outer: do {\n\t for (var i = 0; i < chunk.children.length; ++i) {\n\t var child = chunk.children[i], ch = child.height;\n\t if (h < ch) { chunk = child; continue outer; }\n\t h -= ch;\n\t n += child.chunkSize();\n\t }\n\t return n;\n\t } while (!chunk.lines);\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i], lh = line.height;\n\t if (h < lh) break;\n\t h -= lh;\n\t }\n\t return n + i;\n\t }", "function lineAtHeight(chunk, h) {\n\t var n = chunk.first;\n\t outer: do {\n\t for (var i = 0; i < chunk.children.length; ++i) {\n\t var child = chunk.children[i], ch = child.height;\n\t if (h < ch) { chunk = child; continue outer; }\n\t h -= ch;\n\t n += child.chunkSize();\n\t }\n\t return n;\n\t } while (!chunk.lines);\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i], lh = line.height;\n\t if (h < lh) break;\n\t h -= lh;\n\t }\n\t return n + i;\n\t }", "function lineAtHeight(chunk, h) {\n\t\t var n = chunk.first;\n\t\t outer: do {\n\t\t for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n\t\t var child = chunk.children[i$1], ch = child.height;\n\t\t if (h < ch) { chunk = child; continue outer }\n\t\t h -= ch;\n\t\t n += child.chunkSize();\n\t\t }\n\t\t return n\n\t\t } while (!chunk.lines)\n\t\t var i = 0;\n\t\t for (; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i], lh = line.height;\n\t\t if (h < lh) { break }\n\t\t h -= lh;\n\t\t }\n\t\t return n + i\n\t\t }", "function lineAtHeight(chunk, h) {\n\t\t var n = chunk.first;\n\t\t outer: do {\n\t\t for (var i = 0; i < chunk.children.length; ++i) {\n\t\t var child = chunk.children[i], ch = child.height;\n\t\t if (h < ch) { chunk = child; continue outer; }\n\t\t h -= ch;\n\t\t n += child.chunkSize();\n\t\t }\n\t\t return n;\n\t\t } while (!chunk.lines);\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i], lh = line.height;\n\t\t if (h < lh) break;\n\t\t h -= lh;\n\t\t }\n\t\t return n + i;\n\t\t }", "getYForLine(line) {\n const options = this.options;\n const spacing = options.spacing_between_lines_px;\n const headroom = options.space_above_staff_ln;\n\n const y = this.y + (line * spacing) + (headroom * spacing);\n\n return y;\n }", "vertLineAt (x) { return this._vert[this.vertIdxAt(x)] }", "function lineAtHeight(chunk, h) {\r\n var n = chunk.first;\r\n outer: do {\r\n for (var i = 0; i < chunk.children.length; ++i) {\r\n var child = chunk.children[i], ch = child.height;\r\n if (h < ch) { chunk = child; continue outer; }\r\n h -= ch;\r\n n += child.chunkSize();\r\n }\r\n return n;\r\n } while (!chunk.lines);\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i], lh = line.height;\r\n if (h < lh) break;\r\n h -= lh;\r\n }\r\n return n + i;\r\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i = 0; i < chunk.children.length; ++i) {\n var child = chunk.children[i], ch = child.height;\n if (h < ch) { chunk = child; continue outer; }\n h -= ch;\n n += child.chunkSize();\n }\n return n;\n } while (!chunk.lines);\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) break;\n h -= lh;\n }\n return n + i;\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i = 0; i < chunk.children.length; ++i) {\n var child = chunk.children[i], ch = child.height;\n if (h < ch) { chunk = child; continue outer; }\n h -= ch;\n n += child.chunkSize();\n }\n return n;\n } while (!chunk.lines);\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) break;\n h -= lh;\n }\n return n + i;\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i = 0; i < chunk.children.length; ++i) {\n var child = chunk.children[i], ch = child.height;\n if (h < ch) { chunk = child; continue outer; }\n h -= ch;\n n += child.chunkSize();\n }\n return n;\n } while (!chunk.lines);\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) break;\n h -= lh;\n }\n return n + i;\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i = 0; i < chunk.children.length; ++i) {\n var child = chunk.children[i], ch = child.height;\n if (h < ch) { chunk = child; continue outer; }\n h -= ch;\n n += child.chunkSize();\n }\n return n;\n } while (!chunk.lines);\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) break;\n h -= lh;\n }\n return n + i;\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i = 0; i < chunk.children.length; ++i) {\n var child = chunk.children[i], ch = child.height;\n if (h < ch) { chunk = child; continue outer; }\n h -= ch;\n n += child.chunkSize();\n }\n return n;\n } while (!chunk.lines);\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) break;\n h -= lh;\n }\n return n + i;\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i = 0; i < chunk.children.length; ++i) {\n var child = chunk.children[i], ch = child.height;\n if (h < ch) { chunk = child; continue outer; }\n h -= ch;\n n += child.chunkSize();\n }\n return n;\n } while (!chunk.lines);\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) break;\n h -= lh;\n }\n return n + i;\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i = 0; i < chunk.children.length; ++i) {\n var child = chunk.children[i], ch = child.height;\n if (h < ch) { chunk = child; continue outer; }\n h -= ch;\n n += child.chunkSize();\n }\n return n;\n } while (!chunk.lines);\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) break;\n h -= lh;\n }\n return n + i;\n }", "function lineAtHeight(chunk, h) {\r\n var n = chunk.first;\r\n outer: do {\r\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\r\n var child = chunk.children[i$1], ch = child.height;\r\n if (h < ch) { chunk = child; continue outer }\r\n h -= ch;\r\n n += child.chunkSize();\r\n }\r\n return n\r\n } while (!chunk.lines)\r\n var i = 0;\r\n for (; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i], lh = line.height;\r\n if (h < lh) { break }\r\n h -= lh;\r\n }\r\n return n + i\r\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n}", "function _lineAtHeight(chunk, h) {\n var n = chunk.first;\n\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1],\n ch = child.height;\n\n if (h < ch) {\n chunk = child;\n continue outer;\n }\n\n h -= ch;\n n += child.chunkSize();\n }\n\n return n;\n } while (!chunk.lines);\n\n var i = 0;\n\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i],\n lh = line.height;\n\n if (h < lh) {\n break;\n }\n\n h -= lh;\n }\n\n return n + i;\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height\n if (h < ch) { chunk = child; continue outer }\n h -= ch\n n += child.chunkSize()\n }\n return n\n } while (!chunk.lines)\n var i = 0\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height\n if (h < lh) { break }\n h -= lh\n }\n return n + i\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height\n if (h < ch) { chunk = child; continue outer }\n h -= ch\n n += child.chunkSize()\n }\n return n\n } while (!chunk.lines)\n var i = 0\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height\n if (h < lh) { break }\n h -= lh\n }\n return n + i\n}", "function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\t\t\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) break;\n\t\t else h += line.height;\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i = 0; i < p.children.length; ++i) {\n\t\t var cur = p.children[i];\n\t\t if (cur == chunk) break;\n\t\t else h += cur.height;\n\t\t }\n\t\t }\n\t\t return h;\n\t\t }", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) { break }\n\t\t else { h += line.height; }\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t\t var cur = p.children[i$1];\n\t\t if (cur == chunk) { break }\n\t\t else { h += cur.height; }\n\t\t }\n\t\t }\n\t\t return h\n\t\t }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\t\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\r\n\r\n var h = 0, chunk = lineObj.parent;\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\r\n if (line == lineObj) break;\r\n else h += line.height;\r\n }\r\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i = 0; i < p.children.length; ++i) {\r\n var cur = p.children[i];\r\n if (cur == chunk) break;\r\n else h += cur.height;\r\n }\r\n }\r\n return h;\r\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "getLine(x, y) {\n var cell = this.getCell(x, y)\n if (cell == null) return null\n if (cell.type !== 'line') return null\n return cell.line\n }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "vertLine (idx) { return this._vert[idx] }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\r\n\r\n var h = 0, chunk = lineObj.parent;\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\r\n if (line == lineObj) { break }\r\n else { h += line.height; }\r\n }\r\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\r\n var cur = p.children[i$1];\r\n if (cur == chunk) { break }\r\n else { h += cur.height; }\r\n }\r\n }\r\n return h\r\n}", "function wordLinePosition() {\n $('.line-container').each(function () {\n line = $(this).find('.vertical-line');\n word = $(this).find('h2');\n wordInner = word.html();\n wordFuture = '';\n tran = .1 * wordInner.length;\n for (i = 0; i < wordInner.length; i++) {\n wordFuture += '<span style=\"right:' + 100 + 'px; \">' + wordInner[i] + '</span>';\n }\n word.html(wordFuture);\n line.attr('data-height', ($(this).height() - word.width() - 15));\n });\n}", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t\t }", "lineAt(pos) {\n if (pos < 0 || pos > this.length)\n throw new RangeError(`Invalid position ${pos} in document of length ${this.length}`);\n return this.lineInner(pos, false, 1, 0);\n }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }" ]
[ "0.65733033", "0.64114404", "0.63363874", "0.63363874", "0.63363874", "0.63167506", "0.6293391", "0.62653893", "0.6253694", "0.6222418", "0.6202566", "0.6202566", "0.6202566", "0.6202566", "0.6202566", "0.6202566", "0.6202566", "0.61813724", "0.61696094", "0.61696094", "0.61696094", "0.61696094", "0.61696094", "0.61696094", "0.61696094", "0.61696094", "0.61696094", "0.61696094", "0.61696094", "0.61613566", "0.61310756", "0.61310756", "0.6120014", "0.60896236", "0.60422105", "0.6026916", "0.6026916", "0.60157615", "0.5988982", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.59881324", "0.5987036", "0.5987036", "0.5987036", "0.5987036", "0.5987036", "0.5987036", "0.5987036", "0.59866166", "0.59765464", "0.59765464", "0.5960052", "0.5952815", "0.5952815", "0.5952815", "0.5952815", "0.5952815", "0.5952815", "0.5952815", "0.5952815", "0.5952815", "0.5952815", "0.5952815", "0.5944682", "0.5912083", "0.58298045", "0.58115226", "0.58009607", "0.58009607" ]
0.62214965
25
A Pos instance represents a position within the text.
function Pos(line, ch, sticky) { if ( sticky === void 0 ) sticky = null; if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) } this.line = line; this.ch = ch; this.sticky = sticky; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Pos (line, ch) {\n if (!(this instanceof Pos)) { return new Pos(line, ch) }\n this.line = line; this.ch = ch\n}", "function Pos(x, y) {\n this.x = x; this.y = y;\n}", "function Pos(line, ch, sticky) {\n\t\t if ( sticky === void 0 ) sticky = null;\n\n\t\t if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n\t\t this.line = line;\n\t\t this.ch = ch;\n\t\t this.sticky = sticky;\n\t\t }", "function Pos(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line\n this.ch = ch\n this.sticky = sticky\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n}", "function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n}", "function Pos(x,y)\r\n{\r\n this.x = x;\r\n this.y = y;\r\n}", "function Pos(line, ch, sticky) {\r\n if ( sticky === void 0 ) sticky = null;\r\n\r\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\r\n this.line = line;\r\n this.ch = ch;\r\n this.sticky = sticky;\r\n}", "function Posn(x, y) {\n\tthis.x = x;\n \tthis.y = y;\n}", "function Pos(row, col){\n this.row = row;\n this.col = col;\n this.toString = function(){\n return row + '/' + col;\n }\n}", "function Position (x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "function position(val, norm_fn)\n{\n norm_fn = def(norm_fn, normalizePosition);\n\n var value = norm_fn(val);\n require(typeof value !== 'undefined',\n \"Cannot create Position instance from \" + repr(val));\n\n return new Position(value);\n}", "function position(val, norm_fn)\n{\n norm_fn = def(norm_fn, normalizePosition);\n\n var value = norm_fn(val);\n require(typeof value !== 'undefined',\n \"Cannot create Position instance from \" + repr(val));\n\n return new Position(value);\n}", "function Position (x, y) \n{\n\tthis.x = x;\n\tthis.y = y;\n}", "function Position() {\n this.x = 0;\n this.y = 0;\n}", "function Position(x, y)\n{\n\tthis.x = x;\n\tthis.y = y;\n}", "function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }", "function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }", "function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }", "function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }", "function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }", "function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }", "function Position(start) {\n this.start = start;\n this.end = {\n line: lineno,\n column\n };\n this.source = options.source;\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}", "function Pos(x, y, z) {\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n\r\n this.toString = function() {\r\n return this.x + ',' + this.y + (z ? ',' + z : '');\r\n };\r\n}", "function Position(x, y){\n this.x = x;\n this.y = y;\n}", "function Position(start) {\n this.start = start;\n this.end = now();\n }", "function Position(start) {\n this.start = start;\n this.end = now();\n }", "function Position(start) {\n this.start = start;\n this.end = now();\n }", "function Position(start) {\n this.start = start;\n this.end = now();\n }", "function Position(start) {\n this.start = start;\n this.end = now();\n }", "function Position(start) {\n\t this.start = start;\n\t this.end = { line: lineno, column: column };\n\t this.source = options.source;\n\t }", "function Position(start) {\n this.start = start\n this.end = {line: lineno, column: column}\n this.source = options.source\n }", "constructor(pos) {\n this.pos = pos;\n }", "function Position (x, y) {\n this.x = x;\n this.y = y;\n this.position = this;\n}", "function pos() {\r\n var p = _pfa(arguments);\r\n\r\n if (p) {\r\n self.moveTo(p.x, p.y);\r\n }\r\n\r\n return new Pos(ie ? self.screenLeft : self.screenX,\r\n ie ? self.screenTop : self.screenY);\r\n}", "function Position(start) {\n this.start = start\n this.end = now()\n }", "function pos(...args) {\n return {\n id: \"pos\",\n pos: vec2(...args),\n\n // TODO: check physics here?\n move(...args) {\n const p = vec2(...args);\n const dx = p.x * dt();\n const dy = p.y * dt();\n\n this.pos.x += dx;\n this.pos.y += dy;\n },\n\n screenPos() {\n // If you disable this, camera Matrix still works\n return game.camMatrix.multVec2(this.pos);\n },\n\n inspect() {\n return {\n pos: `(${~~this.pos.x}, ${~~this.pos.y})`,\n };\n },\n };\n }", "get pos()\n\t{\n\t\treturn new NodeGraph.Position(this.x, this.y);\n\t}", "function Position() {\n /**\n * @param {integer} x\n * @param {integer} y\n */\n var Position = function(x, y) {\n this.x = x;\n this.y = y;\n }\n\n /**\n * @param {Position} anotherPosition\n * @returns {boolean}\n */\n Position.prototype.equals = function (anotherPosition) {\n return anotherPosition.x == this.x && anotherPosition.y == this.y;\n }\n\n return Position;\n }", "coordsForChar(pos) {\n this.readMeasured();\n return this.docView.coordsForChar(pos);\n }", "function Position(line, column) {\n\tvar self = new Position.create();\n\tself.line = line;\n\tself.column = column;\n\treturn self;\n}", "function _pos() {\r\n var p = _pfa(arguments);\r\n if (p) {\r\n this.p = absPos(this, p);\r\n }\r\n return objCss(this, \"position\") == \"absolute\" ? this.p : absPos(this);\r\n}", "function Position(left, top) {\n this.left = left;\n this.top = top;\n}", "function Position(left, top) {\n this.left = left;\n this.top = top;\n}", "set pos(newPos) {\n this._pos = newPos;\n }", "function getPos() {\n\t\treturn _this.position;\n\t}", "positionAt(offset) {\n const before = this.textDocument.slice(0, offset);\n const newLines = before.match(/\\n/g);\n const line = newLines ? newLines.length : 0;\n const preCharacters = before.match(/(\\n|^).*$/g);\n return new tokenizer_1.Position(line, preCharacters ? preCharacters[0].length : 0);\n }", "constructor($pos) {\n let node = $pos.nodeAfter;\n let $end = $pos.node(0).resolve($pos.pos + node.nodeSize);\n super($pos, $end);\n this.node = node;\n }", "function Player(pos) {\n this.type = 'player';\n this.pos = pos.plus(new Vector(0.1, 0.1));\n this.size = new Vector(0.9, 0.9);\n this.speed = new Vector(0, 0);\n}", "function Line (position) {\n\tthis.position = position; \n}", "function position(token) {\n return {start: point(token.start), end: point(token.end)}\n }", "function PosWithInfo(line, ch, outside, xRel) {\n\t\t var pos = Pos(line, ch);\n\t\t pos.xRel = xRel;\n\t\t if (outside) pos.outside = true;\n\t\t return pos;\n\t\t }", "constructor(x_pos, y_pos) {\n this.x_pos = x_pos;\n this.y_pos = y_pos;\n }", "function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }", "addPosition(pos) {\n this.positions += '=\"'+pos.line + ':' + pos.linePosition + '\",';\n }", "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch);\n\t pos.xRel = xRel;\n\t if (outside) pos.outside = true;\n\t return pos;\n\t }", "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch);\n\t pos.xRel = xRel;\n\t if (outside) pos.outside = true;\n\t return pos;\n\t }", "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch);\n\t pos.xRel = xRel;\n\t if (outside) pos.outside = true;\n\t return pos;\n\t }", "constructor(pos, mark) {\n super();\n this.pos = pos;\n this.mark = mark;\n }", "constructor(pos, mark) {\n super();\n this.pos = pos;\n this.mark = mark;\n }", "function Coordinates(posX, posY){\n\tthis.posX = posX;\n\tthis.posY = posY;\n}", "pos() {\n if (this.is_vertex()) {\n return this.position;\n } else {\n return this.offset;\n }\n }", "createPosition () {\n\t\treturn {\n\t\t\tstart: {\n\t\t\t\tline: this.line,\n\t\t\t\tcolumn: this.col\n\t\t\t},\n\t\t\tsource: this.source,\n\t\t\trange: [ this.pos ]\n\t\t};\n\t}", "positionAt(offset) {\n return (0, utils_1.positionAt)(offset, this.getText(), this.getLineOffsets());\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }" ]
[ "0.7744325", "0.7327437", "0.73072433", "0.7230869", "0.71548593", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.7148194", "0.7127105", "0.7103211", "0.6844026", "0.6655517", "0.6566933", "0.6566933", "0.6507474", "0.64926934", "0.64920175", "0.646197", "0.646197", "0.646197", "0.646197", "0.646197", "0.646197", "0.6434232", "0.64169157", "0.64169157", "0.63986605", "0.6389229", "0.6337429", "0.6337429", "0.6337429", "0.6337429", "0.6337429", "0.6327465", "0.6300861", "0.627286", "0.6272165", "0.62218726", "0.6218545", "0.6210536", "0.6204215", "0.61790115", "0.60956097", "0.60814655", "0.60672486", "0.60595465", "0.60595465", "0.5964843", "0.58974004", "0.5859352", "0.58366567", "0.5799277", "0.57720196", "0.57702565", "0.57544386", "0.5753342", "0.5736101", "0.57259005", "0.5724562", "0.5724562", "0.5724562", "0.56812173", "0.56812173", "0.56705624", "0.5668737", "0.5667145", "0.5659565", "0.56446326", "0.56446326", "0.56446326", "0.56446326", "0.56446326", "0.56446326", "0.56446326", "0.56446326" ]
0.72398067
16
Compare two positions, return 0 if they are the same, a negative number when a is less, and a positive number otherwise.
function cmp(a, b) { return a.line - b.line || a.ch - b.ch }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function posCompare(a, b) {\n const yDiff = a[1] - b[1];\n if (yDiff !== 0) return yDiff;\n return a[0] - b[0];\n}", "function compare(a,b) {\n if (a.x < b.x)\n return -1;\n if (a.x > b.x)\n return 1;\n return 0;\n }", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare(a, b) {\n if (a < b) {\n return -1\n } else if (b < a) {\n return 1\n } else {\n return 0\n }\n}", "function compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}", "function compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}", "function compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}", "function compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}", "function compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}", "function _comparePosition(a,b){return a.compareDocumentPosition?a.compareDocumentPosition(b):a.contains?(a!=b&&a.contains(b)&&16)+(a!=b&&b.contains(a)&&8)+(0<=a.sourceIndex&&0<=b.sourceIndex?(a.sourceIndex<b.sourceIndex&&4)+(a.sourceIndex>b.sourceIndex&&2):1)+0:0}", "function compare(a, b) {\n\t return a < b ? -1 : a > b ? 1 : 0;\n\t}", "function compare(a, b) {\n\t return a < b ? -1 : a > b ? 1 : 0;\n\t}", "function compare(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n}", "function compare (a, b) {\n if (a > b) {\n return 1\n }\n else if (a < b) {\n return -1\n }\n return 0\n \n }", "function compare(a, b) {\n if (a>b) return 1;\n if (a<b) return -1;\n }", "function compare(a, b) {\n if (a.index < b.index)\n return -1;\n else (a.index > b.index)\n return 1;\n }", "function compare(a, b) {\n if (a.index < b.index)\n return -1;\n else (a.index > b.index)\n return 1;\n }", "function compare(a,b) {\n\t\t\t if (a.index < b.index)\n\t\t\t\treturn -1;\n\t\t\t if (a.index > b.index)\n\t\t\t\treturn 1;\n\t\t\t return 0;\n\t\t\t}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n }", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n }", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n var x = a.length;\n var y = b.length;\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n }", "function compare( a, b ) {\n\tif ( a === b )\n\t\treturn 0;\n\tif ( a < b )\n\t\treturn -1;\n\treturn 1;\n}", "function compare(a,b){\n var x = a.totalDiff;\n var y = b.totalDiff;\n if (x < y) {return -1;}\n if (x > y) {return 1;}\n return 0;\n }", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n\n if (y < x) {\n return 1;\n }\n\n return 0;\n }", "comparePoints (a, b) {\n let comparison = 0\n\n if (a.points > b.points) {\n comparison = -1\n } else if (b.points > a.points) {\n comparison = 1\n }\n return comparison\n }", "function compare(a, b){\n if(a.value < b.value)\n return -1;\n if(a.value > b.value)\n return 1;\n return 0;\n}", "function compare(a, b) {\n if (a < b) return -1;\n if (a > b) return 1;\n return 0;\n}", "compare(a, b) {\n if (a === b) return 0;\n return a < b ? -1 : 1;\n }", "function compare(a,b){if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i],y=b[i];break}return x<y?-1:y<x?1:0}", "function compare(a,b){if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i],y=b[i];break}return x<y?-1:y<x?1:0}", "function compare(a,b){if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i],y=b[i];break}return x<y?-1:y<x?1:0}", "function compare(a, b) {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n // a must be equal to b\n return 0;\n }", "function compare(a, b) {\n\t\t\tif (a.y === b.y) {\n\t\t\t return (a.x < b.x) ? -1 : 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t return (a.y < b.y) ? -1 : 1;\n\t\t\t}\n\t\t}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n\n if (y < x) {\n return 1;\n }\n\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n\n if (y < x) {\n return 1;\n }\n\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n\n if (y < x) {\n return 1;\n }\n\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n\n if (y < x) {\n return 1;\n }\n\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}", "function compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}" ]
[ "0.798942", "0.7316707", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7240236", "0.7222929", "0.7222929", "0.7222929", "0.7222929", "0.7222929", "0.7201643", "0.72000194", "0.72000194", "0.71760553", "0.7166889", "0.7158215", "0.71301687", "0.71301687", "0.7081427", "0.7079217", "0.7063667", "0.70578253", "0.7057233", "0.70417905", "0.7032547", "0.70222205", "0.7010204", "0.70079434", "0.6996345", "0.6992868", "0.6992868", "0.6992868", "0.69745326", "0.697156", "0.6964177", "0.6964177", "0.6964177", "0.6964177", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577", "0.69631577" ]
0.0
-1
Most of the external API clips given positions to make sure they actually exist within the document.
function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_pos(){\n\t//Write our checking of all positions\n\n\tif (blob_pos_x > c_canvas.width - 20){\n\tblob_pos_x = blob_pos_x - 4;\n\t}\n\tif (blob_pos_x < 0){\n\tblob_pos_x = blob_pos_x + 4;\n\t}\n\tif (blob_pos_y > c_canvas.height - 20){\n\tblob_pos_y = blob_pos_y - 4;\n\t}\n\tif (blob_pos_y < 0){\n\tblob_pos_y = blob_pos_y + 4;\n\t}\n\n\n\t}", "isValidPos(pos) {\n try {\n let x = pos[0];\n let y = pos[1];\n return ( (x > -1 && x < 8) && (y > -1 && y < 8) );\n } catch (error) {\n \n }\n }", "function updateRelativePositions() {\n\n\tminPoiDistance = Number.MAX_VALUE;\n\tmaxPoiDistance = 0;\n\n\tfor (i=0, l=pois.length; i<l; i++) {\n\n\t\tvar poi = pois[i];\n\t\t\n\t\tif (poi.view) {\n\n\t\t\tpoi.distance = location_utils.calculateDistance(deviceLocation, poi);\n\t\t\t\n\t\t\t// this would ideally be more of a databinding event\n\t\t\tif (poi.controller) {\n\t\t\t\tpoi.controller.setDistance(location_utils.neatUSfromMeters(poi.distance));\n\t\t\t}\n\t\t\t\n\t\t\tif (poi.distance <= maxRange) {\n\t\t\t\t\n\t\t\t\tmaxPoiDistance = Math.max(maxPoiDistance, poi.distance);\n\t\t\t\tminPoiDistance = Math.min(minPoiDistance, poi.distance);\n\t\t\t\t\n\t\t\t\tpoi.inRange = true;\n\n\t\t\t\tpoi.bearing = location_utils.calculateBearing(deviceLocation, poi);\t\t\t\t\n\t\t\t} \n\t\t\telse {\n\t\t\t\t// don't show pois that are beyond maxDistance\n\t\t\t\tpoi.inRange = false;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpoiDistanceRange = maxPoiDistance - minPoiDistance;\n\n\t// Sort by Distance\n\tpois.sort(function(a, b) {\n\t\treturn b.distance - a.distance;\n\t});\n\n\t\t\t\t\n\tradarRange = Math.max(100, pois[0].distance);\n\n\tvar cnt = pois.length;\n\trankHeight = yRange / cnt;\n\t\n\tfor (i=0; i<cnt; i++) {\n\t\tpois[i].view.zIndex = i;\n\t\tpois[i].distanceRank = i;\n\t\tpositionRadarBlip(pois[i]);\n\t}\n}", "function validatePosition()\n{\n this.p = collisionWithWallsInSector(this.p, this.prev_p, this.sector, DO_NOT_UPDATE_WALL_DIR);\n this.p = collisionWithSectorsInSector(this.p, this.prev_p, this.sector, DO_NOT_UPDATE_WALL_DIR);\n}", "validatePosition() {\n\n }", "static _checkRangesForContainment(rangeA, rangeB, collisionInfo, flipResultPositions)\n {\n if (flipResultPositions)\n {\n if (rangeA.max < rangeB.max || rangeA.min > rangeB.min) collisionInfo.shapeAContained = false;\t\t\t\t\n if (rangeB.max < rangeA.max || rangeB.min > rangeA.min) collisionInfo.shapeBContained = false;\t\n }\n else\n {\n if (rangeA.max > rangeB.max || rangeA.min < rangeB.min) collisionInfo.shapeAContained = false;\n if (rangeB.max > rangeA.max || rangeB.min < rangeA.min) collisionInfo.shapeBContained = false;\n }\n }", "fullPositionsUpdate(positions) {\n const openPositions = [];\n\n for (const positionItem of positions) {\n const position = positionItem.data;\n\n if (position.symbol in this.positions && !['buy', 'sell'].includes(position.side.toLowerCase())) {\n delete this.positions[position.symbol];\n continue;\n }\n\n openPositions.push(position);\n }\n\n const currentPositions = {};\n\n for (const position of Bybit.createPositionsWithOpenStateOnly(openPositions)) {\n currentPositions[position.symbol] = position;\n }\n\n this.logger.debug(`Bybit: Positions via API updated: ${Object.keys(currentPositions).length}`);\n this.positions = currentPositions;\n }", "function applyBoundaries(pos){\r\n\tif(pos.x < -planeWidth/2+5) pos.x = -planeWidth/2 + 5;\r\n\tif(pos.x > planeWidth/2-5) pos.x = planeWidth/2-5; \r\n\tif(pos.y > planeHeight/2-5) pos.y = planeHeight/2-5;\r\n\tif(pos.y < -planeHeight/2+5) pos.y = -planeHeight/2+5;\r\n}", "function checkColl(position){\n if(position.x>=500 && position.y>380)\n return true;\n var platforms = document.getElementById(\"platforms\");\n for (var i = 0; i < platforms.childNodes.length; i++) {\n var node = platforms.childNodes.item(i);\n if (node.nodeName != \"rect\" && node.nodeName != \"line\") continue;\n\n if(node.nodeName == \"rect\"){\n var x = parseFloat(node.getAttribute(\"x\"));\n var y = parseFloat(node.getAttribute(\"y\"));\n var w = parseFloat(node.getAttribute(\"width\"));\n var h = parseFloat(node.getAttribute(\"height\"));\n var pos = new Point(x, y);\n var size = new Size(w, h);\n if (intersect(position, PLAYER_SIZE, pos, size))\n return true;\n } \n else if(node.nodeName == \"line\"){\n var x1 = parseFloat(node.getAttribute(\"x1\"));\n var x2 = parseFloat(node.getAttribute(\"x2\"));\n var y1 = parseFloat(node.getAttribute(\"y1\"));\n var y = y1-10.0;\n var w = x2-x1;\n var h = 20.0;\n var pos = new Point(x1, y);\n var size = new Size(w, h);\n\n if (intersect(position, PLAYER_SIZE, pos, size)) {\n return true;\n }\n }\n }\n return false;\n}", "function checkPosition(id, x, y){\r\n let gameJson = reader.read(id).game;\r\n let gameMoves = gameJson.movements;\r\n if(x < 0 || x > 2 || y < 0 || y > 2)\r\n return WRONG_POS;\r\n for(let i = 0; i < gameMoves.length; i++){\r\n if(gameMoves[i].movement.x == x && gameMoves[i].movement.y == y)\r\n return WRONG_POS;\r\n }\r\n}", "function checkAllShipsPlaced() {\n for (var p = 0; p < this.game.PLAYERS; p++) {\n for (var s = 0; s < fleet[p].length; s++) {\n\n if (fleet[p][s].length != fleet[p][s].coords.length) return false;\n\n for (var c = 0; c < fleet[p][s].coords.length; c++) {\n coords = fleet[p][s].coords[c];\n \n if (typeof layout[p][coords] == 'undefined') {\n return false;\n };\n }\n\n }\n }\n return true;\n }", "function checkLoc(){\n for(var i = 0; i < food.length; i++){\n var distX = food[i].loc.x - snake.loc.x;\n var distY = food[i].loc.y - snake.loc.y;\n if(distX == (0) && distY == (0)){\n food.splice(i, 1);\n //removes the food\n //would add in a new food if that was the way I wanted it to be\n loadFood(0);\n snake.segments.push(createVector(0, 0));\n console.log(snake.segments.length)\n score++;\n }\n }\n}", "checkAvailable(x, y, newShip, posNewShip) {\n const currentShips = _.flatten(this.allShipsPosition(this.ships));\n\n // Check to see if any overlap ?\n const overlapPos = _.find(currentShips, (ship) => {\n return _.find(posNewShip, (pos) => {\n return pos.x === ship.x && pos.y === ship.y;\n });\n });\n\n if (overlapPos || !this.checkRange(x, y, newShip)) {\n return false;\n }\n\n return true;\n }", "isValidPosition(pos){\n return pos.x >=0 && pos.y >= 0 && pos.x < this.props.width && pos.y < this.props.height; \n }", "function observeBoundaries(oldPos, newPos) {\r\n return (\r\n newPos[0] >= 0 &&\r\n newPos[0] <= MAP_WIDTH - SPRITE_SIZE &&\r\n newPos[1] >= 0 &&\r\n newPos[1] <= MAP_HEIGHT - SPRITE_SIZE\r\n );\r\n }", "updatePositions(){\n this.api.get_positions(this.apiPositionListener)\n }", "function checkCoordinates (startCoordinate, direction, length) {\n let noOverlap = true\n for (let i = 0; i < length; i++) {\n let newCoordinate = [startCoordinate[0] + i * direction[0], startCoordinate[1] + i * direction[1]]\n this.reservedCoordinates.forEach(coordinate => {\n let reservedX = coordinate[0]\n let reservedY = coordinate[1]\n let newX = newCoordinate[0]\n let newY = newCoordinate[1]\n if (reservedX === newX && reservedY === newY) {\n noOverlap = false\n } \n })\n }\n return noOverlap\n}", "checkParticleBoundaries(){\n const particlesToRemove = [];\n Object.keys(this.particles).forEach( (id) => {\n const particle = this.particles[id];\n // if particle is out of bounds, add to particles to remove array\n if ( particle.posX > this.canvasWidth\n || particle.posX < 0\n || particle.posY > this.canvasHeight\n || particle.posY < 0\n ) {\n particlesToRemove.push(id);\n }\n });\n\n if (particlesToRemove.length > 0){\n\n particlesToRemove.forEach((id) => {\n // We're checking if the total particles exceed the max particles.\n // If the total particles exeeds max particles, we delete the particle\n // entry in the object. Otherwise, we just create a new particle\n // and insert it into the old particle's object id. This saves us\n // a little time above with generating a new UUID or running the delete command\n if (Object.keys(this.particles).length > this.maxParticles){\n delete this.particles[id];\n } else {\n this.particles[id] = this.makeRandomParticle();\n }\n });\n }\n }", "function createClipping(pos){\n // Plane Equation is a*X + b*Y +c*Z + d = 0\n let res = TETRAMESH.makeSlice(0, 1, 0, Number(pos));\n let triCoord = res[\"vertex\"];\n let trisetData = res[\"data\"];\n let sliderValues;\n if (triCoord.length !== 0) {\n x3domUtils.updateCoordPoint(get(\"triSetCoordinate\"), triCoord);\n x3domUtils.updateDataValue(get(\"triSetAttr\"), trisetData);\n sliderValues = utils.getSliderMinMax(\"isoColor\", DATA_REAL_MIN, DATA_REAL_MAX);\n get(\"triSetIsoColor\").setAttribute(\"min\", sliderValues.min);\n get(\"triSetIsoColor\").setAttribute(\"max\", sliderValues.max);\n }\n}", "isClear(positions) {\n const minX = min(positions.map(piece => piece.x));\n const maxX = max(positions.map(piece => piece.x));\n const minY = min(positions.map(piece => piece.y));\n const maxY = max(positions.map(piece => piece.y));\n\n if (minX < 0) { return false; }\n if (minY < 0) { return false; }\n if (maxX >= this.width) { return false; }\n if (maxY >= this.height) { return false; }\n\n return !some(positions, (position, a, b) => {\n if (this.getSquare(position.x, position.y)) { return true; }\n });\n }", "checkCollisions(position) {\n\n // AABB collision\n function checkCollision(obj1, obj2) {\n // TODO: remove these magic numbers\n // obj1 is the player and obj2 are the blocks\n let w1 = 32;\n let h1 = 40;\n let w2 = 32;\n let h2 = 32;\n let collideX = obj1.x < obj2.x + w2 && obj1.x + w1 > obj2.x;\n let collideY = obj1.y < obj2.y + h2 && obj1.y + h1 > obj2.y;\n return collideX && collideY;\n }\n\n // some fancy ES6 to get the objects that aren't the player\n let notPlayer = objects.filter(o => o.sprite !== \"player\");\n for(let o of notPlayer) {\n if(checkCollision(position, o.location)) {\n // if we collide return what we collided with\n return o;\n }\n }\n\n // otherwise return null\n return null;\n }", "function elementsOverlap(pos) {\n if (snake.x == pos.x && snake.y == pos.y)\n return true;\n if(food){\n if(food.x == pos.x && food.y == pos.y)\n return true;\n }\n if(barriers && barriers.length>0 && food){\n for(var i = 0; i < barriers.length; i++){\n for(var j = 0; j < barriers[i].positions.length; j++){\n if(barriers[i].positions[j].pos.x == pos.x && barriers[i].positions[j].pos.y == pos.y){\n return true;\n }\n if(barriers[i].positions[j].pos.x == food.x && barriers[i].positions[j].pos.y == food.y){\n return true;\n }\n }\n }\n }\n for (var i = 0; i < snake.tail.length; i++) {\n if (snake.tail[i].x == pos.x && snake.tail[i].y == pos.y)\n return true;\n }\n return false;\n}", "function areCoordinatesInBounds (body) {\n var coordsValid = isMarkerInSFRectangleBoundary(parseFloat(body['loc_lat']), parseFloat(body['loc_long']))\n if (coordsValid) {\n console.log('coord in SF: pass')\n return true\n } else {\n console.log('coord in SF: fail')\n return false\n }\n}", "function loadClippingURL(pos)\r\n\t{\r\n\tmarkRead(activeClippings[pos].id);\r\n\tn = open(activeClippings[pos].URL,\"win\"+activeClippings[pos].id);\r\n\t}", "function observeBoundaries(oldPos, newPos) {\n return (newPos[0] >= 0 && newPos[0] <= MAP_WIDTH - SPRITE_SIZE) &&\n (newPos[1] >= 0 && newPos[1] <= MAP_HEIGHT - SPRITE_SIZE)\n}", "function overlap(){ \n if(count === 0){\n console.log(\"Ok\");\n clearInterval(x);\n fall();\n }\n var fRect = floor.getBoundingClientRect();\n var cRect = cart.getBoundingClientRect();\n for(var i = 0; i < papers.length; i++){\n var p = document.querySelector(papers[i]);\n var pRect = p.getBoundingClientRect();\n var pcOffset = cRect.top - pRect.top;\n\tvar pcOffset2 = cRect.left - pRect.left;\n var pfOffset = pRect.top - fRect.top;\n if(pcOffset >= 0 && pcOffset <= 100){\n if(pcOffset2 >= -100 && pcOffset2 <= 100){\n p.style.display = \"none\";\n score += 1; \n count--;\n }\n }\n else if(pfOffset >= -200 && pfOffset <= -1){\n p.style.display = \"none\";\n count--;\n }\n }\n}", "function check_for_isolated_squares(squares_pos) {\r\n\t//console.log(squares_pos);\r\n\tlet isolated = false;\r\n\tfor(let i in squares_pos) {\r\n\t\tif(squares_pos[i].x == -1 || squares_pos[i].y == -1) {\r\n\t\t\tconsole.log(\"Isolated square: \" + i);\r\n\t\t\tisolated = true;\r\n\t\t}\r\n\t}\r\n\treturn isolated;\r\n}", "function legalmpos(x,y){\r\n\tif (x >= 0 && x <= 120 && y>=320) return false;\r\n var monsters = svgdoc.getElementById(\"monsters\");\r\n for (var i = 0; i < monsters.childNodes.length; i++) {\r\n\t\tpos1 = new Point(x,y);\r\n\t\tpos2 = new Point(monsters.childNodes[i].getAttribute(\"x\"), monsters.childNodes[i].getAttribute(\"y\"));\r\n\t\tif(intersect( pos1,OBJECT_DISTANCE,pos2,OBJECT_DISTANCE) )return false;\r\n\t}\r\n\treturn true;\r\n}", "function goodThingCollides(position) {\n var platforms = document.getElementById(\"platforms\");\n\n for (var i = 0; i < platforms.childNodes.length; ++i) {\n var node = platforms.childNodes.item(i);\n\n if (node.nodeName != \"rect\")\n continue;\n\n if (collides(node, position, GOOD_THING_SIZE))\n return true;\n }\n\n var goodThings = document.getElementById(\"goodthings\");\n\n for (var i = 0; i < goodThings.childNodes.length; ++i) {\n var goodThing = goodThings.childNodes.item(i);\n var x = parseInt(goodThing.getAttribute(\"x\"));\n var y = parseInt(goodThing.getAttribute(\"y\"));\n\n if (intersect(position, GOOD_THING_SIZE, new Point(x, y), GOOD_THING_SIZE))\n return true;\n }\n\n if (intersect(position, GOOD_THING_SIZE, player.position, PLAYER_SIZE))\n return true;\n\n if (intersect(position, GOOD_THING_SIZE, EXIT_POSITION, EXIT_SIZE))\n return true;\n\n if (intersect(position, GOOD_THING_SIZE, PORTAL1_POSITION, PORTAL1_SIZE))\n return true;\n\n if (intersect(position, GOOD_THING_SIZE, PORTAL2_POSITION, PORTAL2_SIZE))\n return true;\n\n return false;\n}", "function updatePositionsfinal() {\n var positions = line2.geometry.attributes.position.array;\n\n var x = 6; \n var y = 2.7; \n var z = -2.5;\n var index = 0;\n\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n\n positions[ index ++ ] = x;\n positions[ index ++ ] = y;\n positions[ index ++ ] = z;\n\n x += (9/MAX_POINTS);\n y += (2.6/MAX_POINTS);\n }\n}", "function updatePositionsincident() {\n var positions = line.geometry.attributes.position.array;\n\n var x = -16;\n var y = 0; \n var z = -2.5;\n var index = 0;\n\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n\n positions[ index ++ ] = x;\n positions[ index ++ ] = y;\n positions[ index ++ ] = z;\n\n x += (11.78/MAX_POINTS);\n y += (3/MAX_POINTS);\n }\n}", "fullPositionsUpdate(positions) {\n let openPositions = []\n\n for (const position of positions) {\n if (position['symbol'] in this.positions && !['buy', 'sell'].includes(position['side'].toLowerCase())) {\n delete this.positions[position.symbol]\n continue\n }\n\n openPositions.push(position)\n }\n\n let currentPositions = {}\n\n for(const position of Bybit.createPositionsWithOpenStateOnly(openPositions)) {\n currentPositions[position.symbol] = position\n }\n\n this.positions = currentPositions\n }", "checkObstruction(startCoordinates, endCoordinates) {\n if (startCoordinates.x != endCoordinates.x) //moves in x\n {\n if (startCoordinates.x < endCoordinates.x)\n return this.checkObstructionForward(startCoordinates, endCoordinates, 'x')\n else if (startCoordinates.x > endCoordinates.x)\n return this.checkObstructionBackwards(startCoordinates, endCoordinates, 'x')\n } else if (startCoordinates.y != endCoordinates.y) //moves in y\n {\n if (startCoordinates.y < endCoordinates.y)\n return this.checkObstructionForward(startCoordinates, endCoordinates, 'y')\n else if (startCoordinates.y > endCoordinates.y)\n return this.checkObstructionBackwards(startCoordinates, endCoordinates, 'y')\n }\n\n }", "checkForCollision(ps) {\n if( ps !== null ) { \n for(let i = 0; i < this.collisionSX.length; i++ ) {\n if( ps.position.x >= this.collisionSX[i] && ps.position.x <= this.collisionEX[i] ) {\n if( ps.position.y >= this.collisionSY[i] && ps.position.y <= this.collisionEY[i] ) {\n //print(\"collsion at shape \" + i);\n return true;\n }\n }\n }\n }\n\n return false; \n }", "function confineInContainer(position, width, height, api) {\n\t var viewWidth = api.getWidth();\n\t var viewHeight = api.getHeight();\n\t position[0] = Math.min(position[0] + width, viewWidth) - width;\n\t position[1] = Math.min(position[1] + height, viewHeight) - height;\n\t position[0] = Math.max(position[0], 0);\n\t position[1] = Math.max(position[1], 0);\n\t}", "function checkShipStatus(indShips, idAtPos, copyShips, ships) {\n\n for (var x = 0; x < indShips.length; x++) {\n\n //Looks for the ship position and removes it from indShips array\n if (indShips[x].includes(idAtPos)) {\n indShips[x].splice(indShips[x].indexOf(idAtPos), 1);\n\n //If after removing the ship returns an empty array, then return true\n if (indShips[x].length === 0) {\n copyShips.splice(copyShips.indexOf(ships[x]), 1);\n return [true, x, copyShips];\n }\n }\n }\n\n return [false, -1, copyShips];\n\n} //End checkShipStatus", "getAround(pos) {\n var around = [];\n var aroundNotFree = [];\n var positions = [\n {\n x: pos.x,\n y: pos.y + 1\n },\n {\n x: pos.x,\n y: pos.y - 1\n },\n {\n x: pos.x + 1,\n y: pos.y\n },\n {\n x: pos.x - 1,\n y: pos.y\n },\n ];\n\n for (var index in positions) {\n var position = positions[index];\n try {\n this._handleBound(position);\n if (this.isFree(position)) {\n around.push(position);\n }\n else {\n aroundNotFree.push(position);\n }\n } catch (e) {\n //do nothing in this case\n }\n }\n\n return {free: around, notFree: aroundNotFree};\n }", "function getNewPositionForFood(){\n // get all the xs and ys from snake body\n let xArr = yArr = [], xy;\n $.each(snake, function(index, value){\n if($.inArray(value.x, xArr) != -1){\n xArr.push(value.x);\n }\n if($.inArray(value.y, yArr) == -1) {\n yArr.push(value.y);\n }\n });\n xy = getEmptyXY(xArr, yArr);\n return xy;\n }", "isValid(position) {\n\t\treturn position.x >= 0 && position.x < this.width\n\t\t && position.y >= 0 && position.y < this.height;\n\t}", "function confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n }", "function confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n }", "function checkIfPosEmpty(targetPos: Vector3) { \n\tvar allObstacles: GameObject[] = GameObject.FindGameObjectsWithTag(\"Obstacle\"); \n\tfor each(var current in allObstacles) \n\t{ \n\t\tif(current.transform.position == targetPos){\n\t\t\t//Debug.Log(current.transform.position);\n\t\t\t// TODO: broadcast collide message\n\t\t\treturn false; \n\t\t}\n\t} \n\treturn true; \n}", "function confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n}", "checkCoordinates(obj) {\n for (let elem of game.coordinates) {\n if (obj.x === elem.x && obj.y === elem.y) {\n if (elem.occupied) {\n return true;\n } else {\n return false;\n }\n }\n }\n }", "function checkPosition() {\n // Für Ameise Schwarz\n for (let i = 0; i < Sem.ant.length; i++) {\n let a = Sem.ant[i];\n // Wenn Ameisen Position auf X - Achse zwischen 567 & 750 \n if (a.x >= 567 && a.x <= 750) {\n // Wenn Ameisen Position auf Y - Achse zwischen 245 & 429\n if (a.y >= 245 && a.y <= 429) {\n // Ruft Funktion für Game Over Screen auf\n gameLost();\n }\n }\n }\n // Für Ameise Braun\n for (let i = 0; i < Sem.antBrown.length; i++) {\n let b = Sem.antBrown[i];\n // Wenn Ameisen Position auf X - Achse zwischen 567 & 750\n if (b.x >= 567 && b.x <= 750) {\n // Wenn Ameisen Position auf Y - Achse zwischen 245 & 429\n if (b.y >= 245 && b.y <= 429) {\n // Ruft Funktion für Game Over Screen auf\n gameLost();\n }\n }\n }\n // Für Ameise Rot\n for (let i = 0; i < Sem.antRed.length; i++) {\n let r = Sem.antRed[i];\n // Wenn Ameisen Position auf X - Achse zwischen 567 & 750\n if (r.x >= 567 && r.x <= 750) {\n // Wenn Ameisen Position auf Y - Achse zwischen 245 & 429\n if (r.y >= 245 && r.y <= 429) {\n // Ruft Funktion für Game Over Screen auf\n gameLost();\n }\n }\n }\n }", "function optimizeAnchors(positions) {\n return positions.map((position, index) => {\n const others = [...positions.slice(0, index), ...positions.slice(index + 1)];\n const othersBearing = getBearingFromOtherPoints(position, others);\n return {\n lngLat: position.lngLat,\n anchor: getAnchor(position.axis, othersBearing),\n };\n });\n}", "function checkShipPlacement() {\n if (!displayGrid.querySelector('.ship')) allShipsPlaced = true;\n }", "function checkFoodCordinates(){\n if (snakeCordinates[0].xaxis==foodxaxis && snakeCordinates[0].yaxis==foodyaxis){\n var addingTail={\n \txaxis:snakeCordinates[0].xaxis+dx,\n \tyaxis:snakeCordinates[0].yaxis+dy\n }\n snakeCordinates.unshift(addingTail);\n food();\n score+=1;\n functionscore();\n\n }\n}", "static computeClippedPointIndices(clippedPoints, originalPoints) {\n const isClipped = (p) => originalPoints.find(q => q.equals(p)) === undefined;\n return new Set(clippedPoints.map((p, i) => (isClipped(p) ? i : -1)).filter(i => i !== -1));\n }", "function checkStandingFLC(pos) {\n let legX = bodyParts[PartEnums.TORSO].x - bodyParts[PartEnums.TORSO].width / 2.5;\n let legY = bodyParts[PartEnums.TORSO].y;\n return pos.x >= legX && pos.x <= (legX + 30) && pos.y >= legY && pos.y <= legY + 100;\n}", "function checkForGuideArea(dataArray, position) {\n let possibleGuideAreas = getClosest(dataArray,position);\n if (possibleGuideAreas.distance < 0.1) {\n addGuide(possibleGuideAreas.closest.text);\n } else {\n removeGuide();\n }\n}", "fullPositionsUpdate(positions) {\n const openPositions = [];\n\n for (const position of positions) {\n if (position.symbol in this.positions && position.isOpen !== true) {\n delete this.positions[position.symbol];\n } else {\n openPositions.push(position);\n }\n }\n\n const currentPositions = {};\n\n for (const position of Bitmex.createPositionsWithOpenStateOnly(openPositions)) {\n currentPositions[position.symbol] = position;\n }\n\n this.positions = currentPositions;\n }", "getEmptyPositionsWithSpaceWithWalls() {\n var emptyPositions = this.getEmptyPositions();\n var res = emptyPositions.filter(p => (((GameConfig.WIDTH - 3) >= p.x) && ((GameConfig.HEIGHT - 3) >= p.y)) && ((2 <= p.x) && (2 <= p.y)));\n return res;\n }", "get positionOptions() {\n if (!this.args.positions) {\n return [];\n }\n\n // Include INACTVE positions if the person has it so it can be unchecked\n let filteredPositions = this.args.positions.filter(position => {\n return position.active || this.args.positionIds.includes(position.id)\n });\n\n return filteredPositions.map((position) => {\n return [positionLabel([position]), position.id];\n });\n }", "checkCollide(pos1, pos2){\n if (Math.abs(pos1[0] - pos2[0]) < 50 &&\n pos1[1] === pos2[1]){\n\n return true;\n } else {\n return false;\n }\n }", "function checkPos(androidReq){\n console.log(\"CHECK\");\n\n if(pos != null) {\n var point = null;\n var dist = null;\n\n Tour.find({_id: \"58d26bd01c539c795303bb2f\"}, function (err, docs) {\n if(pos < docs[0].tour.length) {\n if (!err) {\n point = docs[0].tour[pos];\n if (point != null) {\n dist = getDistanceFromLatLonInKm(point.latitude, point.longitude, androidReq.latitude, androidReq.longitude) * 1000;\n }\n }\n console.log(\"Distance: \" + dist);\n if (dist < 5) {\n console.log(point.name);\n if(pos + 1 < docs[0].tour.length){\n pos++;\n point =docs[0].tour[pos];\n main.updateDronePos(\n {\n \"latitude\": point.latitude,\n \"longitude\": point.longitude\n }\n );\n }\n\n }\n current_pos = docs[0].tour[pos-1];\n }\n });\n }\n}", "function usePositions(props, hostElement, calloutElement, targetRef, getBounds) {\n var _a = react__WEBPACK_IMPORTED_MODULE_0__.useState(), positions = _a[0], setPositions = _a[1];\n var positionAttempts = react__WEBPACK_IMPORTED_MODULE_0__.useRef(0);\n var previousTarget = react__WEBPACK_IMPORTED_MODULE_0__.useRef();\n var async = (0,_fluentui_react_hooks__WEBPACK_IMPORTED_MODULE_6__.useAsync)();\n var hidden = props.hidden, target = props.target, finalHeight = props.finalHeight, onPositioned = props.onPositioned, directionalHint = props.directionalHint;\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () {\n if (!hidden) {\n var timerId_1 = async.requestAnimationFrame(function () {\n // If we expect a target element to position against, we need to wait until `targetRef.current`\n // is resolved. Otherwise we can try to position.\n var expectsTarget = !!target;\n if (hostElement.current && calloutElement.current && (!expectsTarget || targetRef.current)) {\n var currentProps = (0,tslib__WEBPACK_IMPORTED_MODULE_7__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_7__.__assign)({}, props), { target: targetRef.current, bounds: getBounds() });\n var previousPositions = previousTarget.current === target ? positions : undefined;\n // If there is a finalHeight given then we assume that the user knows and will handle\n // additional positioning adjustments so we should call positionCard\n var newPositions = finalHeight\n ? (0,_Positioning__WEBPACK_IMPORTED_MODULE_5__.positionCard)(currentProps, hostElement.current, calloutElement.current, previousPositions)\n : (0,_Positioning__WEBPACK_IMPORTED_MODULE_5__.positionCallout)(currentProps, hostElement.current, calloutElement.current, previousPositions);\n // Set the new position only when the positions are not exists or one of the new callout positions\n // are different. The position should not change if the position is within 2 decimal places.\n if ((!positions && newPositions) ||\n (positions && newPositions && !arePositionsEqual(positions, newPositions) && positionAttempts.current < 5)) {\n // We should not reposition the callout more than a few times, if it is then the content is likely resizing\n // and we should stop trying to reposition to prevent a stack overflow.\n positionAttempts.current++;\n setPositions(newPositions);\n }\n else if (positionAttempts.current > 0) {\n // Only call the onPositioned callback if the callout has been re-positioned at least once.\n positionAttempts.current = 0;\n onPositioned === null || onPositioned === void 0 ? void 0 : onPositioned(positions);\n }\n }\n }, calloutElement.current);\n previousTarget.current = target;\n return function () {\n async.cancelAnimationFrame(timerId_1);\n previousTarget.current = undefined;\n };\n }\n }, [\n hidden,\n directionalHint,\n async,\n calloutElement,\n hostElement,\n targetRef,\n finalHeight,\n getBounds,\n onPositioned,\n positions,\n props,\n target,\n ]);\n return positions;\n}", "closestPointTo(position, closest, exclude) {\n if (this.visible && this.objects !== undefined) {\n for (let i = 0; i < this.objects.length; i++) {\n this.objects[i].closestPointTo(position, closest, exclude);\n }\n }\n }", "function validate_click(posClicked) {\r\n for(var i = 0;i<$scope.movidasPosibles.length;i++){\r\n var pos = JSON.parse(\"[\" + posClicked + \"]\");\r\n if($scope.movidasPosibles[i][0]===pos[0] && $scope.movidasPosibles[i][1] ===pos[1]){\r\n $scope.http_request.body.x = pos[0];//guarda las posiciones clickeadas\r\n $scope.http_request.body.y = pos[1];//al final se va mantener siempre una posicion guardada\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "function addClipping()\r\n\t{\r\n\tnewClipping = this.id.substring(3,this.id.length)\r\n\tduplicate = false;\r\n\tfor (i=0; i < allClippings.length; i++) //find the position the allClippings array of the selected clipping\r\n\t\t{\r\n\t\tif (newClipping == allClippings[i].id) {pos = i; i = allClippings.length}\r\n\t\t}\r\n\t\t\r\n\tif (activeClippings.length > 0)\tcheckForDuplicates() //make sure clipping is not already seletected\r\n\t\r\n\tif (!duplicate)\r\n\t{\t\r\n\t\teventCheckForCookies();\r\n\t\tif (cookiesOn == true)\r\n\t\t\t{\r\n\t\t\tactiveClippings[activeClippings.length] = new Clipping(allClippings[pos].id,allClippings[pos].headline,allClippings[pos].URL);\r\n\t\t\t\r\n\t\t\t//find all instances of the clipping in article and hides it\r\n\t \t\tclippingInstanceVisibility(this.id,'hidden') \r\n\t \t\t\r\n\t \t\tdrawClippings();\t\r\n\t \t\tevent.cancleBubble = true;\r\n\t \t\tupdateClippingCounter();\r\n\t\t\tsaveClippings();\r\n\t\t \t}\r\n\t \t}\r\n\t}", "moveTo(pos) {\n let { cursor } = this, p = pos - this.offset;\n while (!this.done && cursor.from < p) {\n if (cursor.to >= pos && cursor.enter(p, 1, exports.IterMode.IgnoreOverlays | exports.IterMode.ExcludeBuffers)) ;\n else if (!cursor.next(false))\n this.done = true;\n }\n }", "function checkPosition() {\n const offset = reposition(prevFocused);\n if (offset.top !== prevOffset.top || offset.left !== prevOffset.left || offset.width !== prevOffset.width || offset.height !== prevOffset.height) {\n // console.log(\"Changed focus position\", offset, prevFocused);\n prevOffset = offset;\n staticCounter = 0;\n } else {\n staticCounter++;\n }\n if (staticCounter < 3) {\n // at the beginning and as long as we see position changes\n // we will check the position/bounds more often\n positionTimeout = setTimeout(checkPosition, 100);\n } else {\n // we want to measure at least every 2 seconds\n positionTimeout = setTimeout(checkPosition, 1000);\n }\n }", "function checkLaps(laps, lapCount) {\n\n for (var j = 0;\n j < laps.length;\n j++) {\n\n // Has name?\n var name = laps[j].name;\n // if (name == undefined || name.length == 0) {\n\n // alert(\"Warning: invalid name for element \" + j);\n // }\n\n // Has placings?\n var places = laps[j].placing;\n // if (places == undefined) {\n\n // alert(\"Warning: missing placings for element \" + j + \" (\" + name + \")\");\n // }\n // else if (places.length == 0 || places.length > lapCount + 1) {\n\n // alert(\"Warning: invalid number of placings (\" + places.length + \") for element \" + j +\n // \" (\" + name + \") - expected between 1 and \" + (lapCount - 1));\n // }\n\n // Check markers.\n var maxLaps = places.length;\n //checkMarker(laps[j].pitstops, \"pitstop\", maxLaps, j, name);\n //checkMarker(laps[j].mechanical, \"mechanical\", maxLaps, j, name);\n checkMarker(laps[j].accident, \"accident\", maxLaps, j, name);\n }\n\n for (var i = 0;\n i < lapCount;\n i++) {\n\n var positions = [];\n for (j = 0;\n j < laps.length;\n j++) {\n\n places = laps[j].placing;\n if (places.length > i) {\n\n // Valid placing?\n var placing = places[i];\n // if (isNaN(placing) || placing < 1 || placing % 1 != 0) {\n\n // alert(\"Warning: invalid placing '\" + placing + \"' for \" + laps[j].name)\n // }\n // else {\n\n // var count = positions[placing];\n // positions[placing] = isNaN(count) ? 1 : count + 1\n // }\n }\n }\n\n // Check for duplicate/missing positions.\n for (j = 1;\n j < positions.length;\n j++) {\n\n count = positions[j];\n if (count != 1) {\n\n alert(\"Warning: data inconsistent: lap \" + i + \", position \" + j + \", count \" + count);\n }\n }\n }\n}", "ifInBound(currentPos, coordinates1, coordinates2){\n \n //check for inverted squares\n if(coordinates1.latitude < coordinates2.latitude){\n //swap\n var temp = coordinates1\n coordinates1 = coordinates2\n coordinates2 = temp\n }\n else{\n\n }\n console.log(\"====ALL MY COORDINATES ==== \")\n console.log(currentPos)\n console.log(coordinates1)\n console.log(coordinates2)\n\n if((currentPos.coords.latitude <= coordinates1.latitude) && (currentPos.coords.latitude >= coordinates2.latitude)){\n console.log(\"latitude inbound\")\n if((currentPos.coords.longitude >= coordinates1.longitude) && (currentPos.coords.longitude <= coordinates2.longitude)){\n console.log(\"longitude inbound\")\n return true\n }\n }\n return false\n\n }", "function markOccupiedSpots() {\n \n\t\tif(!spotsInitialized || playersInitialized < 2) {\n \n\t\t\treturn null;\n \n } // end if statement\n\t\n\t\tfor(var i = 0; i<10; i++) {\n \n\t\t\tfindClosestSpot(myMarbles[i].x, myMarbles[i].y).isEmpty = false;\n\t\t\tfindClosestSpot(othersMarbles[i].x, othersMarbles[i].y).isEmpty = false;\n \n\t\t} // end for loop\n \n\t} // end markOccupiedSpots()", "checkPosition(){\r\n if(isCriticalPosition(this.pos)){\r\n //if((this.pos.x-8)%16 == 0 && (this.pos.y-8)%16 == 0){//checks if pacman is on a critical spot\r\n //let arrPosition = createVector((this.pos.x-8)/16, (this.pos.y-8)/16);//changes location to an array position\r\n let arrPosition = pixelToTile(this.pos);\r\n //resets all paths for the ghosts\r\n //this.blinky.setPath();\r\n //this.pinky.setPath();\r\n //this.clyde.setPath();\r\n //this.inky.setPath();\r\n //Checks if the position has been eaten or not, blank spaces are considered eaten\r\n if(!this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].eaten){\r\n this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].eaten = true;\r\n //score+=10;//adds points for eating\r\n this.score+=1;\r\n this.dotsEaten++;\r\n this.ttl = 600;\r\n if(this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].bigDot){//checks if the big dot is eaten\r\n //set all ghosts to frightened mode\r\n if(!this.blinky.goHome && !this.blinky.tempDead){\r\n this.blinky.frightened = true;\r\n this.blinky.flashCount = 0;\r\n }if(!this.clyde.goHome && !this.clyde.tempDead){\r\n this.clyde.frightened = true;\r\n this.clyde.flashCount = 0;\r\n }if(!this.pinky.goHome && !this.pinky.tempDead){\r\n this.pinky.frightened = true;\r\n this.pinky.flashCount = 0;\r\n }if(!this.inky.goHome && !this.inky.tempDead){\r\n this.inky.frightened = true;\r\n this.inky.flashCount = 0;\r\n }\r\n }\r\n }\r\n //the position in the tiles array that pacman is turning towards\r\n let positionToCheck = new createVector(arrPosition.x + this.goTo.x, arrPosition.y + this.goTo.y);\r\n //console.log(\"Position to Check X: \", positionToCheck.x, \" Y: \", positionToCheck.y);\r\n if(this.tiles[floor(positionToCheck.y)][floor(positionToCheck.x)].tunnel){//checks if the next position will be in the tunnel\r\n this.specialCase(this.pos);\r\n }if(this.tiles[floor(positionToCheck.y)][floor(positionToCheck.x)].wall){//checks if the space is not a wall\r\n if(tiles[floor(arrPosition.y + vel.y)][floor(arrPosition.x + vel.x)].wall){\r\n this.vel = createVector(this.goTo.x, this.goTo.y);//Not sure about this line...\r\n return false;\r\n }else{//moving ahead is free\r\n return true;\r\n }//return !(this.tiles[floor(arrPosition.y + this.vel.y)][floor(arrPosition.x + this.vel.x)].wall);//if both are walls then don't move\r\n }else{//allows pacman to turn\r\n this.vel = createVector(this.goTo.x, this.goTo.y);\r\n return true;\r\n }\r\n }else{//if pacman is not on a critial spot\r\n let ahead = createVector(this.pos.x+10*this.vel.x, this.pos.y+10*this.vel.y);\r\n //if((this.pos.x+10*this.vel.x-8)%16 == 0 && (this.pos.y+10*this.vel.y-8)%16 == 0){\r\n if(isCriticalPosition(ahead)){\r\n //let arrPosition = createVector((this.pos.x+10*this.vel.y-8)/16, (this.pos.y+10*this.vel.y)/16);\r\n let arrPostion = pixelToTile(ahead);//convert to an array position\r\n if(!this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].eaten){\r\n this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].eaten = true;//eat the dot\r\n this.score+=1;//10\r\n this.dotsEaten++;\r\n ttl = 600;\r\n if(this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].bigDot && bigDotsActive){\r\n //this.score+=40;//could be used to give a better reward for getting the big dots\r\n //sets all ghosts to frightened mode\r\n if(!this.blinky.goHome && !this.blinky.tempDead){\r\n this.blinky.frightened = true;\r\n this.blinky.flashCount = 0;\r\n }if(!this.clyde.goHome && !this.clyde.tempDead){\r\n this.clyde.frightened = true;\r\n this.clyde.flashCount = 0;\r\n }if(!this.pinky.goHome && !this.pinky.tempDead){\r\n this.pinky.frightened = true;\r\n this.pinky.flashCount = 0;\r\n }if(!this.inky.goHome && !this.inky.tempDead){\r\n this.inky.frightened = true;\r\n this.inky.flashCount = 0;\r\n }\r\n }\r\n } \r\n }if(this.goTo.x+this.vel.x == 0 && this.vel.y+this.goTo.y == 0){//if turning change directions entirely, 180 degrees\r\n this.vel = createVector(this.goTo.x, this.goTo.y);//turn\r\n return true;\r\n }return true;//if it is not a critical position then it will continue forward\r\n }\r\n }", "function checkHasPositionalTracking () {\n\t var vrDisplay = controls.getVRDisplay();\n\t if (isMobile() || isGearVR()) { return false; }\n\t return vrDisplay && vrDisplay.capabilities.hasPosition;\n\t}", "function observeBoundaries(oldPos, newPos) {\n return (newPos[0] >= 0 && newPos[0] <= mapWidth - spriteSize) &&\n (newPos[1] >= 0 && newPos[1] <= mapHeight - spriteSize)\n }", "function isClippedInViewport(domElement) {\n var rect = domElement.getBoundingClientRect();\n return rect.top < 0 || rect.bottom > document.documentElement.clientHeight || rect.left < 0 || rect.right > document.documentElement.clientWidth;\n } // don't need to check for \"both items null/empty\", and don't need to null-check item, since item required to be length-1 JQ object", "_checkCollision() {\n\n for (let ship of this.ships) {\n let pos = ship.getPosition();\n if (pos.y >= this.canvas.height) {\n // Killed ships are not moved, they stay at their location, but are invisible.\n // I don't want to kill the player with one invisible ship :)\n if (!ship.dead) {\n ship.kill();\n this.score.damage();\n this.base.removeShield();\n }\n }\n }\n }", "function updatePositionsRandincident() {\n var positions = new Array(4);\n\n for(var i =0 ;i<4 ; i++) {\n positions[i] = new Array(MAX_POINTS * 3);\n positions[i] = randAllLines[i].geometry.attributes.position.array;\n }\n\n var x = [-16,-16,-16,-16]; \n var y = [-0.5,-0.3,0.3,0.5]; \n var y2 = [1,0.5,1.5,2];\n var z = -2.5;\n var index = 0;\n\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n for(var j=0;j<4;j++){\n positions[j][ index ++ ] = x[j];\n positions[j][ index ++ ] = y[j];\n positions[j][ index ++ ] = z;\n\n x[j] += ((4.5)/MAX_POINTS);\n if(j==0 || j==1){\n y[j] -= ((y2[j])/MAX_POINTS);\n } else {\n y[j] += ((y2[j])/MAX_POINTS);\n }\n index-=3;\n }\n index+=3;\n }\n}", "function getpositions(id){\n let res = [];\n let pos = id.split('_');\n let xLastPos = parseInt(pos[0]);\n let yLastPos = parseInt(pos[1]);\n\n for(let i = 0 ; i < offsets.length ; i++){\n\n let xNewPos = xLastPos + offsets[i][0];\n\n if(xNewPos >= 1 && xNewPos <= 8 ){\n let yNewPos = yLastPos + offsets[i][1];\n\n if(yNewPos >= 1 && yNewPos <= 8){\n \n res.push(xNewPos+\"_\"+yNewPos);\n }\n }\n }\n return res;\n}", "inBounds(){\n if (this.pos.x <= 0) {\n this.pos.x = 0;\n }\n if (this.pos.y <= 0) {\n this.pos.y = 0;\n }\n if (this.pos.x >= width ) {\n this.pos.x = width;\n }\n if (this.pos.y >= height) {\n this.pos.y = height;\n }\n }", "calculate() {\n let mvecs = [];\n super.setPkt(Status.GRAB,\"SOLID\");\n let i = 0;\n if(super.getResp()[0]){\n let data = super.getResp()[0];\n data.forEach(element => {\n if(PVector.getDistance(this.pos,element.pos) < 64){\n let mtv = Polygon.isColliding(this.hitbox,element.hitbox);\n if(mtv){\n mvecs.push(element.hitbox);\n }\n }\n });\n }\n if(mvecs.length > 0){;\n this.rot *= -1;\n this.movement.scale(-1);\n this.applyMovement();\n this.applyRotation();\n this.movement.scale(-1);\n this.rot *= -1;\n }\n super.clearResp();\n }", "_isOverlappingExisting(x, y, w, h) {\n if(!this._positions.length) return false;\n let over = false;\n this._positions.forEach((item) => {\n if (!(item.x > x + w ||\n item.x + item.width < x ||\n item.y > y + h ||\n item.y + item.height < y)) over = true;\n });\n\n return over;\n }", "updateOlliPositionsAoSimNoSmooth(positions) {\n for (let position of positions) {\n let coordinates = [position.coordinates[0], position.coordinates[1]];\n const data = {\n 'type': 'FeatureCollection',\n 'features': [{\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n }\n }]\n };\n let layerId = `olli-bus-${position.olliId}`;\n let layer = this.map.getSource(layerId);\n if (layer) {\n layer.setData(data);\n }\n else {\n this.map.addLayer({\n 'id': layerId,\n 'source': {\n 'type': 'geojson',\n 'data': data\n },\n 'type': 'symbol',\n 'layout': {\n 'icon-image': 'olli',\n 'icon-size': 0.75\n }\n });\n }\n }\n }", "function captureSquareOffsets () {\n squareElsOffsets = {}\n\n for (var i in squareElsIds) {\n if (!squareElsIds.hasOwnProperty(i)) continue\n\n squareElsOffsets[i] = $('#' + squareElsIds[i]).offset()\n }\n }", "function positions() {\n\t\t\tfor (var z=0;z<divs.length;z++) {\n\t\t\t\tvar xPos = $( \"#\" + z ).css(\"left\");\n\t\t\t\tvar word = $( \"#\" + z ).text();\n\t\t\t\tvar t = $( \"#\" + z ).text();\n\n\t\t\t\tif (parseInt(xPos) > 700) {\n\t\t\t\t\t$( \"#\" + z ).css(\"background-color\", \"red\");\n\t\t\t\t\tnewSentence.push(word);\n\n\t\t\t\t\tnewSentence = newSentence.filter(function(item,index,inputArray) {\n\t\t\t return inputArray.indexOf(item) == index;\n\t\t\t \t});\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\t// join newly formed sentence \n\t\t\t\tvar yes = newSentence.join(' ');\n\t\t\t\t// send sentence via socket to server to text \n\t\t\t\tsocket.emit('text', yes);\n\t\t\t};\n\t\t}", "function thereIsRover(position) {\n for (rover in RoversDeployed) {\n if (rover.position == position) {\n return true;\n }\n }\n return false;\n}", "function checkForDuplicates()\r\n\t{\r\n\tfor (i=0; i < activeClippings.length; i++)\r\n\t\t{\r\n\t\tif (newClipping == activeClippings[i].id) {i = allClippings.length; duplicate = true;}\r\n\t\t}\r\n\t}", "function isFoodPosOK(x,y){\n //not on snake0\n for (var i = 0; i < snakes[0].body.length; i++){\n if (x == snakes[0].body[i][0] && y == snakes[0].body[i][1])\n return false;\n }\n //not on snake1\n for (var i = 0; i < snakes[1].body.length; i++){\n if (x == snakes[1].body[i][0] && y == snakes[1].body[i][1])\n return false;\n }\n return true;\n }", "createObstacleAt(position) {\n this.worldCubes[toKey(position)] = true //data not that important I think\n if (this.hasCubeAt(position)) {\n this.respawnParentsOfCubeAt(position)\n }\n }", "function checkHits(coords) {\n var hits = Object.values(roaches).filter(function(x){\n return Math.abs(x.x - coords.x) + Math.abs(x.y - coords.y) < HITBOX;\n });\n return hits;\n}", "validCoords(coords) {\n const [r, c] = coords;\n return r >= 0 && r < this.rows && c >= 0 && c < this.cols;\n }", "function initPositionBonus() {\n xBonus = Math.trunc(Math.random()*nombreBlockParWidth)*tailleSerp;\n yBonus = Math.trunc(Math.random()*nombreBlockParHeight)*tailleSerp;\n\n // Verification que le Bonus soit en-dehors du Serpent\n for (var i = 0; i < bodySerp.length; i++) {\n if (xBonus == xSerp && yBonus == xSerp) {\n initPositionBonus();\n }\n }\n }", "checkCoordinates(ship,position){\n if(ship.vertical == false){\n // prevents a ship from extending horizontally off of grid when placed\n if(10 - parseInt(position.charAt(1)) < ship.length){\n this.message = 'Not Enough Space'\n return false\n }\n else{\n // checks each potential position the ship could occupy, based on length, horizontally from the right of the position coordinate\n for(let i = 0; i < ship.length; i++){\n // if the grid is empty at a given coordinate the next is checked, the process is repeated for the length of the ship\n if(this.grid[parseInt(position.charAt(0))][(parseInt(position.charAt(1)))+i] === ''){\n continue\n }\n else{\n this.message = 'A ship cannot be placed over another ship'\n return false\n }\n }\n return true\n }\n }\n // '10' is the botom of the grid and so a vertical ship cannot begin in the '10' row / (9'x')\n else if(ship.vertical == true){\n if(10 - parseInt(position.charAt(0)) < ship.length){\n this.message = 'Not Enough Space'\n return false\n }\n else{\n // checks each potential position the ship could occupy, based on length, horizontally from the right of the position coordinate\n for(let i = 0; i < ship.length; i++){\n // if the grid is empty at a given coordinate the next is checked, the process is repeated for the length of the ship\n if(this.grid[(parseInt(position.charAt(0))+i)][parseInt(position.charAt(1))] === ''){\n continue\n }\n else{\n this.message = 'A ship cannot be placed over another ship'\n return false\n }\n }\n return true\n }\n } \n }", "function movesFromPos(pos,plyr){\n \"use strict\";\n var mvs = cartesianProd([0,1,2],[0,1,2]);\n mvs = mvs.filter(function(loc){\n\t\t\t return pos[loc[0]][loc[1]] === 0;\n\t\t });\n return mvs.map(function(l){\n\t\t return [l]\n\t\t ;});\n}", "intersectsWith(object, position) {\n let direction = new THREE.Vector3(-1, 0, 0).normalize();\n const raycaster = new THREE.Raycaster();\n raycaster.set(position, direction);\n const intersects = raycaster.intersectObject(object);\n if (intersects.length === 0) { return false; }\n else { return true; }\n }", "function isOccupied(position) {\n let div = document.getElementById(position)\n // if (div == null)\n // return false;\n console.log(position)\n if (div.firstChild.className === 'none') {\n return false\n } else {\n return true\n }\n }", "contains(i) { return this.#pos[i] != 0; }", "function checkHasPositionalTracking () {\n var vrDisplay = getVRDisplay();\n if (isMobile() || isGearVR()) { return false; }\n return vrDisplay && vrDisplay.capabilities.hasPosition;\n}", "function isSnakePosOK(x,y){\n //not on the other snake\n for (var k = 0; k < snakes[1-i].body.length; k++){\n if ((x == snakes[1-i].body[k][0] || x-1 == snakes[1-i].body[k][0] || x-2 == snakes[1-i].body[k][0]) && y == snakes[1-i].body[k][1])\n return false; \n }\n //not on food\n if ((x == foodPos[0] || x-1 == foodPos[0] || x-2 == foodPos[0]) && y == foodPos[1])\n return false;\n return true;\n }", "_updatePosition() {\n const position = this._overlayRef.getConfig().positionStrategy;\n const origin = this._getOrigin();\n const overlay = this._getOverlayPosition();\n position.withPositions([\n Object.assign(Object.assign({}, origin.main), overlay.main),\n Object.assign(Object.assign({}, origin.fallback), overlay.fallback)\n ]);\n }", "function checkPlacement() {\r\n for(index of shipArray) {\r\n if(boardObj.message[index].ship != \"none\") { //If there is already a ship here...\r\n shipArray = finalShipArray.slice();\r\n return false; //...don't move the ship here!\r\n }\r\n }\r\n return true; //If all cells at the indices of shipArray are empty, then return true\r\n}", "query(range, found) {\n if (!found) {\n found = [];\n }\n if (!this.boundary.intersects(range)) {\n return found;\n } else {\n for (let p of this.particles) {\n if (range.contains(p.x, p.y)) {\n found.push(p);\n }\n }\n if (this.divided) {\n this.northeast.query(range, found);\n this.northwest.query(range, found);\n this.southeast.query(range, found);\n this.southwest.query(range, found);\n }\n return found;\n }\n }", "function fetchPositions() {\n console.log('Querying Critical Maps Api');\n\n get(config.criticalmaps.baseUrl, processResult);\n}", "checkCollide(pos1, pos2){\n\t if (Math.abs(pos1[0] - pos2[0]) < 50 &&\n\t pos1[1] === pos2[1]){\n\t\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }", "function _testRectPolyCollision_clipRectSegs(mRect, moveBox) {\n return _.chain(mRect.toSegments())\n .filter(seg => {\n let u = VecMath.sub(seg[1], seg[0]);\n let testPt = [seg[0][0], moveBox.height*2, 1];\n let v = VecMath.sub(testPt, seg[0]);\n let cross = VecMath.cross(u, v);\n\n // Keep the segment if the test point is on its \"left\" side.\n return cross[2] < 0;\n })\n .map(seg => {\n let p = seg[0];\n let q = seg[1];\n\n // let p be the leftmost point.\n if(p[0] > q[0]) {\n let swap = q;\n q = p;\n p = swap;\n }\n\n // Get the segment's line equation data.\n let dx = q[0] - p[0];\n let dy = q[1] - p[1];\n let m = dy/dx;\n let b = p[1] - m*p[0];\n let newSeg = [p, q];\n newSeg.m = m;\n newSeg.b = b;\n return newSeg;\n })\n .value();\n }", "function snakeAtPosition(pos) {\n\n\t\tvar conflict = false;\n\n\t\tfor (var i = 0; i < snake.snakePieces.length; i++) {\n\n\t\t\tif (snake.snakePieces[i].position.x == pos.x && snake.snakePieces[i].position.y == pos.y) {\n\t\t\t\tconflict == true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn conflict;\n\t}", "function clampPosition (pos) {\n var line = pos.line\n var column = pos.column\n return {\n // According to\n // <https://github.com/gotwarlost/istanbul/blob/d919f7355027e3c213aa81af5464962d9dc8350b/coverage.json.md#location-objects>\n // lines start at 1 and columns at 0.\n line: Math.max(1, line),\n column: Math.max(0, column)\n }\n}", "function aiCheck(posX,posY){\n let moves = [];\n if(posX+1 < 10 && posX +1 >=0 && map[posX+1][posY] !== \"-1\")\n {//right\n moves.push({x:posX+1,y:posY});\n }\n if(posX -1 < 10 && posX -1 >=0 && map[posX-1][posY] !== \"-1\")\n {//left\n moves.push({x:posX-1,y:posY});\n }\n if(posY +1 < 10 && posY +1 >=0 && map[posX][posY+1] !== \"-1\")\n {//down\n moves.push({x:posX,y:posY+1});\n }\n if(posY -1 < 10 && posY -1 >=0 && map[posX][posY-1] !== \"-1\")\n {//up\n moves.push({x:posX,y:posY-1});\n }\n //console.log(moves);\n return moves;\n}" ]
[ "0.5863681", "0.567558", "0.55955523", "0.5533016", "0.5504405", "0.5477774", "0.54361933", "0.53989476", "0.53916335", "0.5389024", "0.53696203", "0.53577834", "0.5323233", "0.5317081", "0.53043234", "0.5301511", "0.5299161", "0.52897173", "0.52891934", "0.5287068", "0.5286049", "0.52851397", "0.5281775", "0.5276503", "0.52589065", "0.52556026", "0.5240848", "0.52302295", "0.52159846", "0.5215851", "0.5215459", "0.5200798", "0.5173935", "0.51733696", "0.5162185", "0.5159454", "0.514752", "0.5143993", "0.5142886", "0.5142212", "0.5142212", "0.51350904", "0.5132171", "0.5120605", "0.5098377", "0.5082311", "0.5069712", "0.50482213", "0.50475377", "0.5036875", "0.5035051", "0.5028514", "0.50195324", "0.5017675", "0.5007365", "0.5004944", "0.5004662", "0.5002809", "0.4992773", "0.4989175", "0.4985771", "0.49764794", "0.49659407", "0.49648023", "0.4958415", "0.49442315", "0.49417457", "0.4936201", "0.49360856", "0.49292326", "0.49253744", "0.49204987", "0.49185568", "0.4914108", "0.4911316", "0.49090236", "0.49090117", "0.49084213", "0.49010077", "0.48964614", "0.4895796", "0.48953053", "0.48885828", "0.48884264", "0.48801932", "0.48793632", "0.48790523", "0.48700768", "0.48680055", "0.48663983", "0.48663583", "0.48551786", "0.48524776", "0.48513538", "0.48482403", "0.48481554", "0.48467597", "0.48466673", "0.48465565", "0.48449543", "0.48438546" ]
0.0
-1
Search an array of spans for a span matching the given marker.
function getMarkedSpanFor(spans, marker) { if (spans) { for (var i = 0; i < spans.length; ++i) { var span = spans[i]; if (span.marker == marker) { return span } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n\t\t if (spans) for (var i = 0; i < spans.length; ++i) {\n\t\t var span = spans[i];\n\t\t if (span.marker == marker) return span;\n\t\t }\n\t\t }", "function getMarkedSpanFor(spans, marker) {\r\n if (spans) for (var i = 0; i < spans.length; ++i) {\r\n var span = spans[i];\r\n if (span.marker == marker) return span;\r\n }\r\n }", "function getMarkedSpanFor(spans, marker) {\n\t\t if (spans) { for (var i = 0; i < spans.length; ++i) {\n\t\t var span = spans[i];\n\t\t if (span.marker == marker) { return span }\n\t\t } }\n\t\t }", "function getMarkedSpanFor(spans, marker) {\n\t if (spans) for (var i = 0; i < spans.length; ++i) {\n\t var span = spans[i];\n\t if (span.marker == marker) return span;\n\t }\n\t }", "function getMarkedSpanFor(spans, marker) {\n\t if (spans) for (var i = 0; i < spans.length; ++i) {\n\t var span = spans[i];\n\t if (span.marker == marker) return span;\n\t }\n\t }", "function getMarkedSpanFor(spans, marker) {\n\t if (spans) for (var i = 0; i < spans.length; ++i) {\n\t var span = spans[i];\n\t if (span.marker == marker) return span;\n\t }\n\t }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\r\n if (spans) { for (var i = 0; i < spans.length; ++i) {\r\n var span = spans[i];\r\n if (span.marker == marker) { return span }\r\n } }\r\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n}", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n}", "function findMarker(markers, place) {\n return markers.find(function (value) {\n return value.title.toLowerCase() === place.toLowerCase();\n });\n }", "function findMarker(datasetNum, arrayOfMarkers) {\n return arrayOfMarkers[datasetNum].current.marker;\n }", "function findMarker(buffer, position) {\n var index;\n for (index = position; index < buffer.length; index++) {\n if ((buffer[index] == marker1) && (buffer[index + 1] == marker2))\n return index;\n }\n return -1;\n}", "function findMarkerIndex(name) {\n //name 'SFO - San Fr...'\n return markers.findIndex(function (m) {\n return m.title === name;\n });\n}", "function highlight_marker(data) {\n for (var i = 0; i < markers.length; i++) {\n if (markers[i].title == data) {\n makeItBounce( markers[ i ] );\n populateInfoWindow(markers[i], largeInfowindow);\n break;\n }\n }\n}", "function findMarker(lat, lng) {\r\n\t\t\tvar marker = null;\r\n\r\n\t\t\tfor (var i = 0; i < _markers.length; i++) {\r\n\t\t\t\tvar m = _markers[i];\r\n\t\t\t\tif (m.position.lat() == lat && m.position.lng() == lng) {\r\n\t\t\t\t\tmarker = m;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn marker;\r\n\r\n\t\t} // findMarker", "function findInArray(arr, val){\n var foundIt = arr.indexOf(val);\n if(arr[foundIt] === val) {\n return true;\n }\n else return false;\n}", "function findNeedle(array) {\n\n for (let i=0; i < array.length; i++){\n if (array[i] === 'needle') return 'found the needle at position ' + i;\n }\n \n}", "function search() {\n // Retrieves the value in the search text <input> tag\n // For loop to search through all students names and emails for a match to student text <input> entry\n // If a match is found it is added to the visibleStudents[] array \n let entry = studentSearchInput.value;\n for (let i = 0; i < students.length; i++) {\n let studentName = students[i].querySelector('div h3').textContent;\n let studentEmail = students[i].querySelector('.email').textContent;\n\n if (studentName.indexOf(entry) >= 0 || studentEmail.indexOf(entry) >= 0) {\n visibleStudents.push(i);\n }\n }\n}", "function linearSearchIndexOf(arr, val) {\n for (let i = 0; i < arr.length; i++) {\n if (val === arr[i]) return i;\n }\n return -1;\n}", "function linearSearch(arr, val){\n for(let i=0; i<arr.length; i++){\n if(arr[i] === val){\n return i;\n }\n return -1;\n }\n console.log('Hello World!')\n}", "function search(arr, item) {\n return arr.indexOf(item);\n }", "function linearSearch(arr, val) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === val) return i\n }\n return -1\n}", "function search(arr, item) {\n return arr.indexOf(item)\n }", "function indexOf(arr, searchItem) {\n // code here\n}", "function indexOf(arr, searchItem) {\n // code here\n}", "function findWaldo(arr, found) {\n for (var i = 0; i < arr.length; i++) {\n debugger;\n if (arr[i] == \"Waldo\") {\n found(i); // execute callback\n }\n }\n}", "function removeMarkedSpan(spans, span) {\n\t\t for (var r, i = 0; i < spans.length; ++i)\n\t\t if (spans[i] != span) (r || (r = [])).push(spans[i]);\n\t\t return r;\n\t\t }", "function linearSearch(arr, val){\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === val) {\n return i;\n }\n }\n return -1;\n}", "function linear_search(arr, n){\n for(var elem of arr){\n if(elem === n){\n return arr.indexOf(elem);\n }\n }\n}", "function addlistenertoMarkers(k) {\n for (var i = 0; i < snowCaps.peaks.length; i++) {\n if (snowCaps.peaks[i].marker.id == k) {\n locateSelected(snowCaps.peaks[i]);\n }\n }\n}", "function search(arr, item) {\n\treturn arr.indexOf(item)\n}", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function search(arr, item) {\n return arr.indexOf(item);\n}", "function removeMarkedSpan(spans, span) {\n\t for (var r, i = 0; i < spans.length; ++i)\n\t if (spans[i] != span) (r || (r = [])).push(spans[i]);\n\t return r;\n\t }", "function removeMarkedSpan(spans, span) {\n\t for (var r, i = 0; i < spans.length; ++i)\n\t if (spans[i] != span) (r || (r = [])).push(spans[i]);\n\t return r;\n\t }", "function removeMarkedSpan(spans, span) {\n\t for (var r, i = 0; i < spans.length; ++i)\n\t if (spans[i] != span) (r || (r = [])).push(spans[i]);\n\t return r;\n\t }", "function removeMarkedSpan(spans, span) {\r\n for (var r, i = 0; i < spans.length; ++i)\r\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\r\n return r;\r\n }", "function renderSpan(sid, spanIds) {\n var element = document.createElement('span');\n element.setAttribute('id', sid);\n element.setAttribute('title', '[' + sid + '] ');\n element.setAttribute('class', 'span');\n\n var pid = getPidBySid(sid);\n var beg = spans[sid].begin;\n var end = spans[sid].end;\n var len = end - beg;\n\n var c; // index of current span\n for (c = 0; c < spanIds.length; c++) if (spanIds[c] == sid) break;\n\n var begnode = document.getElementById(pid).childNodes[0];\n var begoff = beg - pars[pid].begin;\n\n // adjust the begin node and offset\n if (c > 0) {\n var p = c - 1; // index of preceding span\n\n // when the previous span includes the region\n if (spans[spanIds[p]].end > beg) {\n begnode = document.getElementById(spanIds[p]).childNodes[0];\n begoff = beg - spans[spanIds[p]].begin;\n }\n\n else {\n if (getPidBySid(spanIds[p]) == pid) {\n // find the outermost preceding span\n var pnode = document.getElementById(spanIds[p]);\n while (pnode.parentElement &&\n spans[pnode.parentElement.id] &&\n spans[pnode.parentElement.id].end > spans[pnode.id].begin &&\n spans[pnode.parentElement.id].end < end) {pnode = pnode.parentElement}\n\n begnode = pnode.nextSibling;\n begoff = beg - spans[pnode.id].end;\n }\n }\n }\n\n var endnode = begnode;\n var endoff = begoff + len;\n\n // if there is an intervening span, adjust the end node and offset\n if ((c < spanIds.length - 1) && (end > spans[spanIds[c + 1]].begin)) {\n var i = c + 1; // index of the rightmost intervening span\n // if there is a room for further intervening\n while (i < spanIds.length - 1) {\n // find the next span at the same level\n var n = i + 1;\n while ((n < spanIds.length) && (spans[spanIds[n]].begin < spans[spanIds[i]].end)) n++;\n if (n == spanIds.length) break;\n if (end > spans[spanIds[n]].begin) i = n;\n else break;\n }\n endnode = document.getElementById(spanIds[i]).nextSibling;\n endoff = end - spans[spanIds[i]].end;\n }\n\n var range = document.createRange();\n range.setStart(begnode, begoff);\n range.setEnd(endnode, endoff);\n range.surroundContents(element);\n\n $('#' + sid).off('mouseup', spanClicked).on('mouseup', spanClicked);\n }", "function linearSearch(arr, val) {\n // Loop through the array and check if the current array element is equal to the value\n for (let i = 0; i < arr.length; i++) {\n // If it is, return the index at which the element is found\n if (arr[i] === val) return i;\n \n }\n // if the value is never found, return -1;\n return -1;\n}", "function searchLocations(str) {\n var input = str.toLowerCase();\n var locations = LVM.getLocations();\n var temp_array = []\n console.log('input: \"' + input + '\"');\n\n // Do nothing if input has not changed.\n if (LVM.searchInput() == str) { return; }\n\n // Body\n for (var i = 0; i < locations.length; i++) {\n var item = LVM.currLocations()[i];\n var marker = markers[i];\n // I chose to use `setMap()` instead of `setVisible()` because the\n // infowindow doesn't automatically hide in `setVisible()`.\n if (locations[i].title.toLowerCase().includes(input)) {\n item.toHide(false);\n marker.setVisible(true);\n temp_array.push(marker);\n } else {\n item.toHide(true);\n marker.setVisible(false);\n\n // Hide infowindow if marker is not shown\n if (largeInfowindow.marker == marker) {\n console.log(\"close infowindow\");\n largeInfowindow.close();\n console.log(largeInfowindow);\n }\n }\n }\n\n // Closing\n if (temp_array.length > 0) { fitBounds(temp_array); }\n LVM.searchInput(str);\n}", "function search(arr, val) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === val) {\n return i;\n }\n }\n return -1\n}", "function removeMarkedSpan(spans, span) {\n\t\t var r;\n\t\t for (var i = 0; i < spans.length; ++i)\n\t\t { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n\t\t return r\n\t\t }", "function linearSearch(arr, num) {\n // add whatever parameters you deem necessary - good luck!\n let indexOfItem = -1;\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === num) indexOfItem = i;\n }\n return indexOfItem;\n}", "function search(arr, val) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === val) {\n return i\n }\n }\n return -1\n}", "function removeMarkedSpan(spans, span) {\n var r;\n\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i] != span) {\n (r || (r = [])).push(spans[i]);\n }\n }\n\n return r;\n } // Add a span to a line.", "function removeMarkedSpan(spans, span) {\n var r\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }\n return r\n}", "function linearSearch(arr, val){\n// loop through the array and check if the\n for(let i = 0; i < arr.length; i++){\n // current array element is equal to the value\n if(arr[i] === val)return i;//if it is, return the index at which the element is found\n }\n return -1;// if the value is never found, return -1\n \n }", "function search (arr, val) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === value) {\n return i\n }\n }\n return -1;\n}", "function linearSearch(arr, val) {\n\n ////// doesn't work because return statement returns \n ////// the inner anonymous callback function to forEach not linearSearch itself!\n // arr.forEach((element, index) => {\n // console.log(element, index, element === val);\n // if (element === val) {\n // console.log('found it!');\n // return index;\n // }\n // });\n\n for (let i = 0; i < arr.length; i++) {\n let element = arr[i];\n if (element === val) {\n return i;\n }\n }\n\n return -1;\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }" ]
[ "0.7195285", "0.7195285", "0.7195285", "0.7195285", "0.7195285", "0.7195285", "0.7195285", "0.7165243", "0.7141147", "0.71237963", "0.7118984", "0.7118984", "0.7118984", "0.7104211", "0.7104211", "0.71036065", "0.70881194", "0.70881194", "0.70881194", "0.70881194", "0.70881194", "0.70881194", "0.70881194", "0.70881194", "0.70881194", "0.70881194", "0.70881194", "0.6291824", "0.5888308", "0.55972856", "0.55906487", "0.5536975", "0.5481095", "0.53504705", "0.534119", "0.533259", "0.52397794", "0.5206674", "0.5190822", "0.5182659", "0.5180181", "0.51685643", "0.51685643", "0.51681036", "0.5159172", "0.5142567", "0.5125742", "0.51129997", "0.5110917", "0.5109743", "0.5109743", "0.5109743", "0.5109743", "0.5109743", "0.5109743", "0.5109743", "0.51064223", "0.5100045", "0.5100045", "0.5100045", "0.50987095", "0.5093999", "0.50936925", "0.50378525", "0.5036692", "0.5032118", "0.5027147", "0.50094205", "0.5006988", "0.5006471", "0.5006471", "0.5000879", "0.49964815", "0.49902797", "0.4989993", "0.4989993", "0.4989993", "0.4989993", "0.4989993", "0.4989993", "0.4989993", "0.4989993", "0.4989993", "0.4989993" ]
0.7182503
19